1919#include " TOFWorkflowUtils/ClusterReaderSpec.h"
2020#include " TOFWorkflow/TOFMatchedReaderSpec.h"
2121#include " TOFWorkflowUtils/ClusterReaderSpec.h"
22+ #include " ReconstructionDataFormats/GlobalTrackID.h"
23+ #include " DetectorsCommonDataFormats/DetID.h"
2224#include " GlobalTrackingWorkflow/TrackTPCITSReaderSpec.h"
2325#include " GlobalTrackingWorkflow/CosmicsMatchingSpec.h"
2426#include " GlobalTrackingWorkflow/TrackCosmicsWriterSpec.h"
2527#include " Algorithm/RangeTokenizer.h"
2628
2729using namespace o2 ::framework;
2830using DetID = o2::detectors::DetID;
31+ using GID = o2::dataformats::GlobalTrackID;
2932// ------------------------------------------------------------------
3033
3134// we need to add workflow options before including Framework/runDataProcessing
@@ -36,8 +39,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
3639 {" disable-mc" , o2::framework::VariantType::Bool, false , {" disable MC propagation even if available" }},
3740 {" disable-root-input" , o2::framework::VariantType::Bool, false , {" disable root-files input reader" }},
3841 {" disable-root-output" , o2::framework::VariantType::Bool, false , {" disable root-files output writer" }},
39- {" onlyDet" , VariantType::String, std::string{DetID::NONE}, {" comma-separated list of detectors to use. Overrides skipDet" }},
40- {" skipDet" , VariantType::String, std::string{DetID::NONE}, {" comma-separate list of detectors to skip" }},
42+ {" track-sources" , VariantType::String, std::string{GID::ALL}, {" comma-separated list of sources to use" }},
4143 {" configKeyValues" , VariantType::String, " " , {" Semicolon separated key=value strings ..." }}};
4244
4345 std::swap (workflowOptions, options);
@@ -62,18 +64,7 @@ void customize(std::vector<o2::framework::CompletionPolicy>& policies)
6264WorkflowSpec defineDataProcessing (ConfigContext const & configcontext)
6365{
6466 WorkflowSpec specs;
65- DetID::mask_t dets;
66- dets.set (); // by default read all
67-
68- if (!configcontext.helpOnCommandLine ()) {
69- auto mskOnly = DetID::getMask (configcontext.options ().get <std::string>(" onlyDet" ));
70- auto mskSkip = DetID::getMask (configcontext.options ().get <std::string>(" skipDet" ));
71- if (mskOnly.any ()) {
72- dets &= mskOnly;
73- } else {
74- dets ^= mskSkip;
75- }
76- }
67+ GID::mask_t alowedSources = GID::getSourcesMask (" ITS,TPC,ITS-TPC,TPC-TOF,ITS-TPC-TOF" );
7768
7869 // Update the (declared) parameters if changed from the command line
7970 o2::conf::ConfigurableParam::updateFromString (configcontext.options ().get <std::string>(" configKeyValues" ));
@@ -87,16 +78,36 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
8778 std::vector<int > tpcClusSectors = o2::RangeTokenizer::tokenize<int >(" 0-35" );
8879 std::vector<int > tpcClusLanes = tpcClusSectors;
8980
81+ GID::mask_t src = alowedSources & GID::getSourcesMask (configcontext.options ().get <std::string>(" track-sources" ));
82+
9083 if (!disableRootInp) {
91- // ITS tracks and clusters
92- if (dets[DetID ::ITS]) {
84+
85+ if (src[GID ::ITS]) {
9386 specs.emplace_back (o2::its::getITSTrackReaderSpec (useMC));
94- specs.emplace_back (o2::itsmft::getITSClusterReaderSpec (false , true )); // mc not neaded
9587 }
9688
97- // TPC tracks and clusters
98- if (dets[DetID::TPC]) {
89+ if (src[GID::TPC]) {
9990 specs.emplace_back (o2::tpc::getTPCTrackReaderSpec (useMC));
91+ }
92+
93+ if (src[GID::ITSTPC] || src[GID::ITSTPCTOF]) { // ITSTPCTOF does not provide tracks, only matchInfo
94+ specs.emplace_back (o2::globaltracking::getTrackTPCITSReaderSpec (useMC));
95+ }
96+
97+ if (src[GID::ITSTPCTOF]) {
98+ specs.emplace_back (o2::tof::getTOFMatchedReaderSpec (useMC, false , false )); // MC, MatchInfo_glo, no TOF_TPCtracks
99+ specs.emplace_back (o2::tof::getClusterReaderSpec (false )); // RSTODO Needed just to set the time of ITSTPC track, consider moving to MatchInfoTOF
100+ }
101+
102+ if (src[GID::TPCTOF]) {
103+ specs.emplace_back (o2::tof::getTOFMatchedReaderSpec (useMC, true , true )); // mc, MatchInfo_TPC, TOF_TPCtracks
104+ }
105+
106+ // clusters for refit
107+ if (GID::includesDet (DetID::ITS, src)) {
108+ specs.emplace_back (o2::itsmft::getITSClusterReaderSpec (false , true )); // mc not neaded
109+ }
110+ if (GID::includesDet (DetID::TPC, src)) {
100111 specs.emplace_back (o2::tpc::getPublisherSpec (o2::tpc::PublisherConf{
101112 " tpc-native-cluster-reader" ,
102113 " tpc-native-clusters.root" ,
@@ -110,25 +121,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
110121 false ));
111122 specs.emplace_back (o2::tpc::getClusterSharingMapSpec ());
112123 }
113-
114- // ITS-TPC matches
115- if (dets[DetID::ITS] && dets[DetID::TPC]) {
116- specs.emplace_back (o2::globaltracking::getTrackTPCITSReaderSpec (true ));
117- }
118-
119- if (dets[DetID::TPC] && dets[DetID::TOF]) {
120- // TPC-TOF matches
121- specs.emplace_back (o2::tof::getTOFMatchedReaderSpec (true , true , true )); // MC info here is redundant
122- // TOF clusters
123- specs.emplace_back (o2::tof::getClusterReaderSpec (false )); // RSTODO Needed just to set the time of ITSTPC track, consider moving to MatchInfoTOF
124- // ITS-TPC-TOF matches
125- if (dets[DetID::ITS]) {
126- specs.emplace_back (o2::tof::getTOFMatchedReaderSpec (true , false , false )); // MC info here is redundant
127- }
128- }
129124 }
130125
131- specs.emplace_back (o2::globaltracking::getCosmicsMatchingSpec (dets , useMC));
126+ specs.emplace_back (o2::globaltracking::getCosmicsMatchingSpec (src , useMC));
132127
133128 if (!disableRootOut) {
134129 specs.emplace_back (o2::globaltracking::getTrackCosmicsWriterSpec (useMC));
0 commit comments