Project
Loading...
Searching...
No Matches
TrackerTraits.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.
15
16#ifndef TRACKINGITSU_INCLUDE_TRACKERTRAITS_H_
17#define TRACKINGITSU_INCLUDE_TRACKERTRAITS_H_
18
19#include <oneapi/tbb.h>
20#include <utility>
21#include <vector>
22
28#include "ITStracking/Cell.h"
33
34// #define OPTIMISATION_OUTPUT
35
36namespace o2
37{
38namespace gpu
39{
40class GPUChainITS;
41}
42namespace its
43{
44class TrackITSExt;
45
46template <int NLayers>
47struct RoadSeed {
51
52 RoadSeed() = default;
53 RoadSeed(TrackSeed<NLayers>&& inputSeed, int inputCellId, int inputCellTopologyId)
54 : seed{std::move(inputSeed)}, cellId{inputCellId}, cellTopologyId{inputCellTopologyId} {}
55};
56
57template <int NLayers>
59{
60 public:
64
65 virtual ~TrackerTraits() = default;
67 virtual void initialiseTimeFrame(const int iteration);
68
69 virtual void computeLayerTracklets(const int iteration, int iVertex);
70 virtual void computeLayerCells(const int iteration);
71 virtual void findCellsNeighbours(const int iteration);
72 virtual void findRoads(const int iteration);
73
74 virtual void computeVertexCandidates(const int iteration);
75 virtual void computeBeamFromVertices(const int iteration);
76 virtual void computeVertices(const int iteration);
77
78 template <typename InputSeed>
79 void processNeighbours(int iteration, int defaultCellTopologyId, int iLevel, uint64_t capacityKey, const bounded_vector<InputSeed>& currentSeeds, bounded_vector<RoadSeedN>& updatedSeeds);
80
81 void acceptTracks(int iteration, bounded_vector<TrackITSExt>& tracks, const bounded_vector<int>& trackIndices, bounded_vector<bounded_vector<int>>& firstClusters);
82 void markTracks(int iteration);
83
84 void updateTrackingParameters(const std::vector<TrackingParameters>& trkPars)
85 {
86 mTrkParams = trkPars;
87 }
88
89 virtual void setBz(float bz);
90 float getBz() const { return mBz; }
91 virtual const char* getName() const noexcept { return "CPU"; }
92 virtual bool isGPU() const noexcept { return false; }
93 void setMemoryPool(std::shared_ptr<BoundedMemoryResource> pool) noexcept { mMemoryPool = pool; }
94 auto getMemoryPool() const noexcept { return mMemoryPool; }
95
96 // Others
97 void setNThreads(int n, std::shared_ptr<tbb::task_arena>& arena);
98 int getNThreads() { return mTaskArena->max_concurrency(); }
99
100 // TimeFrame information forwarding
101 virtual int getTFNumberOfClusters() const { return mTimeFrame->getNumberOfClusters(); }
102 virtual int getTFNumberOfTracklets() const { return mTimeFrame->getNumberOfTracklets(); }
103 virtual int getTFNumberOfCells() const { return mTimeFrame->getNumberOfCells(); }
104
105 private:
106 bool skipROF(int iteration, int rof) const; // seeding-vertex pass: skip ROFs above the per-ROF vertex threshold
107
108 std::shared_ptr<BoundedMemoryResource> mMemoryPool;
109
110 protected:
111 std::shared_ptr<tbb::task_arena> mTaskArena;
112
115 : activeHypotheses(memoryResource), nextHypotheses(memoryResource)
116 {
117 }
118
119 bounded_vector<TrackExtensionHypothesis<NLayers>> activeHypotheses;
120 bounded_vector<TrackExtensionHypothesis<NLayers>> nextHypotheses;
121 };
122
123 bool finaliseTrackSeed(const TrackSeedN& seed,
124 TrackITSExt& track,
125 const int iteration,
126 const TrackingFrameInfo* const* tfInfos,
127 const Cluster* const* unsortedClusters,
128 const o2::base::Propagator* propagator,
129 const TrackFollowContext<NLayers>& followCtx,
130 TrackFollowerScratch& scratch);
131
134 std::vector<TrackingParameters> mTrkParams;
135
136 float mBz{-999.f};
137};
138
139} // namespace its
140} // namespace o2
141
142#endif /* TRACKINGITSU_INCLUDE_TRACKERTRAITS_H_ */
Cross-timeframe output-size prediction.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
Shared budgeted host allocation and bounded-vector utilities.
std::vector< o2::its::TrackITS > tracks
Hypothesis search used by CPU and GPU track extension.
o2::gpu::GPUChainITS * mChain
void markTracks(int iteration)
TimeFrame< NLayers > * mTimeFrame
virtual void findRoads(const int iteration)
virtual void computeVertices(const int iteration)
virtual const char * getName() const noexcept
void updateTrackingParameters(const std::vector< TrackingParameters > &trkPars)
virtual void computeVertexCandidates(const int iteration)
virtual void adoptTimeFrame(TimeFrame< NLayers > *tf)
virtual int getTFNumberOfClusters() const
virtual void findCellsNeighbours(const int iteration)
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > pool) noexcept
virtual int getTFNumberOfTracklets() const
TrackSeed< NLayers > TrackSeedN
virtual void computeLayerCells(const int iteration)
virtual void initialiseTimeFrame(const int iteration)
void processNeighbours(int iteration, int defaultCellTopologyId, int iLevel, uint64_t capacityKey, const bounded_vector< InputSeed > &currentSeeds, bounded_vector< RoadSeedN > &updatedSeeds)
std::vector< TrackingParameters > mTrkParams
virtual void setBz(float bz)
void setNThreads(int n, std::shared_ptr< tbb::task_arena > &arena)
virtual bool isGPU() const noexcept
void acceptTracks(int iteration, bounded_vector< TrackITSExt > &tracks, const bounded_vector< int > &trackIndices, bounded_vector< bounded_vector< int > > &firstClusters)
std::shared_ptr< tbb::task_arena > mTaskArena
virtual void computeBeamFromVertices(const int iteration)
bool finaliseTrackSeed(const TrackSeedN &seed, TrackITSExt &track, const int iteration, const TrackingFrameInfo *const *tfInfos, const Cluster *const *unsortedClusters, const o2::base::Propagator *propagator, const TrackFollowContext< NLayers > &followCtx, TrackFollowerScratch &scratch)
virtual int getTFNumberOfCells() const
virtual void computeLayerTracklets(const int iteration, int iVertex)
auto getMemoryPool() const noexcept
virtual ~TrackerTraits()=default
GLdouble n
Definition glcorearb.h:1982
constexpr int UnusedIndex
Definition Constants.h:32
const float const float const float bz
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< GPUReconstructionTimeframe > tf
TrackSeed< NLayers > seed
RoadSeed()=default
RoadSeed(TrackSeed< NLayers > &&inputSeed, int inputCellId, int inputCellTopologyId)
bounded_vector< TrackExtensionHypothesis< NLayers > > activeHypotheses
TrackFollowerScratch(std::pmr::memory_resource *memoryResource)
bounded_vector< TrackExtensionHypothesis< NLayers > > nextHypotheses