Project
Loading...
Searching...
No Matches
GPUO2InterfaceRefit.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 GPUO2INTERFACEREFIT_H
16#define GPUO2INTERFACEREFIT_H
17
18// Some defines denoting that we are compiling for O2
19#ifndef GPUCA_TPC_GEOMETRY_O2
20#define GPUCA_TPC_GEOMETRY_O2
21#endif
22#ifndef GPUCA_O2_INTERFACE
23#define GPUCA_O2_INTERFACE
24#endif
25
26#include <memory>
27#include <vector>
28#include <gsl/span>
29
30namespace o2::base
31{
32template <typename value_T>
33class PropagatorImpl;
34using Propagator = PropagatorImpl<float>;
35} // namespace o2::base
36namespace o2::dataformats
37{
38template <typename FirstEntry, typename NElem>
39class RangeReference;
40}
41namespace o2::tpc
42{
43using TPCClRefElem = uint32_t;
45class TrackTPC;
47} // namespace o2::tpc
48namespace o2::track
49{
50template <typename value_T>
51class TrackParametrizationWithError;
52using TrackParCovF = TrackParametrizationWithError<float>;
54} // namespace o2::track
55
56namespace o2::gpu
57{
58class GPUParam;
59class GPUTrackingRefit;
60class CorrectionMapsHelper;
62{
63 public:
64 // Must initialize with:
65 // - In any case: Cluster Native access structure (cl), TPC Fast Transformation helper instance (trans), solenoid field (bz), TPC Track hit references (trackRef)
66 // - Either the shared cluster map (sharedmap) or the vector of tpc tracks (trks) to build the shared cluster map internally
67 // - o2::base::Propagator (p) in case RefitTrackAsTrackParCov is to be used
68 // - In case the --configKeyValues defining GPUParam settings require an occupancy map for TPC error estimation, the map must either be provided as occupancymap, or nHbfPerTf must be set non-zero
69
70 GPUO2InterfaceRefit(const o2::tpc::ClusterNativeAccess* cl, const o2::gpu::CorrectionMapsHelper* trans, float bzNominalGPU, const o2::tpc::TPCClRefElem* trackRef, uint32_t nHbfPerTf = 0, const uint8_t* sharedmap = nullptr, const uint32_t* occupancymap = nullptr, int32_t occupancyMapSize = -1, const std::vector<o2::tpc::TrackTPC>* trks = nullptr, o2::base::Propagator* p = nullptr);
72
73 int32_t RefitTrackAsGPU(o2::tpc::TrackTPC& trk, bool outward = false, bool resetCov = false);
74 int32_t RefitTrackAsTrackParCov(o2::tpc::TrackTPC& trk, bool outward = false, bool resetCov = false);
75 int32_t RefitTrackAsGPU(o2::track::TrackParCov& trk, const o2::tpc::TrackTPCClusRef& clusRef, float time0, float* chi2 = nullptr, bool outward = false, bool resetCov = false);
76 int32_t RefitTrackAsTrackParCov(o2::track::TrackParCov& trk, const o2::tpc::TrackTPCClusRef& clusRef, float time0, float* chi2 = nullptr, bool outward = false, bool resetCov = false);
77 void setTrackReferenceX(float v);
79 void updateCalib(const o2::gpu::CorrectionMapsHelper* trans, float bzNominalGPU);
80 auto getParam() const { return mParam.get(); }
81
82 // To create shared cluster maps and occupancy maps.
83 // param is an optional parameter to override the param object, by default a default object from --configKeyValues is used.
84 // If the param object / default object requires an occupancy map, an occupancy map ptr and nHbfPerTf value must be provided.
85 // You can use the function fillOccupancyMapGetSize(...) to get the required size of the occupancy map. If 0 is returned, no map is required.
86 // Providing only the shmap ptr but no ocmap ptr will create only the shared map, but no occupancy map.
87 static void fillSharedClustersAndOccupancyMap(const o2::tpc::ClusterNativeAccess* cl, const gsl::span<const o2::tpc::TrackTPC> trks, const o2::tpc::TPCClRefElem* trackRef, uint8_t* shmap, uint32_t* ocmap = nullptr, uint32_t nHbfPerTf = 0, const GPUParam* param = nullptr);
88 static size_t fillOccupancyMapGetSize(uint32_t nHbfPerTf, const GPUParam* param = nullptr);
89
90 private:
91 std::unique_ptr<GPUTrackingRefit> mRefit;
92 std::unique_ptr<GPUParam> mParam;
93 std::vector<uint8_t> mSharedMap;
94 std::vector<uint32_t> mOccupancyMap;
95};
96} // namespace o2::gpu
97
98#endif
o2::track::TrackParCov TrackParCov
Definition Recon.h:39
int32_t RefitTrackAsTrackParCov(o2::tpc::TrackTPC &trk, bool outward=false, bool resetCov=false)
static size_t fillOccupancyMapGetSize(uint32_t nHbfPerTf, const GPUParam *param=nullptr)
static void fillSharedClustersAndOccupancyMap(const o2::tpc::ClusterNativeAccess *cl, const gsl::span< const o2::tpc::TrackTPC > trks, const o2::tpc::TPCClRefElem *trackRef, uint8_t *shmap, uint32_t *ocmap=nullptr, uint32_t nHbfPerTf=0, const GPUParam *param=nullptr)
void updateCalib(const o2::gpu::CorrectionMapsHelper *trans, float bzNominalGPU)
int32_t RefitTrackAsGPU(o2::tpc::TrackTPC &trk, bool outward=false, bool resetCov=false)
const GLdouble * v
Definition glcorearb.h:832
GLenum GLfloat param
Definition glcorearb.h:271
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
uint32_t TPCClRefElem
TrackParCovF TrackParCov
Definition Track.h:33
TrackParametrizationWithError< float > TrackParCovF
Definition Track.h:31