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