Project
Loading...
Searching...
No Matches
RecoContainer.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
15
16#include <fmt/format.h>
17#include <chrono>
39// FIXME: ideally, the data formats definition should be independent of the framework
40// collectData is using the input of ProcessingContext to extract the first valid
41// header and the TF orbit from it
45
46#ifdef ENABLE_UPGRADES
48#endif
49
50using namespace o2::globaltracking;
51using namespace o2::framework;
52namespace o2d = o2::dataformats;
53
56
59
61{
62 if (requestMap.find("clusITS") != requestMap.end()) {
63 LOGP(fatal, "setITSPerLayer must be called before request ITS clusters");
64 }
65 ITSPerLayer = v;
66}
67
69{
70 if (requestMap.find("clusMFT") != requestMap.end()) {
71 LOGP(fatal, "setMFTPerLayer must be called before requesting MFT clusters");
72 }
73 MFTPerLayer = v;
74}
76{
77 if (std::find(inputs.begin(), inputs.end(), isp) == inputs.end()) {
78 inputs.emplace_back(isp);
79 }
80}
81
83{
84 addInput({"IRFramesITS", "ITS", "IRFRAMES", 0, Lifetime::Timeframe});
85 requestMap["IRFramesITS"] = false;
86}
87
89{
90 addInput({"trackITS", "ITS", "TRACKS", 0, Lifetime::Timeframe});
91 addInput({"trackITSROF", "ITS", "ITSTrackROF", 0, Lifetime::Timeframe});
92 addInput({"trackITSClIdx", "ITS", "TRACKCLSID", 0, Lifetime::Timeframe});
93 addInput({"alpparITS", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam")});
94 if (mc) {
95 addInput({"trackITSMCTR", "ITS", "TRACKSMCTR", 0, Lifetime::Timeframe});
96 }
97 requestMap["trackITS"] = mc;
98}
99
101{
102 addInput({"trackMFT", "MFT", "TRACKS", 0, Lifetime::Timeframe});
103 addInput({"trackMFTROF", "MFT", "MFTTrackROF", 0, Lifetime::Timeframe});
104 addInput({"trackMFTClIdx", "MFT", "TRACKCLSID", 0, Lifetime::Timeframe});
105 addInput({"alpparMFT", "MFT", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("MFT/Config/AlpideParam")});
106 if (mc) {
107 addInput({"trackMFTMCTR", "MFT", "TRACKSMCTR", 0, Lifetime::Timeframe});
108 }
109 requestMap["trackMFT"] = mc;
110}
111
113{
114 addInput({"trackMCH", "MCH", "TRACKS", 0, Lifetime::Timeframe});
115 addInput({"trackMCHROF", "MCH", "TRACKROFS", 0, Lifetime::Timeframe});
116 addInput({"trackMCHTRACKCLUSTERS", "MCH", "TRACKCLUSTERS", 0, Lifetime::Timeframe});
117 if (mc) {
118 addInput({"trackMCHMCTR", "MCH", "TRACKLABELS", 0, Lifetime::Timeframe});
119 }
120 requestMap["trackMCH"] = mc;
121}
122
124{
125 addInput({"trackMIDROF", "MID", "TRACKROFS", 0, Lifetime::Timeframe});
126 addInput({"trackClMIDROF", "MID", "TRCLUSROFS", 0, Lifetime::Timeframe});
127 addInput({"trackMID", "MID", "TRACKS", 0, Lifetime::Timeframe});
128 addInput({"trackMIDTRACKCLUSTERS", "MID", "TRACKCLUSTERS", 0, Lifetime::Timeframe});
129 if (mc) {
130 addInput({"trackMIDMCTR", "MID", "TRACKLABELS", 0, Lifetime::Timeframe});
131 addInput({"trackMIDMCTRCL", "MID", "TRCLUSLABELS", 0, Lifetime::Timeframe});
132 }
133 requestMap["trackMID"] = mc;
134}
135
137{
138 addInput({"trackTPC", "TPC", "TRACKS", 0, Lifetime::Timeframe});
139 addInput({"trackTPCClRefs", "TPC", "CLUSREFS", 0, Lifetime::Timeframe});
140 if (requestMap.find("clusTPC") != requestMap.end()) {
141 addInput({"clusTPCshmap", "TPC", "CLSHAREDMAP", 0, Lifetime::Timeframe});
143 }
144 if (mc) {
145 addInput({"trackTPCMCTR", "TPC", "TRACKSMCLBL", 0, Lifetime::Timeframe});
146 }
147 requestMap["trackTPC"] = mc;
148}
149
151{
152 addInput({"trackITSTPC", "GLO", "TPCITS", 0, Lifetime::Timeframe});
153 addInput({"trackITSTPCABREFS", "GLO", "TPCITSAB_REFS", 0, Lifetime::Timeframe});
154 addInput({"trackITSTPCABCLID", "GLO", "TPCITSAB_CLID", 0, Lifetime::Timeframe});
155 if (mc) {
156 addInput({"trackITSTPCMCTR", "GLO", "TPCITS_MC", 0, Lifetime::Timeframe});
157 addInput({"trackITSTPCABMCTR", "GLO", "TPCITSAB_MC", 0, Lifetime::Timeframe});
158 }
159 requestMap["trackITSTPC"] = mc;
160}
161
163{
164 addInput({"fwdtracks", "GLO", "GLFWD", 0, Lifetime::Timeframe});
165 if (mc) {
166 addInput({"MCTruth", "GLO", "GLFWD_MC", 0, Lifetime::Timeframe});
167 }
168 requestMap["fwdtracks"] = mc;
169}
170
172{
173 addInput({"matchMFTMCH", "GLO", "MTC_MFTMCH", 0, Lifetime::Timeframe});
174 requestMap["matchMFTMCH"] = mc;
175}
176
178{
179 addInput({"matchMCHMID", "GLO", "MTC_MCHMID", 0, Lifetime::Timeframe});
180 if (mc) {
181 addInput({"matchMCHMID_MCTR", "GLO", "MCMTC_MCHMID", 0, Lifetime::Timeframe});
182 }
183 requestMap["matchMCHMID"] = mc;
184}
185
187{
188 auto ss = getMatchingInputSubSpec();
189 addInput({"matchTPCTOF", "TOF", "MTC_TPC", ss, Lifetime::Timeframe});
190 addInput({"trackTPCTOF", "TOF", "TOFTRACKS_TPC", ss, Lifetime::Timeframe});
191 if (mc) {
192 addInput({"clsTOF_TPC_MCTR", "TOF", "MCMTC_TPC", ss, Lifetime::Timeframe});
193 }
194 requestMap["trackTPCTOF"] = mc;
195}
196
198{
199 addInput({"trackITSTPCTRD", "TRD", "MATCH_ITSTPC", 0, Lifetime::Timeframe});
200 addInput({"trigITSTPCTRD", "TRD", "TRGREC_ITSTPC", 0, Lifetime::Timeframe});
201 if (mc) {
202 addInput({"trackITSTPCTRDMCTR", "TRD", "MCLB_ITSTPC", 0, Lifetime::Timeframe});
203 addInput({"trackITSTPCTRDSAMCTR", "TRD", "MCLB_ITSTPC_TRD", 0, Lifetime::Timeframe});
204 }
205 requestMap["trackITSTPCTRD"] = mc;
206}
207
209{
210 auto ss = getMatchingInputSubSpec();
211 addInput({"trackTPCTRD", "TRD", "MATCH_TPC", ss, Lifetime::Timeframe});
212 addInput({"trigTPCTRD", "TRD", "TRGREC_TPC", ss, Lifetime::Timeframe});
213 if (mc) {
214 addInput({"trackTPCTRDMCTR", "TRD", "MCLB_TPC", ss, Lifetime::Timeframe});
215 addInput({"trackTPCTRDSAMCTR", "TRD", "MCLB_TPC_TRD", ss, Lifetime::Timeframe});
216 }
217 requestMap["trackTPCTRD"] = mc;
218}
219
221{
223 addInput({"matchITSTPCTOF", "TOF", "MTC_ITSTPC", 0, Lifetime::Timeframe});
224 if (mc) {
225 addInput({"clsTOF_GLO_MCTR", "TOF", "MCMTC_ITSTPC", 0, Lifetime::Timeframe});
226 }
227 requestMap["matchTOF_ITSTPC"] = mc;
228 }
230 addInput({"matchTPCTRDTOF", "TOF", "MTC_TPCTRD", 0, Lifetime::Timeframe});
231 if (mc) {
232 addInput({"clsTOF_GLO2_MCTR", "TOF", "MCMTC_TPCTRD", 0, Lifetime::Timeframe});
233 }
234 requestMap["matchTOF_TPCTRD"] = mc;
235 }
237 addInput({"matchITSTPCTRDTOF", "TOF", "MTC_ITSTPCTRD", 0, Lifetime::Timeframe});
238 if (mc) {
239 addInput({"clsTOF_GLO3_MCTR", "TOF", "MCMTC_ITSTPCTRD", 0, Lifetime::Timeframe});
240 }
241 requestMap["matchTOF_ITSTPCTRD"] = mc;
242 }
243}
244
246{
247 uint16_t nInp = ITSPerLayer ? MaxITSLayers : 1;
248 for (uint16_t il = 0; il < nInp; ++il) {
249 addInput({"clusITS" + std::to_string(il), "ITS", "COMPCLUSTERS", il, Lifetime::Timeframe});
250 addInput({"clusITSPatt" + std::to_string(il), "ITS", "PATTERNS", il, Lifetime::Timeframe});
251 addInput({"clusITSROF" + std::to_string(il), "ITS", "CLUSTERSROF", il, Lifetime::Timeframe});
252 if (mc) {
253 addInput({"clusITSMC" + std::to_string(il), "ITS", "CLUSTERSMCTR", il, Lifetime::Timeframe});
254 }
255 }
256 addInput({"alpparITS", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam")});
257 addInput({"cldictITS", "ITS", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("ITS/Calib/ClusterDictionary")});
258 requestMap["clusITS"] = mc;
259}
260
261#ifdef ENABLE_UPGRADES
262void DataRequest::requestIT3Clusters(bool mc)
263{
264 uint16_t nInp = ITSPerLayer ? MaxITSLayers : 1;
265 for (uint16_t il = 0; il < nInp; ++il) {
266 addInput({"clusITS" + std::to_string(il), "ITS", "COMPCLUSTERS", il, Lifetime::Timeframe});
267 addInput({"clusITSPatt" + std::to_string(il), "ITS", "PATTERNS", il, Lifetime::Timeframe});
268 addInput({"clusITSROF" + std::to_string(il), "ITS", "CLUSTERSROF", il, Lifetime::Timeframe});
269 if (mc) {
270 addInput({"clusITSMC" + std::to_string(il), "ITS", "CLUSTERSMCTR", il, Lifetime::Timeframe});
271 }
272 }
273 addInput({"alpparITS", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam")});
274 addInput({"cldictIT3", "IT3", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("IT3/Calib/ClusterDictionary")});
275 requestMap["clusIT3"] = mc;
276}
277#endif
278
280{
281 uint16_t nInp = MFTPerLayer ? MaxMFTLayers : 1;
282 for (uint16_t il = 0; il < nInp; ++il) {
283 addInput({"clusMFT" + std::to_string(il), "MFT", "COMPCLUSTERS", il, Lifetime::Timeframe});
284 addInput({"clusMFTPatt" + std::to_string(il), "MFT", "PATTERNS", il, Lifetime::Timeframe});
285 addInput({"clusMFTROF" + std::to_string(il), "MFT", "CLUSTERSROF", il, Lifetime::Timeframe});
286 if (mc) {
287 addInput({"clusMFTMC" + std::to_string(il), "MFT", "CLUSTERSMCTR", il, Lifetime::Timeframe});
288 }
289 }
290 addInput({"cldictMFT", "MFT", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("MFT/Calib/ClusterDictionary")});
291 addInput({"alpparMFT", "MFT", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("MFT/Config/AlpideParam")});
292 requestMap["clusMFT"] = mc;
293}
294
296{
297 addInput({"clusTPCoccmap", "TPC", "TPCOCCUPANCYMAP", 0, Lifetime::Timeframe});
298 requestMap["TPCOcc"] = false;
299}
300
302{
303 addInput({"clusTPC", ConcreteDataTypeMatcher{"TPC", "CLUSTERNATIVE"}, Lifetime::Timeframe});
304 if (!getenv("DPL_DISABLE_TPC_TRIGGER_READER") || atoi(getenv("DPL_DISABLE_TPC_TRIGGER_READER")) != 1) {
306 }
307 if (requestMap.find("trackTPC") != requestMap.end()) {
308 addInput({"clusTPCshmap", "TPC", "CLSHAREDMAP", 0, Lifetime::Timeframe});
310 }
311 if (mc) {
312 addInput({"clusTPCMC", ConcreteDataTypeMatcher{"TPC", "CLNATIVEMCLBL"}, Lifetime::Timeframe});
313 }
314 requestMap["clusTPC"] = mc;
315}
316
318{
319 addInput({"trigTPC", "TPC", "TRIGGERWORDS", 0, Lifetime::Timeframe});
320 requestMap["trigTPC"] = false;
321}
322
324{
325 addInput({"tofcluster", "TOF", "CLUSTERS", 0, Lifetime::Timeframe});
326 if (mc) {
327 addInput({"tofclusterlabel", "TOF", "CLUSTERSMCTR", 0, Lifetime::Timeframe});
328 }
329 requestMap["clusTOF"] = mc;
330}
331
333{
334 if (mc) {
335 LOG(warn) << "MCH global clusters do not support MC lables, disabling";
336 mc = false;
337 }
338 addInput({"clusMCH", "MCH", "GLOBALCLUSTERS", 0, Lifetime::Timeframe});
339 addInput({"clusMCHROF", "MCH", "CLUSTERROFS", 0, Lifetime::Timeframe});
340 if (mc) {
341 addInput({"clusMCHMC", "MCH", "CLUSTERLABELS", 0, Lifetime::Timeframe});
342 }
343 requestMap["clusMCH"] = mc;
344}
345
347{
348 if (mc) { // RS: remove this once labels will be available
349 LOG(warn) << "HMP clusters do not support MC lables, disabling";
350 mc = false;
351 }
352 addInput({"hmpidcluster", "HMP", "CLUSTERS", 0, Lifetime::Timeframe});
353 addInput({"hmpidtriggers", "HMP", "INTRECORDS1", 0, Lifetime::Timeframe});
354 if (mc) {
355 addInput({"hmpidclusterlabel", "HMP", "CLUSTERSMCTR", 0, Lifetime::Timeframe});
356 }
357 requestMap["clusHMP"] = mc;
358}
359
361{
362 addInput({"clusMID", "MID", "CLUSTERS", 0, Lifetime::Timeframe});
363 addInput({"clusMIDROF", "MID", "CLUSTERSROF", 0, Lifetime::Timeframe});
364 if (mc) {
365 addInput({"clusMIDMC", "MID", "CLUSTERSLABELS", 0, Lifetime::Timeframe});
366 }
367 requestMap["clusMID"] = mc;
368}
369
371{
372 addInput({"trdtracklets", o2::header::gDataOriginTRD, "TRACKLETS", 0, Lifetime::Timeframe});
373 addInput({"trdctracklets", o2::header::gDataOriginTRD, "CTRACKLETS", 0, Lifetime::Timeframe});
374 addInput({"trdtrigrecmask", o2::header::gDataOriginTRD, "TRIGRECMASK", 0, Lifetime::Timeframe});
375 addInput({"trdtriggerrec", o2::header::gDataOriginTRD, "TRKTRGRD", 0, Lifetime::Timeframe});
376 if (mc) {
377 addInput({"trdtrackletlabels", o2::header::gDataOriginTRD, "TRKLABELS", 0, Lifetime::Timeframe});
378 }
379 requestMap["trackletTRD"] = mc;
380}
381
383{
384 addInput({"ft0recpoints", "FT0", "RECPOINTS", 0, Lifetime::Timeframe});
385 addInput({"ft0channels", "FT0", "RECCHDATA", 0, Lifetime::Timeframe});
386 if (mc) {
387 LOG(error) << "FT0 RecPoint does not support MC truth";
388 }
389 requestMap["FT0"] = false;
390}
391
393{
394 addInput({"fv0recpoints", "FV0", "RECPOINTS", 0, Lifetime::Timeframe});
395 addInput({"fv0channels", "FV0", "RECCHDATA", 0, Lifetime::Timeframe});
396 if (mc) {
397 LOG(error) << "FV0 RecPoint does not support MC truth";
398 }
399 requestMap["FV0"] = false;
400}
401
403{
404 addInput({"fddrecpoints", "FDD", "RECPOINTS", 0, Lifetime::Timeframe});
405 addInput({"fddchannels", "FDD", "RECCHDATA", 0, Lifetime::Timeframe});
406 if (mc) {
407 LOG(error) << "FDD RecPoint does not support MC truth";
408 }
409 requestMap["FDD"] = false;
410}
411
413{
414 addInput({"zdcbcrec", "ZDC", "BCREC", 0, Lifetime::Timeframe});
415 addInput({"zdcenergy", "ZDC", "ENERGY", 0, Lifetime::Timeframe});
416 addInput({"zdctdcdata", "ZDC", "TDCDATA", 0, Lifetime::Timeframe});
417 addInput({"zdcinfo", "ZDC", "INFO", 0, Lifetime::Timeframe});
418 if (mc) {
419 LOG(error) << "ZDC RecEvent does not support MC truth";
420 }
421 requestMap["ZDC"] = false;
422}
423
425{
426 addInput({"cosmics", "GLO", "COSMICTRC", 0, Lifetime::Timeframe});
427 if (mc) {
428 addInput({"cosmicsMC", "GLO", "COSMICTRC_MC", 0, Lifetime::Timeframe});
429 }
430 requestMap["Cosmics"] = mc;
431}
432
434{
435 addInput({"cosmicsExt", "GLO", "COSMFULL", 0, Lifetime::Timeframe});
436 addInput({"cosmicsExtTF", "GLO", "COSMFULLTF", 0, Lifetime::Timeframe});
437 if (mc) {
438 LOG(error) << "Extended cosmics do not support MC truth";
439 }
440 requestMap["CosmicsExt"] = false;
441}
442
444{
445 addInput({"pvtx", "GLO", "PVTX", 0, Lifetime::Timeframe});
446 addInput({"pvtx_trmtc", "GLO", "PVTX_TRMTC", 0, Lifetime::Timeframe}); // global ids of associated tracks
447 addInput({"pvtx_tref", "GLO", "PVTX_TRMTCREFS", 0, Lifetime::Timeframe}); // vertex - trackID refs
448 if (mc) {
449 addInput({"pvtx_mc", "GLO", "PVTX_MCTR", 0, Lifetime::Timeframe});
450 }
451 requestMap["PVertex"] = mc;
452}
453
454void DataRequest::requestPrimaryVerticesTMP(bool mc) // primary vertices before global vertex-track matching
455{
456 addInput({"pvtx", "GLO", "PVTX", 0, Lifetime::Timeframe});
457 addInput({"pvtx_cont", "GLO", "PVTX_CONTID", 0, Lifetime::Timeframe}); // global ids of contributors
458 addInput({"pvtx_contref", "GLO", "PVTX_CONTIDREFS", 0, Lifetime::Timeframe}); // vertex - trackID refs of contributors
459 if (mc) {
460 addInput({"pvtx_mc", "GLO", "PVTX_MCTR", 0, Lifetime::Timeframe});
461 }
462 requestMap["PVertexTMP"] = mc;
463}
464
466{
467 addInput({"v0sIdx", "GLO", "V0S_IDX", 0, Lifetime::Timeframe});
468 addInput({"v0s", "GLO", "V0S", 0, Lifetime::Timeframe});
469 addInput({"p2v0s", "GLO", "PVTX_V0REFS", 0, Lifetime::Timeframe});
470 addInput({"cascsIdx", "GLO", "CASCS_IDX", 0, Lifetime::Timeframe});
471 addInput({"cascs", "GLO", "CASCS", 0, Lifetime::Timeframe});
472 addInput({"p2cascs", "GLO", "PVTX_CASCREFS", 0, Lifetime::Timeframe});
473 addInput({"decay3bodyIdx", "GLO", "DECAYS3BODY_IDX", 0, Lifetime::Timeframe});
474 addInput({"decay3body", "GLO", "DECAYS3BODY", 0, Lifetime::Timeframe});
475 addInput({"p2decay3body", "GLO", "PVTX_3BODYREFS", 0, Lifetime::Timeframe});
476 requestMap["SVertex"] = false; // no MC provided for secondary vertices
477}
478
480{
481 addInput({"strangetracks", "GLO", "STRANGETRACKS", 0, Lifetime::Timeframe});
482 if (mc) {
483 addInput({"strack_mc", "GLO", "STRANGETRACKS_MC", 0, Lifetime::Timeframe});
484 }
485 requestMap["STracker"] = mc; // no MC for the time being
486}
487
489{
490 addInput({"CTPDigits", "CTP", "DIGITS", 0, Lifetime::Timeframe});
491 addInput({"CTPLumi", "CTP", "LUMI", 0, Lifetime::Timeframe});
492 if (mc) {
493 LOG(warning) << "MC truth not implemented for CTP";
494 // addInput({"CTPDigitsMC", "CTP", "DIGITSMCTR", 0, Lifetime::Timeframe});
495 }
496 requestMap["CTPDigits"] = false;
497}
498
500{
501 addInput({"CPVClusters", "CPV", "CLUSTERS", 0, Lifetime::Timeframe});
502 addInput({"CPVTriggers", "CPV", "CLUSTERTRIGRECS", 0, Lifetime::Timeframe});
503 if (mc) {
504 addInput({"CPVClustersMC", "CPV", "CLUSTERTRUEMC", 0, Lifetime::Timeframe});
505 }
506 requestMap["CPVClusters"] = mc;
507}
508
510{
511 addInput({"PHSCells", "PHS", "CELLS", 0, Lifetime::Timeframe});
512 addInput({"PHSTriggers", "PHS", "CELLTRIGREC", 0, Lifetime::Timeframe});
513 if (mc) {
514 addInput({"PHSCellsMC", "PHS", "CELLSMCTR", 0, Lifetime::Timeframe});
515 }
516 requestMap["PHSCells"] = mc;
517}
518
520{
521 addInput({"EMCCells", "EMC", "CELLS", 0, Lifetime::Timeframe});
522 addInput({"EMCTriggers", "EMC", "CELLSTRGR", 0, Lifetime::Timeframe});
523 if (mc) {
524 addInput({"EMCCellsMC", "EMC", "CELLSMCTR", 0, Lifetime::Timeframe});
525 }
526 requestMap["EMCCells"] = mc;
527}
528
530{
531 addInput({"matchHMP", "HMP", "MATCHES", 0, Lifetime::Timeframe});
532 if (mc) {
533 addInput({"clsHMP_GLO_MCTR", "HMP", "MCLABELS", 0, Lifetime::Timeframe});
534 }
535 requestMap["matchHMP"] = mc;
536}
537
539{
540 // request tracks for sources probided by the mask
541 if (src[GTrackID::ITS]) {
542 requestITSTracks(useMC);
543 }
544 if (src[GTrackID::MFT]) {
545 requestMFTTracks(useMC);
546 }
548 requestMCHTracks(useMC);
549 }
550 if (src[GTrackID::MID]) {
551 requestMIDTracks(useMC);
552 }
553 if (src[GTrackID::TPC]) {
554 requestTPCTracks(useMC);
555 }
557 requestITSTPCTracks(useMC);
558 }
559 if (src[GTrackID::MFTMCH]) {
561 }
562 if (src[GTrackID::MCHMID]) {
564 }
565 if (src[GTrackID::TPCTOF]) {
566 requestTPCTOFTracks(useMC);
567 }
569 requestTPCTRDTracks(useMC);
570 }
573 }
575 requestTOFMatches(src, useMC);
576 requestTOFClusters(false);
577 }
578 if (src[GTrackID::FT0]) {
579 requestFT0RecPoints(false); // RS FIXME: at the moment does not support MC
580 }
581 if (src[GTrackID::FV0]) {
582 requestFV0RecPoints(false); // RS FIXME: at the moment does not support MC
583 }
584 if (src[GTrackID::FDD]) {
585 requestFDDRecPoints(false); // RS FIXME: at the moment does not support MC
586 }
587 if (src[GTrackID::ZDC]) {
588 requestZDCRecEvents(false); // RS FIXME: at the moment does not support MC
589 }
590 if (GTrackID::includesDet(DetID::CTP, src)) {
591 requestCTPDigits(false); // RS FIXME: at the moment does not support MC
592 }
593 if (GTrackID::includesDet(DetID::CPV, src)) {
594 requestCPVClusters(useMC);
595 }
596 if (GTrackID::includesDet(DetID::PHS, src)) {
597 requestPHOSCells(useMC);
598 }
599 if (GTrackID::includesDet(DetID::EMC, src)) {
600 requestEMCALCells(useMC);
601 }
602 if (GTrackID::includesDet(DetID::HMP, src)) {
603 requestHMPClusters(useMC);
604 }
605 if (src[GTrackID::HMP]) {
606 requestHMPMatches(useMC);
607 }
608}
609
611{
612 // request clusters for detectors of the sources probided by the mask
613 // clusters needed for refits
614 if (GTrackID::includesDet(DetID::ITS, src) && !skipDetClusters[DetID::ITS]) {
615 requestITSClusters(useMC);
616 }
617 if (GTrackID::includesDet(DetID::MFT, src) && !skipDetClusters[DetID::MFT]) {
618 requestMFTClusters(useMC);
619 }
620 if (GTrackID::includesDet(DetID::TPC, src) && !skipDetClusters[DetID::TPC]) {
621 requestTPCClusters(useMC);
622 }
623 if (GTrackID::includesDet(DetID::TOF, src) && !skipDetClusters[DetID::TOF]) {
624 requestTOFClusters(useMC);
625 }
626 if (GTrackID::includesDet(DetID::TRD, src) && !skipDetClusters[DetID::TRD]) {
627 requestTRDTracklets(useMC);
628 }
629 if (GTrackID::includesDet(DetID::CTP, src) && !skipDetClusters[DetID::CTP]) {
630 requestCTPDigits(false); // RS FIXME: at the moment does not support MC
631 }
632 if (GTrackID::includesDet(DetID::CPV, src) && !skipDetClusters[DetID::CPV]) {
633 requestCPVClusters(useMC);
634 }
635 if (GTrackID::includesDet(DetID::PHS, src) && !skipDetClusters[DetID::PHS]) {
636 requestPHOSCells(useMC);
637 }
638 if (GTrackID::includesDet(DetID::EMC, src) && !skipDetClusters[DetID::EMC]) {
639 requestEMCALCells(useMC);
640 }
641 if (GTrackID::includesDet(DetID::MCH, src) && !skipDetClusters[DetID::MCH]) {
642 requestMCHClusters(useMC);
643 }
644 if (GTrackID::includesDet(DetID::HMP, src) && !skipDetClusters[DetID::HMP]) {
645 requestHMPClusters(useMC);
646 }
647}
648
649//__________________________________________________________________
651{
652 auto& reqMap = requests.requestMap;
653
654 ITSPerLayer = requests.getITSPerLayer();
655 MFTPerLayer = requests.getMFTPerLayer();
656
657 startIR = {0, pc.services().get<o2::framework::TimingInfo>().firstTForbit};
658
659 auto req = reqMap.find("trackITS");
660 if (req != reqMap.end()) {
661 addITSTracks(pc, req->second);
662 }
663
664 req = reqMap.find("trackMFT");
665 if (req != reqMap.end()) {
666 addMFTTracks(pc, req->second);
667 }
668
669 req = reqMap.find("trackMCH");
670 if (req != reqMap.end()) {
671 addMCHTracks(pc, req->second);
672 }
673
674 req = reqMap.find("trackMID");
675 if (req != reqMap.end()) {
676 addMIDTracks(pc, req->second);
677 }
678
679 req = reqMap.find("trackTPC");
680 if (req != reqMap.end()) {
681 addTPCTracks(pc, req->second);
682 }
683
684 req = reqMap.find("trackITSTPC");
685 if (req != reqMap.end()) {
686 addITSTPCTracks(pc, req->second);
687 }
688
689 req = reqMap.find("fwdtracks");
690 if (req != reqMap.end()) {
691 addGlobalFwdTracks(pc, req->second);
692 }
693
694 req = reqMap.find("matchMFTMCH");
695 if (req != reqMap.end()) {
696 addMFTMCHMatches(pc, req->second);
697 }
698
699 req = reqMap.find("matchMCHMID");
700 if (req != reqMap.end()) {
701 addMCHMIDMatches(pc, req->second);
702 }
703
704 req = reqMap.find("trackITSTPCTRD");
705 if (req != reqMap.end()) {
706 addITSTPCTRDTracks(pc, req->second);
707 }
708
709 req = reqMap.find("trackTPCTRD");
710 if (req != reqMap.end()) {
711 addTPCTRDTracks(pc, req->second);
712 }
713
714 req = reqMap.find("trackTPCTOF");
715 if (req != reqMap.end()) {
716 addTPCTOFTracks(pc, req->second);
717 }
718
719 req = reqMap.find("matchTOF_ITSTPC");
720 if (req != reqMap.end()) {
721 addTOFMatchesITSTPC(pc, req->second);
722 }
723
724 req = reqMap.find("matchTOF_TPCTRD");
725 if (req != reqMap.end()) {
726 addTOFMatchesTPCTRD(pc, req->second);
727 }
728
729 req = reqMap.find("matchTOF_ITSTPCTRD");
730 if (req != reqMap.end()) {
731 addTOFMatchesITSTPCTRD(pc, req->second);
732 }
733
734 req = reqMap.find("clusITS");
735 if (req != reqMap.end()) {
736 addITSClusters(pc, req->second);
737 }
738
739#ifdef ENABLE_UPGRADES
740 req = reqMap.find("clusIT3");
741 if (req != reqMap.end()) {
742 addIT3Clusters(pc, req->second);
743 }
744#endif
745
746 req = reqMap.find("clusMFT");
747 if (req != reqMap.end()) {
748 addMFTClusters(pc, req->second);
749 }
750
751 req = reqMap.find("TPCOcc");
752 bool TPCOccDone = false;
753 if (req != reqMap.end()) {
754 TPCOccDone = true;
755 addTPCOccMap(pc);
756 }
757
758 req = reqMap.find("clusTPC");
759 if (req != reqMap.end()) {
760 auto tracksON = reqMap.find("trackTPC") != reqMap.end();
761 addTPCClusters(pc, req->second, tracksON, tracksON && (!TPCOccDone));
762 }
763
764 req = reqMap.find("trigTPC");
765 if (req != reqMap.end()) {
766 addTPCTriggers(pc);
767 }
768
769 req = reqMap.find("clusTOF");
770 if (req != reqMap.end()) {
771 addTOFClusters(pc, req->second);
772 }
773
774 req = reqMap.find("clusHMP");
775 if (req != reqMap.end()) {
776 addHMPClusters(pc, req->second);
777 }
778
779 req = reqMap.find("CTPDigits");
780 if (req != reqMap.end()) {
781 addCTPDigits(pc, req->second);
782 }
783
784 req = reqMap.find("CPVClusters");
785 if (req != reqMap.end()) {
786 addCPVClusters(pc, req->second);
787 }
788
789 req = reqMap.find("PHSCells");
790 if (req != reqMap.end()) {
791 addPHOSCells(pc, req->second);
792 }
793
794 req = reqMap.find("EMCCells");
795 if (req != reqMap.end()) {
796 addEMCALCells(pc, req->second);
797 }
798
799 req = reqMap.find("clusMCH");
800 if (req != reqMap.end()) {
801 addMCHClusters(pc, req->second);
802 }
803
804 req = reqMap.find("clusMID");
805 if (req != reqMap.end()) {
806 addMIDClusters(pc, req->second);
807 }
808
809 req = reqMap.find("FT0");
810 if (req != reqMap.end()) {
811 addFT0RecPoints(pc, req->second);
812 }
813
814 req = reqMap.find("FV0");
815 if (req != reqMap.end()) {
816 addFV0RecPoints(pc, req->second);
817 }
818
819 req = reqMap.find("FDD");
820 if (req != reqMap.end()) {
821 addFDDRecPoints(pc, req->second);
822 }
823
824 req = reqMap.find("ZDC");
825 if (req != reqMap.end()) {
826 addZDCRecEvents(pc, req->second);
827 }
828
829 req = reqMap.find("trackletTRD");
830 if (req != reqMap.end()) {
831 addTRDTracklets(pc, req->second);
832 }
833
834 req = reqMap.find("Cosmics");
835 if (req != reqMap.end()) {
836 addCosmicTracks(pc, req->second);
837 }
838
839 req = reqMap.find("CosmicsExt");
840 if (req != reqMap.end()) {
841 addCosmicExtTracks(pc, req->second);
842 }
843
844 req = reqMap.find("PVertex");
845 if (req != reqMap.end()) {
846 addPVertices(pc, req->second);
847 }
848
849 req = reqMap.find("PVertexTMP");
850 if (req != reqMap.end()) {
851 addPVerticesTMP(pc, req->second);
852 }
853
854 req = reqMap.find("SVertex");
855 if (req != reqMap.end()) {
856 addSVertices(pc, req->second);
857 }
858
859 req = reqMap.find("STracker");
860 if (req != reqMap.end()) {
861 addStrangeTracks(pc, req->second);
862 }
863
864 req = reqMap.find("IRFramesITS");
865 if (req != reqMap.end()) {
866 addIRFramesITS(pc);
867 }
868 req = reqMap.find("matchHMP");
869 if (req != reqMap.end()) {
870 addHMPMatches(pc, req->second);
871 }
872}
873
874//____________________________________________________________
876{
877 svtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::V0Index>>("v0sIdx"), V0SIDX);
878 svtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::V0>>("v0s"), V0S);
880 svtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::CascadeIndex>>("cascsIdx"), CASCSIDX);
881 svtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::Cascade>>("cascs"), CASCS);
883 svtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::Decay3BodyIndex>>("decay3bodyIdx"), DECAY3BODYIDX);
884 svtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::Decay3Body>>("decay3body"), DECAY3BODY);
886 // no mc
887}
888
889//____________________________________________________________
891{
892 pvtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::PrimaryVertex>>("pvtx"), PVTX);
893 pvtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::VtxTrackIndex>>("pvtx_trmtc"), PVTX_TRMTC);
894 pvtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::VtxTrackRef>>("pvtx_tref"), PVTX_TRMTCREFS);
895
896 if (mc) { // in case was loaded via addPVerticesTMP
897 pvtxPool.registerContainer(pc.inputs().get<gsl::span<o2::MCEventLabel>>("pvtx_mc"), PVTX_MCTR);
898 }
899}
900
901//____________________________________________________________
903{
904 strkPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::StrangeTrack>>("strangetracks"), STRACK);
905 if (mc) {
906 strkPool.registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("strack_mc"), STRACK_MC);
907 }
908}
909
910//____________________________________________________________
912{
913 pvtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::PrimaryVertex>>("pvtx"), PVTX);
914 pvtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::VtxTrackIndex>>("pvtx_cont"), PVTX_CONTID);
915 pvtxPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::VtxTrackRef>>("pvtx_contref"), PVTX_CONTIDREFS);
916
917 if (mc) { // in case was loaded via addPVertices
918 pvtxPool.registerContainer(pc.inputs().get<gsl::span<o2::MCEventLabel>>("pvtx_mc"), PVTX_MCTR);
919 }
920}
921
922//____________________________________________________________
924{
927 // the messages are ROOT-serialized, keep the deserialized objects alive until the next TF
928 std::shared_ptr<const std::vector<TrackCosmicsExtended>> cosm = pc.inputs().get<std::vector<TrackCosmicsExtended>*>("cosmicsExt");
929 std::shared_ptr<const CosmicsTFInfo> tfInfo = pc.inputs().get<CosmicsTFInfo*>("cosmicsExtTF");
931 cosmPool.registerContainer(gsl::span<const CosmicsTFInfo>(tfInfo.get(), 1), COSMEXT_TFINFO);
932 cosmExtHolder[0] = std::move(cosm);
933 cosmExtHolder[1] = std::move(tfInfo);
934 if (mc) {
935 LOG(error) << "Extended cosmics do not support MC truth";
936 }
937}
938
939//____________________________________________________________
941{
942 cosmPool.registerContainer(pc.inputs().get<gsl::span<o2::dataformats::TrackCosmics>>("cosmics"), COSM_TRACKS);
943 if (mc) {
944 cosmPool.registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("cosmicsMC"), COSM_TRACKS_MC);
945 }
946}
947
948//____________________________________________________________
950{
951 if (pc.services().get<o2::framework::TimingInfo>().globalRunNumberChanged) { // this params need to be queried only once
952 pc.inputs().get<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>*>("alpparITS"); // note: configurable param does not need finaliseCCDB
953 }
954 commonPool[GTrackID::ITS].registerContainer(pc.inputs().get<gsl::span<o2::its::TrackITS>>("trackITS"), TRACKS);
955 commonPool[GTrackID::ITS].registerContainer(pc.inputs().get<gsl::span<int>>("trackITSClIdx"), INDICES);
956 commonPool[GTrackID::ITS].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::ROFRecord>>("trackITSROF"), TRACKREFS);
957 if (mc) {
958 commonPool[GTrackID::ITS].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackITSMCTR"), MCLABELS);
959 }
960}
961
962//____________________________________________________________
964{
965 commonPool[GTrackID::ITS].registerContainer(pc.inputs().get<gsl::span<o2::dataformats::IRFrame>>("IRFramesITS"), VARIA);
966}
967
968//____________________________________________________________
970{
971 if (pc.services().get<o2::framework::TimingInfo>().globalRunNumberChanged) { // this params need to be queried only once
972 pc.inputs().get<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::MFT>*>("alpparMFT"); // note: configurable param does not need finaliseCCDB
973 }
974 commonPool[GTrackID::MFT].registerContainer(pc.inputs().get<gsl::span<o2::mft::TrackMFT>>("trackMFT"), TRACKS);
975 commonPool[GTrackID::MFT].registerContainer(pc.inputs().get<gsl::span<int>>("trackMFTClIdx"), INDICES);
976 commonPool[GTrackID::MFT].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::ROFRecord>>("trackMFTROF"), TRACKREFS);
977 if (mc) {
978 commonPool[GTrackID::MFT].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackMFTMCTR"), MCLABELS);
979 }
980}
981
982//____________________________________________________________
984{
985 commonPool[GTrackID::MCH].registerContainer(pc.inputs().get<gsl::span<o2::mch::TrackMCH>>("trackMCH"), TRACKS);
986 commonPool[GTrackID::MCH].registerContainer(pc.inputs().get<gsl::span<o2::mch::ROFRecord>>("trackMCHROF"), TRACKREFS);
987 commonPool[GTrackID::MCH].registerContainer(pc.inputs().get<gsl::span<o2::mch::Cluster>>("trackMCHTRACKCLUSTERS"), INDICES);
988 if (mc) {
989 commonPool[GTrackID::MCH].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackMCHMCTR"), MCLABELS);
990 }
991}
992
993//____________________________________________________________
995{
996 commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::mid::Track>>("trackMID"), TRACKS);
997 commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::mid::ROFRecord>>("trackMIDROF"), TRACKREFS);
998 commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::mid::Cluster>>("trackMIDTRACKCLUSTERS"), INDICES);
999 commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::mid::ROFRecord>>("trackClMIDROF"), MATCHES);
1000 if (mc) {
1001 commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackMIDMCTR"), MCLABELS);
1003 }
1004}
1005
1006//________________________________________________________
1011
1012//________________________________________________________
1017
1018//____________________________________________________________
1020{
1021 commonPool[GTrackID::TPC].registerContainer(pc.inputs().get<gsl::span<o2::tpc::TrackTPC>>("trackTPC"), TRACKS);
1022 commonPool[GTrackID::TPC].registerContainer(pc.inputs().get<gsl::span<o2::tpc::TPCClRefElem>>("trackTPCClRefs"), INDICES);
1023 if (mc) {
1024 commonPool[GTrackID::TPC].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackTPCMCTR"), MCLABELS);
1025 }
1026}
1027
1028//__________________________________________________________
1030{
1031 commonPool[GTrackID::ITSTPC].registerContainer(pc.inputs().get<gsl::span<o2d::TrackTPCITS>>("trackITSTPC"), TRACKS);
1032 commonPool[GTrackID::ITSAB].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::TrkClusRef>>("trackITSTPCABREFS"), TRACKREFS);
1033 commonPool[GTrackID::ITSAB].registerContainer(pc.inputs().get<gsl::span<int>>("trackITSTPCABCLID"), INDICES);
1034 if (mc) {
1035 commonPool[GTrackID::ITSTPC].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackITSTPCMCTR"), MCLABELS);
1036 commonPool[GTrackID::ITSAB].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackITSTPCABMCTR"), MCLABELS);
1037 }
1038}
1039
1040//__________________________________________________________
1042{
1043 commonPool[GTrackID::MFTMCH].registerContainer(pc.inputs().get<gsl::span<o2d::GlobalFwdTrack>>("fwdtracks"), TRACKS);
1044 if (mc) {
1045 commonPool[GTrackID::MFTMCH].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("MCTruth"), MCLABELS);
1046 }
1047}
1048
1049//__________________________________________________________
1051{
1052 commonPool[GTrackID::MFTMCH].registerContainer(pc.inputs().get<gsl::span<o2d::MatchInfoFwd>>("matchMFTMCH"), MATCHES);
1053}
1054
1055//__________________________________________________________
1057{
1058 commonPool[GTrackID::MCHMID].registerContainer(pc.inputs().get<gsl::span<o2d::TrackMCHMID>>("matchMCHMID"), MATCHES);
1059 if (mc) {
1060 commonPool[GTrackID::MCHMID].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("matchMCHMID_MCTR"), MCLABELS);
1061 }
1062}
1063
1064//__________________________________________________________
1066{
1067 commonPool[GTrackID::ITSTPCTRD].registerContainer(pc.inputs().get<gsl::span<o2::trd::TrackTRD>>("trackITSTPCTRD"), TRACKS);
1068 commonPool[GTrackID::ITSTPCTRD].registerContainer(pc.inputs().get<gsl::span<o2::trd::TrackTriggerRecord>>("trigITSTPCTRD"), TRACKREFS);
1069 if (mc) {
1070 commonPool[GTrackID::ITSTPCTRD].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackITSTPCTRDMCTR"), MCLABELS);
1071 commonPool[GTrackID::ITSTPCTRD].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackITSTPCTRDSAMCTR"), MCLABELSEXTRA);
1072 }
1073}
1074
1075//__________________________________________________________
1077{
1078 commonPool[GTrackID::TPCTRD].registerContainer(pc.inputs().get<gsl::span<o2::trd::TrackTRD>>("trackTPCTRD"), TRACKS);
1079 commonPool[GTrackID::TPCTRD].registerContainer(pc.inputs().get<gsl::span<o2::trd::TrackTriggerRecord>>("trigTPCTRD"), TRACKREFS);
1080 if (mc) {
1081 commonPool[GTrackID::TPCTRD].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackTPCTRDMCTR"), MCLABELS);
1082 commonPool[GTrackID::TPCTRD].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("trackTPCTRDSAMCTR"), MCLABELSEXTRA);
1083 }
1084}
1085
1086//__________________________________________________________
1088{
1089 commonPool[GTrackID::TPCTOF].registerContainer(pc.inputs().get<gsl::span<o2d::TrackTPCTOF>>("trackTPCTOF"), TRACKS);
1090 commonPool[GTrackID::TPCTOF].registerContainer(pc.inputs().get<gsl::span<o2d::MatchInfoTOF>>("matchTPCTOF"), MATCHES);
1091 if (mc) {
1092 commonPool[GTrackID::TPCTOF].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("clsTOF_TPC_MCTR"), MCLABELS);
1093 }
1094}
1095
1096//__________________________________________________________
1098{
1099 commonPool[GTrackID::ITSTPCTOF].registerContainer(pc.inputs().get<gsl::span<o2d::MatchInfoTOF>>("matchITSTPCTOF"), MATCHES); // only ITS/TPC : TOF match info, no real tracks
1100 if (mc) {
1101 commonPool[GTrackID::ITSTPCTOF].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("clsTOF_GLO_MCTR"), MCLABELS);
1102 }
1103}
1104//__________________________________________________________
1106{
1107 commonPool[GTrackID::TPCTRDTOF].registerContainer(pc.inputs().get<gsl::span<o2d::MatchInfoTOF>>("matchTPCTRDTOF"), MATCHES); // only ITS/TPC : TOF match info, no real tracks
1108 if (mc) {
1109 commonPool[GTrackID::TPCTRDTOF].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("clsTOF_GLO2_MCTR"), MCLABELS);
1110 }
1111}
1112//__________________________________________________________
1114{
1115 commonPool[GTrackID::ITSTPCTRDTOF].registerContainer(pc.inputs().get<gsl::span<o2d::MatchInfoTOF>>("matchITSTPCTRDTOF"), MATCHES); // only ITS/TPC : TOF match info, no real tracks
1116 if (mc) {
1117 commonPool[GTrackID::ITSTPCTRDTOF].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("clsTOF_GLO3_MCTR"), MCLABELS);
1118 }
1119}
1120
1121//__________________________________________________________
1123{
1124 commonPool[GTrackID::HMP].registerContainer(pc.inputs().get<gsl::span<o2d::MatchInfoHMP>>("matchHMP"), MATCHES); // HMPID match info, no real tracks
1125 if (mc) {
1126 commonPool[GTrackID::HMP].registerContainer(pc.inputs().get<gsl::span<o2::MCCompLabel>>("clsHMP_GLO_MCTR"), MCLABELS);
1127 }
1128}
1129
1130//__________________________________________________________
1132{
1133 if (pc.services().get<o2::framework::TimingInfo>().globalRunNumberChanged) { // this params need to be queried only once
1134 pc.inputs().get<o2::itsmft::TopologyDictionary*>("cldictITS"); // just to trigger the finaliseCCDB
1135 pc.inputs().get<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>*>("alpparITS"); // note: configurable param does not need finaliseCCDB
1136 }
1137 uint16_t nInp = ITSPerLayer ? MaxITSLayers : 1;
1138 for (uint16_t il = 0; il < nInp; ++il) {
1139 ITSClustersData[ITSMFT_ROF].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::ROFRecord>>("clusITSROF" + std::to_string(il)), il);
1140 ITSClustersData[ITSMFT_CLS].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::CompClusterExt>>("clusITS" + std::to_string(il)), il);
1141 ITSClustersData[ITSMFT_PAT].registerContainer(pc.inputs().get<gsl::span<unsigned char>>("clusITSPatt" + std::to_string(il)), il);
1142 if (mc) {
1144 }
1145 }
1146}
1147
1148#ifdef ENABLE_UPGRADES
1149void RecoContainer::addIT3Clusters(ProcessingContext& pc, bool mc)
1150{
1151 if (pc.services().get<o2::framework::TimingInfo>().globalRunNumberChanged) { // this params need to be queried only once
1152 pc.inputs().get<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>*>("alpparITS"); // note: configurable param does not need finaliseCCDB
1153 pc.inputs().get<o2::its3::TopologyDictionary*>("cldictIT3"); // just to trigger the finaliseCCDB
1154 }
1155 uint16_t nInp = ITSPerLayer ? MaxITSLayers : 1;
1156 for (uint16_t il = 0; il < nInp; ++il) {
1157 ITSClustersData[ITSMFT_ROF].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::ROFRecord>>("clusITSROF" + std::to_string(il)), il);
1158 ITSClustersData[ITSMFT_CLS].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::CompClusterExt>>("clusITS" + std::to_string(il)), il);
1159 ITSClustersData[ITSMFT_PAT].registerContainer(pc.inputs().get<gsl::span<unsigned char>>("clusITSPatt" + std::to_string(il)), il);
1160 if (mc) {
1162 }
1163 }
1164}
1165#endif
1166
1167//__________________________________________________________
1169{
1170 if (pc.services().get<o2::framework::TimingInfo>().globalRunNumberChanged) { // this params need to be queried only once
1171 pc.inputs().get<o2::itsmft::TopologyDictionary*>("cldictMFT"); // just to trigger the finaliseCCDB
1172 pc.inputs().get<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::MFT>*>("alpparMFT"); // note: configurable param does not need finaliseCCDB
1173 }
1174 uint16_t nInp = MFTPerLayer ? MaxMFTLayers : 1;
1175 for (uint16_t il = 0; il < nInp; ++il) {
1176 MFTClustersData[ITSMFT_ROF].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::ROFRecord>>("clusMFTROF" + std::to_string(il)), il);
1177 MFTClustersData[ITSMFT_CLS].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::CompClusterExt>>("clusMFT" + std::to_string(il)), il);
1178 MFTClustersData[ITSMFT_PAT].registerContainer(pc.inputs().get<gsl::span<unsigned char>>("clusMFTPatt" + std::to_string(il)), il);
1179 if (mc) {
1181 }
1182 }
1183}
1184
1185//__________________________________________________________
1187{
1188 occupancyMapTPC = pc.inputs().get<gsl::span<unsigned int>>("clusTPCoccmap");
1189}
1190
1191//__________________________________________________________
1192void RecoContainer::addTPCClusters(ProcessingContext& pc, bool mc, bool shmap, bool occmap)
1193{
1194 inputsTPCclusters = o2::tpc::getWorkflowTPCInput(pc, 0, mc);
1195 if (shmap) {
1196 clusterShMapTPC = pc.inputs().get<gsl::span<unsigned char>>("clusTPCshmap");
1197 }
1198 if (occmap) {
1199 occupancyMapTPC = pc.inputs().get<gsl::span<unsigned int>>("clusTPCoccmap");
1200 }
1201}
1202
1203//__________________________________________________________
1205{
1206 commonPool[GTrackID::TPC].registerContainer(pc.inputs().get<gsl::span<o2::tpc::TriggerInfoDLBZS>>("trigTPC"), MATCHES);
1207}
1208
1209//__________________________________________________________
1211{
1212 inputsTRD = o2::trd::getRecoInputContainer(pc, nullptr, this, mc);
1213}
1214
1215//__________________________________________________________
1217{
1218 commonPool[GTrackID::TOF].registerContainer(pc.inputs().get<gsl::span<o2::tof::Cluster>>("tofcluster"), CLUSTERS);
1219 if (mc) {
1220 mcTOFClusters = pc.inputs().get<const dataformats::MCTruthContainer<MCCompLabel>*>("tofclusterlabel");
1221 }
1222}
1223
1224//__________________________________________________________
1226{
1227 commonPool[GTrackID::HMP].registerContainer(pc.inputs().get<gsl::span<o2::hmpid::Cluster>>("hmpidcluster"), CLUSTERS);
1228 commonPool[GTrackID::HMP].registerContainer(pc.inputs().get<gsl::span<o2::hmpid::Trigger>>("hmpidtriggers"), CLUSREFS);
1229 if (mc) {
1230 mcHMPClusters = pc.inputs().get<const dataformats::MCTruthContainer<MCCompLabel>*>("hmpidclusterlabel");
1231 }
1232}
1233//__________________________________________________________
1235{
1236 commonPool[GTrackID::MCH].registerContainer(pc.inputs().get<gsl::span<o2::mch::ROFRecord>>("clusMCHROF"), CLUSREFS);
1237 commonPool[GTrackID::MCH].registerContainer(pc.inputs().get<gsl::span<o2::mch::Cluster>>("clusMCH"), CLUSTERS);
1238 if (mc) {
1240 }
1241}
1242
1243//__________________________________________________________
1245{
1246 commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::mid::ROFRecord>>("clusMIDROF"), CLUSREFS);
1247 commonPool[GTrackID::MID].registerContainer(pc.inputs().get<gsl::span<o2::mid::Cluster>>("clusMID"), CLUSTERS);
1248 if (mc) {
1250 }
1251}
1252
1253//__________________________________________________________
1255{
1256 commonPool[GTrackID::CTP].registerContainer(pc.inputs().get<gsl::span<o2::ctp::CTPDigit>>("CTPDigits"), CLUSTERS);
1257 if (pc.inputs().get<gsl::span<char>>("CTPLumi").size() == sizeof(o2::ctp::LumiInfo)) {
1258 mCTPLumi = pc.inputs().get<o2::ctp::LumiInfo>("CTPLumi");
1259 }
1260 if (mc) {
1261 // pc.inputs().get<const dataformats::MCTruthContainer<MCCompLabel>*>("CTPDigitsMC");
1262 }
1263}
1264
1265//__________________________________________________________
1267{
1268 commonPool[GTrackID::CPV].registerContainer(pc.inputs().get<gsl::span<o2::cpv::Cluster>>("CPVClusters"), CLUSTERS);
1269 commonPool[GTrackID::CPV].registerContainer(pc.inputs().get<gsl::span<o2::cpv::TriggerRecord>>("CPVTriggers"), CLUSREFS);
1270 if (mc) {
1272 }
1273}
1274
1275//__________________________________________________________
1277{
1278 commonPool[GTrackID::PHS].registerContainer(pc.inputs().get<gsl::span<o2::phos::Cell>>("PHSCells"), CLUSTERS);
1279 commonPool[GTrackID::PHS].registerContainer(pc.inputs().get<gsl::span<o2::phos::TriggerRecord>>("PHSTriggers"), CLUSREFS);
1280 if (mc) {
1282 }
1283}
1284
1285//__________________________________________________________
1287{
1288 commonPool[GTrackID::EMC].registerContainer(pc.inputs().get<gsl::span<o2::emcal::Cell>>("EMCCells"), CLUSTERS);
1289 commonPool[GTrackID::EMC].registerContainer(pc.inputs().get<gsl::span<o2::emcal::TriggerRecord>>("EMCTriggers"), CLUSREFS);
1290 if (mc) {
1292 }
1293}
1294
1295//__________________________________________________________
1297{
1298 commonPool[GTrackID::FT0].registerContainer(pc.inputs().get<gsl::span<o2::ft0::RecPoints>>("ft0recpoints"), TRACKS);
1299 commonPool[GTrackID::FT0].registerContainer(pc.inputs().get<gsl::span<o2::ft0::ChannelDataFloat>>("ft0channels"), CLUSTERS);
1300
1301 if (mc) {
1302 LOG(error) << "FT0 RecPoint does not support MC truth";
1303 }
1304}
1305
1306//__________________________________________________________
1308{
1309 commonPool[GTrackID::FV0].registerContainer(pc.inputs().get<gsl::span<o2::fv0::RecPoints>>("fv0recpoints"), TRACKS);
1310 commonPool[GTrackID::FV0].registerContainer(pc.inputs().get<gsl::span<o2::fv0::ChannelDataFloat>>("fv0channels"), CLUSTERS);
1311
1312 if (mc) {
1313 LOG(error) << "FV0 RecPoint does not support MC truth";
1314 }
1315}
1316
1317//__________________________________________________________
1319{
1320 commonPool[GTrackID::FDD].registerContainer(pc.inputs().get<gsl::span<o2::fdd::RecPoint>>("fddrecpoints"), TRACKS);
1321 commonPool[GTrackID::FDD].registerContainer(pc.inputs().get<gsl::span<o2::fdd::ChannelDataFloat>>("fddchannels"), CLUSTERS);
1322
1323 if (mc) {
1324 LOG(error) << "FDD RecPoint does not support MC truth";
1325 }
1326}
1327
1328//__________________________________________________________
1330{
1331 commonPool[GTrackID::ZDC].registerContainer(pc.inputs().get<gsl::span<o2::zdc::BCRecData>>("zdcbcrec"), MATCHES);
1332 commonPool[GTrackID::ZDC].registerContainer(pc.inputs().get<gsl::span<o2::zdc::ZDCEnergy>>("zdcenergy"), TRACKS);
1333 commonPool[GTrackID::ZDC].registerContainer(pc.inputs().get<gsl::span<o2::zdc::ZDCTDCData>>("zdctdcdata"), CLUSTERS);
1334 commonPool[GTrackID::ZDC].registerContainer(pc.inputs().get<gsl::span<uint16_t>>("zdcinfo"), PATTERNS);
1335
1336 if (mc) {
1337 LOG(error) << "ZDC RecEvent does not support MC truth";
1338 }
1339}
1340
1342{
1343 return inputsTPCclusters->clusterIndex;
1344}
1345
1346gsl::span<const o2::trd::Tracklet64> RecoContainer::getTRDTracklets() const
1347{
1348 return inputsTRD ? inputsTRD->mTracklets : gsl::span<const o2::trd::Tracklet64>();
1349}
1350
1351gsl::span<const o2::trd::CalibratedTracklet> RecoContainer::getTRDCalibratedTracklets() const
1352{
1353 return inputsTRD ? inputsTRD->mSpacePoints : gsl::span<const o2::trd::CalibratedTracklet>();
1354}
1355
1356gsl::span<const o2::trd::TriggerRecord> RecoContainer::getTRDTriggerRecords() const
1357{
1358 static int countWarnings = 0;
1359 if (inputsTRD == nullptr) {
1360 if (countWarnings < 1) {
1361 LOG(warning) << "No TRD triggers";
1362 countWarnings++;
1363 }
1364 return gsl::span<const o2::trd::TriggerRecord>();
1365 } else {
1366 return inputsTRD->mTriggerRecords;
1367 }
1368}
1369
1371{
1372 return inputsTRD ? inputsTRD->mTrackletLabels.get() : nullptr;
1373}
1374
1379
1380//__________________________________________________________
1382{
1383 // get outer param of track
1384 auto trSrc = gidx.getSource();
1385 if (trSrc == GTrackID::ITSTPC) {
1386 return getTrack<o2d::TrackTPCITS>(gidx).getParamOut();
1387 } else if (trSrc == GTrackID::ITSTPCTOF) { // the physical tracks are in ITS-TPC, need to get reference from match info
1388 return getTrack<o2d::TrackTPCITS>(getTOFMatch(gidx).getTrackRef()).getParamOut();
1389 } else if (trSrc == GTrackID::TPCTOF) {
1390 return getTrack<o2d::TrackTPCTOF>(gidx).getParamOut();
1391 } else if (trSrc == GTrackID::ITSTPCTRDTOF) { // the physical tracks are in ITS-TPC-TRD, need to get reference from match info
1392 return getTrack<o2::trd::TrackTRD>(getTOFMatch(gidx).getTrackRef()).getOuterParam();
1393 }
1394 if (trSrc == GTrackID::TPCTRDTOF) { // the physical tracks are in TPC-TRD, need to get reference from match info
1395 return getTrack<o2::trd::TrackTRD>(getTOFMatch(gidx).getTrackRef()).getOuterParam();
1396 } else if (trSrc == GTrackID::ITSTPCTRD) {
1397 return getTrack<o2::trd::TrackTRD>(gidx).getOuterParam();
1398 }
1399 if (trSrc == GTrackID::TPCTRD) {
1400 return getTrack<o2::trd::TrackTRD>(gidx).getOuterParam();
1401 } else if (trSrc == GTrackID::ITS) {
1402 return getTrack<o2::its::TrackITS>(gidx).getParamOut();
1403 } else if (trSrc == GTrackID::TPC) {
1404 return getTrack<o2::tpc::TrackTPC>(gidx).getParamOut();
1405 } else {
1406 throw std::runtime_error(fmt::format("not defined for tracks of source {:d}", int(trSrc)));
1407 }
1408}
1409
1410//__________________________________________________________
1412{
1413 if (src == GTrackID::ITSTPCTOF) {
1414 if (!isMatchSourceLoaded(src)) { // the physical tracks are in ITS-TPC, need to get reference from match info
1415 return false;
1416 }
1418 }
1419 if (src == GTrackID::TPCTRDTOF) {
1420 if (!isMatchSourceLoaded(src)) { // the physical tracks are in ITS-TPC, need to get reference from match info
1421 return false;
1422 }
1424 }
1425 if (src == GTrackID::ITSTPCTRDTOF) {
1426 if (!isMatchSourceLoaded(src)) { // the physical tracks are in ITS-TPC, need to get reference from match info
1427 return false;
1428 }
1430 }
1431 return commonPool[src].isLoaded(TRACKS);
1432}
1433
1434//__________________________________________________________
1436{
1437 // get base track
1438 auto trSrc = gidx.getSource();
1439 if (trSrc == GTrackID::ITSTPCTOF || trSrc == GTrackID::TPCTRDTOF || trSrc == GTrackID::ITSTPCTRDTOF) { // the physical tracks are in ITS-TPC, need to get reference from match info
1440 gidx = getTOFMatch(gidx).getTrackRef();
1441 }
1442 return getObject<o2::track::TrackParCov>(gidx, TRACKS);
1443}
1444
1445//__________________________________________________________
1447{
1448 // get ITS-TPC track pointed by global TOF match
1449 return getTPCITSTrack(getTOFMatch(gidx).getTrackRef());
1450}
1451
1452//________________________________________________________
1453void RecoContainer::fillTrackMCLabels(const gsl::span<GTrackID> gids, std::vector<o2::MCCompLabel>& mcinfo) const
1454{
1455 // fills the MCLabels corresponding to gids to MC info
1456 mcinfo.clear();
1457 mcinfo.reserve(gids.size());
1458 for (auto gid : gids) {
1459 mcinfo.push_back(getTrackMCLabel(gid));
1460 }
1461}
1462
1463//________________________________________________________
1465{
1466 createTracksVariadic([&creator](const auto& _tr, GTrackID _origID, float t0, float terr) {
1467 if constexpr (std::is_base_of_v<o2::track::TrackParCov, std::decay_t<decltype(_tr)>>) {
1468 return creator(_tr, _origID);
1469 } else {
1470 return false;
1471 }
1472 });
1473}
1474
1475//________________________________________________________
1476// get contributors from single detectors
1478{
1479 GlobalIDSet table;
1480 auto src = gidx.getSource();
1481 table[src] = gidx;
1482 if (src == GTrackID::ITSTPCTRD) {
1483 const auto& parent0 = getITSTPCTRDTrack<o2::trd::TrackTRD>(gidx);
1484 const auto& parent1 = getTPCITSTrack(parent0.getRefGlobalTrackId());
1485 table[GTrackID::ITSTPC] = parent0.getRefGlobalTrackId();
1486 table[parent1.getRefITS().getSource()] = parent1.getRefITS();
1487 table[GTrackID::TPC] = parent1.getRefTPC();
1488 table[GTrackID::TRD] = gidx; // there is no standalone TRD track, so use the index for the ITSTPCTRD track array
1489 } else if (src == GTrackID::TPCTRD) {
1490 const auto& parent0 = getTPCTRDTrack<o2::trd::TrackTRD>(gidx);
1491 table[GTrackID::TPC] = parent0.getRefGlobalTrackId();
1492 table[GTrackID::TRD] = gidx; // there is no standalone TRD track, so use the index for the TPCTRD track array
1493 } else if (src == GTrackID::ITSTPCTOF) {
1494 const auto& parent0 = getTOFMatch(gidx); // ITS/TPC : TOF
1495 const auto& parent1 = getTPCITSTrack(parent0.getTrackRef());
1496 table[GTrackID::ITSTPC] = parent0.getTrackRef();
1497 table[GTrackID::TOF] = {unsigned(parent0.getIdxTOFCl()), GTrackID::TOF};
1498 table[GTrackID::TPC] = parent1.getRefTPC();
1499 table[parent1.getRefITS().getSource()] = parent1.getRefITS(); // ITS source might be an ITS track or ITSAB tracklet
1500 } else if (src == GTrackID::ITSTPCTRDTOF) {
1501 const auto& parent0 = getTOFMatch(gidx); // ITS/TPC : TOF
1502 const auto& parent1 = getITSTPCTRDTrack<o2::trd::TrackTRD>(parent0.getTrackRef());
1503 const auto& parent2 = getTPCITSTrack(parent1.getRefGlobalTrackId());
1504 table[GTrackID::ITSTPCTRD] = parent0.getTrackRef();
1505 table[GTrackID::ITSTPC] = parent1.getRefGlobalTrackId();
1506 table[GTrackID::TOF] = {unsigned(parent0.getIdxTOFCl()), GTrackID::TOF};
1507 table[GTrackID::TPC] = parent2.getRefTPC();
1508 table[parent2.getRefITS().getSource()] = parent2.getRefITS(); // ITS source might be an ITS track or ITSAB tracklet
1509 table[GTrackID::TRD] = parent0.getTrackRef(); // there is no standalone TRD track, so use the index for the ITSTPCTRD track array
1510 } else if (src == GTrackID::TPCTRDTOF) {
1511 const auto& parent0 = getTOFMatch(gidx); // TPCTRD : TOF
1512 const auto& parent1 = getTPCTRDTrack<o2::trd::TrackTRD>(parent0.getTrackRef());
1513 table[GTrackID::TPCTRD] = parent0.getTrackRef();
1514 table[GTrackID::TPC] = parent1.getRefGlobalTrackId();
1515 table[GTrackID::TOF] = {unsigned(parent0.getIdxTOFCl()), GTrackID::TOF};
1516 table[GTrackID::TRD] = parent0.getTrackRef(); // there is no standalone TRD track, so use the index for the TPCTRD track array
1517 } else if (src == GTrackID::TPCTOF) {
1518 const auto& parent0 = getTPCTOFMatch(gidx); // TPC : TOF
1519 table[GTrackID::TOF] = {unsigned(parent0.getIdxTOFCl()), GTrackID::TOF};
1520 table[GTrackID::TPC] = parent0.getTrackRef();
1521 } else if (src == GTrackID::ITSTPC) {
1522 const auto& parent0 = getTPCITSTrack(gidx);
1523 table[GTrackID::TPC] = parent0.getRefTPC();
1524 table[parent0.getRefITS().getSource()] = parent0.getRefITS(); // ITS source might be an ITS track or ITSAB tracklet
1525 } else if (src == GTrackID::MFTMCH || src == GTrackID::MFTMCHMID) {
1526 const auto& parent0 = getGlobalFwdTrack(gidx);
1527 table[GTrackID::MFT] = parent0.getMFTTrackID();
1528 table[GTrackID::MCH] = parent0.getMCHTrackID();
1529 if (parent0.getMIDTrackID() != -1) {
1530 table[GTrackID::MID] = parent0.getMIDTrackID();
1531 }
1532 } else if (src == GTrackID::MCHMID) {
1533 const auto& parent0 = getMCHMIDMatch(gidx);
1534 table[GTrackID::MCH] = parent0.getMCHRef();
1535 table[GTrackID::MID] = parent0.getMIDRef();
1536 }
1537 return table;
1538}
1539
1540//________________________________________________________
1541// get contributing TPC GTrackID to the source. If source gidx is not contributed by TPC,
1542// returned GTrackID.isSourceSet()==false
1544{
1545 auto src = gidx.getSource();
1546 if (src == GTrackID::ITSTPCTRD) {
1547 const auto& parent0 = getITSTPCTRDTrack<o2::trd::TrackTRD>(gidx);
1548 const auto& parent1 = getTPCITSTrack(parent0.getRefGlobalTrackId());
1549 return parent1.getRefTPC();
1550 } else if (src == GTrackID::ITSTPCTOF) {
1551 const auto& parent0 = getTOFMatch(gidx); // ITS/TPC : TOF
1552 const auto& parent1 = getTPCITSTrack(parent0.getTrackRef());
1553 return parent1.getRefTPC();
1554 } else if (src == GTrackID::ITSTPCTRDTOF) {
1555 const auto& parent0 = getTOFMatch(gidx); // ITS/TPC/TRD : TOF
1556 const auto& parent1 = getITSTPCTRDTrack<o2::trd::TrackTRD>(parent0.getTrackRef());
1557 const auto& parent2 = getTPCITSTrack(parent1.getRefGlobalTrackId());
1558 return parent2.getRefTPC();
1559 } else if (src == GTrackID::TPCTOF) {
1560 const auto& parent0 = getTPCTOFMatch(gidx); // TPC : TOF
1561 return parent0.getTrackRef();
1562 } else if (src == GTrackID::TPCTRDTOF) {
1563 const auto& parent0 = getTOFMatch(gidx); // TPC/TRD : TOF
1564 const auto& parent1 = getTPCTRDTrack<o2::trd::TrackTRD>(parent0.getTrackRef());
1565 return parent1.getRefGlobalTrackId();
1566 } else if (src == GTrackID::TPCTRD) {
1567 const auto& parent0 = getTPCTRDTrack<o2::trd::TrackTRD>(gidx);
1568 return parent0.getRefGlobalTrackId();
1569 } else if (src == GTrackID::ITSTPC) {
1570 const auto& parent0 = getTPCITSTrack(gidx);
1571 return parent0.getRefTPC();
1572 }
1573 return src == GTrackID::TPC ? gidx : GTrackID{};
1574}
1575
1576//________________________________________________________
1577// get contributing ITS GTrackID to the source. If source gidx is not contributed by TPC,
1578// returned GTrackID.isSourceSet()==false
1580{
1581 auto src = gidx.getSource();
1582 if (src == GTrackID::ITSTPCTRD) {
1583 const auto& parent0 = getITSTPCTRDTrack<o2::trd::TrackTRD>(gidx);
1584 const auto& parent1 = getTPCITSTrack(parent0.getRefGlobalTrackId());
1585 return parent1.getRefITS();
1586 } else if (src == GTrackID::ITSTPCTOF) {
1587 const auto& parent0 = getTOFMatch(gidx); // ITS/TPC : TOF
1588 const auto& parent1 = getTPCITSTrack(parent0.getTrackRef());
1589 return parent1.getRefITS();
1590 } else if (src == GTrackID::ITSTPCTRDTOF) {
1591 const auto& parent0 = getTOFMatch(gidx); // ITS/TPC : TOF
1592 const auto& parent1 = getITSTPCTRDTrack<o2::trd::TrackTRD>(parent0.getTrackRef());
1593 const auto& parent2 = getTPCITSTrack(parent1.getRefGlobalTrackId());
1594 return parent2.getRefITS();
1595 } else if (src == GTrackID::ITSTPC) {
1596 const auto& parent0 = getTPCITSTrack(gidx);
1597 return parent0.getRefITS();
1598 }
1599 return src == GTrackID::ITS ? gidx : GTrackID{};
1600}
1601
1602//________________________________________________________
1607
1608//________________________________________________________
1613
1614//________________________________________________________
1615void RecoContainer::getTrackTimeITSTPCTRDTOF(GTrackID gid, float& t, float& tErr) const
1616{
1617 const auto& match = getITSTPCTRDTOFMatches()[gid];
1618 t = (match.getSignal() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
1619 tErr = 0.010f;
1620}
1621
1622//________________________________________________________
1623void RecoContainer::getTrackTimeTPCTRDTOF(GTrackID gid, float& t, float& tErr) const
1624{
1625 const auto& match = getTPCTRDTOFMatches()[gid];
1626 t = (match.getSignal() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
1627 tErr = 0.010f;
1628}
1629
1630//________________________________________________________
1631void RecoContainer::getTrackTimeITSTPCTOF(GTrackID gid, float& t, float& tErr) const
1632{
1633 const auto& match = getITSTPCTOFMatches()[gid];
1634 t = (match.getSignal() - match.getLTIntegralOut().getTOF(o2::track::PID::Pion)) * PS2MUS; // tof time in \mus, FIXME: account for time of flight to R TOF
1635 tErr = 0.010f;
1636}
1637
1638//________________________________________________________
1639void RecoContainer::getTrackTimeITSTPCTRD(GTrackID gid, float& t, float& tErr) const
1640{
1641 const auto trigITSTPCTRD = getITSTPCTRDTriggers();
1642 // very slow: find the trigger this track belongs to
1643 for (const auto& trig : trigITSTPCTRD) {
1644 if (trig.getTrackRefs().getEntriesBound() > gid.getIndex()) {
1645 t = trig.getBCData().differenceInBC(startIR) * o2::constants::lhc::LHCBunchSpacingMUS;
1646 tErr = 5.e-3;
1647 const auto& trc = getITSTPCTRDTracks<o2::trd::TrackTRD>()[gid];
1648 if (trc.hasPileUpInfo()) { // distance to farthest collision within the pileup integration time
1649 tErr += trc.getPileUpTimeErrorMUS();
1650 }
1651 return;
1652 }
1653 }
1654}
1655
1656//________________________________________________________
1657void RecoContainer::getTrackTimeTPCTRD(GTrackID gid, float& t, float& tErr) const
1658{
1659 const auto trigTPCTRD = getTPCTRDTriggers();
1660 // very slow: find the trigger this track belongs to
1661 for (const auto& trig : trigTPCTRD) {
1662 if (trig.getTrackRefs().getEntriesBound() > gid.getIndex()) {
1663 t = trig.getBCData().differenceInBC(startIR) * o2::constants::lhc::LHCBunchSpacingMUS;
1664 tErr = 5.e-3;
1665 const auto& trc = getTPCTRDTracks<o2::trd::TrackTRD>()[gid];
1666 if (trc.hasPileUpInfo()) { // distance to farthest collision within the pileup integration time
1667 tErr += trc.getPileUpTimeErrorMUS();
1668 }
1669 return;
1670 }
1671 }
1672}
1673
1674//________________________________________________________
1675void RecoContainer::getTrackTimeITSTPC(GTrackID gid, float& t, float& tErr) const
1676{
1677 const auto& trc = getTPCITSTrack(gid);
1678 t = trc.getTimeMUS().getTimeStamp();
1679 tErr = trc.getTimeMUS().getTimeStampError();
1680}
1681
1682//________________________________________________________
1683void RecoContainer::getTrackTimeTPCTOF(GTrackID gid, float& t, float& tErr) const
1684{
1685 const auto& trc = getTPCTOFTrack(gid);
1686 t = trc.getTimeMUS().getTimeStamp();
1687 tErr = trc.getTimeMUS().getTimeStampError();
1688}
1689
1690//________________________________________________________
1691void RecoContainer::getTrackTimeITS(GTrackID gid, float& t, float& tErr) const
1692{
1693 const auto& rofrs = getITSTracksROFRecords();
1694 for (const auto& rof : rofrs) { // slow
1695 if (gid.getIndex() < rof.getFirstEntry() + rof.getNEntries()) {
1696 t = rof.getBCData().differenceInBC(startIR) * o2::constants::lhc::LHCBunchSpacingMUS;
1697 tErr = 0.5;
1698 return;
1699 }
1700 }
1701}
1702
1703//________________________________________________________
1704void RecoContainer::getTrackTimeTPC(GTrackID gid, float& t, float& tErr) const
1705{
1706 const auto& trc = getTPCTrack(gid);
1707 t = trc.getTime0() + 0.5 * (trc.getDeltaTFwd() - trc.getDeltaTBwd());
1708 tErr = 0.5 * (trc.getDeltaTFwd() + trc.getDeltaTBwd());
1709}
1710
1711//________________________________________________________
1712void RecoContainer::getTrackTime(GTrackID gid, float& t, float& tErr) const
1713{
1714 auto src = gid.getSource();
1715 if (src == GTrackID::ITSTPCTRDTOF) {
1716 return getTrackTimeITSTPCTRDTOF(gid, t, tErr);
1717 }
1718 if (src == GTrackID::TPCTRDTOF) {
1719 return getTrackTimeTPCTRDTOF(gid, t, tErr);
1720 }
1721 if (src == GTrackID::ITSTPCTOF) {
1722 return getTrackTimeITSTPCTOF(gid, t, tErr);
1723 }
1724 if (src == GTrackID::ITSTPCTRD) {
1725 return getTrackTimeITSTPCTRD(gid, t, tErr);
1726 }
1727 if (src == GTrackID::TPCTRD) {
1728 return getTrackTimeTPCTRD(gid, t, tErr);
1729 }
1730 if (src == GTrackID::ITSTPC) {
1731 return getTrackTimeITSTPC(gid, t, tErr);
1732 }
1733 if (src == GTrackID::TPCTOF) {
1734 return getTrackTimeTPCTOF(gid, t, tErr);
1735 }
1736 if (src == GTrackID::ITS) {
1737 return getTrackTimeITS(gid, t, tErr);
1738 }
1739 if (src == GTrackID::TPC) {
1740 return getTrackTimeTPC(gid, t, tErr);
1741 }
1742}
Definition of the ClusterTopology class.
Definition of the BuildTopologyDictionary class for ITS3.
unsigned short int uint16_t
char error[CURL_ERROR_SIZE]
Class to delimit start and end IR of certain time period.
Wrapper container for different reconstructed object types.
Matched cosmic track with the raw clusters of its legs and of the road around them,...
Result of top-bottom cosmic tracks leg matching.
Definition of the MUON track.
Reference on ITS/MFT clusters set.
Extention of GlobalTrackID by flags relevant for verter-track association.
Referenc on track indices contributing to the vertex, with possibility chose tracks from specific sou...
void registerContainer(const C &cont, int src)
register container in the accessor
A container to hold and manage MC truth information/labels.
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:60
decltype(auto) get(R binding, int part=0) const
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
bool match(const std::vector< std::string > &queries, const char *pattern)
Definition dcs-ccdb.cxx:229
GLenum src
Definition glcorearb.h:1767
const GLdouble * v
Definition glcorearb.h:832
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
Definition glcorearb.h:5034
constexpr o2::header::DataOrigin gDataOriginTRD
Definition DataHeader.h:580
Definition of a container to keep/associate and arbitrary number of labels associated to an index wit...
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
constexpr int MaxMFTLayers
constexpr int MaxITSLayers
TrackParCovF TrackParCov
Definition Track.h:33
auto getRecoInputContainer(o2::framework::ProcessingContext &pc, o2::gpu::GPUTrackingInOutPointers *ptrs, const o2::globaltracking::RecoContainer *inputTracks, bool mc=false)
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52
per-TF quantities: the TPC transformation used in the reconstruction and the TPC occupancy
matched cosmic with everything needed for an offline refit
void addInput(const o2::framework::InputSpec &&isp)
void requestTOFMatches(o2::dataformats::GlobalTrackID::mask_t src, bool mc)
std::unordered_map< std::string, bool > requestMap
void requestTracks(o2::dataformats::GlobalTrackID::mask_t src, bool mc)
void requestClusters(o2::dataformats::GlobalTrackID::mask_t src, bool useMC, o2::detectors::DetID::mask_t skipDetClusters={})
std::vector< o2::framework::InputSpec > inputs
uint32_t getMatchingInputSubSpec() const
void addFDDRecPoints(o2::framework::ProcessingContext &pc, bool mc)
std::shared_ptr< const void > cosmExtHolder[2]
void addGlobalFwdTracks(o2::framework::ProcessingContext &pc, bool mc)
void addTOFMatchesITSTPCTRD(o2::framework::ProcessingContext &pc, bool mc)
GTrackID getITSContributorGID(GTrackID source) const
const o2::dataformats::MatchInfoTOF & getTPCTOFMatch(GTrackID id) const
void addITSTracks(o2::framework::ProcessingContext &pc, bool mc)
void addHMPMatches(o2::framework::ProcessingContext &pc, bool mc)
void addTPCTOFTracks(o2::framework::ProcessingContext &pc, bool mc)
GlobalIDSet getSingleDetectorRefs(GTrackID gidx) const
std::unique_ptr< const o2::dataformats::MCTruthContainer< o2::MCCompLabel > > mcTOFClusters
const o2::dataformats::MCTruthContainer< o2::phos::MCLabel > * getPHOSCellsMCLabels() const
const o2::tpc::TrackTPC & getTPCTrack(GTrackID id) const
std::array< AccSlots, GTrackID::NSources > commonPool
void addFT0RecPoints(o2::framework::ProcessingContext &pc, bool mc)
gsl::span< const o2::trd::CalibratedTracklet > getTRDCalibratedTracklets() const
const o2::dataformats::TrackMCHMID & getMCHMIDMatch(GTrackID gid) const
void addTPCTriggers(o2::framework::ProcessingContext &pc)
void addCosmicTracks(o2::framework::ProcessingContext &pc, bool mc)
void addStrangeTracks(o2::framework::ProcessingContext &pc, bool mc)
std::unique_ptr< const o2::dataformats::MCTruthContainer< o2::mid::MCClusterLabel > > mcMIDTrackClusters
bool isMatchSourceLoaded(int src) const
void addMCHClusters(o2::framework::ProcessingContext &pc, bool mc)
void addPVerticesTMP(o2::framework::ProcessingContext &pc, bool mc)
void addITSTPCTracks(o2::framework::ProcessingContext &pc, bool mc)
const o2::tpc::ClusterNativeAccess & getTPCClusters() const
void addMCHTracks(o2::framework::ProcessingContext &pc, bool mc)
std::array< std::unique_ptr< const o2::dataformats::MCTruthContainer< o2::MCCompLabel > >, MaxMFTLayers > mcMFTClusters
void getTrackTimeTPCTRD(GTrackID gid, float &t, float &tErr) const
void addTPCClusters(o2::framework::ProcessingContext &pc, bool mc, bool shmap, bool occmap)
void addEMCALCells(o2::framework::ProcessingContext &pc, bool mc)
void addMIDTracks(o2::framework::ProcessingContext &pc, bool mc)
void addMFTTracks(o2::framework::ProcessingContext &pc, bool mc)
void getTrackTimeITSTPCTRDTOF(GTrackID gid, float &t, float &tErr) const
void getTrackTimeITSTPCTOF(GTrackID gid, float &t, float &tErr) const
void getTrackTimeTPC(GTrackID gid, float &t, float &tErr) const
void addZDCRecEvents(o2::framework::ProcessingContext &pc, bool mc)
void addMCHMIDMatches(o2::framework::ProcessingContext &pc, bool mc)
gsl::span< const o2::trd::TriggerRecord > getTRDTriggerRecords() const
const o2::dataformats::MCTruthContainer< o2::MCCompLabel > * getTRDTrackletsMCLabels() const
void addPVertices(o2::framework::ProcessingContext &pc, bool mc)
void getTrackTimeTPCTRDTOF(GTrackID gid, float &t, float &tErr) const
void addTPCOccMap(o2::framework::ProcessingContext &pc)
void getTrackTimeITS(GTrackID gid, float &t, float &tErr) const
void addTOFMatchesITSTPC(o2::framework::ProcessingContext &pc, bool mc)
void addIRFramesITS(o2::framework::ProcessingContext &pc)
const o2::dataformats::TrackTPCITS & getITSTPCTOFTrack(GTrackID id) const
const o2::dataformats::TrackTPCTOF & getTPCTOFTrack(GTrackID gid) const
void addTOFClusters(o2::framework::ProcessingContext &pc, bool mc)
o2::MCCompLabel getTrackMCLabel(GTrackID id) const
GTrackID getTPCContributorGID(GTrackID source) const
std::array< std::unique_ptr< const o2::dataformats::MCTruthContainer< o2::MCCompLabel > >, MaxITSLayers > mcITSClusters
std::unique_ptr< o2::trd::RecoInputContainer > inputsTRD
const o2::dataformats::MCTruthContainer< o2::mid::MCClusterLabel > * getMIDClustersMCLabels() const
const o2::track::TrackParCov & getTrackParam(GTrackID gidx) const
void getTrackTimeITSTPCTRD(GTrackID gid, float &t, float &tErr) const
void addCosmicExtTracks(o2::framework::ProcessingContext &pc, bool mc)
void addMFTClusters(o2::framework::ProcessingContext &pc, bool mc)
void addMIDClusters(o2::framework::ProcessingContext &pc, bool mc)
void addTPCTRDTracks(o2::framework::ProcessingContext &pc, bool mc)
const o2::dataformats::ConstMCTruthContainerView< o2::MCCompLabel > * getTPCClustersMCLabels() const
std::unique_ptr< const o2::dataformats::MCTruthContainer< o2::MCCompLabel > > mcMCHClusters
gsl::span< const unsigned char > clusterShMapTPC
externally set TPC clusters sharing map
void addTRDTracklets(o2::framework::ProcessingContext &pc, bool mc)
void getTrackTimeITSTPC(GTrackID gid, float &t, float &tErr) const
const o2::dataformats::TrackTPCITS & getTPCITSTrack(GTrackID gid) const
void collectData(o2::framework::ProcessingContext &pc, const DataRequest &request)
void addPHOSCells(o2::framework::ProcessingContext &pc, bool mc)
std::unique_ptr< const o2::dataformats::MCTruthContainer< o2::phos::MCLabel > > mcPHSCells
void addCPVClusters(o2::framework::ProcessingContext &pc, bool mc)
void addITSTPCTRDTracks(o2::framework::ProcessingContext &pc, bool mc)
const o2::track::TrackParCov & getTrackParamOut(GTrackID gidx) const
void fillTrackMCLabels(const gsl::span< GTrackID > gids, std::vector< o2::MCCompLabel > &mcinfo) const
void addMFTMCHMatches(o2::framework::ProcessingContext &pc, bool mc)
void getTrackTimeTPCTOF(GTrackID gid, float &t, float &tErr) const
void addTOFMatchesTPCTRD(o2::framework::ProcessingContext &pc, bool mc)
std::unique_ptr< const o2::dataformats::MCTruthContainer< o2::mid::MCClusterLabel > > mcMIDClusters
std::unique_ptr< const o2::dataformats::MCTruthContainer< o2::emcal::MCLabel > > mcEMCCells
std::unique_ptr< o2::tpc::internal::getWorkflowTPCInput_ret > inputsTPCclusters
void addCTPDigits(o2::framework::ProcessingContext &pc, bool mc)
void addTPCTracks(o2::framework::ProcessingContext &pc, bool mc)
std::unique_ptr< const o2::dataformats::MCTruthContainer< o2::MCCompLabel > > mcCPVClusters
void addFV0RecPoints(o2::framework::ProcessingContext &pc, bool mc)
void createTracks(std::function< bool(const o2::track::TrackParCov &, GTrackID)> const &creator) const
void getTrackTime(GTrackID gid, float &t, float &tErr) const
std::array< ITSClusAccessor, NITSMFTCLUSSLOTS > ITSClustersData
void addSVertices(o2::framework::ProcessingContext &pc, bool)
void addITSClusters(o2::framework::ProcessingContext &pc, bool mc)
void addHMPClusters(o2::framework::ProcessingContext &pc, bool mc)
gsl::span< const unsigned int > occupancyMapTPC
externally set TPC clusters occupancy map
std::array< MFTClusAccessor, NITSMFTCLUSSLOTS > MFTClustersData
std::unique_ptr< const o2::dataformats::MCTruthContainer< o2::MCCompLabel > > mcHMPClusters
std::array< GTrackID, GTrackID::NSources > GlobalIDSet
static constexpr float PS2MUS
gsl::span< const o2::trd::Tracklet64 > getTRDTracklets() const
const o2::dataformats::MCTruthContainer< o2::emcal::MCLabel > * getEMCALCellsMCLabels() const
const o2::dataformats::MatchInfoTOF & getTOFMatch(GTrackID id) const
const o2::dataformats::MCTruthContainer< o2::mid::MCClusterLabel > * getMIDTracksClusterMCLabels() const
const o2::dataformats::GlobalFwdTrack & getGlobalFwdTrack(GTrackID gid) const
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"