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#include "GPUO2ExternalUser.h"
19#include <memory>
20#include <vector>
21#include <gsl/span>
22
23namespace o2::base
24{
25template <typename value_T>
26class PropagatorImpl;
27using Propagator = PropagatorImpl<float>;
28} // namespace o2::base
29namespace o2::dataformats
30{
31template <typename FirstEntry, typename NElem>
32class RangeReference;
33}
34namespace o2::tpc
35{
36using TPCClRefElem = uint32_t;
38class TrackTPC;
40} // namespace o2::tpc
41namespace o2::track
42{
43template <typename value_T>
44class TrackParametrizationWithError;
45using TrackParCovF = TrackParametrizationWithError<float>;
47} // namespace o2::track
48
49namespace o2::gpu
50{
51class GPUParam;
52class GPUTrackingRefit;
53class CorrectionMapsHelper;
55{
56 public:
57 // Must initialize with:
58 // - In any case: Cluster Native access structure (cl), TPC Fast Transformation helper instance (trans), solenoid field (bz), TPC Track hit references (trackRef)
59 // - Either the shared cluster map (sharedmap) or the vector of tpc tracks (trks) to build the shared cluster map internally
60 // - o2::base::Propagator (p) in case RefitTrackAsTrackParCov is to be used
61 // - 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
62
63 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);
65
66 int32_t RefitTrackAsGPU(o2::tpc::TrackTPC& trk, bool outward = false, bool resetCov = false);
67 int32_t RefitTrackAsTrackParCov(o2::tpc::TrackTPC& trk, bool outward = false, bool resetCov = false);
68 int32_t RefitTrackAsGPU(o2::track::TrackParCov& trk, const o2::tpc::TrackTPCClusRef& clusRef, float time0, float* chi2 = nullptr, bool outward = false, bool resetCov = false);
69 int32_t RefitTrackAsTrackParCov(o2::track::TrackParCov& trk, const o2::tpc::TrackTPCClusRef& clusRef, float time0, float* chi2 = nullptr, bool outward = false, bool resetCov = false);
70 void setTrackReferenceX(float v);
72 void updateCalib(const o2::gpu::CorrectionMapsHelper* trans, float bzNominalGPU);
73 auto getParam() const { return mParam.get(); }
74
75 // To create shared cluster maps and occupancy maps.
76 // param is an optional parameter to override the param object, by default a default object from --configKeyValues is used.
77 // If the param object / default object requires an occupancy map, an occupancy map ptr and nHbfPerTf value must be provided.
78 // You can use the function fillOccupancyMapGetSize(...) to get the required size of the occupancy map. If 0 is returned, no map is required.
79 // Providing only the shmap ptr but no ocmap ptr will create only the shared map, but no occupancy map.
80 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);
81 static size_t fillOccupancyMapGetSize(uint32_t nHbfPerTf, const GPUParam* param = nullptr);
82
83 private:
84 std::unique_ptr<GPUTrackingRefit> mRefit;
85 std::unique_ptr<GPUParam> mParam;
86 std::vector<uint8_t> mSharedMap;
87 std::vector<uint32_t> mOccupancyMap;
88};
89} // namespace o2::gpu
90
91#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:223
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:168
uint32_t TPCClRefElem
TrackParCovF TrackParCov
Definition Track.h:33
TrackParametrizationWithError< float > TrackParCovF
Definition Track.h:31