Project
Loading...
Searching...
No Matches
TrackingInterface.cxx
Go to the documentation of this file.
1// Copyright 2019-2026 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
12#include <algorithm>
13#include <array>
14#include <format>
15#include <memory>
16
17#include <oneapi/tbb/task_arena.h>
18
21
24
28
38
39using namespace o2::framework;
40using namespace o2::its;
41
43{
44 // get parameters
45 const auto& trackConf = o2::its::TrackerParamConfig::Instance();
46 const auto& vertConf = o2::its::VertexerParamConfig::Instance();
47 if (auto parmode = (TrackingMode::Type)trackConf.trackingMode; mMode == TrackingMode::Unset || (parmode != TrackingMode::Unset && mMode != parmode)) {
48 LOGP(info, "Tracking mode overwritten by configurable params from {} to {}", TrackingMode::toString(mMode), TrackingMode::toString(parmode));
49 mMode = parmode;
50 }
51 auto trackParams = TrackingMode::getTrackingParameters(mMode);
52 auto vertParams = TrackingMode::getVertexingParameters(mMode);
53 overrideParameters(trackParams, vertParams);
54 LOGP(info, "Initializing tracker in {} phase reconstruction with {} passes for tracking and {}/{} for vertexing", TrackingMode::toString(mMode), trackParams.size(), o2::its::VertexerParamConfig::Instance().nIterations, vertParams.size());
55 mTracker->setParameters(trackParams);
56 mVertexer->setParameters(vertParams);
57 TrackingParameters vertexTrackingParams;
58 mTimeFrame->initVertexingTopology(vertexTrackingParams);
59 if (!trackParams.empty()) {
61 mTimeFrame->initTrackerTopologies(gsl::span<const TrackingParameters>(trackParams.data(), trackParams.size()));
62 }
63
64 if (mMode == TrackingMode::Cosmics) {
65 mRunVertexer = false;
66 mCosmicsProcessing = true;
67 LOGP(info, "Cosmic mode enabled, will skip vertexing");
68 }
69
70 // threading
71 if (trackConf.nThreads == vertConf.nThreads) {
72 bool clamped{false};
73 int nThreads = trackConf.nThreads;
74 if (nThreads > 0) {
75 const int hw = std::thread::hardware_concurrency();
76 const int maxThreads = (hw == 0 ? 1 : hw);
77 nThreads = std::clamp(nThreads, 1, maxThreads);
78 clamped = trackConf.nThreads > maxThreads;
79 }
80 LOGP(info, "Tracker and Vertexer will share the task arena with {} thread(s){}", nThreads, (clamped) ? " (clamped)" : "");
81 mTaskArena = std::make_shared<tbb::task_arena>(std::abs(nThreads));
82 }
83 mVertexer->setNThreads(vertConf.nThreads, mTaskArena);
84 mTracker->setNThreads(trackConf.nThreads, mTaskArena);
85 mTimeFrame->setIsStaggered(mDoStaggering);
86
87 // prepare data filter
88 for (int iLayer = 0; iLayer < ((mDoStaggering) ? NLayers : 1); ++iLayer) {
89 mFilter.emplace_back("compClusters", "ITS", "COMPCLUSTERS", iLayer, Lifetime::Timeframe);
90 mFilter.emplace_back("patterns", "ITS", "PATTERNS", iLayer, Lifetime::Timeframe);
91 mFilter.emplace_back("ROframe", "ITS", "CLUSTERSROF", iLayer, Lifetime::Timeframe);
92 if (mIsMC) {
93 mFilter.emplace_back("itsmclabels", "ITS", "CLUSTERSMCTR", iLayer, Lifetime::Timeframe);
94 }
95 }
96}
97
99{
101
102 // filter input and compose
103 std::array<gsl::span<const itsmft::CompClusterExt>, NLayers> compClusters;
104 std::array<gsl::span<const unsigned char>, NLayers> patterns;
105 std::array<gsl::span<const itsmft::ROFRecord>, NLayers> rofsinput;
106 std::array<const dataformats::MCTruthContainer<MCCompLabel>*, NLayers> labels{};
107 for (const DataRef& ref : framework::InputRecordWalker{pc.inputs(), mFilter}) {
108 auto const* dh = DataRefUtils::getHeader<o2::header::DataHeader*>(ref);
109 if (framework::DataRefUtils::match(ref, {"compClusters", framework::ConcreteDataTypeMatcher{"ITS", "COMPCLUSTERS"}})) {
110 compClusters[dh->subSpecification] = pc.inputs().get<gsl::span<o2::itsmft::CompClusterExt>>(ref);
111 }
112 if (framework::DataRefUtils::match(ref, {"patterns", framework::ConcreteDataTypeMatcher{"ITS", "PATTERNS"}})) {
113 patterns[dh->subSpecification] = pc.inputs().get<gsl::span<unsigned char>>(ref);
114 }
115 if (framework::DataRefUtils::match(ref, {"ROframes", framework::ConcreteDataTypeMatcher{"ITS", "CLUSTERSROF"}})) {
116 rofsinput[dh->subSpecification] = pc.inputs().get<gsl::span<o2::itsmft::ROFRecord>>(ref);
117 }
118 if (framework::DataRefUtils::match(ref, {"itsmclabels", framework::ConcreteDataTypeMatcher{"ITS", "CLUSTERSMCTR"}})) {
119 labels[dh->subSpecification] = pc.inputs().get<const dataformats::MCTruthContainer<MCCompLabel>*>(ref).release();
120 }
121 }
122
123 bool hasClusters = false;
124 for (int iLayer = 0; iLayer < ((mDoStaggering) ? NLayers : 1); ++iLayer) {
125 LOGP(info, "ITSTracker{} pulled {} clusters, {} RO frames", ((mDoStaggering) ? std::format(" on layer {}", iLayer) : ""), compClusters[iLayer].size(), rofsinput[iLayer].size());
126 if (compClusters[iLayer].empty()) {
127 LOGP(warn, " -> received no processable data{}", (mDoStaggering) ? std::format(" on layer {}", iLayer) : "");
128 } else {
129 hasClusters = true;
130 }
131 if (mIsMC) {
132 LOG(info) << " -> " << labels[iLayer]->getIndexedSize() << " MC label objects";
133 }
134 }
135
136 const auto& tfInfo = pc.services().get<o2::framework::TimingInfo>();
137 gsl::span<const o2::itsmft::PhysTrigger> physTriggers;
138 std::vector<o2::itsmft::PhysTrigger> fromTRD;
139 if (mUseTriggers == 2) { // use TRD triggers
140 o2::InteractionRecord irFirstTF{0, tfInfo.firstTForbit};
141 auto trdTriggers = pc.inputs().get<gsl::span<o2::trd::TriggerRecord>>("phystrig");
142 for (const auto& trig : trdTriggers) {
143 if (trig.getBCData() >= irFirstTF && trig.getNumberOfTracklets()) {
144 irFirstTF = trig.getBCData();
145 fromTRD.emplace_back(o2::itsmft::PhysTrigger{.ir = irFirstTF, .data = 0});
146 }
147 }
148 physTriggers = gsl::span<const o2::itsmft::PhysTrigger>(fromTRD.data(), fromTRD.size());
149 } else if (mUseTriggers == 1) { // use Phys triggers from ITS stream
150 physTriggers = pc.inputs().get<gsl::span<o2::itsmft::PhysTrigger>>("phystrig");
151 }
152
153 const int clockLayerId{mDoStaggering ? mTimeFrame->getROFOverlapTableView().getClock() : 0};
154 auto& irFrames = pc.outputs().make<std::vector<o2::dataformats::IRFrame>>(Output{"ITS", "IRFRAMES", 0});
155 irFrames.reserve(rofsinput[clockLayerId].size());
156
157 auto& allClusIdx = pc.outputs().make<std::vector<int>>(Output{"ITS", "TRACKCLSID", 0});
158 auto& allTracks = pc.outputs().make<std::vector<o2::its::TrackITS>>(Output{"ITS", "TRACKS", 0});
159 auto& allTrackROFs = pc.outputs().make<std::vector<o2::itsmft::ROFRecord>>(Output{"ITS", "ITSTrackROF", 0});
160 auto& vertices = pc.outputs().make<std::vector<Vertex>>(Output{"ITS", "VERTICES", 0});
161 auto& vertROFvec = pc.outputs().make<std::vector<o2::itsmft::ROFRecord>>(Output{"ITS", "VERTICESROF", 0}); // TODO fill this!
162
163 // MC
164 static pmr::vector<o2::MCCompLabel> dummyMCLabTracks, dummyMCLabVerts;
165 static pmr::vector<float> dummyMCPurVerts;
166 auto& allTrackLabels = mIsMC ? pc.outputs().make<std::vector<o2::MCCompLabel>>(Output{"ITS", "TRACKSMCTR", 0}) : dummyMCLabTracks;
167 auto& allVerticesLabels = mIsMC ? pc.outputs().make<std::vector<o2::MCCompLabel>>(Output{"ITS", "VERTICESMCTR", 0}) : dummyMCLabVerts;
168 auto& allVerticesPurities = mIsMC ? pc.outputs().make<std::vector<float>>(Output{"ITS", "VERTICESMCPUR", 0}) : dummyMCPurVerts;
169
170 const auto clock = mTimeFrame->getROFOverlapTableView().getClock();
171 const auto& clockLayer = mTimeFrame->getROFOverlapTableView().getClockLayer();
172 auto setBCData = [&](auto& rofs) {
173 for (size_t iROF{0}; iROF < rofs.size(); ++iROF) { // set BC data
174 auto& rof = rofs[iROF];
175 int orb = (iROF * par.getROFLengthInBC(clock) / o2::constants::lhc::LHCMaxBunches) + tfInfo.firstTForbit;
176 int bc = (iROF * par.getROFLengthInBC(clock) % o2::constants::lhc::LHCMaxBunches) + par.getROFDelayInBC(clock);
178 rof.setBCData(ir);
179 rof.setROFrame(iROF);
180 rof.setNEntries(0);
181 rof.setFirstEntry(-1);
182 }
183 };
184
185 if (!hasClusters) {
186 // skip processing if no data is received entirely but still create empty output so consumers do not wait
187 allTrackROFs.resize(clockLayer.mNROFsTF);
188 vertROFvec.resize(clockLayer.mNROFsTF);
189 setBCData(allTrackROFs);
190 setBCData(vertROFvec);
191 return;
192 }
193
194 if (mOverrideBeamEstimation) {
195 mTimeFrame->setBeamPosition(mMeanVertex->getX(),
196 mMeanVertex->getY(),
197 mMeanVertex->getSigmaY2(),
198 mTracker->getParameters()[0].LayerResolution[0],
199 mTracker->getParameters()[0].SystErrorY2[0]);
200 }
201
202 mTracker->setBz(o2::base::Propagator::Instance()->getNominalBz());
203 mTracker->setTimeSlice(tfInfo.timeslice);
204
205 for (int iLayer = 0; iLayer < ((mDoStaggering) ? NLayers : 1); ++iLayer) {
206 gsl::span<const unsigned char>::iterator pattIt = patterns[iLayer].begin();
207 loadROF(rofsinput[iLayer], compClusters[iLayer], pattIt, ((mDoStaggering) ? iLayer : -1), labels[iLayer]);
208 }
209
210 auto logger = [&](const std::string& s) { LOG(info) << s; };
211 auto fatalLogger = [&](const std::string& s) { LOG(fatal) << s; };
212 auto errorLogger = [&](const std::string& s) { LOG(error) << s; };
213
214 FastMultEst multEst; // mult estimator
216 multEst.selectROFs(rofsinput, compClusters, physTriggers, tfInfo.firstTForbit, mDoStaggering, mTimeFrame->getROFOverlapTableView(), processMultiplictyMask);
217 mTimeFrame->setMultiplicityCutMask(processMultiplictyMask);
218 for (int iLayer = 0; iLayer < ((mDoStaggering) ? NLayers : 1); ++iLayer) {
219 mTimeFrame->getROFMaskView().print(iLayer);
220 }
221
222 float vertexerElapsedTime{0.f}, trackerElapsedTime{0.f};
223 if (mRunVertexer) {
224 // Run seeding vertexer
225 vertexerElapsedTime = mVertexer->clustersToVertices(logger);
226 const auto& vtx = mTimeFrame->getPrimaryVertices();
227 vertices.insert(vertices.begin(), vtx.begin(), vtx.end());
228 if (mIsMC) {
229 allVerticesLabels.reserve(vertices.size());
230 allVerticesPurities.reserve(vertices.size());
231 for (const auto& lbl : mTimeFrame->getPrimaryVerticesLabels()) {
232 allVerticesLabels.push_back(lbl.first);
233 allVerticesPurities.push_back(lbl.second);
234 }
235 }
236 }
237 multEst.selectROFsWithVertices(vertices, mTimeFrame->getROFOverlapTableView(), processMultiplictyMask);
238
239 auto clockROFspan = rofsinput[clockLayerId];
240 auto clockTiming = mTimeFrame->getROFOverlapTableView().getClockLayer();
241 for (auto iRof{0}; iRof < clockROFspan.size(); ++iRof) {
242 auto& vtxROF = vertROFvec.emplace_back(clockROFspan[iRof]);
243 if (mRunVertexer) {
244 auto vtxSpan = mTimeFrame->getPrimaryVertices(clockLayerId, iRof);
246 if (!vtxSpan.empty()) {
247 bool hasUPC = std::any_of(vtxSpan.begin(), vtxSpan.end(), [](const auto& v) { return v.isFlagSet(Vertex::UPCMode); });
248 if (hasUPC) { // at least one vertex in this ROF and it is from second vertex iteration
249 LOGP(debug, "ROF {} rejected as vertices are from the UPC iteration", iRof);
250 processUPCMask.selectROF({clockTiming.getROFStartInBC(iRof), clockTiming.getROFEndInBC(iRof)});
251 vtxROF.setFlag(o2::itsmft::ROFRecord::VtxUPCMode);
252 } else { // in all cases except if as standard mode vertex was found, the ROF was processed with UPC settings
253 vtxROF.setFlag(o2::itsmft::ROFRecord::VtxStdMode);
254 }
255 } else {
256 vtxROF.setFlag(o2::itsmft::ROFRecord::VtxUPCMode);
257 }
258 } else {
259 vtxROF.setFlag(o2::itsmft::ROFRecord::VtxStdMode);
260 }
261 }
262 }
263
264 if (mRunVertexer && hasClusters) {
265 LOGP(info, " + Vertex seeding total elapsed time: {} ms for {} vertices found", vertexerElapsedTime, mTimeFrame->getPrimaryVerticesNum());
266 }
267
268 if (mOverrideBeamEstimation) {
269 LOG(info) << fmt::format(" + Beam position set to: {}, {} from meanvertex object", mTimeFrame->getBeamX(), mTimeFrame->getBeamY());
270 } else {
271 LOG(info) << fmt::format(" + Beam position computed for the TF: {}, {}", mTimeFrame->getBeamX(), mTimeFrame->getBeamY());
272 }
273
274 if (hasClusters) {
275 mTimeFrame->setMultiplicityCutMask(processMultiplictyMask);
276 mTimeFrame->setUPCCutMask(processUPCMask);
277 if (mMode == o2::its::TrackingMode::Async && o2::its::TrackerParamConfig::Instance().fataliseUponFailure) {
278 trackerElapsedTime = mTracker->clustersToTracks(logger, fatalLogger);
279 } else {
280 trackerElapsedTime = mTracker->clustersToTracks(logger, errorLogger);
281 }
282 LOGP(info, " + Tracking total elapse time: {} ms for {} tracks found", trackerElapsedTime, mTimeFrame->getNumberOfTracks());
283 }
284 if constexpr (constants::DoTimeBenchmarks) {
285 const auto& trackConf = o2::its::TrackerParamConfig::Instance();
286 const auto& vertConf = o2::its::VertexerParamConfig::Instance();
287 logger(std::format("=== TimeSlice {} processing completed in: {:.2f} ms using {}/{} thread(s) ===", tfInfo.timeslice, trackerElapsedTime + vertexerElapsedTime, vertConf.nThreads, trackConf.nThreads));
288 }
289
290 size_t totTracks{mTimeFrame->getNumberOfTracks()}, totClusIDs{mTimeFrame->getNumberOfUsedClusters()};
291 if (totTracks) {
292 allTracks.reserve(totTracks);
293 allClusIdx.reserve(totClusIDs);
294
296 LOG(warning) << fmt::format(" + The processed timeframe had {} clusters with wild z coordinates, check the dictionaries", mTimeFrame->hasBogusClusters());
297 }
298 }
299
300 auto& tracks = mTimeFrame->getTracks();
301 allTrackLabels.reserve(mTimeFrame->getTracksLabel().size()); // should be 0 if not MC
302 std::copy(mTimeFrame->getTracksLabel().begin(), mTimeFrame->getTracksLabel().end(), std::back_inserter(allTrackLabels));
303 // create the track to clock ROF association here
304 // the clock ROF is just the fastest ROF
305 // the number of ROFs does not necessarily reflect the actual ROFs
306 // due to possible delay of other layers, however it is guaranteed to be >=0
307 // tracks are guaranteed to be sorted here by their lower edge
308 // we pick whatever is the largest possible number of rofs since there might be tracks/vertices which are beyond
309 // the clock layer
310 int highestROF{0};
311 for (const auto& trc : tracks) {
312 highestROF = std::max(highestROF, (int)clockLayer.getROF(trc.getTimeStamp()));
313 }
314 for (const auto& vtx : vertices) {
315 highestROF = std::max(highestROF, (int)clockLayer.getROF(vtx.getTimeStamp().lower()));
316 }
317 highestROF = std::max(highestROF, (int)clockLayer.mNROFsTF);
318 allTrackROFs.resize(highestROF);
319 vertROFvec.resize(highestROF);
320 setBCData(allTrackROFs);
321 setBCData(vertROFvec);
322
323 mTimeFrame->useMultiplictyMask(); // use multiplicty selection for IR frames
324
325 std::vector<int> rofEntries(highestROF + 1, 0);
326 for (unsigned int iTrk{0}; iTrk < tracks.size(); ++iTrk) {
327 auto& trc{tracks[iTrk]};
328 trc.setFirstClusterEntry((int)allClusIdx.size()); // before adding tracks, create final cluster indices
329 int ncl = trc.getNumberOfClusters(), nclf = 0;
330 for (int ic = TrackITSExt::MaxClusters; ic--;) { // track internally keeps in->out cluster indices, but we want to store the references as out->in!!!
331 auto clid = trc.getClusterIndex(ic);
332 if (clid >= 0) {
333 trc.setClusterSize(ic, mTimeFrame->getClusterSize((mDoStaggering) ? ic : 0, clid));
334 allClusIdx.push_back(clid);
335 nclf++;
336 }
337 }
338 assert(ncl == nclf);
339 allTracks.emplace_back(trc);
340 auto rof = clockLayer.getROF(trc.getTimeStamp());
341 ++rofEntries[rof];
342 }
343 std::exclusive_scan(rofEntries.begin(), rofEntries.end(), rofEntries.begin(), 0);
344 for (size_t iROF{0}; iROF < allTrackROFs.size(); ++iROF) {
345 allTrackROFs[iROF].setFirstEntry(rofEntries[iROF]);
346 allTrackROFs[iROF].setNEntries(rofEntries[iROF + 1] - rofEntries[iROF]);
347 if (mTimeFrame->getROFMaskView().isROFEnabled(clockLayerId, (int)iROF)) {
348 auto& irFrame = irFrames.emplace_back(allTrackROFs[iROF].getBCData(), allTrackROFs[iROF].getBCData() + clockLayer.mROFLength - 1);
349 irFrame.info = allTrackROFs[iROF].getNEntries();
350 }
351 }
352 // same thing for vertices rofs
353 std::fill(rofEntries.begin(), rofEntries.end(), 0);
354 for (const auto& vtx : vertices) {
355 auto rof = clockLayer.getROF(vtx.getTimeStamp().lower());
356 ++rofEntries[rof];
357 }
358 std::exclusive_scan(rofEntries.begin(), rofEntries.end(), rofEntries.begin(), 0);
359 for (size_t iROF{0}; iROF < vertROFvec.size(); ++iROF) {
360 vertROFvec[iROF].setFirstEntry(rofEntries[iROF]);
361 vertROFvec[iROF].setNEntries(rofEntries[iROF + 1] - rofEntries[iROF]);
362 }
363
364 LOGP(info, "ITSTracker pushed {} tracks in {} rofs and {} vertices {}", allTracks.size(), allTrackROFs.size(), vertices.size(), ((mDoStaggering) ? "in staggered-readout mode" : ""));
365 if (mIsMC) {
366 LOGP(info, "ITSTracker pushed {} track labels", allTrackLabels.size());
367 LOGP(info, "ITSTracker pushed {} vertex labels", allVerticesLabels.size());
368 LOGP(info, "ITSTracker pushed {} vertex purities", allVerticesPurities.size());
369 }
370 mTimeFrame->wipe();
371}
372
374{
376 static bool initOnceDone = false;
377 if (mOverrideBeamEstimation) {
379 }
380 if (!initOnceDone) { // this params need to be queried only once
381 initOnceDone = true;
384 if (pc.inputs().getPos("itsTGeo") >= 0) {
385 pc.inputs().get<o2::its::GeometryTGeo*>("itsTGeo");
386 }
389 initialise();
390
391 if (pc.services().get<const o2::framework::DeviceSpec>().inputTimesliceId == 0) { // print settings only for the 1st pipeling
392 // print all used settings
393 if (o2::its::FastMultEstConfig::Instance().isRequested()) {
395 }
396 const auto& vtxParams = mVertexer->getParameters();
397 if (!vtxParams.empty()) {
399 }
400 const auto& trParams = mTracker->getParameters();
401 if (!trParams.empty()) {
403 }
404 // quick summary
405 for (size_t it = 0; it < vtxParams.size(); it++) {
406 const auto& par = vtxParams[it];
407 LOGP(info, "vtxIter#{} : {}", it, par.asString());
408 }
409 for (size_t it = 0; it < trParams.size(); it++) {
410 const auto& par = trParams[it];
411 LOGP(info, "recoIter#{} : {}", it, par.asString());
412 }
413 }
414
415 // prepare rof lookup table(s)
417 const int nOrbitsPerTF = o2::base::GRPGeomHelper::getNHBFPerTF();
420 const auto& trackParams = mTracker->getParameters();
421 for (int iLayer = 0; iLayer < NLayers; ++iLayer) {
422 const unsigned int nROFsPerOrbit = o2::constants::lhc::LHCMaxBunches / par.getROFLengthInBC(iLayer);
423 const LayerTiming timing{
424 .mNROFsTF = (nROFsPerOrbit * nOrbitsPerTF),
425 .mROFLength = (uint32_t)par.getROFLengthInBC(iLayer),
426 .mROFDelay = (uint32_t)par.getROFDelayInBC(iLayer),
427 .mROFBias = (uint32_t)par.getROFBiasInBC(iLayer),
428 .mROFAddTimeErr = (trackParams.empty() ? o2::its::TrackerParamConfig::Instance().addTimeError[iLayer] : trackParams[0].AddTimeError[iLayer])};
429 rofTable.defineLayer(iLayer, timing);
430 vtxTable.defineLayer(iLayer, timing);
431 }
432 rofTable.init();
434 vtxTable.init();
436 }
437}
438
440{
442 return;
443 }
444 if (matcher == ConcreteDataMatcher("ITS", "CLUSDICT", 0)) {
445 LOG(info) << "cluster dictionary updated";
447 return;
448 }
449 // Note: strictly speaking, for Configurable params we don't need finaliseCCDB check, the singletons are updated at the CCDB fetcher level
450 if (matcher == ConcreteDataMatcher("ITS", "ALPIDEPARAM", 0)) {
451 LOG(info) << "Alpide param updated";
453 par.printKeyValues();
454 return;
455 }
456 if (matcher == ConcreteDataMatcher("GLO", "MEANVERTEX", 0)) {
457 LOGP(info, "Mean vertex acquired");
459 return;
460 }
461 if (matcher == ConcreteDataMatcher("ITS", "GEOMTGEO", 0)) {
462 LOG(info) << "ITS GeometryTGeo loaded from ccdb";
464 return;
465 }
466}
467
469{
470 mVertexer->printSummary();
471 mTracker->printSummary();
472}
473
475 TrackerTraitsN* trackerTraits,
476 TimeFrameN* frame)
477{
478 mVertexer = std::make_unique<VertexerN>(vertexerTraits);
479 mTracker = std::make_unique<TrackerN>(trackerTraits);
480 mTimeFrame = frame;
481 mVertexer->adoptTimeFrame(*mTimeFrame);
482 mTracker->adoptTimeFrame(*mTimeFrame);
483
484 // set common memory resource
485 if (!mMemoryPool) {
486 mMemoryPool = std::make_shared<BoundedMemoryResource>();
487 }
488 vertexerTraits->setMemoryPool(mMemoryPool);
489 trackerTraits->setMemoryPool(mMemoryPool);
490 mTimeFrame->setMemoryPool(mMemoryPool);
491 mTracker->setMemoryPool(mMemoryPool);
492 mVertexer->setMemoryPool(mMemoryPool);
493}
494
496{
497 pc.inputs().get<o2::itsmft::TopologyDictionary*>("itscldict"); // just to trigger the finaliseCCDB
498}
499
500void ITSTrackingInterface::loadROF(gsl::span<const itsmft::ROFRecord>& trackROFspan,
501 gsl::span<const itsmft::CompClusterExt> clusters,
502 gsl::span<const unsigned char>::iterator& pattIt,
503 int layer,
505{
506 mTimeFrame->loadROFrameData(trackROFspan, clusters, pattIt, mDict, layer, mcLabels);
507}
std::vector< std::string > labels
std::ostringstream debug
uint64_t bc
Definition RawEventData.h:5
Configuration parameters for ITS fast multiplicity estimator.
Fast multiplicity estimator for ITS.
Helper for geometry and GRP related CCDB requests.
Class to delimit start and end IR of certain time period.
Definition of the GeometryTGeo class.
Definition of the ITSMFT ROFrame (trigger) record.
A helper class to iteratate over all parts of all input routes.
Definition Physics trigger record extracted from the ITS/MFT stream.
void checkUpdates(o2::framework::ProcessingContext &pc)
static GRPGeomHelper & instance()
GPUd() value_type estimateLTFast(o2 static GPUd() float estimateLTIncrement(const o2 PropagatorImpl * Instance(bool uninitialized=false)
Definition Propagator.h:178
void printKeyValues(bool showProv=true, bool useLogger=false, bool withPadding=true, bool showHash=true) const final
A container to hold and manage MC truth information/labels.
decltype(auto) make(const Output &spec, Args... args)
A helper class to iteratate over all parts of all input routes.
int getPos(const char *name) const
decltype(auto) get(R binding, int part=0) const
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
static GeometryTGeo * Instance()
void fillMatrixCache(int mask) override
static void adopt(GeometryTGeo *raw, bool canDelete=false)
void run(framework::ProcessingContext &pc)
void setMeanVertex(const o2::dataformats::MeanVertexObject *v)
void setClusterDictionary(const o2::itsmft::TopologyDictionary *d)
virtual void requestTopologyDictionary(framework::ProcessingContext &pc)
virtual void updateTimeDependentParams(framework::ProcessingContext &pc)
virtual void loadROF(gsl::span< const itsmft::ROFRecord > &trackROFspan, gsl::span< const itsmft::CompClusterExt > clusters, gsl::span< const unsigned char >::iterator &pattIt, int layer, const dataformats::MCTruthContainer< MCCompLabel > *mcLabels)
virtual void finaliseCCDB(framework::ConcreteDataMatcher &matcher, void *obj)
void setTraitsFromProvider(VertexerTraitsN *, TrackerTraitsN *, TimeFrameN *)
virtual void overrideParameters(std::vector< TrackingParameters > &t, std::vector< VertexingParameters > &v)
static constexpr int MaxClusters
< heavy version of TrackITS, with clusters embedded
Definition TrackITS.h:171
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > pool) noexcept
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > pool)
GLsizeiptr size
Definition glcorearb.h:659
const GLdouble * v
Definition glcorearb.h:832
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLint ref
Definition glcorearb.h:291
constexpr int LHCMaxBunches
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< VertexingParameters > getVertexingParameters(Type mode)
std::string toString(Type mode)
std::vector< TrackingParameters > getTrackingParameters(Type mode)
constexpr bool DoTimeBenchmarks
Definition Constants.h:28
std::vector< T, fair::mq::pmr::polymorphic_allocator< T > > vector
void empty(int)
static bool match(DataRef const &ref, const char *binding)
size_t inputTimesliceId
The time pipelining id of this particular device.
Definition DeviceSpec.h:68
void selectROFsWithVertices(const auto &vertices, const ROFOverlapTableN::View &overlapView, ROFMaskTableN &sel) const
Definition FastMultEst.h:54
int selectROFs(const std::array< gsl::span< const o2::itsmft::ROFRecord >, NLayers > &rofs, const std::array< gsl::span< const o2::itsmft::CompClusterExt >, NLayers > &clus, const gsl::span< const o2::itsmft::PhysTrigger > trig, uint32_t firstTForbit, bool doStaggering, const ROFOverlapTableN::View &overlapView, ROFMaskTableN &sel)
ROFVertexLookupTable< NLayers > ROFVertexLookupTableN
Definition TimeFrame.h:68
size_t getNumberOfUsedClusters() const
Definition TimeFrame.h:598
void initDefaultTrackingTopology(const TrackingParameters &trkParam, const int maxLayers=NLayers)
void useMultiplictyMask() noexcept
Definition TimeFrame.h:160
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > pool)
memory management
size_t getNumberOfTracks() const
Definition TimeFrame.h:592
void initVertexingTopology(const TrackingParameters &trkParam)
int getClusterSize(int layer, int clusterId) const
Definition TimeFrame.h:177
float getBeamY() const
Definition TimeFrame.h:110
const auto & getROFMaskView() const
Definition TimeFrame.h:171
int hasBogusClusters() const
Definition TimeFrame.h:243
void loadROFrameData(gsl::span< const o2::itsmft::ROFRecord > rofs, gsl::span< const itsmft::CompClusterExt > clusters, gsl::span< const unsigned char >::iterator &pattIt, const itsmft::TopologyDictionary *dict, int layer, const dataformats::MCTruthContainer< MCCompLabel > *mcLabels=nullptr)
Definition TimeFrame.cxx:59
void initTrackerTopologies(gsl::span< const TrackingParameters > trkParams, const int maxLayers=NLayers)
void setUPCCutMask(ROFMaskTableN cutMask)
Definition TimeFrame.h:165
float getBeamX() const
Definition TimeFrame.h:109
void setROFVertexLookupTable(ROFVertexLookupTableN table)
Definition TimeFrame.h:149
auto getPrimaryVerticesNum()
Definition TimeFrame.h:79
virtual void wipe()
void setBeamPosition(const float x, const float y, const float s2, const float base=50.f, const float systematic=0.f)
Definition TimeFrame.h:103
auto & getTracksLabel()
Definition TimeFrame.h:206
auto & getPrimaryVertices()
Definition TimeFrame.h:78
const auto & getROFOverlapTableView() const
Definition TimeFrame.h:139
ROFOverlapTable< NLayers > ROFOverlapTableN
Definition TimeFrame.h:67
auto & getPrimaryVerticesLabels()
Definition TimeFrame.h:81
void setIsStaggered(bool b) noexcept
staggering
Definition TimeFrame.h:224
void setROFOverlapTable(ROFOverlapTableN table)
Definition TimeFrame.h:142
void setMultiplicityCutMask(ROFMaskTableN cutMask)
Definition TimeFrame.h:155
const auto & getROFOverlapTable() const
Definition TimeFrame.h:138
o2::InteractionRecord ir
Definition PhysTrigger.h:24
static constexpr int T2L
Definition Cartesian.h:55
static constexpr int T2GRot
Definition Cartesian.h:57
static constexpr int T2G
Definition Cartesian.h:56
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)
std::vector< Cluster > clusters