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 <vector>
21
26#include "ITStracking/Cell.h"
30
31// #define OPTIMISATION_OUTPUT
32
33namespace o2
34{
35namespace gpu
36{
37class GPUChainITS;
38}
39namespace its
40{
41class TrackITSExt;
42
43template <int NLayers>
45{
46 public:
49
50 virtual ~TrackerTraits() = default;
52 virtual void initialiseTimeFrame(const int iteration) { mTimeFrame->initialise(mTrkParams[iteration], mTrkParams[iteration].NLayers, iteration); }
53
54 virtual void computeLayerTracklets(const int iteration, int iVertex);
55 virtual void computeLayerCells(const int iteration);
56 virtual void findCellsNeighbours(const int iteration);
57 virtual void findRoads(const int iteration);
58
59 template <typename InputSeed>
60 void processNeighbours(int iteration, int defaultCellTopologyId, int iLevel, const bounded_vector<InputSeed>& currentCellSeed, const bounded_vector<int>& currentCellId, const bounded_vector<int>& currentCellTopologyId, bounded_vector<TrackSeedN>& updatedCellSeed, bounded_vector<int>& updatedCellId, bounded_vector<int>& updatedCellTopologyId);
61
62 void acceptTracks(int iteration, bounded_vector<TrackITSExt>& tracks, const bounded_vector<int>& trackIndices, bounded_vector<bounded_vector<int>>& firstClusters);
63 void markTracks(int iteration);
64
65 void updateTrackingParameters(const std::vector<TrackingParameters>& trkPars)
66 {
67 mTrkParams = trkPars;
68 }
70
71 virtual void setBz(float bz);
72 float getBz() const { return mBz; }
73 virtual const char* getName() const noexcept { return "CPU"; }
74 virtual bool isGPU() const noexcept { return false; }
75 void setMemoryPool(std::shared_ptr<BoundedMemoryResource> pool) noexcept { mMemoryPool = pool; }
76 auto getMemoryPool() const noexcept { return mMemoryPool; }
77
78 // Others
79 void setNThreads(int n, std::shared_ptr<tbb::task_arena>& arena);
80 int getNThreads() { return mTaskArena->max_concurrency(); }
81
82 // TimeFrame information forwarding
83 virtual int getTFNumberOfClusters() const { return mTimeFrame->getNumberOfClusters(); }
84 virtual int getTFNumberOfTracklets() const { return mTimeFrame->getNumberOfTracklets(); }
85 virtual int getTFNumberOfCells() const { return mTimeFrame->getNumberOfCells(); }
86
87 private:
88 std::shared_ptr<BoundedMemoryResource> mMemoryPool;
89 std::shared_ptr<tbb::task_arena> mTaskArena;
90
91 protected:
101
102 bool finaliseTrackSeed(const TrackSeedN& seed,
103 TrackITSExt& track,
104 const int iteration,
105 const TrackingFrameInfo* const* tfInfos,
106 const Cluster* const* unsortedClusters,
107 const o2::base::Propagator* propagator);
108
111 std::vector<TrackingParameters> mTrkParams;
112
113 float mBz{-999.f};
114};
115
116} // namespace its
117} // namespace o2
118
119#endif /* TRACKINGITSU_INCLUDE_TRACKERTRAITS_H_ */
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)
void processNeighbours(int iteration, int defaultCellTopologyId, int iLevel, const bounded_vector< InputSeed > &currentCellSeed, const bounded_vector< int > &currentCellId, const bounded_vector< int > &currentCellTopologyId, bounded_vector< TrackSeedN > &updatedCellSeed, bounded_vector< int > &updatedCellId, bounded_vector< int > &updatedCellTopologyId)
virtual void initialiseTimeFrame(const int iteration)
TimeFrame< NLayers > * getTimeFrame()
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
virtual void computeLayerCells(const int iteration)
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)
virtual int getTFNumberOfCells() const
virtual void computeLayerTracklets(const int iteration, int iVertex)
auto getMemoryPool() const noexcept
bool finaliseTrackSeed(const TrackSeedN &seed, TrackITSExt &track, const int iteration, const TrackingFrameInfo *const *tfInfos, const Cluster *const *unsortedClusters, const o2::base::Propagator *propagator)
virtual ~TrackerTraits()=default
GLdouble n
Definition glcorearb.h:1982
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
bounded_vector< TrackExtensionHypothesis< NLayers > > activeHypotheses
TrackFollowerScratch(std::pmr::memory_resource *memoryResource)
bounded_vector< TrackExtensionHypothesis< NLayers > > nextHypotheses