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