13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
39 static constexpr int MaxLinks = TrackingTopologyN::MaxLinks;
40 static constexpr int MaxCells = TrackingTopologyN::MaxCells;
41 static constexpr int MaxStreams = MaxCells > NLayers ? MaxCells : NLayers;
121 virtual
bool isGPU() const noexcept final {
return true; }
122 virtual const char*
getName() const noexcept override final {
return "GPU"; }
183 const bounded_vector<o2::MCCompLabel>&
getLineLabelFlat()
const {
return mLineLabelFlatHost; }
228 enum class SlotInit {
233 template <
typename T>
235 template <
typename T>
237 template <
typename SlotPtr>
238 SlotPtr* allocSlotArray(
size_t n);
239 template <
typename T>
240 void copyToDevice(T*
dst,
const T*
src,
size_t n);
241 template <
typename T>
242 void copyFromDevice(T*
dst,
const T*
src,
size_t n);
243 template <
typename T,
typename ArrayT>
244 void publishSlot(ArrayT deviceArray,
int slot, T*
const& devicePtr,
Stream&);
245 template <
typename T,
size_t N,
typename ArrayT>
247 template <
typename T,
size_t N,
typename ArrayT,
typename Container>
248 void uploadSlot(std::array<T*, N>& slots, ArrayT deviceArray,
int slot,
const Container& host,
const char* what);
249 template <
typename ArrayT,
typename T,
size_t N>
250 void createPinnedSlotArray(ArrayT& deviceArray, std::array<T*, N>& slots, std::bitset<NLayers + 1>& pinned);
251 template <
typename Layers>
252 void pinHostLayers(Layers& layers, std::bitset<NLayers + 1>& pinned,
int maxLayers);
253 template <
typename Table>
254 typename Table::View uploadNavigationTable(
const Table& table,
const typename Table::View& hostView);
257 std::array<int, MaxLinks> mNTracklets{};
258 std::array<int, MaxCells> mNCells{};
259 std::array<int, MaxCells> mNNeighbours{};
263 float* mIterationParametersDevice{
nullptr};
264 const float* mLayerRadiiDevice{
nullptr};
265 const float* mMinPtsDevice{
nullptr};
266 const float* mLayerxX0Device{
nullptr};
268 ROFOverlapTableN::View mDeviceROFOverlapTableView;
269 ROFVertexLookupTableN::View mDeviceROFVertexLookupTableView;
270 ROFMaskTableN::View mDeviceROFMaskTableView;
271 std::vector<typename TrackingTopologyN::View> mDeviceTrackerTopologyViews;
272 typename TrackingTopologyN::View mDeviceTrackingTopologyView;
275 Vertex* mPrimaryVerticesDevice{
nullptr};
276 std::array<Cluster*, NLayers> mClustersDevice{};
277 std::array<Cluster*, NLayers> mUnsortedClustersDevice{};
278 std::array<int*, NLayers> mClustersIndexTablesDevice{};
279 std::array<unsigned char*, NLayers> mUsedClustersDevice{};
280 std::array<int*, NLayers> mROFramesClustersDevice{};
281 const Cluster** mClustersDeviceArray{
nullptr};
282 const Cluster** mUnsortedClustersDeviceArray{
nullptr};
283 const int** mClustersIndexTablesDeviceArray{
nullptr};
284 uint8_t** mUsedClustersDeviceArray{
nullptr};
285 const int** mROFramesClustersDeviceArray{
nullptr};
286 int* mROFramesPVDevice;
287 std::array<int*, NLayers> mClusterSortKeysDevice{};
288 std::array<int*, NLayers> mClusterSortPermDevice{};
289 float* mClusterMinRDevice{
nullptr};
290 float* mClusterMaxRDevice{
nullptr};
291 std::array<Tracklet*, MaxLinks> mTrackletsDevice{};
292 std::array<int*, MaxLinks> mTrackletsLUTDevice{};
293 std::array<int*, MaxCells> mCellsLUTDevice{};
294 std::array<int*, MaxCells> mNeighboursLUTDevice{};
296 Tracklet** mTrackletsDeviceArray{
nullptr};
297 int** mCellsLUTDeviceArray{
nullptr};
298 int** mNeighboursCellLUTDeviceArray{
nullptr};
299 int** mTrackletsLUTDeviceArray{
nullptr};
300 std::array<CellSeed*, MaxCells> mCellsDevice{};
301 CellSeed** mCellsDeviceArray{
nullptr};
303 int* mTrackSeedIndicesDevice{
nullptr};
304 int* mTrackCounterDevice{
nullptr};
305 unsigned int mNTracks{0};
307 TrackITSExt* mTrackITSExtDevice{
nullptr};
308 int* mTrackIndicesDevice{
nullptr};
309 TrackExtensionHypothesis<NLayers>* mActiveTrackExtensionHypothesesDevice{
nullptr};
310 TrackExtensionHypothesis<NLayers>* mNextTrackExtensionHypothesesDevice{
nullptr};
311 std::array<CellNeighbour*, MaxCells> mNeighboursDevice{};
312 CellNeighbour** mNeighboursDeviceArray{
nullptr};
313 std::array<TrackingFrameInfo*, NLayers> mTrackingFrameInfoDevice{};
314 const TrackingFrameInfo** mTrackingFrameInfoDeviceArray{
nullptr};
315 std::array<unsigned long long*, 3> mClusterOwnersDevice{};
316 unsigned long long** mClusterOwnersDeviceArray{
nullptr};
317 int* mLineSlotsDevice{
nullptr};
319 int* mLineRofDevice{
nullptr};
320 int* mLineClustersDevice{
nullptr};
321 float* mLineChi2Device{
nullptr};
322 float* mLinePtDevice{
nullptr};
323 float* mLineZsDevice{
nullptr};
325 float* mLineZsSortedDevice{
nullptr};
327 int* mLinesSortedIdx{
nullptr};
328 int* mLineRofSortedDevice{
nullptr};
329 int* mRofLineOffsetsDevice{
nullptr};
330 int* mLineDensityDevice{
nullptr};
332 uint8_t* mLineIsPeakDevice{
nullptr};
333 int* mLineDensityFineDevice{
nullptr};
335 uint8_t* mLineIsPeakFineDevice{
nullptr};
336 int* mPeakScanDevice{
nullptr};
337 int* mPeakLineIdxDevice{
nullptr};
338 int* mPeakOffsetsDevice{
nullptr};
339 VertexCand* mVertexCandsDevice{
nullptr};
340 int mNLinesCapacity{0};
341 bounded_vector<o2::its::Line> mLinesHost;
342 bounded_vector<int> mLineRofHost;
343 bounded_vector<int> mLineClustersHost;
344 bounded_vector<VertexCand> mVertexCandsHost;
345 bounded_vector<int> mPeakOffsetsHost;
346 bounded_vector<o2::MCCompLabel> mLineLabelFlatHost;
347 PeakMembershipHost mPeakMembershipHost;
348 Vertex* mDiamondDevice{
nullptr};
352 std::bitset<NLayers + 1> mPinnedUnsortedClusters{0};
353 std::bitset<NLayers + 1> mPinnedClusters{0};
354 std::bitset<NLayers + 1> mPinnedClustersIndexTables{0};
355 std::bitset<NLayers + 1> mPinnedUsedClusters{0};
356 std::bitset<NLayers + 1> mPinnedROFramesClusters{0};
357 std::bitset<NLayers + 1> mPinnedTrackingFrameInfo{0};
360 bounded_vector<TrackITSExt> mTrackITSExt;
361 bounded_vector<int> mTrackIndices;
364template <
int NLayers>
367 std::vector<unsigned int>
sizes(this->mUnsortedClusters.size());
368 std::transform(this->mUnsortedClusters.begin(), this->mUnsortedClusters.end(),
sizes.begin(),
369 [](
const auto&
v) { return static_cast<unsigned int>(v.size()); });
373template <
int NLayers>
376 return std::accumulate(mNTracklets.begin(), mNTracklets.begin() + this->mTrackingTopologyView.nLinks, 0);
379template <
int NLayers>
382 return std::accumulate(mNCells.begin(), mNCells.begin() + this->mTrackingTopologyView.nCells, 0);
385template <
int NLayers>
388 return std::accumulate(mNNeighbours.begin(), mNNeighbours.begin() + this->mTrackingTopologyView.nCells, 0);
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
Shared budgeted host allocation and bounded-vector utilities.
small types shared by the host and device seeding vertexers, describing lines projected onto the beam...
HMPID cluster implementation.
CellSeed: connections of three clusters.
unsigned int downloadLinesDevice()
gsl::span< Tracklet * > getDeviceTracklets()
int * getDeviceClustersIndexTable(const int layer)
size_t getNumberOfTracklets() const final
virtual const char * getName() const noexcept override final
virtual bool isGPU() const noexcept final
interface
void downloadTrackITSExtDevice()
void createUsedClustersDevice(const int)
int * getDeviceROFramesClusters(const int layer)
void createClusterRadiiDevice()
void loadROFOverlapTable()
uint8_t * getDeviceLineIsPeak()
void prepareClusters(const TrackingParameters &trkParam, const int maxLayers) override
void createClustersIndexTables(const int)
int * getDevicePeakScan()
void createCellsLUTDeviceArray()
TrackExtensionHypothesis< NLayers > * getDeviceActiveTrackExtensionHypotheses()
const int * getDeviceNPeaks()
void pushMemoryStack(const int)
Most relevant operations.
int * getDeviceLineSlots()
int * getDeviceLineSortedIdx()
void createROFrameClustersDeviceArray(const int=NLayers)
const float * getDeviceMinRs() const
void loadTrackingTopologies()
int * getDeviceClusterSortPerm(const int layer)
const auto getDeviceROFOverlapTableView()
LineProjSoA getLineProjSoA()
void loadClustersIndexTables(const int)
TrackITSExt * getDeviceTrackITSExt()
void unregisterHostMemory()
TrackSeedN * getDeviceTrackSeeds()
int * getDeviceTrackIndices()
void createTrackletsBuffers(const int, size_t capacity)
void downloadPeakMembershipInputs()
void initialise(const TrackingParameters &, int maxLayers, int iteration)
float * getDeviceLinePt()
const auto & getHostLines() const
const auto getDeviceROFMaskTableView()
unsigned char * getDeviceUsedClusters(const int)
virtual void wipe() final
cleanup
void createTrackITSExtHost(const size_t nTracks)
size_t getNumberOfNeighbours() const final
void createTrackletsLUTDevice(bool, const int)
gpu::LineWindow * getDeviceLineWin()
uint8_t ** getDeviceArrayUsedClusters() const
const auto & getHostLineClusters() const
const int ** getDeviceArrayClustersIndexTables() const
const float * getDeviceMinPts() const
void createTrackExtensionScratchDevice(const int nThreads, const int maxHypotheses)
gpu::LineWindow * getDeviceLineWinFine()
void recordEvent(const int)
int ** getDeviceArrayCellsLUT() const
auto getNTrackSeeds() const
CellSeed ** getDeviceArrayCells()
gsl::span< CellSeed * > getDeviceCells()
Vertex * getDeviceVertices()
int * getDeviceTrackCounter()
o2::its::Line * getDeviceLines()
const auto getDeviceTrackingTopologyView() const
void waitEvent(const int, const int)
gsl::span< int * > getDeviceTrackletsLUTs()
void popMemoryStack(const int)
void createCellsBuffers(const int, size_t capacity)
void syncStreams(const bool=true)
void createTrackletsBuffersArray()
int * getDeviceTrackSeedIndices()
int * getDeviceLineClusters()
~TimeFrameGPU() override=default
int * getDeviceNeighboursLUT(const int layer)
const int ** getDeviceROFrameClusters() const
uint8_t * getDeviceLineIsPeakFine()
int * getDeviceROFramesPV()
int * getDeviceLineDensityFine()
VertexCand * getDeviceVertexCands()
void loadTrackingFrameInfoDevice(const int)
int * getDeviceLineDensity()
void createUnsortedClustersDeviceArray(const int=NLayers)
o2::its::TimeEstBC * getDeviceLineTimes()
const auto getDeviceROFVertexLookupTableView()
Tracklet ** getDeviceArrayTracklets()
void createClustersDevice(const int)
size_t getNumberOfCells() const final
float * getDeviceLineZs()
auto & getStream(const size_t stream)
synchronization
void createTrackingFrameInfoDeviceArray(const int=NLayers)
Cluster * getDeviceUnsortedClusters(const int layer)
LineProjSoA getLineProjSortedSoA()
const auto & getHostLineRof() const
const auto & getHostPeakOffsets() const
void loadUnsortedClustersDevice(const int)
void createDiamondDevice(const Vertex &diamond)
const float * getDeviceLayerxX0() const
Cluster * getDeviceClusters(const int layer)
void createTrackletsLUTDeviceArray()
void loadROFCutMask(const int)
void createClustersDeviceArray(const int=NLayers)
void createCellsLUTDevice(const int)
void sortClustersDevice(const int layer, const TrackingParameters &trkParam)
const Cluster ** getDeviceArrayUnsortedClusters() const
void uploadClusterRadii()
void loadIterationParameters(const TrackingParameters &)
int * getDeviceClusterSortKeys(const int layer)
CellNeighbour ** getDeviceArrayNeighbours()
CellNeighbour * getDeviceNeighbours(const int layer)
void createCellsBuffersArray()
void resetClusterOwnersDevice()
const auto & getHostPeakMembership() const
void uploadROFVertexLookupTable()
void setDevicePropagator(const o2::base::PropagatorImpl< float > *p) final
void createTrackITSExtDevice(const size_t capacity)
int ** getDeviceArrayTrackletsLUT() const
gsl::span< int > getNCells()
void createLinesDevice(const int nCells)
const float * getDeviceMaxRs() const
void createClustersIndexTablesArray(const int=NLayers)
int ** getDeviceArrayNeighboursCellLUT() const
const o2::base::Propagator * getChainPropagator()
int downloadVertexCandsDevice()
const Cluster ** getDeviceArrayClusters() const
TrackExtensionHypothesis< NLayers > * getDeviceNextTrackExtensionHypotheses()
int * getDevicePeakLineIdx()
void createClusterOwnersDevice()
gsl::span< int > getNNeighbours()
const TrackingFrameInfo ** getDeviceArrayTrackingFrameInfo() const
IndexTableUtilsN * getDeviceIndexTableUtils()
void createNeighboursLUTDevice(const int, const unsigned int)
Vertex * getDeviceDiamond()
void loadROFVertexLookupTable()
const auto & getHostVertexCands() const
float * getDeviceLineChi2()
void loadROFrameClustersDevice(const int)
void createClusterSortScratchDevice(const int layer)
void loadUsedClustersDevice()
std::array< CellNeighbour *, MaxCells > & getDeviceNeighboursAll()
unsigned long long ** getDeviceArrayClusterOwners()
void createUsedClustersDeviceArray(const int=NLayers)
gsl::span< int * > getDeviceCellLUTs()
int * getDeviceRofLineOffsets()
void initialise(const TrackingParameters &, int maxLayers)
void createNeighboursDevice(const unsigned int layer, size_t capacity)
void allocateClusterSortStorage(const TrackingParameters &trkParam, const int maxLayers) override
const float * getDeviceLayerRadii() const
void createTrackSeedsDevice(const size_t capacity)
bounded_vector< o2::MCCompLabel > & getLineLabelFlat()
int * getDevicePeakOffsets()
gsl::span< int > getNTracklets()
void loadIndexTableUtils()
void createClusterOwnersDeviceArray()
std::vector< unsigned int > getClusterSizes()
const bounded_vector< o2::MCCompLabel > & getLineLabelFlat() const
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLint GLint GLsizei GLint GLenum GLenum type
GLenum GLuint GLint GLint layer
o2::its::LineWindow LineWindow
TrackExtensionHypothesis< NLayers > int const int maxHypotheses
o2::dataformats::Vertex< o2::its::TimeEstBC > Vertex
ROFVertexLookupTable< NLayers > ROFVertexLookupTableN
TrackSeed< NLayers > TrackSeedN
IndexTableUtils< NLayers > IndexTableUtilsN
const o2::base::PropagatorImpl< float > * mPropagatorDevice
int getNrof(int layer) const
TrackingTopologyN::View mTrackingTopologyView
TrackingTopology< NLayers > TrackingTopologyN
ROFOverlapTable< NLayers > ROFOverlapTableN
ROFMaskTable< NLayers > ROFMaskTableN