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
50// #include "StrangenessTrackingWorkflow/StrangenessTrackingReaderSpec.h"
51
52using namespace o2::framework;
53using namespace o2::globaltracking;
54using namespace o2::dataformats;
56
57int InputHelper::addInputSpecs(const ConfigContext& configcontext, WorkflowSpec& specs,
58 GID::mask_t maskClusters, GID::mask_t maskMatches, GID::mask_t maskTracks,
59 bool useMC, GID::mask_t maskClustersMC, GID::mask_t maskTracksMC,
60 bool subSpecStrict)
61{
62 if (configcontext.options().get<bool>("disable-root-input")) {
63 return 0;
64 }
65 if (useMC && configcontext.options().get<bool>("disable-mc")) {
66 useMC = false;
67 }
68 if (!useMC) {
69 maskClustersMC = GID::getSourcesMask(GID::NONE);
70 maskTracksMC = GID::getSourcesMask(GID::NONE);
71 } else {
72 // some detectors do not support MC labels
73 if (maskClusters[GID::MCH] && maskClustersMC[GID::MCH]) {
74 LOG(warn) << "MCH global clusters do not support MC lables, disabling";
75 maskClustersMC &= ~GID::getSourceMask(GID::MCH);
76 }
77 }
78
79 if (maskTracks[GID::ITS]) {
80 specs.emplace_back(o2::its::getITSTrackReaderSpec(maskTracksMC[GID::ITS]));
81 }
82 if (maskClusters[GID::ITS]) {
84 specs.emplace_back(o2::itsmft::getITSClusterReaderSpec(maskClustersMC[GID::ITS], doStag, true));
85 }
86 if (maskTracks[GID::MFT]) {
87 specs.emplace_back(o2::mft::getMFTTrackReaderSpec(maskTracksMC[GID::MFT]));
88 }
89 if (maskClusters[GID::MFT]) {
91 specs.emplace_back(o2::itsmft::getMFTClusterReaderSpec(maskClustersMC[GID::MFT], doStag, true));
92 }
93 if (maskTracks[GID::MCH] || maskMatches[GID::MCHMID]) {
94 specs.emplace_back(o2::mch::getTrackReaderSpec(maskTracksMC[GID::MCH] || maskTracksMC[GID::MCHMID]));
95 }
96 if (maskTracks[GID::MID]) {
97 specs.emplace_back(o2::mid::getTrackReaderSpec(maskTracksMC[GID::MID]));
98 }
99 if (maskTracks[GID::TPC]) {
100 specs.emplace_back(o2::tpc::getTPCTrackReaderSpec(maskTracksMC[GID::TPC]));
101 }
102 if (maskClusters[GID::TPC]) {
103 specs.emplace_back(o2::tpc::getClusterReaderSpec(maskClustersMC[GID::TPC]));
104 if (!getenv("DPL_DISABLE_TPC_TRIGGER_READER") || atoi(getenv("DPL_DISABLE_TPC_TRIGGER_READER")) != 1) {
105 specs.emplace_back(o2::tpc::getTPCTriggerReaderSpec());
106 }
107 }
108 if (maskTracks[GID::TPC] && maskClusters[GID::TPC]) {
109 specs.emplace_back(o2::tpc::getClusterSharingMapSpec());
110 }
111 if (maskMatches[GID::ITSTPC] || maskMatches[GID::ITSTPCTOF] || maskTracks[GID::ITSTPC] || maskTracks[GID::ITSTPCTOF]) {
112 specs.emplace_back(o2::globaltracking::getTrackTPCITSReaderSpec(maskTracksMC[GID::ITSTPC] || maskTracksMC[GID::ITSTPCTOF]));
113 }
114 if (maskMatches[GID::ITSTPCTOF] || maskTracks[GID::ITSTPCTOF]) {
115 specs.emplace_back(o2::tof::getTOFMatchedReaderSpec(maskTracksMC[GID::ITSTPCTOF], 1, /*maskTracks[GID::ITSTPCTOF]*/ false)); // ITSTPCTOF does not provide tracks, only matchInfo
116 }
117 if (maskMatches[GID::MFTMCH] || maskTracks[GID::MFTMCH]) {
118 specs.emplace_back(o2::globaltracking::getGlobalFwdTrackReaderSpec(maskTracksMC[GID::MFTMCH])); // MFTMCH matches does not provide tracks, only matchInfo
119 }
120 if (maskMatches[GID::MCHMID] || maskTracks[GID::MCHMID]) {
121 specs.emplace_back(o2::globaltracking::getMCHMIDMatchedReaderSpec(maskTracksMC[GID::MCHMID])); // MCHMID matches does not provide tracks, only matchInfo
122 }
123 if (maskMatches[GID::ITSTPCTRDTOF] || maskTracks[GID::ITSTPCTRDTOF]) {
124 specs.emplace_back(o2::tof::getTOFMatchedReaderSpec(maskTracksMC[GID::ITSTPCTRDTOF], 3, /*maskTracks[GID::ITSTPCTOF]*/ false)); // ITSTPCTOF does not provide tracks, only matchInfo
125 }
126 if (maskMatches[GID::TPCTRDTOF] || maskTracks[GID::TPCTRDTOF]) {
127 specs.emplace_back(o2::tof::getTOFMatchedReaderSpec(maskTracksMC[GID::TPCTRDTOF], 2, /*maskTracks[GID::ITSTPCTOF]*/ false)); // ITSTPCTOF does not provide tracks, only matchInfo
128 }
129 if (maskClusters[GID::TOF] ||
130 maskTracks[GID::ITSTPCTOF] || maskTracks[GID::ITSTPCTRDTOF] || maskTracks[GID::TPCTRDTOF] ||
131 maskMatches[GID::ITSTPCTOF] || maskMatches[GID::ITSTPCTRDTOF] || maskMatches[GID::TPCTRDTOF]) {
132 specs.emplace_back(o2::tof::getClusterReaderSpec(maskClustersMC[GID::TOF]));
133 }
134 if (maskClusters[GID::HMP]) {
135 specs.emplace_back(o2::hmpid::getClusterReaderSpec());
136 }
137 if (maskMatches[GID::TPCTOF] || maskTracks[GID::TPCTOF]) {
138 specs.emplace_back(o2::tof::getTOFMatchedReaderSpec(maskTracksMC[GID::TPCTOF], 0, maskTracks[GID::TPCTOF], subSpecStrict));
139 }
140 if (maskMatches[GID::HMP]) {
141 specs.emplace_back(o2::hmpid::getHMPMatchedReaderSpec(maskTracksMC[GID::HMP]));
142 }
143 if (maskTracks[GID::FT0] || maskClusters[GID::FT0]) {
144 specs.emplace_back(o2::ft0::getRecPointReaderSpec(maskTracksMC[GID::FT0] || maskClustersMC[GID::FT0]));
145 }
146 if (maskTracks[GID::FV0] || maskClusters[GID::FV0]) {
147 specs.emplace_back(o2::fv0::getRecPointReaderSpec(maskTracksMC[GID::FV0] || maskClustersMC[GID::FV0]));
148 }
149 if (maskTracks[GID::FDD] || maskClusters[GID::FDD]) {
150 specs.emplace_back(o2::fdd::getFDDRecPointReaderSpec(maskTracksMC[GID::FDD] || maskClustersMC[GID::FDD]));
151 }
152 if (maskTracks[GID::ZDC] || maskClusters[GID::ZDC]) {
153 specs.emplace_back(o2::zdc::getRecEventReaderSpec(maskTracksMC[GID::ZDC] || maskClustersMC[GID::ZDC]));
154 }
155
156 if (maskClusters[GID::TRD]) {
157 specs.emplace_back(o2::trd::getTRDTrackletReaderSpec(maskClustersMC[GID::TRD], true));
158 }
159 if (maskTracks[GID::ITSTPCTRD] || maskTracks[GID::ITSTPCTRDTOF]) {
160 specs.emplace_back(o2::trd::getTRDGlobalTrackReaderSpec(maskTracksMC[GID::ITSTPCTRD]));
161 }
162 if (maskTracks[GID::TPCTRD] || maskTracks[GID::TPCTRDTOF]) {
163 specs.emplace_back(o2::trd::getTRDTPCTrackReaderSpec(maskTracksMC[GID::TPCTRD], subSpecStrict));
164 }
165 if (maskTracks[GID::CTP] || maskClusters[GID::CTP]) {
166 specs.emplace_back(o2::ctp::getDigitsReaderSpec(maskTracksMC[GID::CTP] || maskClustersMC[GID::CTP]));
167 }
168
169 if (maskTracks[GID::PHS] || maskClusters[GID::PHS]) {
170 specs.emplace_back(o2::phos::getPHOSCellReaderSpec(maskTracksMC[GID::PHS] || maskClustersMC[GID::PHS]));
171 }
172
173 if (maskTracks[GID::CPV] || maskClusters[GID::CPV]) {
174 specs.emplace_back(o2::cpv::getCPVClusterReaderSpec(maskTracksMC[GID::CPV] || maskClustersMC[GID::CPV]));
175 }
176
177 if (maskTracks[GID::EMC] || maskClusters[GID::EMC]) {
178 specs.emplace_back(o2::emcal::getCellReaderSpec(maskTracksMC[GID::EMC] || maskClustersMC[GID::EMC]));
179 }
180
181 if (maskClusters[GID::MCH]) {
182 specs.emplace_back(o2::mch::getClusterReaderSpec(maskClustersMC[GID::MCH], "mch-cluster-reader", true, true));
183 }
184
185 return 0;
186}
187
188// attach primary vertex reader
190{
191 if (configcontext.options().get<bool>("disable-root-input")) {
192 return 0;
193 }
194 specs.emplace_back(o2::vertexing::getPrimaryVertexReaderSpec(mc));
195 return 0;
196}
197
198// attach secondary vertex reader
200{
201 if (configcontext.options().get<bool>("disable-root-input")) {
202 return 0;
203 }
205 return 0;
206}
207
208// attach strangeness tracking reader
210{
211 if (configcontext.options().get<bool>("disable-root-input")) {
212 return 0;
213 }
215 return 0;
216}
217
218// attach cosmic tracks reader
220{
221 if (configcontext.options().get<bool>("disable-root-input")) {
222 return 0;
223 }
224 specs.emplace_back(o2::globaltracking::getTrackCosmicsReaderSpec(mc));
225 return 0;
226}
227
228// attach vector of ITS reconstructed IRFrames
230{
231 if (configcontext.options().get<bool>("disable-root-input")) {
232 return 0;
233 }
234 specs.emplace_back(o2::globaltracking::getIRFrameReaderSpec("ITS", 0, "its-irframe-reader", "o2_its_irframe.root"));
235 return 0;
236}
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 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 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"