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