Project
Loading...
Searching...
No Matches
InputHelper.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
51// #include "StrangenessTrackingWorkflow/StrangenessTrackingReaderSpec.h"
52
53using namespace o2::framework;
54using namespace o2::globaltracking;
55using namespace o2::dataformats;
57
58int InputHelper::addInputSpecs(const ConfigContext& configcontext, WorkflowSpec& specs,
59 GID::mask_t maskClusters, GID::mask_t maskMatches, GID::mask_t maskTracks,
60 bool useMC, GID::mask_t maskClustersMC, GID::mask_t maskTracksMC,
61 bool subSpecStrict)
62{
63 if (configcontext.options().get<bool>("disable-root-input")) {
64 return 0;
65 }
66 if (useMC && configcontext.options().get<bool>("disable-mc")) {
67 useMC = false;
68 }
69 if (!useMC) {
70 maskClustersMC = GID::getSourcesMask(GID::NONE);
71 maskTracksMC = GID::getSourcesMask(GID::NONE);
72 } else {
73 // some detectors do not support MC labels
74 if (maskClusters[GID::MCH] && maskClustersMC[GID::MCH]) {
75 LOG(warn) << "MCH global clusters do not support MC lables, disabling";
76 maskClustersMC &= ~GID::getSourceMask(GID::MCH);
77 }
78 }
79
80 if (maskTracks[GID::ITS]) {
81 specs.emplace_back(o2::its::getITSTrackReaderSpec(maskTracksMC[GID::ITS]));
82 }
83 if (maskClusters[GID::ITS]) {
85 specs.emplace_back(o2::itsmft::getITSClusterReaderSpec(maskClustersMC[GID::ITS], doStag, true));
86 }
87 if (maskTracks[GID::MFT]) {
88 specs.emplace_back(o2::mft::getMFTTrackReaderSpec(maskTracksMC[GID::MFT]));
89 }
90 if (maskClusters[GID::MFT]) {
92 specs.emplace_back(o2::itsmft::getMFTClusterReaderSpec(maskClustersMC[GID::MFT], doStag, true));
93 }
94 if (maskTracks[GID::MCH] || maskMatches[GID::MCHMID]) {
95 specs.emplace_back(o2::mch::getTrackReaderSpec(maskTracksMC[GID::MCH] || maskTracksMC[GID::MCHMID]));
96 }
97 if (maskTracks[GID::MID]) {
98 specs.emplace_back(o2::mid::getTrackReaderSpec(maskTracksMC[GID::MID]));
99 }
100 if (maskTracks[GID::TPC]) {
101 specs.emplace_back(o2::tpc::getTPCTrackReaderSpec(maskTracksMC[GID::TPC]));
102 }
103 if (maskClusters[GID::TPC]) {
104 specs.emplace_back(o2::tpc::getClusterReaderSpec(maskClustersMC[GID::TPC]));
105 if (!getenv("DPL_DISABLE_TPC_TRIGGER_READER") || atoi(getenv("DPL_DISABLE_TPC_TRIGGER_READER")) != 1) {
106 specs.emplace_back(o2::tpc::getTPCTriggerReaderSpec());
107 }
108 }
109 if (maskTracks[GID::TPC] && maskClusters[GID::TPC]) {
110 specs.emplace_back(o2::tpc::getClusterSharingMapSpec());
111 }
112 if (maskMatches[GID::ITSTPC] || maskMatches[GID::ITSTPCTOF] || maskTracks[GID::ITSTPC] || maskTracks[GID::ITSTPCTOF]) {
113 specs.emplace_back(o2::globaltracking::getTrackTPCITSReaderSpec(maskTracksMC[GID::ITSTPC] || maskTracksMC[GID::ITSTPCTOF]));
114 }
115 if (maskMatches[GID::ITSTPCTOF] || maskTracks[GID::ITSTPCTOF]) {
116 specs.emplace_back(o2::tof::getTOFMatchedReaderSpec(maskTracksMC[GID::ITSTPCTOF], 1, /*maskTracks[GID::ITSTPCTOF]*/ false)); // ITSTPCTOF does not provide tracks, only matchInfo
117 }
118 if (maskMatches[GID::MFTMCH] || maskTracks[GID::MFTMCH]) {
119 specs.emplace_back(o2::globaltracking::getGlobalFwdTrackReaderSpec(maskTracksMC[GID::MFTMCH])); // MFTMCH matches does not provide tracks, only matchInfo
120 }
121 if (maskMatches[GID::MCHMID] || maskTracks[GID::MCHMID]) {
122 specs.emplace_back(o2::globaltracking::getMCHMIDMatchedReaderSpec(maskTracksMC[GID::MCHMID])); // MCHMID matches does not provide tracks, only matchInfo
123 }
124 if (maskMatches[GID::ITSTPCTRDTOF] || maskTracks[GID::ITSTPCTRDTOF]) {
125 specs.emplace_back(o2::tof::getTOFMatchedReaderSpec(maskTracksMC[GID::ITSTPCTRDTOF], 3, /*maskTracks[GID::ITSTPCTOF]*/ false)); // ITSTPCTOF does not provide tracks, only matchInfo
126 }
127 if (maskMatches[GID::TPCTRDTOF] || maskTracks[GID::TPCTRDTOF]) {
128 specs.emplace_back(o2::tof::getTOFMatchedReaderSpec(maskTracksMC[GID::TPCTRDTOF], 2, /*maskTracks[GID::ITSTPCTOF]*/ false)); // ITSTPCTOF does not provide tracks, only matchInfo
129 }
130 if (maskClusters[GID::TOF] ||
131 maskTracks[GID::ITSTPCTOF] || maskTracks[GID::ITSTPCTRDTOF] || maskTracks[GID::TPCTRDTOF] ||
132 maskMatches[GID::ITSTPCTOF] || maskMatches[GID::ITSTPCTRDTOF] || maskMatches[GID::TPCTRDTOF]) {
133 specs.emplace_back(o2::tof::getClusterReaderSpec(maskClustersMC[GID::TOF]));
134 }
135 if (maskClusters[GID::HMP]) {
136 specs.emplace_back(o2::hmpid::getClusterReaderSpec());
137 }
138 if (maskMatches[GID::TPCTOF] || maskTracks[GID::TPCTOF]) {
139 specs.emplace_back(o2::tof::getTOFMatchedReaderSpec(maskTracksMC[GID::TPCTOF], 0, maskTracks[GID::TPCTOF], subSpecStrict));
140 }
141 if (maskMatches[GID::HMP]) {
142 specs.emplace_back(o2::hmpid::getHMPMatchedReaderSpec(maskTracksMC[GID::HMP]));
143 }
144 if (maskTracks[GID::FT0] || maskClusters[GID::FT0]) {
145 specs.emplace_back(o2::ft0::getRecPointReaderSpec(maskTracksMC[GID::FT0] || maskClustersMC[GID::FT0]));
146 }
147 if (maskTracks[GID::FV0] || maskClusters[GID::FV0]) {
148 specs.emplace_back(o2::fv0::getRecPointReaderSpec(maskTracksMC[GID::FV0] || maskClustersMC[GID::FV0]));
149 }
150 if (maskTracks[GID::FDD] || maskClusters[GID::FDD]) {
151 specs.emplace_back(o2::fdd::getFDDRecPointReaderSpec(maskTracksMC[GID::FDD] || maskClustersMC[GID::FDD]));
152 }
153 if (maskTracks[GID::ZDC] || maskClusters[GID::ZDC]) {
154 specs.emplace_back(o2::zdc::getRecEventReaderSpec(maskTracksMC[GID::ZDC] || maskClustersMC[GID::ZDC]));
155 }
156
157 if (maskClusters[GID::TRD]) {
158 specs.emplace_back(o2::trd::getTRDTrackletReaderSpec(maskClustersMC[GID::TRD], true));
159 }
160 if (maskTracks[GID::ITSTPCTRD] || maskTracks[GID::ITSTPCTRDTOF]) {
161 specs.emplace_back(o2::trd::getTRDGlobalTrackReaderSpec(maskTracksMC[GID::ITSTPCTRD]));
162 }
163 if (maskTracks[GID::TPCTRD] || maskTracks[GID::TPCTRDTOF]) {
164 specs.emplace_back(o2::trd::getTRDTPCTrackReaderSpec(maskTracksMC[GID::TPCTRD], subSpecStrict));
165 }
166 if (maskTracks[GID::CTP] || maskClusters[GID::CTP]) {
167 specs.emplace_back(o2::ctp::getDigitsReaderSpec(maskTracksMC[GID::CTP] || maskClustersMC[GID::CTP]));
168 }
169
170 if (maskTracks[GID::PHS] || maskClusters[GID::PHS]) {
171 specs.emplace_back(o2::phos::getPHOSCellReaderSpec(maskTracksMC[GID::PHS] || maskClustersMC[GID::PHS]));
172 }
173
174 if (maskTracks[GID::CPV] || maskClusters[GID::CPV]) {
175 specs.emplace_back(o2::cpv::getCPVClusterReaderSpec(maskTracksMC[GID::CPV] || maskClustersMC[GID::CPV]));
176 }
177
178 if (maskTracks[GID::EMC] || maskClusters[GID::EMC]) {
179 specs.emplace_back(o2::emcal::getCellReaderSpec(maskTracksMC[GID::EMC] || maskClustersMC[GID::EMC]));
180 }
181
182 if (maskClusters[GID::MCH]) {
183 specs.emplace_back(o2::mch::getClusterReaderSpec(maskClustersMC[GID::MCH], "mch-cluster-reader", true, true));
184 }
185
186 return 0;
187}
188
189// attach primary vertex reader
191{
192 if (configcontext.options().get<bool>("disable-root-input")) {
193 return 0;
194 }
195 specs.emplace_back(o2::vertexing::getPrimaryVertexReaderSpec(mc));
196 return 0;
197}
198
199// attach secondary vertex reader
201{
202 if (configcontext.options().get<bool>("disable-root-input")) {
203 return 0;
204 }
206 return 0;
207}
208
209// attach strangeness tracking reader
211{
212 if (configcontext.options().get<bool>("disable-root-input")) {
213 return 0;
214 }
216 return 0;
217}
218
219// attach cosmic tracks reader
221{
222 if (configcontext.options().get<bool>("disable-root-input")) {
223 return 0;
224 }
225 specs.emplace_back(o2::globaltracking::getTrackCosmicsReaderSpec(mc));
226 return 0;
227}
228
229// attach extended cosmic tracks reader
231{
232 if (configcontext.options().get<bool>("disable-root-input")) {
233 return 0;
234 }
236 return 0;
237}
238
239// attach vector of ITS reconstructed IRFrames
241{
242 if (configcontext.options().get<bool>("disable-root-input")) {
243 return 0;
244 }
245 specs.emplace_back(o2::globaltracking::getIRFrameReaderSpec("ITS", 0, "its-irframe-reader", "o2_its_irframe.root"));
246 return 0;
247}
Device to produce TPC clusters sharing map.
static mask_t getSourcesMask(const std::string_view srcList)
static constexpr std::string_view NONE
keywork for no sources
ConfigParamRegistry & options() const
static int addInputSpecs(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, GID::mask_t maskClusters, GID::mask_t maskMatches, GID::mask_t maskTracks, bool useMC=true, GID::mask_t maskClustersMC=GID::getSourcesMask(GID::ALL), GID::mask_t maskTracksMC=GID::getSourcesMask(GID::ALL), bool subSpecStrict=false)
static int addInputSpecsStrangeTrack(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, bool mc)
static int addInputSpecsCosmicsExtended(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs)
static int addInputSpecsIRFramesITS(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs)
static int addInputSpecsSVertex(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs)
static int addInputSpecsCosmics(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, bool mc)
static int addInputSpecsPVertex(const o2::framework::ConfigContext &configcontext, o2::framework::WorkflowSpec &specs, bool mc)
framework::DataProcessorSpec getCPVClusterReaderSpec(bool useMC=true)
framework::DataProcessorSpec getDigitsReaderSpec(bool propagateMC=true, const std::string &defFile="ctpdigits.root")
Definition of a container to keep/associate and arbitrary number of labels associated to an index wit...
framework::DataProcessorSpec getCellReaderSpec(bool propagateMC)
framework::DataProcessorSpec getFDDRecPointReaderSpec(bool useMC)
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
framework::DataProcessorSpec getRecPointReaderSpec(bool useMC)
framework::DataProcessorSpec getRecPointReaderSpec(bool useMC)
framework::DataProcessorSpec getTrackTPCITSReaderSpec(bool useMC)
create a processor spec
framework::DataProcessorSpec getGlobalFwdTrackReaderSpec(bool useMC)
create a processor spec
framework::DataProcessorSpec getTrackCosmicsReaderSpec(bool useMC)
create a processor spec to read cosmic tracks from a root file
framework::DataProcessorSpec getTrackCosmicsExtendedReaderSpec()
create a processor spec to read the extended cosmics (as written by cosmics-full-writer) from a root ...
framework::DataProcessorSpec getMCHMIDMatchedReaderSpec(bool useMC)
create a processor spec
framework::DataProcessorSpec getIRFrameReaderSpec(o2::header::DataOrigin origin, uint32_t subSpec, const std::string &devName, const std::string &defFileName)
framework::DataProcessorSpec getHMPMatchedReaderSpec(bool useMC)
o2::framework::DataProcessorSpec getClusterReaderSpec()
framework::DataProcessorSpec getITSTrackReaderSpec(bool useMC=true)
framework::DataProcessorSpec getMFTClusterReaderSpec(bool useMC=true, bool doStag=false, bool usePatterns=true, bool useTriggers=true)
framework::DataProcessorSpec getITSClusterReaderSpec(bool useMC=true, bool doStag=false, bool usePatterns=true, bool useTriggers=true)
o2::framework::DataProcessorSpec getTrackReaderSpec(bool useMC, const char *specName="mch-tracks-reader", bool digits=false, uint32_t subspec=0)
o2::framework::DataProcessorSpec getClusterReaderSpec(bool useMC, const char *specName="mch-cluster-reader", bool global=true, bool digits=false)
framework::DataProcessorSpec getMFTTrackReaderSpec(bool useMC=true)
o2::framework::DataProcessorSpec getTrackReaderSpec(bool useMC, const char *specName="mid-tracks-reader")
framework::DataProcessorSpec getPHOSCellReaderSpec(bool useMC=true)
o2::framework::DataProcessorSpec getStrangenessTrackingReaderSpec(bool useMC)
framework::DataProcessorSpec getTOFMatchedReaderSpec(bool useMC, int mode=1, bool readTracks=false, bool subSpecStrict=false)
framework::DataProcessorSpec getClusterReaderSpec(bool useMC)
framework::DataProcessorSpec getClusterReaderSpec(bool useMC, const std::vector< int > *tpcSectors=nullptr, const std::vector< int > *laneConfiguration=nullptr)
framework::DataProcessorSpec getTPCTrackReaderSpec(bool useMC=true)
o2::framework::DataProcessorSpec getClusterSharingMapSpec()
framework::DataProcessorSpec getTPCTriggerReaderSpec()
framework::DataProcessorSpec getTRDTPCTrackReaderSpec(bool useMC, bool subSpecStrict=false)
read TPC-TRD matched tracks from a root file
framework::DataProcessorSpec getTRDTrackletReaderSpec(bool useMC, bool useCalibratedTracklets)
framework::DataProcessorSpec getTRDGlobalTrackReaderSpec(bool useMC)
read ITS-TPC-TRD matched tracks from a root file
o2::framework::DataProcessorSpec getPrimaryVertexReaderSpec(bool useMC)
o2::framework::DataProcessorSpec getSecondaryVertexReaderSpec()
framework::DataProcessorSpec getRecEventReaderSpec(bool useMC)
static bool isITSStaggeringEnabled(o2::framework::ConfigContext const &cfgc)
static bool isMFTStaggeringEnabled(o2::framework::ConfigContext const &cfgc)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"