Project
Loading...
Searching...
No Matches
GPUTrackingRefit.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.
11
14
15#ifndef GPUTRACKINGREFIT_H
16#define GPUTRACKINGREFIT_H
17
18#include "GPUDef.h"
19#include "GPUProcessor.h"
20
21namespace o2::dataformats
22{
23template <typename FirstEntry, typename NElem>
24class RangeReference;
25}
26namespace o2::track
27{
28template <typename T>
29class TrackParametrizationWithError;
30using TrackParCov = TrackParametrizationWithError<float>;
31} // namespace o2::track
32namespace o2::base
33{
34template <typename>
35class PropagatorImpl;
36using Propagator = PropagatorImpl<float>;
37class MatLayerCylSet;
38} // namespace o2::base
39namespace o2::tpc
40{
41struct ClusterNativeAccess;
42class TrackTPC;
44} // namespace o2::tpc
45
46namespace o2::gpu
47{
48class CorrectionMapsHelper;
49class GPUTPCGMTrackParam;
50class GPUTPCGMMergedTrack;
51struct GPUConstantMem;
52struct GPUParam;
53struct GPUTPCGMMergedTrackHit;
54
56{
57 public:
58 void SetClusterStateArray(const uint8_t* v) { mPclusterState = v; }
60 void SetPropagator(const o2::base::Propagator* v) { mPpropagator = v; }
61 void SetClusterNative(const o2::tpc::ClusterNativeAccess* v) { mPclusterNative = v; }
62 void SetTrackHits(const GPUTPCGMMergedTrackHit* v) { mPtrackHits = v; }
63 void SetTrackHitReferences(const uint32_t* v) { mPtrackHitReferences = v; }
64 void SetFastTransformHelper(const CorrectionMapsHelper* v) { mPfastTransformHelper = v; }
65 void SetGPUParam(const GPUParam* v) { mPparam = v; }
66 GPUd() int32_t RefitTrackAsGPU(GPUTPCGMMergedTrack& trk, bool outward = false, bool resetCov = false) { return RefitTrack<GPUTPCGMMergedTrack, GPUTPCGMTrackParam>(trk, outward, resetCov); }
67 GPUd() int32_t RefitTrackAsTrackParCov(GPUTPCGMMergedTrack& trk, bool outward = false, bool resetCov = false) { return RefitTrack<GPUTPCGMMergedTrack, o2::track::TrackParCov>(trk, outward, resetCov); }
68 GPUd() int32_t RefitTrackAsGPU(o2::tpc::TrackTPC& trk, bool outward = false, bool resetCov = false) { return RefitTrack<o2::tpc::TrackTPC, GPUTPCGMTrackParam>(trk, outward, resetCov); }
69 GPUd() int32_t RefitTrackAsTrackParCov(o2::tpc::TrackTPC& trk, bool outward = false, bool resetCov = false) { return RefitTrack<o2::tpc::TrackTPC, o2::track::TrackParCov>(trk, outward, resetCov); }
70
71 struct TrackParCovWithArgs {
73 const o2::tpc::TrackTPCClusRef& clusRef;
74 float time0;
75 float* chi2;
76 };
77 GPUd() int32_t RefitTrackAsGPU(o2::track::TrackParCov& trk, const o2::tpc::TrackTPCClusRef& clusRef, float time0, float* chi2 = nullptr, bool outward = false, bool resetCov = false)
78 {
79 TrackParCovWithArgs x{trk, clusRef, time0, chi2};
80 return RefitTrack<TrackParCovWithArgs, GPUTPCGMTrackParam>(x, outward, resetCov);
81 }
82 GPUd() int32_t RefitTrackAsTrackParCov(o2::track::TrackParCov& trk, const o2::tpc::TrackTPCClusRef& clusRef, float time0, float* chi2 = nullptr, bool outward = false, bool resetCov = false)
83 {
84 TrackParCovWithArgs x{trk, clusRef, time0, chi2};
85 return RefitTrack<TrackParCovWithArgs, o2::track::TrackParCov>(x, outward, resetCov);
86 }
87
88 bool mIgnoreErrorsOnTrackEnds = true; // Ignore errors during propagation / update at the beginning / end of tracks for int16_t tracks / tracks with high incl. angle
89
90 private:
91 const uint8_t* mPclusterState = nullptr; // Ptr to shared cluster state
92 const o2::base::Propagator* mPpropagator = nullptr; // Ptr to propagator for TrackParCov track model
93 const o2::base::MatLayerCylSet* mPmatLUT = nullptr; // Ptr to material LUT
94 const o2::tpc::ClusterNativeAccess* mPclusterNative = nullptr; // Ptr to cluster native access structure
95 const GPUTPCGMMergedTrackHit* mPtrackHits = nullptr; // Ptr to hits for GPUTPCGMMergedTrack tracks
96 const uint32_t* mPtrackHitReferences = nullptr; // Ptr to hits for TrackTPC tracks
97 const CorrectionMapsHelper* mPfastTransformHelper = nullptr; // Ptr to TPC fast transform object helper
98 const GPUParam* mPparam = nullptr; // Ptr to GPUParam
99 template <class T, class S>
100 GPUd() int32_t RefitTrack(T& trk, bool outward, bool resetCov);
101 template <class T, class S, class U>
102 GPUd() void convertTrack(T& trk, const S& trkX, U& prop, float* chi2);
103 template <class U>
104 GPUd() void initProp(U& prop);
105};
106
108{
109 public:
110#ifndef GPUCA_GPUCODE
111 void InitializeProcessor();
112 void RegisterMemoryAllocation();
113 void SetMaxData(const GPUTrackingInOutPointers& io);
114#endif
115 GPUTPCGMMergedTrack* mPTracks = nullptr;
116};
117
118} // namespace o2::gpu
119
120#endif
o2::track::TrackParCov TrackParCov
Definition Recon.h:39
void SetGPUParam(const GPUParam *v)
void SetTrackHits(const GPUTPCGMMergedTrackHit *v)
GPUd() int32_t RefitTrackAsTrackParCov(o2
void SetTrackHitReferences(const uint32_t *v)
void SetFastTransformHelper(const CorrectionMapsHelper *v)
void SetClusterNative(const o2::tpc::ClusterNativeAccess *v)
void SetClusterStateArray(const uint8_t *v)
void SetPtrsFromGPUConstantMem(const GPUConstantMem *v, GPUParam *p=nullptr)
GPUd() int32_t RefitTrackAsGPU(o2
GPUd() int32_t RefitTrackAsGPU(GPUTPCGMMergedTrack &trk
void SetPropagator(const o2::base::Propagator *v)
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
PropagatorF Propagator
Definition Propagator.h:182
Definition of a container to keep/associate and arbitrary number of labels associated to an index wit...
Global TPC definitions and constants.
Definition SimTraits.h:167
o2::dataformats::RangeReference< uint32_t, uint16_t > TrackTPCClusRef
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...