Skip to content

Commit 9c8da3a

Browse files
Possibility to thin only a percentage of the production
1 parent 73425a3 commit 9c8da3a

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

DATA/production/configurations/asyncReco/setenv_extra.sh

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,15 @@ if [[ $BEAMTYPE == "pp" ]]; then
578578
export CONFIG_EXTRA_PROCESS_o2_mch_reco_workflow+=";MCHTracking.chamberResolutionX=0.4;MCHTracking.chamberResolutionY=0.4;MCHTracking.sigmaCutForTracking=7;MCHTracking.sigmaCutForImprovement=6"
579579
fi
580580

581+
# hascode will be used later for downsampling a few things
582+
if [[ -f wn.xml ]]; then
583+
HASHCODE=`grep alien:// wn.xml | tr ' ' '\n' | grep ^lfn | cut -d\" -f2 | head -1 | cksum | cut -d ' ' -f 1`
584+
else
585+
HASHCODE=`echo "${inputarg}" | cksum | cut -d ' ' -f 1`
586+
fi
587+
588+
echo "HASHCODE for current job: $HASHCODE"
589+
581590
# possibly adding calib steps as done online
582591
# could be done better, so that more could be enabled in one go
583592
if [[ $ADD_CALIB == "1" ]]; then
@@ -684,11 +693,6 @@ else
684693
if [[ $ALIEN_JDL_ENABLEPERMILFULLTRACKQC == "1" ]]; then
685694
PERMIL_FULLTRACKQC=${ALIEN_JDL_PERMILFULLTRACKQC:-100}
686695
INVERSE_PERMIL_FULLTRACKQC=$((1000/PERMIL_FULLTRACKQC))
687-
if [[ -f wn.xml ]]; then
688-
HASHCODE=`grep alien:// wn.xml | tr ' ' '\n' | grep ^lfn | cut -d\" -f2 | head -1 | cksum | cut -d ' ' -f 1`
689-
else
690-
HASHCODE=`echo "${inputarg}" | cksum | cut -d ' ' -f 1`
691-
fi
692696
if [[ "$((HASHCODE%INVERSE_PERMIL_FULLTRACKQC))" -eq "0" ]]; then
693697
TRACKQC_FRACTION=1
694698
else
@@ -704,7 +708,35 @@ if [[ $PERIOD == "LHC22c" ]] || [[ $PERIOD == "LHC22d" ]] || [[ $PERIOD == "LHC2
704708
export ARGS_EXTRA_PROCESS_o2_aod_producer_workflow+=" --ctpreadout-create 1"
705709
fi
706710

711+
THIN_AODS=0
707712
if [[ $ALIEN_JDL_THINAODS == "1" ]] ; then
713+
if [[ ! -z $ALIEN_JDL_PERCENTTHINAODS ]]; then
714+
PERCENT_THINAODS=${ALIEN_JDL_PERCENTTHINAODS}
715+
if [[ $PERCENT_THINAODS -gt 100 ]]; then
716+
# we assume we want to thin everything
717+
echo "The percentage to thin was set to a number > 100 (PERCENT_THINAODS = $PERCENT_THINAODS), we assume we need to thin everything and override this to 100"
718+
PERCENT_THINAODS=100
719+
fi
720+
INVERSE_PERCENT_THINAODS=$((100/PERCENT_THINAODS))
721+
if [[ $INVERSE_PERCENT_THINAODS -ne "0" ]]; then
722+
if [[ "$((HASHCODE%INVERSE_PERCENT_THINAODS))" -eq "0" ]]; then
723+
echo "AODs WILL BE THINNED: JDL var to thin AODs was set to true, and the selection HASHCODE%INVERSE_PERCENT_THINAODS returns successfully 0 (ALIEN_JDL_THINAODS = $ALIEN_JDL_THINAODS, PERCENT_THINAODS = $PERCENT_THINAODS, INVERSE_PERCENT_THINAODS = $INVERSE_PERCENT_THINAODS, HASHCODE%INVERSE_PERCENT_THINAODS = $((HASHCODE%INVERSE_PERCENT_THINAODS)))"
724+
THIN_AODS=1
725+
else
726+
echo "AODs WILL NOT BE THINNED: JDL var to thin AODs was set to true, but the selection HASHCODE%INVERSE_PERCENT_THINAODS returns a number different from 0 (ALIEN_JDL_THINAODS = $ALIEN_JDL_THINAODS, PERCENT_THINAODS = $PERCENT_THINAODS, INVERSE_PERCENT_THINAODS = $INVERSE_PERCENT_THINAODS, HASHCODE%INVERSE_PERCENT_THINAODS = $((HASHCODE%INVERSE_PERCENT_THINAODS)))"
727+
THIN_AODS=0
728+
fi
729+
else
730+
echo "AODs WILL NOT BE THINNED: JDL var to thin AODs was set to true, but the inverse of the percentage returns 0, ALIEN_JDL_THINAODS = $ALIEN_JDL_THINAODS, PERCENT_THINAODS = $PERCENT_THINAODS, INVERSE_PERCENT_THINAODS = $INVERSE_PERCENT_THINAODS"
731+
THIN_AODS=0
732+
fi
733+
else
734+
echo "AODs WILL BE THINNED: JDL var to thin AODs was set to true without any percentage"
735+
THIN_AODS=1
736+
fi
737+
fi
738+
739+
if [[ $THIN_AODS == "1" ]]; then
708740
export ARGS_EXTRA_PROCESS_o2_aod_producer_workflow+=" --thin-tracks"
709741
fi
710742

0 commit comments

Comments
 (0)