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 template <typename InputSeed>
75 void processNeighbours(int iteration, int defaultCellTopologyId, int iLevel, uint64_t capacityKey, const bounded_vector<InputSeed>& currentSeeds, bounded_vector<RoadSeedN>& updatedSeeds);
76
77 void acceptTracks(int iteration, bounded_vector<TrackITSExt>& tracks, const bounded_vector<int>& trackIndices, bounded_vector<bounded_vector<int>>& firstClusters);
78 void markTracks(int iteration);
79
80 void updateTrackingParameters(const std::vector<TrackingParameters>& trkPars)
81 {
82 mTrkParams = trkPars;
83 }
84
85 virtual void setBz(float bz);
86 float getBz() const { return mBz; }
87 virtual const char* getName() const noexcept { return "CPU"; }
88 virtual bool isGPU() const noexcept { return false; }
89 void setMemoryPool(std::shared_ptr<BoundedMemoryResource> pool) noexcept { mMemoryPool = pool; }
90 auto getMemoryPool() const noexcept { return mMemoryPool; }
91
92 // Others
93 void setNThreads(int n, std::shared_ptr<tbb::task_arena>& arena);
94 int getNThreads() { return mTaskArena->max_concurrency(); }
95
96 // TimeFrame information forwarding
97 virtual int getTFNumberOfClusters() const { return mTimeFrame->getNumberOfClusters(); }
98 virtual int getTFNumberOfTracklets() const { return mTimeFrame->getNumberOfTracklets(); }
99 virtual int getTFNumberOfCells() const { return mTimeFrame->getNumberOfCells(); }
100
101 private:
102 std::shared_ptr<BoundedMemoryResource> mMemoryPool;
103
104 protected:
105 std::shared_ptr<tbb::task_arena> mTaskArena;
106
116
117 bool finaliseTrackSeed(const TrackSeedN& seed,
118 TrackITSExt& track,
119 const int iteration,
120 const TrackingFrameInfo* const* tfInfos,
121 const Cluster* const* unsortedClusters,
122 const o2::base::Propagator* propagator,
123 const TrackFollowContext<NLayers>& followCtx,
124 TrackFollowerScratch& scratch);
125
128 std::vector<TrackingParameters> mTrkParams;
129
130 float mBz{-999.f};
131};
132
133} // namespace its
134} // namespace o2
135
136#endif /* TRACKINGITSU_INCLUDE_TRACKERTRAITS_H_ */
Cross-timeframe output-size prediction.
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 const char * getName() const noexcept
void updateTrackingParameters(const std::vector< TrackingParameters > &trkPars)
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
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
std::pmr::vector< T > bounded_vector
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