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 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());
54 mTracker->setParameters(trackParams);
55 mVertexer->setParameters(vertParams);
56
57 if (mMode == TrackingMode::Cosmics) {
58 mRunVertexer = false;
59 mCosmicsProcessing = true;
60 LOGP(info, "Cosmic mode enabled, will skip vertexing");
61 }
62
63 // threading
64 if (trackConf.nThreads == vertConf.nThreads) {
65 bool clamped{false};
66 int nThreads = trackConf.nThreads;
67 if (nThreads > 0) {
68 const int hw = std::thread::hardware_concurrency();
69 const int maxThreads = (hw == 0 ? 1 : hw);
70 nThreads = std::clamp(nThreads, 1, maxThreads);
71 clamped = trackConf.nThreads > maxThreads;
72 }
73 LOGP(info, "Tracker and Vertexer will share the task arena with {} thread(s){}", nThreads, (clamped) ? " (clamped)" : "");
74 mTaskArena = std::make_shared<tbb::task_arena>(std::abs(nThreads));
75 }
76 mVertexer->setNThreads(vertConf.nThreads, mTaskArena);
77 mTracker->setNThreads(trackConf.nThreads, mTaskArena);
78 mTimeFrame->setIsStaggered(mDoStaggering);
79
80 // prepare data filter
81 for (int iLayer = 0; iLayer < ((mDoStaggering) ? NLayers : 1); ++iLayer) {
82 mFilter.emplace_back("compClusters", "ITS", "COMPCLUSTERS", iLayer, Lifetime::Timeframe);
83 mFilter.emplace_back("patterns", "ITS", "PATTERNS", iLayer, Lifetime::Timeframe);
84 mFilter.emplace_back("ROframe", "ITS", "CLUSTERSROF", iLayer, Lifetime::Timeframe);
85 if (mIsMC) {
86 mFilter.emplace_back("itsmclabels", "ITS", "CLUSTERSMCTR", iLayer, Lifetime::Timeframe);
87 }
88 }
89}
90
92{
94
95 // filter input and compose
96 std::array<gsl::span<const itsmft::CompClusterExt>, NLayers> compClusters;
97 std::array<gsl::span<const unsigned char>, NLayers> patterns;
98 std::array<gsl::span<const itsmft::ROFRecord>, NLayers> rofsinput;
99 std::array<const dataformats::MCTruthContainer<MCCompLabel>*, NLayers> labels{};
100 for (const DataRef& ref : framework::InputRecordWalker{pc.inputs(), mFilter}) {
101 auto const* dh = DataRefUtils::getHeader<o2::header::DataHeader*>(ref);
102 if (framework::DataRefUtils::match(ref, {"compClusters", framework::ConcreteDataTypeMatcher{"ITS", "COMPCLUSTERS"}})) {
103 compClusters[dh->subSpecification] = pc.inputs().get<gsl::span<o2::itsmft::CompClusterExt>>(ref);
104 }
105 if (framework::DataRefUtils::match(ref, {"patterns", framework::ConcreteDataTypeMatcher{"ITS", "PATTERNS"}})) {
106 patterns[dh->subSpecification] = pc.inputs().get<gsl::span<unsigned char>>(ref);
107 }
108 if (framework::DataRefUtils::match(ref, {"ROframes", framework::ConcreteDataTypeMatcher{"ITS", "CLUSTERSROF"}})) {
109 rofsinput[dh->subSpecification] = pc.inputs().get<gsl::span<o2::itsmft::ROFRecord>>(ref);
110 }
111 if (framework::DataRefUtils::match(ref, {"itsmclabels", framework::ConcreteDataTypeMatcher{"ITS", "CLUSTERSMCTR"}})) {
112 labels[dh->subSpecification] = pc.inputs().get<const dataformats::MCTruthContainer<MCCompLabel>*>(ref).release();
113 }
114 }
115
116 bool hasClusters = false;
117 for (int iLayer = 0; iLayer < ((mDoStaggering) ? NLayers : 1); ++iLayer) {
118 LOGP(info, "ITSTracker{} pulled {} clusters, {} RO frames", ((mDoStaggering) ? std::format(" on layer {}", iLayer) : ""), compClusters[iLayer].size(), rofsinput[iLayer].size());
119 if (compClusters[iLayer].empty()) {
120 LOGP(warn, " -> received no processable data{}", (mDoStaggering) ? std::format(" on layer {}", iLayer) : "");
121 } else {
122 hasClusters = true;
123 }
124 if (mIsMC) {
125 LOG(info) << " -> " << labels[iLayer]->getIndexedSize() << " MC label objects";
126 }
127 }
128
129 const auto& tfInfo = pc.services().get<o2::framework::TimingInfo>();
130 gsl::span<const o2::itsmft::PhysTrigger> physTriggers;
131 std::vector<o2::itsmft::PhysTrigger> fromTRD;
132 if (mUseTriggers == 2) { // use TRD triggers
133 o2::InteractionRecord irFirstTF{0, tfInfo.firstTForbit};
134 auto trdTriggers = pc.inputs().get<gsl::span<o2::trd::TriggerRecord>>("phystrig");
135 for (const auto& trig : trdTriggers) {
136 if (trig.getBCData() >= irFirstTF && trig.getNumberOfTracklets()) {
137 irFirstTF = trig.getBCData();
138 fromTRD.emplace_back(o2::itsmft::PhysTrigger{.ir = irFirstTF, .data = 0});
139 }
140 }
141 physTriggers = gsl::span<const o2::itsmft::PhysTrigger>(fromTRD.data(), fromTRD.size());
142 } else if (mUseTriggers == 1) { // use Phys triggers from ITS stream
143 physTriggers = pc.inputs().get<gsl::span<o2::itsmft::PhysTrigger>>("phystrig");
144 }
145
146 const int clockLayerId{mDoStaggering ? mTimeFrame->getROFOverlapTableView().getClock() : 0};
147 auto& irFrames = pc.outputs().make<std::vector<o2::dataformats::IRFrame>>(Output{"ITS", "IRFRAMES", 0});
148 irFrames.reserve(rofsinput[clockLayerId].size());
149
150 auto& allClusIdx = pc.outputs().make<std::vector<int>>(Output{"ITS", "TRACKCLSID", 0});
151 auto& allTracks = pc.outputs().make<std::vector<o2::its::TrackITS>>(Output{"ITS", "TRACKS", 0});
152 auto& allTrackROFs = pc.outputs().make<std::vector<o2::itsmft::ROFRecord>>(Output{"ITS", "ITSTrackROF", 0});
153 auto& vertices = pc.outputs().make<std::vector<Vertex>>(Output{"ITS", "VERTICES", 0});
154 auto& vertROFvec = pc.outputs().make<std::vector<o2::itsmft::ROFRecord>>(Output{"ITS", "VERTICESROF", 0}); // TODO fill this!
155
156 // MC
157 static pmr::vector<o2::MCCompLabel> dummyMCLabTracks, dummyMCLabVerts;
158 static pmr::vector<float> dummyMCPurVerts;
159 auto& allTrackLabels = mIsMC ? pc.outputs().make<std::vector<o2::MCCompLabel>>(Output{"ITS", "TRACKSMCTR", 0}) : dummyMCLabTracks;
160 auto& allVerticesLabels = mIsMC ? pc.outputs().make<std::vector<o2::MCCompLabel>>(Output{"ITS", "VERTICESMCTR", 0}) : dummyMCLabVerts;
161 auto& allVerticesPurities = mIsMC ? pc.outputs().make<std::vector<float>>(Output{"ITS", "VERTICESMCPUR", 0}) : dummyMCPurVerts;
162
163 if (!hasClusters) {
164 // skip processing if no data is received entirely but still create empty output so consumers do not wait
165 return;
166 }
167
168 if (mOverrideBeamEstimation) {
169 mTimeFrame->setBeamPosition(mMeanVertex->getX(),
170 mMeanVertex->getY(),
171 mMeanVertex->getSigmaY2(),
172 mTracker->getParameters()[0].LayerResolution[0],
173 mTracker->getParameters()[0].SystErrorY2[0]);
174 }
175
176 mTracker->setBz(o2::base::Propagator::Instance()->getNominalBz());
177 mTracker->setTimeSlice(tfInfo.timeslice);
178
179 for (int iLayer = 0; iLayer < ((mDoStaggering) ? NLayers : 1); ++iLayer) {
180 gsl::span<const unsigned char>::iterator pattIt = patterns[iLayer].begin();
181 loadROF(rofsinput[iLayer], compClusters[iLayer], pattIt, ((mDoStaggering) ? iLayer : -1), labels[iLayer]);
182 }
183
184 auto logger = [&](const std::string& s) { LOG(info) << s; };
185 auto fatalLogger = [&](const std::string& s) { LOG(fatal) << s; };
186 auto errorLogger = [&](const std::string& s) { LOG(error) << s; };
187
188 FastMultEst multEst; // mult estimator
190 multEst.selectROFs(rofsinput, compClusters, physTriggers, tfInfo.firstTForbit, mDoStaggering, mTimeFrame->getROFOverlapTableView(), processMultiplictyMask);
191 mTimeFrame->setMultiplicityCutMask(processMultiplictyMask);
192 for (int iLayer = 0; iLayer < ((mDoStaggering) ? NLayers : 1); ++iLayer) {
193 mTimeFrame->getROFMaskView().print(iLayer);
194 }
195
196 float vertexerElapsedTime{0.f}, trackerElapsedTime{0.f};
197 if (mRunVertexer) {
198 // Run seeding vertexer
199 vertexerElapsedTime = mVertexer->clustersToVertices(logger);
200 const auto& vtx = mTimeFrame->getPrimaryVertices();
201 vertices.insert(vertices.begin(), vtx.begin(), vtx.end());
202 if (mIsMC) {
203 allVerticesLabels.reserve(vertices.size());
204 allVerticesPurities.reserve(vertices.size());
205 for (const auto& lbl : mTimeFrame->getPrimaryVerticesLabels()) {
206 allVerticesLabels.push_back(lbl.first);
207 allVerticesPurities.push_back(lbl.second);
208 }
209 }
210 }
211 multEst.selectROFsWithVertices(vertices, mTimeFrame->getROFOverlapTableView(), processMultiplictyMask);
212
213 auto clockROFspan = rofsinput[clockLayerId];
214 auto clockTiming = mTimeFrame->getROFOverlapTableView().getClockLayer();
215 for (auto iRof{0}; iRof < clockROFspan.size(); ++iRof) {
216 auto& vtxROF = vertROFvec.emplace_back(clockROFspan[iRof]);
217 if (mRunVertexer) {
218 auto vtxSpan = mTimeFrame->getPrimaryVertices(clockLayerId, iRof);
220 if (!vtxSpan.empty()) {
221 bool hasUPC = std::any_of(vtxSpan.begin(), vtxSpan.end(), [](const auto& v) { return v.isFlagSet(Vertex::UPCMode); });
222 if (hasUPC) { // at least one vertex in this ROF and it is from second vertex iteration
223 LOGP(debug, "ROF {} rejected as vertices are from the UPC iteration", iRof);
224 processUPCMask.selectROF({clockTiming.getROFStartInBC(iRof), clockTiming.getROFEndInBC(iRof)});
225 vtxROF.setFlag(o2::itsmft::ROFRecord::VtxUPCMode);
226 } else { // in all cases except if as standard mode vertex was found, the ROF was processed with UPC settings
227 vtxROF.setFlag(o2::itsmft::ROFRecord::VtxStdMode);
228 }
229 } else {
230 vtxROF.setFlag(o2::itsmft::ROFRecord::VtxUPCMode);
231 }
232 } else {
233 vtxROF.setFlag(o2::itsmft::ROFRecord::VtxStdMode);
234 }
235 }
236 }
237
238 if (mRunVertexer && hasClusters) {
239 LOGP(info, " + Vertex seeding total elapsed time: {} ms for {} vertices found", vertexerElapsedTime, mTimeFrame->getPrimaryVerticesNum());
240 }
241
242 if (mOverrideBeamEstimation) {
243 LOG(info) << fmt::format(" + Beam position set to: {}, {} from meanvertex object", mTimeFrame->getBeamX(), mTimeFrame->getBeamY());
244 } else {
245 LOG(info) << fmt::format(" + Beam position computed for the TF: {}, {}", mTimeFrame->getBeamX(), mTimeFrame->getBeamY());
246 }
247
248 if (hasClusters) {
249 mTimeFrame->setMultiplicityCutMask(processMultiplictyMask);
250 mTimeFrame->setUPCCutMask(processUPCMask);
251 if (mMode == o2::its::TrackingMode::Async && o2::its::TrackerParamConfig::Instance().fataliseUponFailure) {
252 trackerElapsedTime = mTracker->clustersToTracks(logger, fatalLogger);
253 } else {
254 trackerElapsedTime = mTracker->clustersToTracks(logger, errorLogger);
255 }
256 LOGP(info, " + Tracking total elapse time: {} ms for {} tracks found", trackerElapsedTime, mTimeFrame->getNumberOfTracks());
257 }
258 if constexpr (constants::DoTimeBenchmarks) {
259 const auto& trackConf = o2::its::TrackerParamConfig::Instance();
260 const auto& vertConf = o2::its::VertexerParamConfig::Instance();
261 logger(std::format("=== TimeSlice {} processing completed in: {:.2f} ms using {}/{} thread(s) ===", tfInfo.timeslice, trackerElapsedTime + vertexerElapsedTime, vertConf.nThreads, trackConf.nThreads));
262 }
263
264 size_t totTracks{mTimeFrame->getNumberOfTracks()}, totClusIDs{mTimeFrame->getNumberOfUsedClusters()};
265 if (totTracks) {
266 allTracks.reserve(totTracks);
267 allClusIdx.reserve(totClusIDs);
268
270 LOG(warning) << fmt::format(" + The processed timeframe had {} clusters with wild z coordinates, check the dictionaries", mTimeFrame->hasBogusClusters());
271 }
272
273 auto& tracks = mTimeFrame->getTracks();
274 allTrackLabels.reserve(mTimeFrame->getTracksLabel().size()); // should be 0 if not MC
275 std::copy(mTimeFrame->getTracksLabel().begin(), mTimeFrame->getTracksLabel().end(), std::back_inserter(allTrackLabels));
276 {
277 // create the track to clock ROF association here
278 // the clock ROF is just the fastest ROF
279 // the number of ROFs does not necessarily reflect the actual ROFs
280 // due to possible delay of other layers, however it is guaranteed to be >=0
281 // tracks are guaranteed to be sorted here by their lower edge
282 const auto& clock = mTimeFrame->getROFOverlapTableView().getClock();
283 const auto& clockLayer = mTimeFrame->getROFOverlapTableView().getClockLayer();
284 auto setBCData = [&](auto& rofs) {
285 for (size_t iROF{0}; iROF < rofs.size(); ++iROF) { // set BC data
286 auto& rof = rofs[iROF];
287 int orb = (iROF * par.getROFLengthInBC(clock) / o2::constants::lhc::LHCMaxBunches) + tfInfo.firstTForbit;
288 int bc = (iROF * par.getROFLengthInBC(clock) % o2::constants::lhc::LHCMaxBunches) + par.getROFDelayInBC(clock);
290 rof.setBCData(ir);
291 rof.setROFrame(iROF);
292 rof.setNEntries(0);
293 rof.setFirstEntry(-1);
294 }
295 };
296 // we pick whatever is the largest possible number of rofs since there might be tracks/vertices which are beyond
297 // the clock layer
298 int highestROF{0};
299 for (const auto& trc : tracks) {
300 highestROF = std::max(highestROF, (int)clockLayer.getROF(trc.getTimeStamp()));
301 }
302 for (const auto& vtx : vertices) {
303 highestROF = std::max(highestROF, (int)clockLayer.getROF(vtx.getTimeStamp().lower()));
304 }
305 highestROF = std::max(highestROF, (int)clockLayer.mNROFsTF);
306 allTrackROFs.resize(highestROF);
307 vertROFvec.resize(highestROF);
308 setBCData(allTrackROFs);
309 setBCData(vertROFvec);
310
311 mTimeFrame->useMultiplictyMask(); // use multiplicty selection for IR frames
312
313 std::vector<int> rofEntries(highestROF + 1, 0);
314 for (unsigned int iTrk{0}; iTrk < tracks.size(); ++iTrk) {
315 auto& trc{tracks[iTrk]};
316 trc.setFirstClusterEntry((int)allClusIdx.size()); // before adding tracks, create final cluster indices
317 int ncl = trc.getNumberOfClusters(), nclf = 0;
318 for (int ic = TrackITSExt::MaxClusters; ic--;) { // track internally keeps in->out cluster indices, but we want to store the references as out->in!!!
319 auto clid = trc.getClusterIndex(ic);
320 if (clid >= 0) {
321 trc.setClusterSize(ic, mTimeFrame->getClusterSize((mDoStaggering) ? ic : 0, clid));
322 allClusIdx.push_back(clid);
323 nclf++;
324 }
325 }
326 assert(ncl == nclf);
327 allTracks.emplace_back(trc);
328 auto rof = clockLayer.getROF(trc.getTimeStamp());
329 ++rofEntries[rof];
330 }
331 std::exclusive_scan(rofEntries.begin(), rofEntries.end(), rofEntries.begin(), 0);
332 for (size_t iROF{0}; iROF < allTrackROFs.size(); ++iROF) {
333 allTrackROFs[iROF].setFirstEntry(rofEntries[iROF]);
334 allTrackROFs[iROF].setNEntries(rofEntries[iROF + 1] - rofEntries[iROF]);
335 if (mTimeFrame->getROFMaskView().isROFEnabled(clockLayerId, (int)iROF)) {
336 auto& irFrame = irFrames.emplace_back(allTrackROFs[iROF].getBCData(), allTrackROFs[iROF].getBCData() + clockLayer.mROFLength - 1);
337 irFrame.info = allTrackROFs[iROF].getNEntries();
338 }
339 }
340 // same thing for vertices rofs
341 std::fill(rofEntries.begin(), rofEntries.end(), 0);
342 for (const auto& vtx : vertices) {
343 auto rof = clockLayer.getROF(vtx.getTimeStamp().lower());
344 ++rofEntries[rof];
345 }
346 std::exclusive_scan(rofEntries.begin(), rofEntries.end(), rofEntries.begin(), 0);
347 for (size_t iROF{0}; iROF < vertROFvec.size(); ++iROF) {
348 vertROFvec[iROF].setFirstEntry(rofEntries[iROF]);
349 vertROFvec[iROF].setNEntries(rofEntries[iROF + 1] - rofEntries[iROF]);
350 }
351 }
352 }
353
354 LOGP(info, "ITSTracker pushed {} tracks in {} rofs and {} vertices {}", allTracks.size(), allTrackROFs.size(), vertices.size(), ((mDoStaggering) ? "in staggered-readout mode" : ""));
355 if (mIsMC) {
356 LOGP(info, "ITSTracker pushed {} track labels", allTrackLabels.size());
357 LOGP(info, "ITSTracker pushed {} vertex labels", allVerticesLabels.size());
358 LOGP(info, "ITSTracker pushed {} vertex purities", allVerticesPurities.size());
359 }
360 mTimeFrame->wipe();
361}
362
364{
366 static bool initOnceDone = false;
367 if (mOverrideBeamEstimation) {
369 }
370 if (!initOnceDone) { // this params need to be queried only once
371 initOnceDone = true;
372 pc.inputs().get<o2::itsmft::TopologyDictionary*>("itscldict"); // just to trigger the finaliseCCDB
374 if (pc.inputs().getPos("itsTGeo") >= 0) {
375 pc.inputs().get<o2::its::GeometryTGeo*>("itsTGeo");
376 }
379 initialise();
380
381 if (pc.services().get<const o2::framework::DeviceSpec>().inputTimesliceId == 0) { // print settings only for the 1st pipeling
382 // print all used settings
383 if (o2::its::FastMultEstConfig::Instance().isRequested()) {
385 }
386 const auto& vtxParams = mVertexer->getParameters();
387 if (!vtxParams.empty()) {
389 }
390 const auto& trParams = mTracker->getParameters();
391 if (!trParams.empty()) {
393 }
394 // quick summary
395 for (size_t it = 0; it < vtxParams.size(); it++) {
396 const auto& par = vtxParams[it];
397 LOGP(info, "vtxIter#{} : {}", it, par.asString());
398 }
399 for (size_t it = 0; it < trParams.size(); it++) {
400 const auto& par = trParams[it];
401 LOGP(info, "recoIter#{} : {}", it, par.asString());
402 }
403 }
404
405 // prepare rof lookup table(s)
407 const int nOrbitsPerTF = o2::base::GRPGeomHelper::getNHBFPerTF();
410 const auto& trackParams = mTracker->getParameters();
411 for (int iLayer = 0; iLayer < NLayers; ++iLayer) {
412 const unsigned int nROFsPerOrbit = o2::constants::lhc::LHCMaxBunches / par.getROFLengthInBC(iLayer);
413 const LayerTiming timing{
414 .mNROFsTF = (nROFsPerOrbit * nOrbitsPerTF),
415 .mROFLength = (uint32_t)par.getROFLengthInBC(iLayer),
416 .mROFDelay = (uint32_t)par.getROFDelayInBC(iLayer),
417 .mROFBias = (uint32_t)par.getROFBiasInBC(iLayer),
418 .mROFAddTimeErr = (trackParams.empty() ? o2::its::TrackerParamConfig::Instance().addTimeError[iLayer] : trackParams[0].AddTimeError[iLayer])};
419 rofTable.defineLayer(iLayer, timing);
420 vtxTable.defineLayer(iLayer, timing);
421 }
422 rofTable.init();
424 vtxTable.init();
426 }
427}
428
430{
432 return;
433 }
434 if (matcher == ConcreteDataMatcher("ITS", "CLUSDICT", 0)) {
435 LOG(info) << "cluster dictionary updated";
437 return;
438 }
439 // Note: strictly speaking, for Configurable params we don't need finaliseCCDB check, the singletons are updated at the CCDB fetcher level
440 if (matcher == ConcreteDataMatcher("ITS", "ALPIDEPARAM", 0)) {
441 LOG(info) << "Alpide param updated";
443 par.printKeyValues();
444 return;
445 }
446 if (matcher == ConcreteDataMatcher("GLO", "MEANVERTEX", 0)) {
447 LOGP(info, "Mean vertex acquired");
449 return;
450 }
451 if (matcher == ConcreteDataMatcher("ITS", "GEOMTGEO", 0)) {
452 LOG(info) << "ITS GeometryTGeo loaded from ccdb";
454 return;
455 }
456}
457
459{
460 mTracker->printSummary();
461}
462
464 TrackerTraitsN* trackerTraits,
465 TimeFrameN* frame)
466{
467 mVertexer = std::make_unique<VertexerN>(vertexerTraits);
468 mTracker = std::make_unique<TrackerN>(trackerTraits);
469 mTimeFrame = frame;
470 mVertexer->adoptTimeFrame(*mTimeFrame);
471 mTracker->adoptTimeFrame(*mTimeFrame);
472
473 // set common memory resource
474 if (!mMemoryPool) {
475 mMemoryPool = std::make_shared<BoundedMemoryResource>();
476 }
477 vertexerTraits->setMemoryPool(mMemoryPool);
478 trackerTraits->setMemoryPool(mMemoryPool);
479 mTimeFrame->setMemoryPool(mMemoryPool);
480 mTracker->setMemoryPool(mMemoryPool);
481 mVertexer->setMemoryPool(mMemoryPool);
482}
483
484void ITSTrackingInterface::loadROF(gsl::span<const itsmft::ROFRecord>& trackROFspan,
485 gsl::span<const itsmft::CompClusterExt> clusters,
486 gsl::span<const unsigned char>::iterator& pattIt,
487 int layer,
489{
490 mTimeFrame->loadROFrameData(trackROFspan, clusters, pattIt, mDict, layer, mcLabels);
491}
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 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 *)
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:31
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:69
size_t getNumberOfUsedClusters() const
Definition TimeFrame.h:587
void useMultiplictyMask() noexcept
Definition TimeFrame.h:158
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > pool)
memory management
size_t getNumberOfTracks() const
Definition TimeFrame.h:581
int getClusterSize(int layer, int clusterId) const
Definition TimeFrame.h:175
float getBeamY() const
Definition TimeFrame.h:110
const auto & getROFMaskView() const
Definition TimeFrame.h:169
int hasBogusClusters() const
Definition TimeFrame.h:237
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 setUPCCutMask(ROFMaskTableN cutMask)
Definition TimeFrame.h:163
float getBeamX() const
Definition TimeFrame.h:109
void setROFVertexLookupTable(ROFVertexLookupTableN table)
Definition TimeFrame.h:147
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:200
auto & getPrimaryVertices()
Definition TimeFrame.h:78
const auto & getROFOverlapTableView() const
Definition TimeFrame.h:139
ROFOverlapTable< NLayers > ROFOverlapTableN
Definition TimeFrame.h:68
auto & getPrimaryVerticesLabels()
Definition TimeFrame.h:81
void setIsStaggered(bool b) noexcept
staggering
Definition TimeFrame.h:218
void setROFOverlapTable(ROFOverlapTableN table)
Definition TimeFrame.h:140
void setMultiplicityCutMask(ROFMaskTableN cutMask)
Definition TimeFrame.h:153
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