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