Skip to content

Commit 1ef5c95

Browse files
authored
refactor: detector QA cut code should not be standalone (#306)
1 parent 2d98399 commit 1ef5c95

34 files changed

Lines changed: 322 additions & 565 deletions

bin/qtl-analysis

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ inputDir=$(realpath $inputDir)
267267
[ -z "$outputDir" ] && outputDir=$(realpath $(pwd -P)/outfiles/$dataset) || outputDir=$(realpath $outputDir)
268268

269269
# set subdirectories
270-
finalDirPreQA=$outputDir/timeline_web_preQA
271270
finalDir=$outputDir/timeline_web
272271
logDir=$outputDir/log
273272

@@ -279,7 +278,6 @@ $sep
279278
INPUT_DIR = $inputDir
280279
DATASET_NAME = $dataset
281280
OUTPUT_DIR = $outputDir
282-
FINAL_DIR_PREQA = $finalDirPreQA
283281
FINAL_DIR = $finalDir
284282
LOG_DIR = $logDir
285283
PUBLISH_DIR = $publishDir
@@ -316,9 +314,9 @@ detDirs=(
316314

317315
# cleanup output directories
318316
if $enableAna; then
319-
if [ -d $finalDirPreQA ]; then
320-
printWarning "removing output directory $finalDirPreQA"
321-
rm -r $finalDirPreQA
317+
if [ -d $finalDir ]; then
318+
printWarning "removing output directory $finalDir"
319+
rm -r $finalDir
322320
fi
323321
if [ -d $logDir ]; then
324322
printWarning "removing log directory $logDir"
@@ -327,7 +325,7 @@ if $enableAna; then
327325
fi
328326

329327
# make output directories
330-
mkdir -p $logDir $finalDirPreQA $finalDir
328+
mkdir -p $logDir $finalDir
331329

332330

333331
##################################################################################
@@ -366,7 +364,7 @@ if $enableAna; then
366364
}
367365

368366
# change working directory to output directory
369-
pushd $finalDirPreQA
367+
pushd $finalDir
370368

371369
# make detector subdirectories
372370
for detDir in ${detDirs[@]}; do
@@ -439,26 +437,6 @@ if $enableAna; then
439437
popd
440438
fi
441439

442-
######################################
443-
# run QA
444-
######################################
445-
446-
if $enableAna; then
447-
# first, copy the timelines to the final timeline directory
448-
echo ">>> copy timelines to final directory..."
449-
cp -rL $finalDirPreQA/* $finalDir/
450-
# then add the QA lines
451-
echo ">>> add QA lines..."
452-
logFile=$logDir/qa
453-
$TIMELINESRC/libexec/run-groovy-timeline.sh $TIMELINESRC/qa-detectors/util/applyBounds.groovy $finalDirPreQA $finalDir > $logFile.out 2> $logFile.err || touch $logFile.fail
454-
outputFiles=$(find $finalDir -name "*_QA.hipo")
455-
logFile=$logDir/qa_hipo-check
456-
if [ -n "$outputFiles" ]; then
457-
$TIMELINESRC/libexec/hipo-check.sh $outputFiles > $logFile.out 2> $logFile.err || touch $logFile.fail
458-
fi
459-
fi
460-
461-
462440

463441
######################################
464442
# error checking

doc/dev_notes.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ flowchart TB
2828
2929
subgraph Step 2: Timeline Analysis
3030
subgraph "<strong>bin/qtl analysis</strong>"
31-
timelineDetectorsPreQA["<strong>Make detector timelines</strong><br/>org.jlab.clas.timeline.analysis.run_analysis"]:::proc
32-
outTimelineDetectorsPreQA{{outfiles/$dataset/timeline_web_preQA/$detector/*.hipo}}:::timeline
33-
timelineDetectors["<strong>Draw QA lines</strong><br/>qa-detectors/: applyBounds.groovy"]:::proc
31+
timelineDetectors["<strong>Make detector timelines</strong><br/>org.jlab.clas.timeline.analysis.run_analysis"]:::proc
3432
outTimelineDetectors{{outfiles/$dataset/timeline_web/$detector/*.hipo}}:::timeline
3533
deploy["<strong>Publishing</strong><br/>handled by qtl analysis"]:::proc
3634
end
@@ -41,7 +39,7 @@ flowchart TB
4139
end
4240
timelineDir{{timelines on web server}}:::timeline
4341
44-
outplots --> timelineDetectorsPreQA --> outTimelineDetectorsPreQA --> timelineDetectors --> outTimelineDetectors
42+
outplots --> timelineDetectors --> outTimelineDetectors
4543
outdat --> timelinePhysics
4644
outmon --> timelinePhysics
4745
timelinePhysics --> outTimelinePhysics

doc/procedure.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,5 @@ qtl analysis -i /path/to/output/files -p some/publish/directory/rga_sp19_v5
8080

8181
> [!NOTE]
8282
> - detector timeline production is handled by the [`org.jlab.clas.timeline.analysis` package](/src/main/java/org/jlab/clas/timeline/analysis)
83-
> - QA of detector timelines is handled by the [`qa-detectors/` subdirectory](/qa-detectors);
84-
> see [its documentation](/qa-detectors/README.md)
8583
> - physics timeline production and QA are handled by the [`qa-physics/` subdirectory](/qa-physics);
8684
> see [their documentation](/qa-physics/README.md)

qa-detectors/README.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

qa-detectors/cuts/cuts.txt

Lines changed: 0 additions & 59 deletions
This file was deleted.

qa-detectors/cuts/cuts_rga_fa18.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

qa-detectors/cuts/cuts_rgc_su22.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)