Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions bin/qtl-histogram
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SLURM_LOG=/farm_out/%u/%x-%A_%a
# default options
dataset=test_v0
declare -A modes
for key in findhipo rundir eachdir flatdir single series submit check-cache swifjob focus-detectors focus-physics help; do
for key in findhipo rundir eachdir flatdir single series submit check-cache fast-ls swifjob focus-detectors focus-physics help; do
modes[$key]=false
done
outputDir=""
Expand Down Expand Up @@ -81,8 +81,9 @@ usageVerbose() {
directory tree, e.g., runs grouped by target

--rundir assume each specified [RUN_DIRECTORY] contains
subdirectories named as just run numbers; it is not
recommended to use wildcards for this option
subdirectories named as just run numbers;
- it is not recommended to use wildcards for this option
- see also the \`--fast-ls\` option
**this is the DEFAULT option**

--eachdir assume each specified [RUN_DIRECTORY] is a single
Expand Down Expand Up @@ -121,6 +122,15 @@ usageVerbose() {

--focus-physics run histogramming for physics QA timelines

*** MISCELLANEOUS OPTIONS

--fast-ls use \`jasmine list-files\` to get lists of files, rather
than commands such as \`find\` or \`ls\`, since \`jasmine\`
may be much faster than the latter commands for tape dirs.
- WARNING: assumes you already tested \`--check-cache\`,
since \`jasmine\` uses \`/mss\` stub files
- useful for options such as \`--rundir\` for DST files

$sep

EXAMPLES:
Expand Down Expand Up @@ -300,7 +310,7 @@ declare -A runnumHash # `rdirs` element -> run number
for rdir in ${rdirs[@]}; do
# get the run number, either from `rdir` basename (fast), or from `RUN::config` (slow)
[[ ! -e $rdir ]] && printError "the run file/directory '$rdir' does not exist" && continue
runnum=$(basename $rdir | grep -m1 -o -E "[0-9]+" || echo '') # first, try from run directory (or file) basename
runnum=$(basename $rdir | grep -m1 -o -E "[0-9]+" | tail -n1 || echo '') # first, try from run directory (or file) basename
if [ -z "$runnum" ] || ${modes['swifjob']}; then # otherwise, use RUN::config from a HIPO file (NOTE: assumes all HIPO files have the same run number)
if ${modes['flatdir']}; then
$TIMELINESRC/libexec/hipo-check.sh $rdir
Expand All @@ -313,7 +323,8 @@ for rdir in ${rdirs[@]}; do
runnum=$($TIMELINESRC/libexec/run-groovy-timeline.sh $TIMELINESRC/libexec/get-run-number.groovy $firstHipo | tail -n1 | grep -m1 -o -E "[0-9]+" || echo '')
fi
fi
[ -z "$runnum" -o $runnum -eq 0 ] && printError "unknown run number for '$rdir'; ignoring it!" && continue
[ -z "$runnum" ] && printError "unknown run number for '$rdir'; ignoring it!" && continue
[ $runnum -eq 0 ] && printError "unknown run number for '$rdir'; ignoring it!" && continue
runnum=$((10#$runnum))
runnumHash[$rdir]=$runnum
done
Expand Down Expand Up @@ -366,7 +377,18 @@ for rdir in ${rdirs[@]}; do
realpath $rdir > $inputListFile
else
[[ "$(realpath $rdir)" =~ /mss/ ]] && swifPrefix="mss:" || swifPrefix="file:"
realpath $rdir/*.hipo | sed "s;^;$swifPrefix;" > $inputListFile
if ${modes['fast-ls']}; then
rdir_mss=$(realpath $rdir | sed 's;^.*/cache/;/mss/;')
rdir_cache=$(realpath $rdir)
# fast-ls mode will use `jasmine list-files`, but requires the stub files on `mss` to exist; if a cook is ongoing,
# it's possible the `/mss` directory won't be populated yet, although files are already on `/cache`; for that case,
# fall back to "slow" ls (i.e., the command that runs when not using `--fast-ls`)
jasmine list-files -display json -under $rdir_mss | jq -r '.[].mss' | xargs -n1 basename | sed "s;^;${swifPrefix}${rdir_cache}/;" > $inputListFile \
|| { printWarning "falling back to slow ls..."; realpath $rdir/*.hipo | sed "s;^;$swifPrefix;" > $inputListFile; }
else
echo " (use \`--fast-ls\` if this seems too slow)"
realpath $rdir/*.hipo | sed "s;^;$swifPrefix;" > $inputListFile
fi
fi

# generate job scripts
Expand Down
52 changes: 52 additions & 0 deletions qadb/notes/rge_sp24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Run Group E, Spring 2024, Pass 1

There is no SIDIS-like train, so let's use DST files for the QA.

Similarly to RG-C, there are several targets that we'll need to combine; let's also combine torus polarities.

The DSTs are found in:
```
/cache/clas12/rg-e/production/spring2024/pass1/*/*/dst/recon
```

## Reheat

**TODO**:
- [ ] check if needed; see Fall 2018 RG-K notes
- [ ] if reheating is needed, fix `qtl histogram` paths below

## Run monitoring

> [!IMPORTANT]
> Check any run-dependent settings in `qa-physics/monitorRead.groovy`, such as beam energy.

> [!NOTE]
> Using `--rundir` and `--fast-ls` here rather than `--flatdir`, since we're using a directory of DST files.

check cache:
```bash
bin/qtl histogram -d rge_sp24 --check-cache --rundir --fast-ls --focus-physics $(ls -d /cache/clas12/rg-e/production/spring2024/pass1/*/*/dst/recon)
```

run:
```bash
bin/qtl histogram -d rge_sp24 --rundir --fast-ls --focus-physics $(ls -d /cache/clas12/rg-e/production/spring2024/pass1/*/*/dst/recon)
```

## Double check that we have all the runs

> [!IMPORTANT]
> In case any runs disappeared from `/cache` while running monitoring or reheating, be sure to cross check the output runs with those from `/mss`

## Make timelines

**TODO**:
- [ ] populate `/data/metadata` for RG-E's target types

Make the timelines:
```bash
bin/qtl physics -d rge_sp24 -p rge/qa_pass1_sp24
```

> [!WARNING]
> You may not have permission to publish to this directory; if not, publish to another place and ask the chef to copy the files
50 changes: 50 additions & 0 deletions qadb/notes/rgk_sp24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Run Group K, Spring 2024, Pass 1

We will use SIDIS skims from two datasets: one for a 6.4 GeV beam, and another for a 8.5 GeV beam; we will keep them separate, to be consistent with what we did for Fall 2018 RG-K data:
- `rgk_sp24_6.4GeV`: from `/cache/clas12/rg-k/production/recon/spring2024/pass1/6395MeV/dst/train/skim1`
- `rgk_sp24_8.5GeV`: from `/cache/clas12/rg-k/production/recon/spring2024/pass1/8477MeV/dst/train/skim1`

Before anything, cross check the train and DST run lists:
```bash
bin/qtl xtrain /mss/clas12/rg-k/production/recon/spring2024/pass1/6395MeV/dst/train/skim1 /mss/clas12/rg-k/production/recon/spring2024/pass1/6395MeV/dst/recon
bin/qtl xtrain /mss/clas12/rg-k/production/recon/spring2024/pass1/8477MeV/dst/train/skim1 /mss/clas12/rg-k/production/recon/spring2024/pass1/8477MeV/dst/recon
```

## Reheat

**TODO**:
- [ ] check if needed; see Fall 2018 RG-K notes
- [ ] if reheating is needed, fix `qtl histogram` paths below

## Run monitoring

> [!IMPORTANT]
> Check any run-dependent settings in `qa-physics/monitorRead.groovy`, such as beam energy.

check cache:
```bash
bin/qtl histogram -d rgk_sp24_6.4GeV --check-cache --flatdir --focus-physics /cache/clas12/rg-k/production/recon/spring2024/pass1/6395MeV/dst/train/skim1
bin/qtl histogram -d rgk_sp24_8.5GeV --check-cache --flatdir --focus-physics /cache/clas12/rg-k/production/recon/spring2024/pass1/8477MeV/dst/train/skim1
```

run:
```bash
bin/qtl histogram -d rgk_sp24_6.4GeV --flatdir --focus-physics /cache/clas12/rg-k/production/recon/spring2024/pass1/6395MeV/dst/train/skim1
bin/qtl histogram -d rgk_sp24_8.5GeV --flatdir --focus-physics /cache/clas12/rg-k/production/recon/spring2024/pass1/8477MeV/dst/train/skim1
```

## Double check that we have all the runs

> [!IMPORTANT]
> In case any runs disappeared from `/cache` while running monitoring or reheating, be sure to cross check the output runs with those from `/mss`

## Make timelines

Make the timelines, separately for each of the 2 datasets:
```bash
bin/qtl physics -d rgk_sp24_6.4GeV -p rgk/pass2/qa/sp24_6.4GeV
bin/qtl physics -d rgk_sp24_8.5GeV -p rgk/pass2/qa/sp24_8.5GeV
```

> [!WARNING]
> You may not have permission to publish to this directory; if not, publish to another place and ask the chef to copy the files