Skip to content

Commit 5240041

Browse files
authored
tpc-time-series equiped with internal readers and HBFUtilsInitializer (#15659)
The input cluster sources will be deduced from the track source. The InputHelper will be invoked if --disable-root-inputs option is absent. Possibility to prepend the workflow with the rate/maxTF limiter in standalone mode (i.e. w/o --disable-root-inputs). E.g GLOSET="--shm-segment-size 10000000000 --timeframes-rate-limit 2 --timeframes-rate-limit-ipcid 1234 --hbfutils-config o2_tfidinfo.root,upstream" o2-reader-driver-workflow --max-tf ${MAXTF:--1} $GLOSET | \ o2-tpc-time-series-workflow $GLOSET --enable-unbinned-root-output -b --run
1 parent e1eaa3f commit 5240041

3 files changed

Lines changed: 41 additions & 7 deletions

File tree

Detectors/TPC/workflow/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ o2_add_executable(merge-integrate-cluster-workflow
231231
o2_add_executable(time-series-workflow
232232
COMPONENT_NAME tpc
233233
SOURCES src/tpc-time-series.cxx
234-
PUBLIC_LINK_LIBRARIES O2::TPCWorkflow)
234+
PUBLIC_LINK_LIBRARIES O2::TPCWorkflow
235+
O2::GlobalTrackingWorkflowReaders
236+
O2::GlobalTrackingWorkflowHelpers)
235237

236238
o2_add_executable(scaler-workflow
237239
COMPONENT_NAME tpc

Detectors/TPC/workflow/src/tpc-time-series.cxx

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,38 @@
1414

1515
#include "TPCWorkflow/TPCTimeSeriesSpec.h"
1616
#include "TPCWorkflow/TPCTimeSeriesWriterSpec.h"
17+
#include "DetectorsCommonDataFormats/DetID.h"
1718
#include "CommonUtils/ConfigurableParam.h"
1819
#include "TPCReaderWorkflow/TPCSectorCompletionPolicy.h"
20+
#include "DetectorsBase/DPLWorkflowUtils.h"
21+
#include "GlobalTrackingWorkflowHelpers/InputHelper.h"
22+
#include "DetectorsRaw/HBFUtilsInitializer.h"
23+
#include "DataFormatsITSMFT/DPLAlpideParamInitializer.h"
1924
#include "Framework/ConfigParamSpec.h"
2025
#include "GPUDebugStreamer.h"
2126

2227
using namespace o2::framework;
28+
using GID = o2::dataformats::GlobalTrackID;
29+
using DetID = o2::detectors::DetID;
30+
31+
// ------------------------------------------------------------------
32+
void customize(std::vector<o2::framework::CallbacksPolicy>& policies)
33+
{
34+
o2::raw::HBFUtilsInitializer::addNewTimeSliceCallback(policies);
35+
}
2336

2437
void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
2538
{
2639
// option allowing to set parameters
2740
std::vector<ConfigParamSpec> options{
2841
ConfigParamSpec{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
2942
{"disable-root-output", VariantType::Bool, false, {"disable root-files output writers"}},
43+
{"disable-root-input", VariantType::Bool, false, {"disable root-files input reader"}},
3044
{"enable-unbinned-root-output", VariantType::Bool, false, {"writing out unbinned track data"}},
31-
{"track-sources", VariantType::String, std::string{o2::dataformats::GlobalTrackID::ALL}, {"comma-separated list of sources to use"}},
45+
{"track-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of sources to use"}},
3246
{"material-type", VariantType::Int, 2, {"Type for the material budget during track propagation: 0=None, 1=Geo, 2=LUT"}}};
33-
47+
o2::itsmft::DPLAlpideParamInitializer::addITSConfigOption(options);
48+
o2::raw::HBFUtilsInitializer::addConfigOption(options);
3449
std::swap(workflowOptions, options);
3550
}
3651

@@ -42,11 +57,28 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config)
4257
o2::conf::ConfigurableParam::updateFromString(config.options().get<std::string>("configKeyValues"));
4358
const bool disableWriter = config.options().get<bool>("disable-root-output");
4459
const bool enableUnbinnedWriter = config.options().get<bool>("enable-unbinned-root-output");
45-
auto src = o2::dataformats::GlobalTrackID::getSourcesMask(config.options().get<std::string>("track-sources"));
60+
GID::mask_t allowedSources = GID::getSourcesMask("ITS,TPC,ITS-TPC,ITS-TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD-TOF,FT0");
61+
auto srcTrc = allowedSources & GID::getSourcesMask(config.options().get<std::string>("track-sources"));
62+
o2::dataformats::GlobalTrackID::mask_t srcCls = GID::getSourcesMask("TPC");
63+
if (GID::includesDet(DetID::ITS, srcTrc)) {
64+
srcCls |= GID::getSourcesMask("ITS");
65+
}
66+
if (GID::includesDet(DetID::TRD, srcTrc)) {
67+
srcCls |= GID::getSourcesMask("TRD");
68+
}
69+
if (GID::includesDet(DetID::TOF, srcTrc)) {
70+
srcCls |= GID::getSourcesMask("TOF");
71+
}
72+
4673
auto materialType = static_cast<o2::base::Propagator::MatCorrType>(config.options().get<int>("material-type"));
47-
workflow.emplace_back(o2::tpc::getTPCTimeSeriesSpec(disableWriter, materialType, enableUnbinnedWriter, src));
74+
75+
o2::globaltracking::InputHelper::addInputSpecs(config, workflow, srcCls, srcTrc, srcTrc, false);
76+
o2::globaltracking::InputHelper::addInputSpecsPVertex(config, workflow, false); // P-vertex is always needed
77+
78+
workflow.emplace_back(o2::tpc::getTPCTimeSeriesSpec(disableWriter, materialType, enableUnbinnedWriter, srcTrc));
4879
if (!disableWriter) {
4980
workflow.emplace_back(o2::tpc::getTPCTimeSeriesWriterSpec());
5081
}
82+
o2::raw::HBFUtilsInitializer hbfIni(config, workflow);
5183
return workflow;
5284
}

prodtests/full-system-test/calib-workflow.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fi
2323
if [[ "${CALIB_TPC_SCDCALIB_SENDTRKDATA:-}" == "1" ]]; then ENABLE_TRKDATA_OUTPUT="--send-track-data"; else ENABLE_TRKDATA_OUTPUT=""; fi
2424

2525
# specific calibration workflows
26-
if [[ $CALIB_TPC_SCDCALIB == 1 ]]; then add_W o2-tpc-scdcalib-interpolation-workflow "--vtx-sources $VERTEX_TRACK_MATCHING_SOURCES --tracking-sources $TRACK_SOURCES ${CALIB_TPC_SCDCALIB_SLOTLENGTH:+"--sec-per-slot $CALIB_TPC_SCDCALIB_SLOTLENGTH"} $ENABLE_TRKDATA_OUTPUT $DISABLE_ROOT_OUTPUT --disable-root-input --pipeline $(get_N tpc-track-interpolation TPC REST)"; fi
26+
if [[ $CALIB_TPC_SCDCALIB == 1 ]]; then add_W o2-tpc-scdcalib-interpolation-workflow "--vtx-sources $VERTEX_TRACK_MATCHING_SOURCES --tracking-sources $TRACK_SOURCES ${CALIB_TPC_SCDCALIB_SLOTLENGTH:+"--sec-per-slot $CALIB_TPC_SCDCALIB_SLOTLENGTH"} $ENABLE_TRKDATA_OUTPUT $DISABLE_ROOT_OUTPUT $DISABLE_ROOT_INPUT --pipeline $(get_N tpc-track-interpolation TPC REST)"; fi
2727
if [[ $CALIB_TPC_TIMEGAIN == 1 ]]; then
2828
: ${SCALEEVENTS_TPC_TIMEGAIN:=40}
2929
: ${SCALETRACKS_TPC_TIMEGAIN:=1000}
@@ -77,7 +77,7 @@ if [[ $CALIB_ASYNC_EXTRACTTIMESERIES == 1 ]] ; then
7777
CONFIG_TPCTIMESERIES+=" --min-cluster ${TPCTIMESERIES_MIN_CLUSTER}"
7878
CONFIG_TPCTIMESERIES+=" --max-tgl ${TPCTIMESERIES_MAX_TGL}"
7979
CONFIG_TPCTIMESERIES+=" --mult-max ${TPCTIMESERIES_MULT_MAX}"
80-
add_W o2-tpc-time-series-workflow "${CONFIG_TPCTIMESERIES}"
80+
add_W o2-tpc-time-series-workflow "$DISABLE_ROOT_INPUT ${CONFIG_TPCTIMESERIES}"
8181
fi
8282

8383
# output-proxy for aggregator

0 commit comments

Comments
 (0)