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