-
Notifications
You must be signed in to change notification settings - Fork 508
Expand file tree
/
Copy pathTrackerTraits.h
More file actions
99 lines (80 loc) · 3.5 KB
/
Copy pathTrackerTraits.h
File metadata and controls
99 lines (80 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
///
/// \file TrackerTraits.h
/// \brief
///
#ifndef TRACKINGITSU_INCLUDE_TRACKERTRAITS_H_
#define TRACKINGITSU_INCLUDE_TRACKERTRAITS_H_
#include <oneapi/tbb.h>
#include "ITStracking/Configuration.h"
#include "ITStracking/IndexTableUtils.h"
#include "ITStracking/TimeFrame.h"
#include "ITStracking/Cell.h"
#include "ITStracking/BoundedAllocator.h"
// #define OPTIMISATION_OUTPUT
namespace o2
{
namespace gpu
{
class GPUChainITS;
}
namespace its
{
class TrackITSExt;
template <int NLayers>
class TrackerTraits
{
public:
using IndexTableUtilsN = IndexTableUtils<NLayers>;
using TrackSeedN = TrackSeed<NLayers>;
virtual ~TrackerTraits() = default;
virtual void adoptTimeFrame(TimeFrame<NLayers>* tf) { mTimeFrame = tf; }
virtual void initialiseTimeFrame(const int iteration) { mTimeFrame->initialise(mTrkParams[iteration], mTrkParams[iteration].NLayers, iteration); }
virtual void computeLayerTracklets(const int iteration, int iVertex);
virtual void computeLayerCells(const int iteration);
virtual void findCellsNeighbours(const int iteration);
virtual void findRoads(const int iteration);
template <typename InputSeed>
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);
void acceptTracks(int iteration, bounded_vector<TrackITSExt>& tracks, bounded_vector<bounded_vector<int>>& firstClusters);
void markTracks(int iteration);
void updateTrackingParameters(const std::vector<TrackingParameters>& trkPars)
{
mTrkParams = trkPars;
}
TimeFrame<NLayers>* getTimeFrame() { return mTimeFrame; }
virtual void setBz(float bz);
float getBz() const { return mBz; }
virtual const char* getName() const noexcept { return "CPU"; }
virtual bool isGPU() const noexcept { return false; }
void setMemoryPool(std::shared_ptr<BoundedMemoryResource> pool) noexcept { mMemoryPool = pool; }
auto getMemoryPool() const noexcept { return mMemoryPool; }
// Others
void setNThreads(int n, std::shared_ptr<tbb::task_arena>& arena);
int getNThreads() { return mTaskArena->max_concurrency(); }
// TimeFrame information forwarding
virtual int getTFNumberOfClusters() const { return mTimeFrame->getNumberOfClusters(); }
virtual int getTFNumberOfTracklets() const { return mTimeFrame->getNumberOfTracklets(); }
virtual int getTFNumberOfCells() const { return mTimeFrame->getNumberOfCells(); }
private:
std::shared_ptr<BoundedMemoryResource> mMemoryPool;
std::shared_ptr<tbb::task_arena> mTaskArena;
protected:
void createTrackletMC();
o2::gpu::GPUChainITS* mChain{nullptr};
TimeFrame<NLayers>* mTimeFrame{nullptr};
std::vector<TrackingParameters> mTrkParams;
float mBz{constants::UnsetValue};
};
} // namespace its
} // namespace o2
#endif /* TRACKINGITSU_INCLUDE_TRACKERTRAITS_H_ */