Project
Loading...
Searching...
No Matches
GPUParam.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 GPUPARAM_H
16#define GPUPARAM_H
17
18#include "GPUCommonDef.h"
19#include "GPUCommonMath.h"
20#include "GPUDef.h"
21#include "GPUSettings.h"
24
25#if !defined(GPUCA_GPUCODE)
26namespace o2::base
27{
28template <typename>
29class PropagatorImpl;
30using Propagator = PropagatorImpl<float>;
31} // namespace o2::base
32#endif
33
34namespace o2::gpu
35{
36struct GPUSettingsRec;
37struct GPUSettingsGTP;
38struct GPURecoStepConfiguration;
39
40namespace internal
41{
42template <class T, class S>
43struct GPUParam_t {
44 static constexpr float dAlpha = 0.349066f;
45
46 T rec;
48
49 float bzkG;
50 float bzCLight;
52
56
57 GPUTPCGMPolynomialField polynomialField; // Polynomial approx. of magnetic field for TPC GM
58 const uint32_t* occupancyMap; // Ptr to TPC occupancy map
59 uint32_t occupancyTotal; // Total occupancy in the TPC (nCl / nHbf)
60 uint32_t occupancyMapSize; // Size of occupancy map
61
62 protected:
63#ifndef GPUCA_RUN2
64 float ParamErrors[2][4][4]; // cluster error parameterization used during seeding and fit
65#else
66 float ParamErrorsSeeding0[2][3][4]; // cluster error parameterization used during seeding
67 float ParamS0Par[2][3][6]; // cluster error parameterization used during track fit
68#endif
69};
70} // namespace internal
71
72struct GPUParam : public internal::GPUParam_t<GPUSettingsRec, GPUSettingsParam> {
73
74#ifndef GPUCA_GPUCODE
75 void SetDefaults(float solenoidBz, bool assumeConstantBz = false);
76 void SetDefaults(const GPUSettingsGRP* g, const GPUSettingsRec* r = nullptr, const GPUSettingsProcessing* p = nullptr, const GPURecoStepConfiguration* w = nullptr);
77 void UpdateSettings(const GPUSettingsGRP* g, const GPUSettingsProcessing* p = nullptr, const GPURecoStepConfiguration* w = nullptr, const GPUSettingsRecDynamic* d = nullptr);
78 void UpdateBzOnly(float newSolenoidBz, bool assumeConstantBz = false);
79 void UpdateRun3ClusterErrors(const float* yErrorParam, const float* zErrorParam);
80#endif
81
82 GPUd() constexpr uint32_t tpcMinHitsB5(float qPtB5) const { return CAMath::Abs(qPtB5) > 10 ? 10 : (CAMath::Abs(qPtB5) > 5 ? 15 : 29); } // Minimum hits should depend on Pt, low Pt tracks can have few hits. 29 Hits default, 15 for < 200 mev, 10 for < 100 mev
83 GPUd() constexpr float Alpha(int32_t iSector) const // TODO: Check if this is faster, or the lookup from GPUTPCGeometry
84 {
85 if (iSector >= (int32_t)o2::tpc::constants::MAXSECTOR / 2) {
87 }
88 if (iSector >= (int32_t)o2::tpc::constants::MAXSECTOR / 4) {
90 }
91 return 0.174533f + dAlpha * iSector;
92 }
93 GPUd() float GetClusterErrorSeeding(int32_t yz, int32_t type, float zDiff, float angle2, float unscaledMult) const;
94 GPUd() void GetClusterErrorsSeeding2(uint8_t sector, int32_t row, float z, float sinPhi, float DzDs, float time, float& ErrY2, float& ErrZ2) const;
95 GPUd() float GetSystematicClusterErrorIFC2(float trackX, float trackY, float z, bool sideC) const;
96 GPUd() float GetSystematicClusterErrorC122(float trackX, float trackY, uint8_t sector) const;
97
98 GPUd() float GetClusterError2(int32_t yz, int32_t type, float zDiff, float angle2, float unscaledMult, float scaledAvgInvCharge, float scaledInvCharge) const;
99 GPUd() void GetClusterErrors2(uint8_t sector, int32_t row, float z, float sinPhi, float DzDs, float time, float avgInvCharge, float invCharge, float& ErrY2, float& ErrZ2) const;
100 GPUd() void UpdateClusterError2ByState(int16_t clusterState, float& ErrY2, float& ErrZ2) const;
101 GPUd() float GetUnscaledMult(float time) const;
102
103 GPUd() void Sector2Global(int32_t iSector, float x, float y, float z, float* X, float* Y, float* Z) const;
104 GPUd() void Global2Sector(int32_t iSector, float x, float y, float z, float* X, float* Y, float* Z) const;
105
106 GPUd() bool rejectEdgeClusterByY(float uncorrectedY, int32_t iRow, float trackSigmaY) const;
107};
108
109} // namespace o2::gpu
110
111#endif
uint32_t iSector
GLint GLenum GLint x
Definition glcorearb.h:403
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
GLboolean GLboolean g
Definition glcorearb.h:1233
GLboolean r
Definition glcorearb.h:1233
GLubyte GLubyte GLubyte GLubyte w
Definition glcorearb.h:852
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
PropagatorF Propagator
Definition Propagator.h:223
constexpr int MAXSECTOR
Definition Constants.h:28
int32_t float float sinPhi
Definition GPUParam.h:94
int32_t float float float unscaledMult
Definition GPUParam.h:98
int32_t float float float unscaledMult const
Definition GPUParam.h:93
void SetDefaults(float solenoidBz, bool assumeConstantBz=false)
Definition GPUParam.cxx:33
int32_t float float float float scaledAvgInvCharge
Definition GPUParam.h:98
float float float float float * Y
Definition GPUParam.h:103
GPUd() const expr float Alpha(int32_t iSector) const
Definition GPUParam.h:83
int32_t float float angle2
Definition GPUParam.h:93
int32_t float float float float float avgInvCharge
Definition GPUParam.h:99
int32_t float float float float float & ErrY2
Definition GPUParam.h:94
int32_t float zDiff
Definition GPUParam.h:93
void UpdateRun3ClusterErrors(const float *yErrorParam, const float *zErrorParam)
Definition GPUParam.cxx:140
void UpdateSettings(const GPUSettingsGRP *g, const GPUSettingsProcessing *p=nullptr, const GPURecoStepConfiguration *w=nullptr, const GPUSettingsRecDynamic *d=nullptr)
Definition GPUParam.cxx:95
void UpdateBzOnly(float newSolenoidBz, bool assumeConstantBz=false)
Definition GPUParam.cxx:118
int32_t float float float float float float invCharge
Definition GPUParam.h:99
float float float float * X
Definition GPUParam.h:103
GPUd() const expr uint32_t tpcMinHitsB5(float qPtB5) const
Definition GPUParam.h:82
int32_t float float float float time
Definition GPUParam.h:94
int32_t float float float DzDs
Definition GPUParam.h:94
static constexpr float dAlpha
Definition GPUParam.h:44
float ParamErrors[2][4][4]
Definition GPUParam.h:64
const uint32_t * occupancyMap
Definition GPUParam.h:58
GPUTPCGMPolynomialField polynomialField
Definition GPUParam.h:57