Skip to content

Commit b808076

Browse files
shahor02chiarazampolli
authored andcommitted
Apply pixel overflow masking to ITS,MFT before skimming
1 parent 4af77ef commit b808076

1 file changed

Lines changed: 27 additions & 16 deletions

File tree

DATA/production/configurations/CTFSkimming/ctf-skim-workflow.sh

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,28 @@ set -o pipefail
55

66
# ---------------------------------------------------------------------------------------------------------------------
77
# Get this script's directory and load common settings (use zsh first (e.g. on Mac) and fallback on `readlink -f` if zsh is not there)
8-
[[ -z $GEN_TOPO_MYDIR ]] && GEN_TOPO_MYDIR="$O2DPG_ROOT/DATA/production"
8+
: ${GEN_TOPO_MYDIR:="$O2DPG_ROOT/DATA/production"}
99
source $GEN_TOPO_MYDIR/gen_topo_helper_functions.sh || { echo "gen_topo_helper_functions.sh failed" 1>&2 && exit 1; }
1010
source $GEN_TOPO_MYDIR/setenv.sh || { echo "setenv.sh failed" 1>&2 && exit 1; }
1111

12-
if [[ -z $CTF_MINSIZE ]]; then CTF_MINSIZE="2000000000"; fi # accumulate CTFs until file size reached
13-
if [[ -z $CTF_MAX_PER_FILE ]]; then CTF_MAX_PER_FILE="10000"; fi # but no more than given number of CTFs per file
12+
: ${CTF_MINSIZE:="2000000000"} # accumulate CTFs until file size reached
13+
: ${CTF_MAX_PER_FILE:="1000000"} # but no more than given number of CTFs per file
1414

1515
# Set general arguments
1616
source $GEN_TOPO_MYDIR/getCommonArgs.sh || { echo "getCommonArgs.sh failed" 1>&2 && exit 1; }
1717

1818
TIMEFRAME_RATE_LIMIT=2
19-
[[ -z $NUMAID ]] && NUMAID="0"
20-
if [[ $ALIEN_JDL_CPUCORES == 8 ]]; then
19+
: ${NUMAID:="0"}
20+
21+
if [[ ${ALIEN_JDL_CPUCORES:-} == 8 ]]; then
2122
export MULTIPLICITY_PROCESS_tpc_entropy_decoder=2
2223
export MULTIPLICITY_PROCESS_tpc_entropy_encoder=2
2324
TIMEFRAME_RATE_LIMIT=3
2425
fi
2526

26-
[[ -z $SHM_MANAGER_SHMID ]] && ( [[ $EXTINPUT == 1 ]] || [[ $NUMAGPUIDS != 0 ]] ) && ARGS_ALL+=" --no-cleanup"
27-
[[ ! -z $TIMEFRAME_RATE_LIMIT ]] && [[ $TIMEFRAME_RATE_LIMIT != 0 ]] && ARGS_ALL+=" --timeframes-rate-limit $TIMEFRAME_RATE_LIMIT --timeframes-rate-limit-ipcid $(($NUMAID + 10 * ${O2JOBID:-0}))"
28-
[[ ! -z $TIMEFRAME_SHM_LIMIT ]] && ARGS_ALL+=" --timeframes-shm-limit $TIMEFRAME_SHM_LIMIT"
27+
[[ -z ${SHM_MANAGER_SHMID:-} ]] && ( [[ ${EXTINPUT:-} == 1 ]] || [[ ${NUMAGPUIDS:-} != 0 ]] ) && ARGS_ALL+=" --no-cleanup"
28+
[[ ! -z ${TIMEFRAME_RATE_LIMIT:-} ]] && [[ ${TIMEFRAME_RATE_LIMIT:-} != 0 ]] && ARGS_ALL+=" --timeframes-rate-limit $TIMEFRAME_RATE_LIMIT --timeframes-rate-limit-ipcid $(($NUMAID + 10 * ${O2JOBID:-0}))"
29+
[[ ! -z ${TIMEFRAME_SHM_LIMIT:-} ]] && ARGS_ALL+=" --timeframes-shm-limit $TIMEFRAME_SHM_LIMIT"
2930

3031
{ source $O2DPG_ROOT/DATA/production/workflow-multiplicities.sh; [[ $? != 0 ]] && echo "workflow-multiplicities.sh failed" 1>&2 && exit 1; }
3132

@@ -52,19 +53,29 @@ while [[ $# -gt 0 ]]; do
5253
esac
5354
done
5455

55-
if [[ -z $IRFRAMES ]] || [[ -z $CTFLIST ]] ; then
56+
if [[ -z ${IRFRAMES:-} ]] || [[ -z ${CTFLIST:-} ]] ; then
5657
echo "Format: ${0##*/} -f <IRFramesFile> -c <CTFsList>"
5758
exit 1
5859
fi
5960

60-
[[ "0$ALLOW_MISSING_DET" == "00" ]] && ALLOW_MISSING_DET= || ALLOW_MISSING_DET="--allow-missing-detectors"
61-
[[ "0$SKIP_SKIMMED_OUT_TF" == "00" ]] && SKIP_SKIMMED_OUT_TF= || SKIP_SKIMMED_OUT_TF="--skip-skimmed-out-tf"
61+
[[ "0${ALLOW_MISSING_DET:-}" == "00" ]] && ALLOW_MISSING_DET= || ALLOW_MISSING_DET="--allow-missing-detectors"
62+
[[ "0${SKIP_SKIMMED_OUT_TF:-}" == "00" ]] && SKIP_SKIMMED_OUT_TF= || SKIP_SKIMMED_OUT_TF="--skip-skimmed-out-tf"
63+
64+
: ${DEF_MARGIN_BWD:=55} # default backward margin to account for time misalignments
65+
: ${DEF_MARGIN_FWD:=55} # default forward margin to account for time misalignments
6266

63-
[[ -z $DEF_MARGIN_BWD ]] && DEF_MARGIN_BWD=55 # default backward margin to account for time misalignments
64-
[[ -z $DEF_MARGIN_FWD ]] && DEF_MARGIN_FWD=55 # default backward margin to account for time misalignments
67+
if [[ -z ${NO_ITSMFT_MASKING:-} ]] ; then
68+
has_detector_ctf ITS && export ARGS_EXTRA_PROCESS_o2_ctf_reader_workflow="$ARGS_EXTRA_PROCESS_o2_ctf_reader_workflow --its-digits"
69+
has_detector_ctf MFT && export ARGS_EXTRA_PROCESS_o2_ctf_reader_workflow="$ARGS_EXTRA_PROCESS_o2_ctf_reader_workflow --mft-digits"
70+
fi
6571

6672
add_W o2-ctf-reader-workflow "--ctf-data-subspec 1 --ir-frames-files $IRFRAMES $SKIP_SKIMMED_OUT_TF --ctf-input $CTFLIST ${INPUT_FILE_COPY_CMD+--copy-cmd} ${INPUT_FILE_COPY_CMD} --onlyDet $WORKFLOW_DETECTORS $ALLOW_MISSING_DET --pipeline $(get_N tpc-entropy-decoder TPC REST 1 TPCENTDEC)"
6773

74+
if [[ -z ${NO_ITSMFT_MASKING:-} ]] ; then
75+
has_detector_ctf ITS && add_W o2-its-reco-workflow "--digits-from-upstream --disable-mc --disable-tracking --disable-root-output --pipeline $(get_N its-tracker ITS REST 1 ITSTRK)" "ITSClustererParam.maxBCDiffToMaskBias=10;"
76+
has_detector_ctf MFT && add_W o2-mft-reco-workflow "--digits-from-upstream --disable-mc --disable-tracking --disable-root-output --pipeline $(get_N mft-tracker MFT REST 1 MFTTRK)" "MFTClustererParam.maxBCDiffToMaskBias=10;"
77+
fi
78+
6879
has_detector_ctf ITS && add_W o2-itsmft-entropy-encoder-workflow "--select-ir-frames --irframe-margin-bwd ${ITS_MARGIN_BWD:-$DEF_MARGIN_BWD} --irframe-margin-fwd ${ITS_MARGIN_FWD:-$DEF_MARGIN_FWD} --mem-factor ${ITS_ENC_MEMFACT:-1.5} --pipeline $(get_N its-entropy-encoder ITS CTF 1)"
6980
has_detector_ctf MFT && add_W o2-itsmft-entropy-encoder-workflow "--select-ir-frames --irframe-margin-bwd ${MFT_MARGIN_BWD:-$DEF_MARGIN_BWD} --irframe-margin-fwd ${MFT_MARGIN_FWD:-$DEF_MARGIN_FWD} --mem-factor ${MFT_ENC_MEMFACT:-1.5} --runmft true --pipeline $(get_N mft-entropy-encoder MFT CTF 1)"
7081
has_detector_ctf TPC && add_W o2-tpc-reco-workflow "--select-ir-frames --irframe-margin-bwd ${TPC_MARGIN_BWD:-$DEF_MARGIN_BWD} --irframe-margin-fwd ${TPC_MARGIN_FWD:-$DEF_MARGIN_FWD} --mem-factor ${TPC_ENC_MEMFACT:-1.} --input-type compressed-clusters-flat --output-type encoded-clusters,disable-writer --pipeline $(get_N tpc-entropy-encoder TPC CTF 1 TPCENT)"
@@ -86,7 +97,7 @@ add_W o2-ctf-writer-workflow "--output-dir $CTF_DIR --min-file-size ${CTF_MINSIZ
8697

8798
# ---------------------------------------------------------------------------------------------------------------------
8899
# DPL run binary
89-
WORKFLOW+="o2-dpl-run $ARGS_ALL $GLOBALDPLOPT -b"
100+
WORKFLOW+="o2-dpl-run $ARGS_ALL $GLOBALDPLOPT -b --run"
90101

91-
[[ $WORKFLOWMODE == "print" || "0$PRINT_WORKFLOW" == "01" ]] && echo "#Workflow command:\n\n${WORKFLOW}\n" | sed -e "s/\\\\n/\n/g" -e"s/| */| \\\\\n/g" | eval cat $( [[ $WORKFLOWMODE == "dds" ]] && echo '1>&2')
92-
if [[ $WORKFLOWMODE != "print" ]]; then eval $WORKFLOW; else true; fi
102+
[[ ${WORKFLOWMODE:-} == "print" || "0${PRINT_WORKFLOW:-}" == "01" ]] && echo "#Workflow command:\n\n${WORKFLOW}\n" | sed -e "s/\\\\n/\n/g" -e"s/| */| \\\\\n/g" | eval cat $( [[ ${WORKFLOWMODE:-} == "dds" ]] && echo '1>&2')
103+
if [[ ${WORKFLOWMODE:-} != "print" ]]; then eval $WORKFLOW; else true; fi

0 commit comments

Comments
 (0)