Skip to content

Commit 6277647

Browse files
committed
Do not read TPC tracks and/or clusters unless explicitly asked
1 parent 1427335 commit 6277647

3 files changed

Lines changed: 23 additions & 10 deletions

File tree

Detectors/Align/Workflow/include/AlignmentWorkflow/BarrelAlignmentSpec.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ namespace align
2525
{
2626

2727
/// create a processor spec
28-
framework::DataProcessorSpec getBarrelAlignmentSpec(o2::dataformats::GlobalTrackID::mask_t srcMP, o2::dataformats::GlobalTrackID::mask_t src, o2::detectors::DetID::mask_t dets);
28+
framework::DataProcessorSpec getBarrelAlignmentSpec(o2::dataformats::GlobalTrackID::mask_t srcMP, o2::dataformats::GlobalTrackID::mask_t src,
29+
o2::detectors::DetID::mask_t dets, o2::detectors::DetID::mask_t skipDetClusters);
2930

3031
} // namespace align
3132
} // namespace o2

Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,13 @@ void BarrelAlignmentSpec::endOfStream(EndOfStreamContext& ec)
194194
mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
195195
}
196196

197-
DataProcessorSpec getBarrelAlignmentSpec(GTrackID::mask_t srcMP, GTrackID::mask_t src, DetID::mask_t dets)
197+
DataProcessorSpec getBarrelAlignmentSpec(GTrackID::mask_t srcMP, GTrackID::mask_t src, DetID::mask_t dets, DetID::mask_t skipDetClusters)
198198
{
199199
std::vector<OutputSpec> outputs;
200200
auto dataRequest = std::make_shared<DataRequest>();
201201
dataRequest->requestTracks(src, false);
202-
dataRequest->requestClusters(src, false);
202+
dataRequest->requestClusters(src, false, skipDetClusters);
203203
dataRequest->requestPrimaryVertertices(false);
204-
205204
auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(true, // orbitResetTime
206205
true, // GRPECS=true
207206
false, // GRPLHCIF

Detectors/Align/Workflow/src/barrel-alignment-workflow.cxx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
5050
{"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
5151
{"track-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of sources to use"}},
5252
{"detectors", VariantType::String, std::string{"ITS,TPC,TRD,TOF"}, {"comma-separated list of detectors"}},
53+
{"enable-tpc-tracks", VariantType::Bool, false, {"allow reading TPC tracks"}},
54+
{"enable-tpc-clusters", VariantType::Bool, false, {"allow reading TPC clusters (will trigger TPC tracks reading)"}},
5355
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
5456
o2::raw::HBFUtilsInitializer::addConfigOption(options);
5557
std::swap(workflowOptions, options);
@@ -72,7 +74,7 @@ void customize(std::vector<o2::framework::CompletionPolicy>& policies)
7274
WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
7375
{
7476
WorkflowSpec specs;
75-
GID::mask_t alowedSources = GID::getSourcesMask("ITS,MFT,TPC,TRD,ITS-TPC,TPC-TOF,TPC-TRD,ITS-TPC-TRD,TPC-TRD-TOF,ITS-TPC-TOF,ITS-TPC-TRD-TOF");
77+
GID::mask_t alowedSources = GID::getSourcesMask("ITS,TPC,TRD,ITS-TPC,TPC-TOF,TPC-TRD,ITS-TPC-TRD,TPC-TRD-TOF,ITS-TPC-TOF,ITS-TPC-TRD-TOF");
7678
DetID::mask_t allowedDets = DetID::getMask("ITS,TPC,TRD,TOF,CPV,PHS,EMC,HMP");
7779

7880
// Update the (declared) parameters if changed from the command line
@@ -81,9 +83,11 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
8183
o2::conf::ConfigurableParam::writeINI("o2_barrel_alignment_configuration.ini");
8284

8385
auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
86+
bool loadTPCClusters = configcontext.options().get<bool>("enable-tpc-clusters");
87+
bool loadTPCTracks = configcontext.options().get<bool>("enable-tpc-tracks");
8488

8589
DetID::mask_t dets = allowedDets & DetID::getMask(configcontext.options().get<std::string>("detectors"));
86-
90+
DetID::mask_t skipDetClusters; // optionally skip automatically loaded clusters
8791
GID::mask_t src = alowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
8892
GID::mask_t srcCl{};
8993
GID::mask_t srcMP = src; // we may need to load more track types than requested to satisfy dependencies, but only those will be fed to millipede
@@ -92,9 +96,18 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
9296
srcCl |= GID::getSourceMask(GID::ITS);
9397
LOG(info) << "adding ITS request";
9498
}
99+
95100
if (GID::includesDet(DetID::TPC, src)) {
96-
src |= GID::getSourceMask(GID::TPC);
97-
LOG(info) << "adding TPC request";
101+
if (loadTPCTracks || loadTPCClusters) {
102+
src |= GID::getSourceMask(GID::TPC);
103+
LOG(info) << "adding TPC request";
104+
}
105+
if (loadTPCClusters) {
106+
srcCl |= GID::getSourceMask(GID::TPC);
107+
} else {
108+
skipDetClusters |= DetID::getMask(DetID::TPC);
109+
LOG(info) << "Skipping TPC clusters";
110+
}
98111
}
99112
if (GID::includesDet(DetID::TRD, src)) {
100113
src |= GID::getSourceMask(GID::TRD);
@@ -117,9 +130,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
117130
}
118131

119132
GID::mask_t dummy;
120-
specs.emplace_back(o2::align::getBarrelAlignmentSpec(srcMP, src, dets));
133+
specs.emplace_back(o2::align::getBarrelAlignmentSpec(srcMP, src, dets, skipDetClusters));
121134
// RS FIXME: check which clusters are really needed
122-
o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, src, src, src, false, dummy); // clusters MC is not needed
135+
o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcCl, src, src, false, dummy); // clusters MC is not needed
123136
o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, specs, false);
124137

125138
if (!disableRootOut) {

0 commit comments

Comments
 (0)