Skip to content

Commit

Permalink
fix: staging of files from exeQAtimelines
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Sep 16, 2024
1 parent 02547b0 commit 66e78b8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
22 changes: 14 additions & 8 deletions qa-physics/exeQAtimelines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# after finishing analysis in the `QA` subdirectory, this script will call
# qaCut.groovy on the results

set -e
set -e

if [ -z "$TIMELINESRC" ]; then source `dirname $0`/../bin/environ.sh; fi

Expand All @@ -11,20 +11,23 @@ if [ $# -ne 2 ]; then
- run this script from \`$TIMELINESRC/qa-physics\`
- [INPUT_DIR] is the location of the output timeline files from Step 2
(likely \`outfiles/[DATASET]/timeline_physics_qa\`)
(likely \`outfiles/[DATASET]\`)
- the \`qaTree.json\` file used will be \`QA/qa.[DATASET]/qaTree.json\`
""" >&2
exit 101
fi
inDir=$1
dataset=$2

qaDir=$inDir/outmon.qa
tlDir=$inDir/timeline_physics_qa
qaDir=$tlDir/outmon.qa

mkdir -p $qaDir
rm -r $qaDir
mkdir -p $qaDir

rm -vf $tlDir/outdat/passFractions.dat

# defect bit lists
# FIXME: violates DRY (maybe use `jq` to parse from a bit definition's JSON file)
defect_bits_FD=(
Expand Down Expand Up @@ -55,18 +58,21 @@ defect_bits_FT=(

for bit in ${defect_bits_FD[@]}; do
echo "================ FD DEFECT BIT $bit ================"
run-groovy $TIMELINE_GROOVY_OPTS qaCut.groovy $inDir $dataset false $bit
qa=$(ls -t $inDir/outmon/electron_FD_*QA*.hipo | grep -v epoch | head -n1)
run-groovy $TIMELINE_GROOVY_OPTS qaCut.groovy $tlDir $dataset false $bit
qa=$(ls -t $tlDir/outmon/electron_FD_*QA*.hipo | grep -v epoch | head -n1)
mv -v $qa ${qaDir}/$(echo $qa | sed 's/^.*_QA_//g')
done

for bit in ${defect_bits_FT[@]}; do
echo "================ FT DEFECT BIT $bit ================"
run-groovy $TIMELINE_GROOVY_OPTS qaCut.groovy $inDir $dataset FT $bit
qa=$(ls -t $inDir/outmon/electron_FT_*QA*.hipo | grep -v epoch | head -n1)
run-groovy $TIMELINE_GROOVY_OPTS qaCut.groovy $tlDir $dataset FT $bit
qa=$(ls -t $tlDir/outmon/electron_FT_*QA*.hipo | grep -v epoch | head -n1)
mv -v $qa ${qaDir}/$(echo $qa | sed 's/^.*_QA_//g')
done

cp QA/qa.${dataset}/qaTree.json $qaDir
echo ""
cat $inDir/outdat/passFractions.dat
cat $tlDir/outdat/passFractions.dat

echo "================ STAGE TIMELINES ================"
./stageTimelines.sh $tlDir $inDir/timeline_web
10 changes: 7 additions & 3 deletions qa-physics/stageTimelines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ extraList=(
live_time_average
relative_yield
)
for extraFile in ${extraList[@]}; do
mv -v $extraFile.hipo phys_qa_extra/
for hipoFile in $(ls *.hipo); do
hipoFilePatt=\\b$(basename $hipoFile .hipo)\\b
if [[ ${extraList[@]} =~ $hipoFilePatt ]]; then
cp -v $hipoFile phys_qa_extra/
else
cp -v $hipoFile phys_qa/
fi
done
mv -v *.hipo phys_qa/

# if QADB timelines were produced, copy them too
if [ -d $inputDir.qa ]; then
Expand Down

0 comments on commit 66e78b8

Please sign in to comment.