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
25#include "ITStracking/Cell.h"
27
28// #define OPTIMISATION_OUTPUT
29
30namespace o2
31{
32namespace gpu
33{
34class GPUChainITS;
35}
36namespace its
37{
38class TrackITSExt;
39
40template <int NLayers>
42{
43 public:
46
47 virtual ~TrackerTraits() = default;
49 virtual void initialiseTimeFrame(const int iteration) { mTimeFrame->initialise(iteration, mTrkParams[iteration], mTrkParams[iteration].NLayers, false); }
50
51 virtual void computeLayerTracklets(const int iteration, int iVertex);
52 virtual void computeLayerCells(const int iteration);
53 virtual void findCellsNeighbours(const int iteration);
54 virtual void findRoads(const int iteration);
55
56 template <typename InputSeed>
57 void processNeighbours(int iteration, int iLayer, int iLevel, const bounded_vector<InputSeed>& currentCellSeed, const bounded_vector<int>& currentCellId, bounded_vector<TrackSeedN>& updatedCellSeed, bounded_vector<int>& updatedCellId);
58
59 void acceptTracks(int iteration, bounded_vector<TrackITSExt>& tracks, bounded_vector<bounded_vector<int>>& firstClusters, bounded_vector<bounded_vector<int>>& sharedFirstClusters);
60 void markTracks(int iteration, bounded_vector<bounded_vector<int>>& sharedFirstClusters);
61
62 void updateTrackingParameters(const std::vector<TrackingParameters>& trkPars)
63 {
64 mTrkParams = trkPars;
65 }
67
68 virtual void setBz(float bz);
69 float getBz() const { return mBz; }
70 virtual const char* getName() const noexcept { return "CPU"; }
71 virtual bool isGPU() const noexcept { return false; }
72 void setMemoryPool(std::shared_ptr<BoundedMemoryResource> pool) noexcept { mMemoryPool = pool; }
73 auto getMemoryPool() const noexcept { return mMemoryPool; }
74
75 // Others
76 void setNThreads(int n, std::shared_ptr<tbb::task_arena>& arena);
77 int getNThreads() { return mTaskArena->max_concurrency(); }
78
79 // TimeFrame information forwarding
80 virtual int getTFNumberOfClusters() const { return mTimeFrame->getNumberOfClusters(); }
81 virtual int getTFNumberOfTracklets() const { return mTimeFrame->getNumberOfTracklets(); }
82 virtual int getTFNumberOfCells() const { return mTimeFrame->getNumberOfCells(); }
83
84 private:
85 std::shared_ptr<BoundedMemoryResource> mMemoryPool;
86 std::shared_ptr<tbb::task_arena> mTaskArena;
87
88 protected:
91 std::vector<TrackingParameters> mTrkParams;
92
93 float mBz{-999.f};
94};
95
96} // namespace its
97} // namespace o2
98
99#endif /* TRACKINGITSU_INCLUDE_TRACKERTRAITS_H_ */
o2::gpu::GPUChainITS * mChain
TimeFrame< NLayers > * mTimeFrame
virtual void findRoads(const int iteration)
virtual const char * getName() const noexcept
void updateTrackingParameters(const std::vector< TrackingParameters > &trkPars)
virtual void initialiseTimeFrame(const int iteration)
void acceptTracks(int iteration, bounded_vector< TrackITSExt > &tracks, bounded_vector< bounded_vector< int > > &firstClusters, bounded_vector< bounded_vector< int > > &sharedFirstClusters)
TimeFrame< NLayers > * getTimeFrame()
virtual void adoptTimeFrame(TimeFrame< NLayers > *tf)
virtual int getTFNumberOfClusters() const
void markTracks(int iteration, bounded_vector< bounded_vector< int > > &sharedFirstClusters)
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
virtual int getTFNumberOfCells() const
void processNeighbours(int iteration, int iLayer, int iLevel, const bounded_vector< InputSeed > &currentCellSeed, const bounded_vector< int > &currentCellId, bounded_vector< TrackSeedN > &updatedCellSeed, bounded_vector< int > &updatedCellId)
virtual void computeLayerTracklets(const int iteration, int iVertex)
auto getMemoryPool() const noexcept
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