Project
Loading...
Searching...
No Matches
TimeFrame.h
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.
12
13#ifndef TRACKINGITSU_INCLUDE_TIMEFRAME_H_
14#define TRACKINGITSU_INCLUDE_TIMEFRAME_H_
15
16#include <array>
17#include <vector>
18#include <utility>
19#include <algorithm>
20#include <numeric>
21#include <gsl/gsl>
22
25
26#include "ITStracking/Cell.h"
27#include "ITStracking/Cluster.h"
37
39
40namespace o2
41{
42namespace gpu
43{
44class GPUChainITS;
45}
46
47namespace itsmft
48{
49class Cluster;
50class CompClusterExt;
51class TopologyDictionary;
52class ROFRecord;
53} // namespace itsmft
54
55namespace its
56{
57namespace gpu
58{
59template <int>
60class TimeFrameGPU;
61}
62
63template <int NLayers>
64struct TimeFrame {
70 friend class gpu::TimeFrameGPU<NLayers>;
71
72 TimeFrame() = default;
73 virtual ~TimeFrame() = default;
74
75 const Vertex& getPrimaryVertex(const int ivtx) const { return mPrimaryVertices[ivtx]; }
77 auto getPrimaryVerticesNum() { return mPrimaryVertices.size(); };
78 const auto& getPrimaryVertices() const { return mPrimaryVertices; };
80 gsl::span<const Vertex> getPrimaryVertices(int layer, int rofId) const;
81 void addPrimaryVertex(const Vertex& vertex);
83
84 // read-in data
85 void loadROFrameData(gsl::span<const o2::itsmft::ROFRecord> rofs,
86 gsl::span<const itsmft::CompClusterExt> clusters,
87 gsl::span<const unsigned char>::iterator& pattIt,
89 int layer,
90 const dataformats::MCTruthContainer<MCCompLabel>* mcLabels = nullptr);
91 void resetROFrameData(int iLayer);
92 void prepareROFrameData(gsl::span<const itsmft::CompClusterExt> clusters, int layer);
93
94 int getTotalClusters() const;
95 bool empty() const { return getTotalClusters() == 0; }
96 int getSortedIndex(int rofId, int layer, int idx) const { return mROFramesClusters[layer][rofId] + idx; }
97 int getSortedStartIndex(const int rofId, const int layer) const { return mROFramesClusters[layer][rofId]; }
98 int getNrof(int layer) const { return mROFramesClusters[layer].size() - 1; }
99
100 void resetBeamXY(const float x, const float y, const float w = 0);
101 void setBeamPosition(const float x, const float y, const float s2, const float base = 50.f, const float systematic = 0.f)
102 {
104 resetBeamXY(x, y, s2 / o2::gpu::CAMath::Sqrt((base * base) + systematic));
105 }
106
107 float getBeamX() const { return mBeamPos[0]; }
108 float getBeamY() const { return mBeamPos[1]; }
109 std::array<float, 2>& getBeamXY() { return mBeamPos; }
110
111 auto& getMinRs() { return mMinR; }
112 auto& getMaxRs() { return mMaxR; }
113 float getMinR(int layer) const { return mMinR[layer]; }
114 float getMaxR(int layer) const { return mMaxR[layer]; }
115 float getMSangle(int layer) const { return mMSangles[layer]; }
116 auto& getMSangles() { return mMSangles; }
117 float getPhiCut(int layer) const { return mPhiCuts[layer]; }
118 auto& getPhiCuts() { return mPhiCuts; }
121
122 gsl::span<Cluster> getClustersOnLayer(int rofId, int layerId);
123 gsl::span<const Cluster> getClustersOnLayer(int rofId, int layerId) const;
124 gsl::span<const Cluster> getClustersPerROFrange(int rofMin, int range, int layerId) const;
125 gsl::span<const Cluster> getUnsortedClustersOnLayer(int rofId, int layerId) const;
126 gsl::span<uint8_t> getUsedClustersROF(int rofId, int layerId);
127 gsl::span<const uint8_t> getUsedClustersROF(int rofId, int layerId) const;
128 gsl::span<const int> getROFramesClustersPerROFrange(int rofMin, int range, int layerId) const;
129 gsl::span<const int> getROFrameClusters(int layerId) const;
130 gsl::span<const int> getNClustersROFrange(int rofMin, int range, int layerId) const;
131 gsl::span<int> getIndexTable(int rofId, int layerId);
132 const auto& getTrackingFrameInfoOnLayer(int layerId) const { return mTrackingFrameInfo[layerId]; }
133
134 // navigation tables
135 const auto& getIndexTableUtils() const { return mIndexTableUtils; }
136 const auto& getROFOverlapTable() const { return mROFOverlapTable; }
137 const auto& getROFOverlapTableView() const { return mROFOverlapTableView; }
139 {
140 mROFOverlapTable = std::move(table);
142 }
143 const auto& getROFVertexLookupTable() const { return mROFVertexLookupTable; }
152 {
153 mMultiplicityCutMask = std::move(cutMask);
154 mROFMaskView = mROFMask->getView();
155 }
156 void useMultiplictyMask() noexcept
157 {
159 mROFMaskView = mROFMask->getView();
160 }
161 void setUPCCutMask(ROFMaskTableN cutMask) { mUPCCutMask = std::move(cutMask); }
162 void useUPCMask() noexcept
163 {
165 mROFMaskView = mROFMask->getView();
166 }
167 const auto& getROFMaskView() const { return mROFMaskView; }
168
169 const TrackingFrameInfo& getClusterTrackingFrameInfo(int layerId, const Cluster& cl) const;
170 gsl::span<const MCCompLabel> getClusterLabels(int layerId, const Cluster& cl) const { return getClusterLabels(layerId, cl.clusterId); }
171 gsl::span<const MCCompLabel> getClusterLabels(int layerId, const int clId) const { return mClusterLabels[((mIsStaggered) ? layerId : 0)]->getLabels(mClusterExternalIndices[layerId][clId]); }
172 int getClusterExternalIndex(int layerId, const int clId) const { return mClusterExternalIndices[layerId][clId]; }
173 int getClusterSize(int layer, int clusterId) const { return mClusterSize[layer][clusterId]; }
175
177 auto& getCellsLabel(int layer) { return mCellLabels[layer]; }
178
179 bool hasMCinformation() const { return mClusterLabels[0] != nullptr; }
180 void initialise(const int iteration, const TrackingParameters& trkParam, const int maxLayers = NLayers, bool resetVertices = true);
181
182 bool isClusterUsed(int layer, int clusterId) const { return mUsedClusters[layer][clusterId]; }
183 void markUsedCluster(int layer, int clusterId) { mUsedClusters[layer][clusterId] = true; }
184 gsl::span<unsigned char> getUsedClusters(const int layer);
185
186 auto& getTracklets() { return mTracklets; }
188
189 auto& getClusters() { return mClusters; }
191 int getClusterROF(int iLayer, int iCluster);
192 auto& getCells() { return mCells; }
193
197 auto& getTracks() { return mTracks; }
198 auto& getTracksLabel() { return mTracksLabel; }
199 auto& getLinesLabel(const int rofId) { return mLinesLabels[rofId]; }
200
201 size_t getNumberOfClusters() const;
202 virtual size_t getNumberOfCells() const;
203 virtual size_t getNumberOfTracklets() const;
204 virtual size_t getNumberOfNeighbours() const;
205 size_t getNumberOfTracks() const;
207
209 void setMemoryPool(std::shared_ptr<BoundedMemoryResource> pool);
210 auto& getMemoryPool() const noexcept { return mMemoryPool; }
211 bool checkMemory(unsigned long max) { return getArtefactsMemory() < max; }
212 unsigned long getArtefactsMemory() const;
213 void printArtefactsMemory() const;
214
216 void setIsStaggered(bool b) noexcept { mIsStaggered = b; }
217
218 // Vertexer
221 int& getNTrackletsROF(int rofId, int combId) { return mNTrackletsPerROF[combId][rofId]; }
222 auto& getLines(int rofId) { return mLines[rofId]; }
223 int getNLinesTotal() const noexcept { return mTotalLines; }
224 void setNLinesTotal(uint32_t a) noexcept { mTotalLines = a; }
225 auto& getTrackletClusters(int rofId) { return mTrackletClusters[rofId]; }
226 gsl::span<const Tracklet> getFoundTracklets(int rofId, int combId) const;
227 gsl::span<Tracklet> getFoundTracklets(int rofId, int combId);
228 gsl::span<const MCCompLabel> getLabelsFoundTracklets(int rofId, int combId) const;
229 gsl::span<int> getNTrackletsCluster(int rofId, int combId);
230 gsl::span<int> getExclusiveNTrackletsCluster(int rofId, int combId);
231 uint32_t getTotalTrackletsTF(const int iLayer) { return mTotalTracklets[iLayer]; }
232 int getTotalClustersPerROFrange(int rofMin, int range, int layerId) const;
233 // \Vertexer
234
235 int hasBogusClusters() const { return std::accumulate(mBogusClusters.begin(), mBogusClusters.end(), 0); }
236
237 void setBz(float bz) { mBz = bz; }
238 float getBz() const { return mBz; }
239
242 std::shared_ptr<BoundedMemoryResource> mExtMemoryPool; // host memory pool managed by the framework
245 bool hasFrameworkAllocator() const noexcept { return mExternalAllocator != nullptr; }
246 std::pmr::memory_resource* getMaybeFrameworkHostResource(bool forceHost = false) { return (hasFrameworkAllocator() && !forceHost) ? mExtMemoryPool.get() : mMemoryPool.get(); }
247
248 // Propagator
250 virtual void setDevicePropagator(const o2::base::PropagatorImpl<float>* /*unused*/) {};
251
252 template <typename... T>
253 void addClusterToLayer(int layer, T&&... args);
254 template <typename... T>
255 void addTrackingFrameInfoToLayer(int layer, T&&... args);
256 void addClusterExternalIndexToLayer(int layer, const int idx) { mClusterExternalIndices[layer].push_back(idx); }
257
258 std::array<bounded_vector<Cluster>, NLayers> mClusters;
259 std::array<bounded_vector<TrackingFrameInfo>, NLayers> mTrackingFrameInfo;
260 std::array<bounded_vector<int>, NLayers> mClusterExternalIndices;
261 std::array<bounded_vector<int>, NLayers> mROFramesClusters;
262 std::array<const dataformats::MCTruthContainer<MCCompLabel>*, NLayers> mClusterLabels{nullptr};
263 std::array<bounded_vector<int>, 2> mNTrackletsPerCluster;
264 std::array<bounded_vector<int>, 2> mNTrackletsPerClusterSum;
265 std::array<bounded_vector<int>, NLayers> mNClustersPerROF;
266 std::array<bounded_vector<int>, NLayers> mIndexTables;
267 std::vector<bounded_vector<int>> mTrackletsLookupTable;
268 std::array<bounded_vector<uint8_t>, NLayers> mUsedClusters;
269
270 std::array<bounded_vector<Cluster>, NLayers> mUnsortedClusters;
271 std::vector<bounded_vector<Tracklet>> mTracklets;
272 std::vector<bounded_vector<CellSeed>> mCells;
275 std::vector<bounded_vector<int>> mCellsNeighbours;
276 std::vector<bounded_vector<int>> mCellsLookupTable;
277
278 const o2::base::PropagatorImpl<float>* mPropagatorDevice = nullptr; // Needed only for GPU
279
280 virtual void wipe();
281
282 // interface
283 virtual bool isGPU() const noexcept { return false; }
284 virtual const char* getName() const noexcept { return "CPU"; }
285
286 protected:
287 void prepareClusters(const TrackingParameters& trkParam, const int maxLayers = NLayers);
288 float mBz = 5.;
289 unsigned int mNTotalLowPtVertices = 0;
291 std::array<float, 2> mBeamPos = {0.f, 0.f};
293 std::array<float, NLayers> mMinR;
294 std::array<float, NLayers> mMaxR;
298 std::array<bounded_vector<uint8_t>, NLayers> mClusterSize;
299
301 std::vector<bounded_vector<MCCompLabel>> mTrackletLabels;
302 std::vector<bounded_vector<MCCompLabel>> mCellLabels;
303 std::vector<bounded_vector<int>> mCellsNeighboursLUT;
305
306 // Vertexer
309 std::vector<bounded_vector<int>> mNTrackletsPerROF;
310 std::vector<bounded_vector<Line>> mLines;
311 std::vector<bounded_vector<ClusterLines>> mTrackletClusters;
312 std::array<bounded_vector<int>, 2> mTrackletsIndexROF;
313 std::vector<bounded_vector<MCCompLabel>> mLinesLabels;
314 std::array<uint32_t, 2> mTotalTracklets = {0, 0};
315 uint32_t mTotalLines = 0;
316 // \Vertexer
317
318 // lookup tables
321 ROFOverlapTableN::View mROFOverlapTableView;
323 ROFVertexLookupTableN::View mROFVertexLookupTableView;
327 ROFMaskTableN::View mROFMaskView;
328
329 bool mIsStaggered{false};
330
331 std::shared_ptr<BoundedMemoryResource> mMemoryPool;
332};
333
334template <int NLayers>
335gsl::span<const Vertex> TimeFrame<NLayers>::getPrimaryVertices(int layer, int rofId) const
336{
337 if (rofId < 0 || rofId >= getNrof(layer)) {
338 return {};
339 }
340 const auto& entry = mROFVertexLookupTableView.getVertices(layer, rofId);
341 return {&mPrimaryVertices[entry.getFirstEntry()], static_cast<gsl::span<const Vertex>::size_type>(entry.getEntries())};
342}
343
344template <int NLayers>
345inline void TimeFrame<NLayers>::resetBeamXY(const float x, const float y, const float w)
346{
347 mBeamPos[0] = x;
348 mBeamPos[1] = y;
349 mBeamPosWeight = w;
350}
351
352template <int NLayers>
353inline gsl::span<const int> TimeFrame<NLayers>::getROFrameClusters(int layerId) const
354{
355 return {&mROFramesClusters[layerId][0], static_cast<gsl::span<const int>::size_type>(mROFramesClusters[layerId].size())};
356}
357
358template <int NLayers>
359inline gsl::span<Cluster> TimeFrame<NLayers>::getClustersOnLayer(int rofId, int layerId)
360{
361 if (rofId < 0 || rofId >= getNrof(layerId)) {
362 return {};
363 }
364 int startIdx{mROFramesClusters[layerId][rofId]};
365 return {&mClusters[layerId][startIdx], static_cast<gsl::span<Cluster>::size_type>(mROFramesClusters[layerId][rofId + 1] - startIdx)};
366}
367
368template <int NLayers>
369inline gsl::span<const Cluster> TimeFrame<NLayers>::getClustersOnLayer(int rofId, int layerId) const
370{
371 if (rofId < 0 || rofId >= getNrof(layerId)) {
372 return {};
373 }
374 int startIdx{mROFramesClusters[layerId][rofId]};
375 return {&mClusters[layerId][startIdx], static_cast<gsl::span<const Cluster>::size_type>(mROFramesClusters[layerId][rofId + 1] - startIdx)};
376}
377
378template <int NLayers>
379inline gsl::span<uint8_t> TimeFrame<NLayers>::getUsedClustersROF(int rofId, int layerId)
380{
381 if (rofId < 0 || rofId >= getNrof(layerId)) {
382 return {};
383 }
384 int startIdx{mROFramesClusters[layerId][rofId]};
385 return {&mUsedClusters[layerId][startIdx], static_cast<gsl::span<uint8_t>::size_type>(mROFramesClusters[layerId][rofId + 1] - startIdx)};
386}
387
388template <int NLayers>
389inline gsl::span<const uint8_t> TimeFrame<NLayers>::getUsedClustersROF(int rofId, int layerId) const
390{
391 if (rofId < 0 || rofId >= getNrof(layerId)) {
392 return {};
393 }
394 int startIdx{mROFramesClusters[layerId][rofId]};
395 return {&mUsedClusters[layerId][startIdx], static_cast<gsl::span<const uint8_t>::size_type>(mROFramesClusters[layerId][rofId + 1] - startIdx)};
396}
397
398template <int NLayers>
399inline gsl::span<const Cluster> TimeFrame<NLayers>::getClustersPerROFrange(int rofMin, int range, int layerId) const
400{
401 if (rofMin < 0 || rofMin >= getNrof(layerId)) {
402 return {};
403 }
404 int startIdx{mROFramesClusters[layerId][rofMin]}; // First cluster of rofMin
405 int endIdx{mROFramesClusters[layerId][o2::gpu::CAMath::Min(rofMin + range, getNrof(layerId))]};
406 return {&mClusters[layerId][startIdx], static_cast<gsl::span<Cluster>::size_type>(endIdx - startIdx)};
407}
408
409template <int NLayers>
410inline gsl::span<const int> TimeFrame<NLayers>::getROFramesClustersPerROFrange(int rofMin, int range, int layerId) const
411{
412 int chkdRange{o2::gpu::CAMath::Min(range, getNrof(layerId) - rofMin)};
413 return {&mROFramesClusters[layerId][rofMin], static_cast<gsl::span<int>::size_type>(chkdRange)};
414}
415
416template <int NLayers>
417inline gsl::span<const int> TimeFrame<NLayers>::getNClustersROFrange(int rofMin, int range, int layerId) const
418{
419 int chkdRange{o2::gpu::CAMath::Min(range, getNrof(layerId) - rofMin)};
420 return {&mNClustersPerROF[layerId][rofMin], static_cast<gsl::span<int>::size_type>(chkdRange)};
421}
422
423template <int NLayers>
424inline int TimeFrame<NLayers>::getTotalClustersPerROFrange(int rofMin, int range, int layerId) const
425{
426 int startIdx{rofMin}; // First cluster of rofMin
427 int endIdx{o2::gpu::CAMath::Min(rofMin + range, getNrof(layerId))};
428 return mROFramesClusters[layerId][endIdx] - mROFramesClusters[layerId][startIdx];
429}
430
431template <int NLayers>
432inline int TimeFrame<NLayers>::getClusterROF(int iLayer, int iCluster)
433{
434 return std::lower_bound(mROFramesClusters[iLayer].begin(), mROFramesClusters[iLayer].end(), iCluster + 1) - mROFramesClusters[iLayer].begin() - 1;
435}
436
437template <int NLayers>
438inline gsl::span<const Cluster> TimeFrame<NLayers>::getUnsortedClustersOnLayer(int rofId, int layerId) const
439{
440 if (rofId < 0 || rofId >= getNrof(layerId)) {
441 return {};
442 }
443 int startIdx{mROFramesClusters[layerId][rofId]};
444 return {&mUnsortedClusters[layerId][startIdx], static_cast<gsl::span<Cluster>::size_type>(mROFramesClusters[layerId][rofId + 1] - startIdx)};
445}
446
447template <int NLayers>
448inline gsl::span<int> TimeFrame<NLayers>::getIndexTable(int rofId, int layer)
449{
450 if (rofId < 0 || rofId >= getNrof(layer)) {
451 return {};
452 }
453 const int tableSize = mIndexTableUtils.getNphiBins() * mIndexTableUtils.getNzBins() + 1;
454 return {&mIndexTables[layer][rofId * tableSize], static_cast<gsl::span<int>::size_type>(tableSize)};
455}
456
457template <int NLayers>
458template <typename... T>
460{
461 mUnsortedClusters[layer].emplace_back(std::forward<T>(values)...);
462}
463
464template <int NLayers>
465template <typename... T>
467{
468 mTrackingFrameInfo[layer].emplace_back(std::forward<T>(values)...);
469}
470
471template <int NLayers>
472inline gsl::span<uint8_t> TimeFrame<NLayers>::getUsedClusters(const int layer)
473{
474 return {&mUsedClusters[layer][0], static_cast<gsl::span<uint8_t>::size_type>(mUsedClusters[layer].size())};
475}
476
477template <int NLayers>
478inline gsl::span<int> TimeFrame<NLayers>::getNTrackletsCluster(int rofId, int combId)
479{
480 if (rofId < 0 || rofId >= getNrof(1)) {
481 return {};
482 }
483 auto startIdx{mROFramesClusters[1][rofId]};
484 return {&mNTrackletsPerCluster[combId][startIdx], static_cast<gsl::span<int>::size_type>(mROFramesClusters[1][rofId + 1] - startIdx)};
485}
486
487template <int NLayers>
488inline gsl::span<int> TimeFrame<NLayers>::getExclusiveNTrackletsCluster(int rofId, int combId)
489{
490 if (rofId < 0 || rofId >= getNrof(1)) {
491 return {};
492 }
493 auto clusStartIdx{mROFramesClusters[1][rofId]};
494
495 return {&mNTrackletsPerClusterSum[combId][clusStartIdx], static_cast<gsl::span<int>::size_type>(mROFramesClusters[1][rofId + 1] - clusStartIdx)};
496}
497
498template <int NLayers>
499inline gsl::span<Tracklet> TimeFrame<NLayers>::getFoundTracklets(int rofId, int combId)
500{
501 if (rofId < 0 || rofId >= getNrof(1) || mTracklets[combId].empty()) {
502 return {};
503 }
504 auto startIdx{mNTrackletsPerROF[combId][rofId]};
505 return {&mTracklets[combId][startIdx], static_cast<gsl::span<Tracklet>::size_type>(mNTrackletsPerROF[combId][rofId + 1] - startIdx)};
506}
507
508template <int NLayers>
509inline gsl::span<const Tracklet> TimeFrame<NLayers>::getFoundTracklets(int rofId, int combId) const
510{
511 if (rofId < 0 || rofId >= getNrof(1)) {
512 return {};
513 }
514 auto startIdx{mNTrackletsPerROF[combId][rofId]};
515 return {&mTracklets[combId][startIdx], static_cast<gsl::span<Tracklet>::size_type>(mNTrackletsPerROF[combId][rofId + 1] - startIdx)};
516}
517
518template <int NLayers>
519inline gsl::span<const MCCompLabel> TimeFrame<NLayers>::getLabelsFoundTracklets(int rofId, int combId) const
520{
521 if (rofId < 0 || rofId >= getNrof(1) || !hasMCinformation()) {
522 return {};
523 }
524 auto startIdx{mNTrackletsPerROF[combId][rofId]};
525 return {&mTrackletLabels[combId][startIdx], static_cast<gsl::span<Tracklet>::size_type>(mNTrackletsPerROF[combId][rofId + 1] - startIdx)};
526}
527
528template <int NLayers>
530{
531 size_t totalClusters{0};
532 for (const auto& clusters : mUnsortedClusters) {
533 totalClusters += clusters.size();
534 }
535 return int(totalClusters);
536}
537
538template <int NLayers>
540{
541 size_t nClusters{0};
542 for (const auto& layer : mClusters) {
543 nClusters += layer.size();
544 }
545 return nClusters;
546}
547
548template <int NLayers>
550{
551 size_t nCells{0};
552 for (const auto& layer : mCells) {
553 nCells += layer.size();
554 }
555 return nCells;
556}
557
558template <int NLayers>
560{
561 size_t nTracklets{0};
562 for (const auto& layer : mTracklets) {
563 nTracklets += layer.size();
564 }
565 return nTracklets;
566}
567
568template <int NLayers>
570{
571 size_t neigh{0};
572 for (const auto& l : mCellsNeighbours) {
573 neigh += l.size();
574 }
575 return neigh;
576}
577
578template <int NLayers>
580{
581 return mTracks.size();
582}
583
584template <int NLayers>
586{
587 size_t nClusters = 0;
588 for (const auto& layer : mUsedClusters) {
589 nClusters += std::count(layer.begin(), layer.end(), true);
590 }
591 return nClusters;
592}
593
594} // namespace its
595} // namespace o2
596
597#endif
uint64_t vertex
Definition RawEventData.h:9
Definition of a container to keep Monte Carlo truth external to simulation objects.
Definition of the ITS track.
int nClusters
A container to hold and manage MC truth information/labels.
HMPID cluster implementation.
Definition Cluster.h:27
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint entry
Definition glcorearb.h:5735
GLuint GLuint end
Definition glcorearb.h:469
const GLdouble * v
Definition glcorearb.h:832
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLenum GLint * range
Definition glcorearb.h:1899
GLint y
Definition glcorearb.h:270
GLenum GLsizei GLsizei GLint * values
Definition glcorearb.h:1576
GLuint GLsizei const GLchar * label
Definition glcorearb.h:2519
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
GLubyte GLubyte GLubyte GLubyte w
Definition glcorearb.h:852
std::pmr::vector< T > bounded_vector
std::pair< o2::MCCompLabel, float > VertexLabel
Definition Vertex.h:27
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void empty(int)
ROFVertexLookupTable< NLayers > ROFVertexLookupTableN
Definition TimeFrame.h:67
virtual size_t getNumberOfCells() const
Definition TimeFrame.h:549
void prepareClusters(const TrackingParameters &trkParam, const int maxLayers=NLayers)
std::vector< bounded_vector< Line > > mLines
Definition TimeFrame.h:310
auto & getPhiCuts()
Definition TimeFrame.h:118
std::vector< bounded_vector< int > > mTrackletsLookupTable
Definition TimeFrame.h:267
bounded_vector< int > mBogusClusters
Definition TimeFrame.h:304
std::array< float, NLayers > mMaxR
Definition TimeFrame.h:294
const TrackingFrameInfo & getClusterTrackingFrameInfo(int layerId, const Cluster &cl) const
virtual void setDevicePropagator(const o2::base::PropagatorImpl< float > *)
Definition TimeFrame.h:250
const auto & getROFVertexLookupTableView() const
Definition TimeFrame.h:144
size_t getNumberOfUsedClusters() const
Definition TimeFrame.h:585
std::array< bounded_vector< int >, NLayers > mIndexTables
Definition TimeFrame.h:266
ROFMaskTableN mUPCCutMask
Definition TimeFrame.h:325
gsl::span< const Cluster > getUnsortedClustersOnLayer(int rofId, int layerId) const
Definition TimeFrame.h:438
std::array< bounded_vector< int >, 2 > mNTrackletsPerClusterSum
Definition TimeFrame.h:264
size_t getNumberOfClusters() const
Definition TimeFrame.h:539
gsl::span< const Cluster > getClustersOnLayer(int rofId, int layerId) const
Definition TimeFrame.h:369
auto & getPositionResolutions()
Definition TimeFrame.h:120
bounded_vector< MCCompLabel > mTracksLabel
Definition TimeFrame.h:274
void useMultiplictyMask() noexcept
Definition TimeFrame.h:156
bool checkMemory(unsigned long max)
Definition TimeFrame.h:211
ROFMaskTableN * mROFMask
Definition TimeFrame.h:326
const auto & getTrackingFrameInfoOnLayer(int layerId) const
Definition TimeFrame.h:132
std::array< uint32_t, 2 > mTotalTracklets
Definition TimeFrame.h:314
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > pool)
memory management
size_t getNumberOfTracks() const
Definition TimeFrame.h:579
void resetBeamXY(const float x, const float y, const float w=0)
Definition TimeFrame.h:345
void computeTracletsPerClusterScans()
auto & getTrackletsLabel(int layer)
Definition TimeFrame.h:176
uint32_t mTotalLines
Definition TimeFrame.h:315
ROFOverlapTableN mROFOverlapTable
Definition TimeFrame.h:320
std::shared_ptr< BoundedMemoryResource > mExtMemoryPool
Definition TimeFrame.h:242
bounded_vector< TrackITSExt > mTracks
Definition TimeFrame.h:273
auto getFrameworkAllocator()
Definition TimeFrame.h:243
auto & getMSangles()
Definition TimeFrame.h:116
virtual size_t getNumberOfNeighbours() const
Definition TimeFrame.h:569
ROFVertexLookupTableN::View mROFVertexLookupTableView
Definition TimeFrame.h:323
gsl::span< Tracklet > getFoundTracklets(int rofId, int combId)
Definition TimeFrame.h:499
gsl::span< uint8_t > getUsedClustersROF(int rofId, int layerId)
Definition TimeFrame.h:379
std::array< const dataformats::MCTruthContainer< MCCompLabel > *, NLayers > mClusterLabels
Definition TimeFrame.h:262
float getPhiCut(int layer) const
Definition TimeFrame.h:117
std::vector< bounded_vector< CellSeed > > mCells
Definition TimeFrame.h:272
gsl::span< const MCCompLabel > getLabelsFoundTracklets(int rofId, int combId) const
Definition TimeFrame.h:519
void printArtefactsMemory() const
bool empty() const
Definition TimeFrame.h:95
void useUPCMask() noexcept
Definition TimeFrame.h:162
float getMSangle(int layer) const
Definition TimeFrame.h:115
float getBz() const
Definition TimeFrame.h:238
ROFOverlapTableN::View mROFOverlapTableView
Definition TimeFrame.h:321
gsl::span< const Tracklet > getFoundTracklets(int rofId, int combId) const
Definition TimeFrame.h:509
const Vertex & getPrimaryVertex(const int ivtx) const
Definition TimeFrame.h:75
virtual const char * getName() const noexcept
Definition TimeFrame.h:284
const o2::base::PropagatorImpl< float > * getDevicePropagator() const
Definition TimeFrame.h:249
gsl::span< const Cluster > getClustersPerROFrange(int rofMin, int range, int layerId) const
Definition TimeFrame.h:399
int getClusterSize(int layer, int clusterId) const
Definition TimeFrame.h:173
void updateROFVertexLookupTable()
Definition TimeFrame.h:150
float getBeamY() const
Definition TimeFrame.h:108
void setFrameworkAllocator(ExternalAllocator *ext)
void setClusterSize(int layer, bounded_vector< uint8_t > &v)
Definition TimeFrame.h:174
const auto & getIndexTableUtils() const
Definition TimeFrame.h:135
void addPrimaryVertexLabel(const VertexLabel &label)
Definition TimeFrame.h:82
bool hasFrameworkAllocator() const noexcept
Definition TimeFrame.h:245
bounded_vector< float > mMSangles
Definition TimeFrame.h:295
gsl::span< const int > getNClustersROFrange(int rofMin, int range, int layerId) const
Definition TimeFrame.h:417
int getSortedStartIndex(const int rofId, const int layer) const
Definition TimeFrame.h:97
auto & getUnsortedClusters()
Definition TimeFrame.h:190
const auto & getROFMaskView() const
Definition TimeFrame.h:167
void prepareROFrameData(gsl::span< const itsmft::CompClusterExt > clusters, int layer)
gsl::span< unsigned char > getUsedClusters(const int layer)
Definition TimeFrame.h:472
auto & getLines(int rofId)
Definition TimeFrame.h:222
void addClusterExternalIndexToLayer(int layer, const int idx)
Definition TimeFrame.h:256
virtual bool isGPU() const noexcept
Definition TimeFrame.h:283
const auto & getPrimaryVertices() const
Definition TimeFrame.h:78
void markUsedCluster(int layer, int clusterId)
Definition TimeFrame.h:183
gsl::span< int > getIndexTable(int rofId, int layerId)
Definition TimeFrame.h:448
void computeTrackletsPerROFScans()
const o2::base::PropagatorImpl< float > * mPropagatorDevice
Definition TimeFrame.h:278
std::vector< bounded_vector< MCCompLabel > > mLinesLabels
Definition TimeFrame.h:313
auto & getTracklets()
Definition TimeFrame.h:186
std::array< bounded_vector< TrackingFrameInfo >, NLayers > mTrackingFrameInfo
Definition TimeFrame.h:259
void addPrimaryVertex(const Vertex &vertex)
Definition TimeFrame.cxx:47
int getNrof(int layer) const
Definition TimeFrame.h:98
int hasBogusClusters() const
Definition TimeFrame.h:235
std::array< bounded_vector< uint8_t >, NLayers > mUsedClusters
Definition TimeFrame.h:268
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
std::vector< bounded_vector< int > > mCellsNeighbours
Definition TimeFrame.h:275
std::array< float, 2 > & getBeamXY()
Definition TimeFrame.h:109
auto & getCellsNeighbours()
Definition TimeFrame.h:195
void addTrackingFrameInfoToLayer(int layer, T &&... args)
Definition TimeFrame.h:466
std::vector< bounded_vector< MCCompLabel > > mTrackletLabels
PV x and alpha for track propagation.
Definition TimeFrame.h:301
ROFMaskTableN::View mROFMaskView
Definition TimeFrame.h:327
void resetROFrameData(int iLayer)
bounded_vector< float > mPhiCuts
Definition TimeFrame.h:296
void initialise(const int iteration, const TrackingParameters &trkParam, const int maxLayers=NLayers, bool resetVertices=true)
auto & getClusters()
Definition TimeFrame.h:189
int getSortedIndex(int rofId, int layer, int idx) const
Definition TimeFrame.h:96
auto & getCellsLookupTable()
Definition TimeFrame.h:194
std::array< float, 2 > mBeamPos
Definition TimeFrame.h:291
void setUPCCutMask(ROFMaskTableN cutMask)
Definition TimeFrame.h:161
float getBeamX() const
Definition TimeFrame.h:107
void setROFVertexLookupTable(ROFVertexLookupTableN table)
Definition TimeFrame.h:145
unsigned int mNTotalLowPtVertices
Definition TimeFrame.h:289
int getTotalClusters() const
Definition TimeFrame.h:529
virtual ~TimeFrame()=default
uint32_t getTotalTrackletsTF(const int iLayer)
Definition TimeFrame.h:231
std::vector< bounded_vector< int > > mNTrackletsPerROF
Definition TimeFrame.h:309
auto & getMemoryPool() const noexcept
Definition TimeFrame.h:210
gsl::span< const int > getROFramesClustersPerROFrange(int rofMin, int range, int layerId) const
Definition TimeFrame.h:410
ExternalAllocator * mExternalAllocator
State if memory will be externally managed by the GPU framework.
Definition TimeFrame.h:241
std::array< bounded_vector< int >, NLayers > mNClustersPerROF
Definition TimeFrame.h:265
int getClusterROF(int iLayer, int iCluster)
Definition TimeFrame.h:432
int getTotalClustersPerROFrange(int rofMin, int range, int layerId) const
Definition TimeFrame.h:424
auto getPrimaryVerticesNum()
Definition TimeFrame.h:77
std::array< bounded_vector< int >, 2 > mTrackletsIndexROF
Definition TimeFrame.h:312
virtual void wipe()
bounded_vector< float > mPositionResolution
Definition TimeFrame.h:297
std::array< bounded_vector< Cluster >, NLayers > mUnsortedClusters
Definition TimeFrame.h:270
std::vector< bounded_vector< Tracklet > > mTracklets
Definition TimeFrame.h:271
std::vector< bounded_vector< MCCompLabel > > mCellLabels
Definition TimeFrame.h:302
auto & getLinesLabel(const int rofId)
Definition TimeFrame.h:199
void setBeamPosition(const float x, const float y, const float s2, const float base=50.f, const float systematic=0.f)
Definition TimeFrame.h:101
std::vector< bounded_vector< ClusterLines > > mTrackletClusters
Definition TimeFrame.h:311
auto & getTracksLabel()
Definition TimeFrame.h:198
ROFMaskTableN mMultiplicityCutMask
Definition TimeFrame.h:324
auto & getPrimaryVertices()
Definition TimeFrame.h:76
std::vector< bounded_vector< int > > mCellsNeighboursLUT
Definition TimeFrame.h:303
gsl::span< const MCCompLabel > getClusterLabels(int layerId, const int clId) const
Definition TimeFrame.h:171
bounded_vector< VertexLabel > mPrimaryVerticesLabels
Definition TimeFrame.h:308
gsl::span< const uint8_t > getUsedClustersROF(int rofId, int layerId) const
Definition TimeFrame.h:389
virtual size_t getNumberOfTracklets() const
Definition TimeFrame.h:559
bool hasMCinformation() const
Definition TimeFrame.h:179
float getPositionResolution(int layer) const
Definition TimeFrame.h:119
std::array< bounded_vector< uint8_t >, NLayers > mClusterSize
Definition TimeFrame.h:298
gsl::span< const int > getROFrameClusters(int layerId) const
Definition TimeFrame.h:353
std::pmr::memory_resource * getMaybeFrameworkHostResource(bool forceHost=false)
Definition TimeFrame.h:246
std::array< bounded_vector< int >, NLayers > mClusterExternalIndices
Definition TimeFrame.h:260
auto & getCellsLabel(int layer)
Definition TimeFrame.h:177
std::shared_ptr< BoundedMemoryResource > mMemoryPool
Definition TimeFrame.h:331
float getMinR(int layer) const
Definition TimeFrame.h:113
const auto & getROFOverlapTableView() const
Definition TimeFrame.h:137
gsl::span< Cluster > getClustersOnLayer(int rofId, int layerId)
Definition TimeFrame.h:359
IndexTableUtilsN mIndexTableUtils
Definition TimeFrame.h:319
std::array< bounded_vector< int >, NLayers > mROFramesClusters
Definition TimeFrame.h:261
void setBz(float bz)
Definition TimeFrame.h:237
const auto & getROFVertexLookupTable() const
Definition TimeFrame.h:143
void setNLinesTotal(uint32_t a) noexcept
Definition TimeFrame.h:224
void addClusterToLayer(int layer, T &&... args)
Definition TimeFrame.h:459
unsigned long getArtefactsMemory() const
ROFOverlapTable< NLayers > ROFOverlapTableN
Definition TimeFrame.h:66
float getMaxR(int layer) const
Definition TimeFrame.h:114
gsl::span< const MCCompLabel > getClusterLabels(int layerId, const Cluster &cl) const
Definition TimeFrame.h:170
std::array< bounded_vector< Cluster >, NLayers > mClusters
Definition TimeFrame.h:258
std::vector< bounded_vector< int > > mCellsLookupTable
Definition TimeFrame.h:276
bool isBeamPositionOverridden
Definition TimeFrame.h:292
auto & getPrimaryVerticesLabels()
Definition TimeFrame.h:79
gsl::span< const Vertex > getPrimaryVertices(int layer, int rofId) const
Definition TimeFrame.h:335
void setIsStaggered(bool b) noexcept
staggering
Definition TimeFrame.h:216
int getNLinesTotal() const noexcept
Definition TimeFrame.h:223
auto & getTrackletClusters(int rofId)
Definition TimeFrame.h:225
bool isClusterUsed(int layer, int clusterId) const
Definition TimeFrame.h:182
bounded_vector< Vertex > mPrimaryVertices
keep track of clusters with wild coordinates
Definition TimeFrame.h:307
void setROFOverlapTable(ROFOverlapTableN table)
Definition TimeFrame.h:138
gsl::span< int > getExclusiveNTrackletsCluster(int rofId, int combId)
Definition TimeFrame.h:488
void setMultiplicityCutMask(ROFMaskTableN cutMask)
Definition TimeFrame.h:151
bounded_vector< std::array< float, 2 > > mPValphaX
Definition TimeFrame.h:300
auto & getTrackletsLookupTable()
Definition TimeFrame.h:187
ROFVertexLookupTableN mROFVertexLookupTable
Definition TimeFrame.h:322
ROFMaskTable< NLayers > ROFMaskTableN
Definition TimeFrame.h:68
int getClusterExternalIndex(int layerId, const int clId) const
Definition TimeFrame.h:172
std::array< float, NLayers > mMinR
Definition TimeFrame.h:293
const auto & getROFOverlapTable() const
Definition TimeFrame.h:136
int & getNTrackletsROF(int rofId, int combId)
Definition TimeFrame.h:221
gsl::span< int > getNTrackletsCluster(int rofId, int combId)
Definition TimeFrame.h:478
auto & getCellsNeighboursLUT()
Definition TimeFrame.h:196
std::array< bounded_vector< int >, 2 > mNTrackletsPerCluster
Definition TimeFrame.h:263
constexpr size_t max
std::vector< Cluster > clusters