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