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 ALICEO2_ITSMFT_TRACKING_TRACKERTRAITS_H_
17#define ALICEO2_ITSMFT_TRACKING_TRACKERTRAITS_H_
18
19#include <array>
20#include <optional>
21#include <utility>
22#include <vector>
23
24#include <gsl/span>
25#include <oneapi/tbb.h>
26
37
39{
40
41struct TrackerTestAccess;
42
44 int iteration{-1};
50 // Borrows the caller's span sequence and the frame's measurements. Both must
51 // outlive this synchronous traversal; loading/resetting the frame invalidates it.
52 gsl::span<const gsl::span<const GlobalMeasurement>> layerGlobalMeasurements;
53 float bz{0.f};
54
55 IterationContext(int iterationValue, TimeFrame& frameValue, TimeFrameScratch& scratchValue,
56 TraversalTopologyView topologyValue, const IterationConfiguration& configurationValue,
57 gsl::span<const gsl::span<const GlobalMeasurement>> layerGlobalMeasurementsValue,
58 float bzValue)
59 : iteration{iterationValue}, frame{frameValue}, scratch{scratchValue}, topology{topologyValue}, detectorConfiguration{frameValue.getDetectorConfiguration()}, configuration{configurationValue}, layerGlobalMeasurements{layerGlobalMeasurementsValue}, bz{bzValue}
60 {
61 }
62};
63
64// Backend implementation of a traversal supplied explicitly by Tracker.
66{
67 public:
68 virtual ~TrackerTraits() = default;
69 // The production caller supplies all event and iteration state explicitly.
71
72 virtual const char* getName() const noexcept { return "CPU"; }
73 virtual bool isGPU() const noexcept { return false; }
74 void setNThreads(int n, std::shared_ptr<tbb::task_arena>& arena);
75 int getNThreads() { return mTaskArena->max_concurrency(); }
76
77 private:
78 friend struct TrackerTestAccess;
79
80 void acceptTracks(IterationContext& context, int iteration,
82 bounded_vector<bounded_vector<int>>& firstClusters);
83
84 // Tracklet and cell enumeration are common; coordinate selection is owned
85 // by their operation leaves.
86 void computeLayerTracklets(IterationContext& context, int iteration, int iVertex);
87 void computeLayerCells(IterationContext& context, int iteration);
88 void findCellsNeighbours(IterationContext& context, int iteration);
89
90 void findRoads(IterationContext& context, int iteration);
91
92 bool buildTrackSeed(IterationContext& context, int cellPathId,
93 const Triplet& cell, TrackSeed& output) const;
94
95 struct RoadSeedEmission;
96
97 // Neighbour processing helper; it does not encode a detector layer count.
98 template <typename InputSeed>
99 void processNeighbours(IterationContext& context, int iteration, CellPathId startingPath,
100 int defaultCellPathId, int startLevel, int currentLevel,
101 const bounded_vector<InputSeed>& currentSeeds,
104
105 std::shared_ptr<tbb::task_arena> mTaskArena;
106};
107
108} // namespace o2::itsmft::tracking
109
110#endif /* ALICEO2_ITSMFT_TRACKING_TRACKERTRAITS_H_ */
Shared CA tracking configuration for ITS and MFT.
Passive common TimeFrame owner.
std::vector< o2::its::TrackITS > tracks
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
Runtime-plan-owned, detector-neutral CA workspace.
GPU-portable whole-track seed for common CA tracking.
void runTraversal(IterationContext &view)
virtual bool isGPU() const noexcept
virtual const char * getName() const noexcept
void setNThreads(int n, std::shared_ptr< tbb::task_arena > &arena)
GLdouble n
Definition glcorearb.h:1982
GLenum const GLfloat * params
Definition glcorearb.h:272
uint32_t trackClusterIndicesSize noexcept
std::pmr::vector< T > bounded_vector
gsl::span< const gsl::span< const GlobalMeasurement > > layerGlobalMeasurements
IterationContext(int iterationValue, TimeFrame &frameValue, TimeFrameScratch &scratchValue, TraversalTopologyView topologyValue, const IterationConfiguration &configurationValue, gsl::span< const gsl::span< const GlobalMeasurement > > layerGlobalMeasurementsValue, float bzValue)
const DetectorConfiguration & detectorConfiguration
const IterationConfiguration & configuration