From 266b9e0ee8e9d42887d535788ed93d7d5a93d734 Mon Sep 17 00:00:00 2001 From: Matthias Kleiner Date: Thu, 8 Oct 2026 16:20:01 +0200 Subject: [PATCH] asyncReco: optional cosmics matching with raw-cluster output (EXTRACTCOSMICS) JDL EXTRACTCOSMICS=1 enables the calibration workflows (ADD_CALIB, all other calibrations stay off) and CALIB_ASYNC_EXTRACTCOSMICS, which makes O2's calib-workflow.sh add o2-cosmics-match-workflow with the raw-cluster output (o2_cosmics_full.root, to be added to the job's output files). Allowed in async with TPC reconstructed, like the TPC time series. Optional JDL variables: - COSMICSPRESET: matcher preset (default physics-v1) - COSMICSCONFIG: matcher settings on top of the preset (configKeyValues), e.g. cosmicsMatch.minSeedDCAxyTOF=0;cosmicsMatch.minSeedDCAxyNSigmaTOF=0 - COSMICSARGS: extra workflow options, e.g. --debug-tree (cosmics_collector_debug.root, also to be added to the output files) - COSMICSPVVETO=0: no veto of legs belonging to primary-vertex contributors (on by default in calib-workflow.sh) Needs the O2 counterpart in calib-workflow.sh. Co-Authored-By: Claude Opus 5.5 --- DATA/common/setenv_calib.sh | 2 ++ .../configurations/asyncReco/async_pass.sh | 4 ++++ .../configurations/asyncReco/setenv_extra.sh | 20 +++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/DATA/common/setenv_calib.sh b/DATA/common/setenv_calib.sh index 59d457889..6ae6749cc 100755 --- a/DATA/common/setenv_calib.sh +++ b/DATA/common/setenv_calib.sh @@ -35,6 +35,7 @@ if [[ $SYNCMODE == 1 ]] && has_processing_step ENTROPY_ENCODER && [[ ! -z "$WORK if has_detector_calib EMC && has_detector_reco EMC && [[ $SYNCMODE != 1 ]]; then CAN_DO_CALIB_EMC_ASYNC_RECALIB=1; else CAN_DO_CALIB_EMC_ASYNC_RECALIB=0; fi if [[ $SYNCMODE != 1 ]] && has_detector_reco TPC; then CAN_DO_CALIB_ASYNC_EXTRACTTPCCURRENTS=1; else CAN_DO_CALIB_ASYNC_EXTRACTTPCCURRENTS=0; fi if [[ $SYNCMODE != 1 ]] && has_detector_reco TPC; then CAN_DO_CALIB_ASYNC_EXTRACTTIMESERIES=1; else CAN_DO_CALIB_ASYNC_EXTRACTTIMESERIES=0; fi +if [[ $SYNCMODE != 1 ]] && has_detector_reco TPC; then CAN_DO_CALIB_ASYNC_EXTRACTCOSMICS=1; else CAN_DO_CALIB_ASYNC_EXTRACTCOSMICS=0; fi # additional individual settings for calibration workflows if has_detector CTP; then export CALIB_TPC_SCDCALIB_CTP_INPUT="--enable-ctp"; else export CALIB_TPC_SCDCALIB_CTP_INPUT=""; fi @@ -222,6 +223,7 @@ fi ( [[ -z ${CALIB_ASYNC_DISABLE3DCURRENTS:-} ]] || [[ $CAN_DO_CALIB_ASYNC_DISABLE3DCURRENTS == 0 ]] ) && CALIB_ASYNC_DISABLE3DCURRENTS=0 : ${ON_SKIMMED_DATA:=0} ( [[ -z ${CALIB_ASYNC_EXTRACTTIMESERIES:-} ]] || [[ $CAN_DO_CALIB_ASYNC_EXTRACTTIMESERIES == 0 ]] ) && CALIB_ASYNC_EXTRACTTIMESERIES=0 +( [[ -z ${CALIB_ASYNC_EXTRACTCOSMICS:-} ]] || [[ $CAN_DO_CALIB_ASYNC_EXTRACTCOSMICS == 0 ]] ) && CALIB_ASYNC_EXTRACTCOSMICS=0 if [[ "0${GEN_TOPO_VERBOSE:-}" == "01" ]]; then diff --git a/DATA/production/configurations/asyncReco/async_pass.sh b/DATA/production/configurations/asyncReco/async_pass.sh index 5a178344d..6b8e60c2c 100755 --- a/DATA/production/configurations/asyncReco/async_pass.sh +++ b/DATA/production/configurations/asyncReco/async_pass.sh @@ -205,6 +205,10 @@ if [[ "$ALIEN_JDL_EXTRACTTIMESERIES" == "1" ]]; then export ADD_CALIB=1 fi +if [[ "${ALIEN_JDL_EXTRACTCOSMICS:-}" == "1" ]]; then + export ADD_CALIB=1 +fi + if [[ "$ALIEN_JDL_DOTPCTIMEGAINCALIB" == "1" ]]; then export ADD_CALIB=1 fi diff --git a/DATA/production/configurations/asyncReco/setenv_extra.sh b/DATA/production/configurations/asyncReco/setenv_extra.sh index 5f6d70e7d..78f6885c1 100644 --- a/DATA/production/configurations/asyncReco/setenv_extra.sh +++ b/DATA/production/configurations/asyncReco/setenv_extra.sh @@ -797,6 +797,26 @@ if [[ $ADD_CALIB == "1" ]]; then export TPCTIMESERIES_MULT_MAX=$ALIEN_JDL_TPCTIMESERIESMULTMAX fi fi + + # cosmic muons in collision data: matcher (TPC-only legs) + raw clusters of each cosmic -> o2_cosmics_full.root + if [[ -n ${ALIEN_JDL_EXTRACTCOSMICS:-} ]] ; then + echo "Adding cosmics matching and raw-cluster output in setenv_extra.sh" + export CALIB_ASYNC_EXTRACTCOSMICS=$ALIEN_JDL_EXTRACTCOSMICS + if [[ -n ${ALIEN_JDL_COSMICSPRESET:-} ]]; then + export COSMICS_PRESET=$ALIEN_JDL_COSMICSPRESET + fi + # optional: matcher settings on top of the preset (e.g. cosmicsMatch.minSeedDCAxyTOF=0), extra options (e.g. --debug-tree), and + # COSMICSPVVETO=0 to switch off the veto of legs belonging to primary-vertex contributors (on by default in calib-workflow.sh) + if [[ -n ${ALIEN_JDL_COSMICSCONFIG:-} ]]; then + export CONFIG_EXTRA_PROCESS_o2_cosmics_match_workflow+=";$ALIEN_JDL_COSMICSCONFIG" + fi + if [[ -n ${ALIEN_JDL_COSMICSARGS:-} ]]; then + export ARGS_EXTRA_PROCESS_o2_cosmics_match_workflow+=" $ALIEN_JDL_COSMICSARGS" + fi + if [[ -n ${ALIEN_JDL_COSMICSPVVETO:-} ]]; then + export COSMICS_PV_VETO=$ALIEN_JDL_COSMICSPVVETO + fi + fi if [[ $ALIEN_JDL_DOUPLOADSLOCALLY == 1 ]]; then export CCDB_POPULATOR_UPLOAD_PATH="file://$PWD" fi