Skip to content

Commit 6b34fe0

Browse files
sawenzelclaude
andcommitted
Make the TPC time-series task follow the active detectors
This makes the TPC time-series task in the MC workflow take its inputs from the active detectors. - The reader used fixed cluster types without TRD, so the time series failed with "No matching output found for TRD/CTRACKLETS/0" once it requested TRD tracklets. - Track and cluster types now come from cleanDetectorInputList. - The same track list goes to o2-tpc-time-series-workflow via --track-sources, if the async software supports it. - TOF and TRD are optional, and the task requires ITS, TPC and FT0. https://its.cern.ch/jira/browse/O2-7264 #2532 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent f5b3059 commit 6b34fe0

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

‎MC/bin/o2dpg_sim_workflow.py‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,23 +2170,28 @@ def remove_json_prefix(path):
21702170

21712171
#<------------------ TPC - time-series objects
21722172
# initial implementation taken from comments in https://its.cern.ch/jira/browse/O2-4612
2173-
# TODO: this needs to be made configurable (as a function of which detectors are actually present)
2173+
# track sources and reader inputs follow the active detectors; TOF and TRD are optional
2174+
tpcts_tracktypes = cleanDetectorInputList("ITS,TPC,ITS-TPC,ITS-TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD-TOF")
2175+
tpcts_clustertypes = cleanDetectorInputList("FT0,TPC,TOF,TRD")
21742176
tpctsneeds = [ TPCRECOtask['name'],
21752177
ITSTPCMATCHtask['name'],
2176-
TOFTPCMATCHERtask['name'],
21772178
FT0RECOtask['name'],
2178-
PVFINDERtask['name'],
2179-
TRDTRACKINGtask2['name']
2179+
PVFINDERtask['name']
21802180
]
2181+
addWhenActive("TOF", tpctsneeds, TOFTPCMATCHERtask['name'])
2182+
addWhenActive("TRD", tpctsneeds, TRDTRACKINGtask2['name'])
21812183
TPCTStask = createTask(name='tpctimeseries_'+str(tf), needs=tpctsneeds, tf=tf, cwd=timeframeworkdir, lab=["RECO"], mem='2000', cpu='1')
2182-
TPCTStask['cmd'] = 'o2-global-track-cluster-reader --disable-mc --cluster-types "FT0,TOF,TPC" --track-types "ITS,TPC,ITS-TPC,ITS-TPC-TOF,ITS-TPC-TRD-TOF"'
2184+
TPCTStask['cmd'] = f'o2-global-track-cluster-reader --disable-mc --cluster-types "{tpcts_clustertypes}" --track-types "{tpcts_tracktypes}"'
21832185
TPCTStask['cmd'] += ' --primary-vertices '
21842186
TPCTStask['cmd'] += staggITS
2185-
TPCTStask['cmd'] += ' | o2-tpc-time-series-workflow --enable-unbinned-root-output --sample-unbinned-tsallis --sampling-factor 0.01 '
2187+
# older async tags (e.g. 2023 apass4, 2024 pp apass1) do not know --track-sources
2188+
tpcts_sources = option_if_available('o2-tpc-time-series-workflow', '--track-sources', envfile=async_envfile)
2189+
if tpcts_sources:
2190+
tpcts_sources += f' "{tpcts_tracktypes},FT0"'
2191+
TPCTStask['cmd'] += f' | o2-tpc-time-series-workflow{tpcts_sources} --enable-unbinned-root-output --sample-unbinned-tsallis --sampling-factor 0.01 '
21862192
TPCTStask['cmd'] += staggITS
21872193
TPCTStask['cmd'] += putConfigValues() + ' ' + getDPL_global_options(bigshm=True)
2188-
# could be relaxed or changed once the timerseries worklow is more reactive to input cluster- and track-types
2189-
addWhenActive("TOF,TPC,FT0", workflow['stages'], TPCTStask)
2194+
addWhenActive("ITS,TPC,FT0", workflow['stages'], TPCTStask)
21902195

21912196
# cleanup
21922197
# --------

0 commit comments

Comments
 (0)