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"
22#include "GPUTPCGeometry.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
41 float Alpha; // sector angle
42 float CosAlpha, SinAlpha; // sign and cosine of the sector angle
43 float AngleMin, AngleMax; // minimal and maximal angle
44 float ZMin, ZMax; // sector Z range
45};
46
47namespace internal
48{
49template <class T, class S>
50struct GPUParam_t {
51 T rec;
53
54 float bzkG;
55 float bzCLight;
57
61
62 GPUTPCGeometry tpcGeometry; // TPC Geometry
63 GPUTPCGMPolynomialField polynomialField; // Polynomial approx. of magnetic field for TPC GM
64 const uint32_t* occupancyMap; // Ptr to TPC occupancy map
65 uint32_t occupancyTotal; // Total occupancy in the TPC (nCl / nHbf)
66
68
69 protected:
70#ifdef GPUCA_TPC_GEOMETRY_O2
71 float ParamErrors[2][4][4]; // cluster error parameterization used during seeding and fit
72#else
73 float ParamErrorsSeeding0[2][3][4]; // cluster error parameterization used during seeding
74 float ParamS0Par[2][3][6]; // cluster error parameterization used during track fit
75#endif
76};
77} // namespace internal
78
79struct GPUParam : public internal::GPUParam_t<GPUSettingsRec, GPUSettingsParam> {
80
81#ifndef GPUCA_GPUCODE
82 void SetDefaults(float solenoidBz);
83 void SetDefaults(const GPUSettingsGRP* g, const GPUSettingsRec* r = nullptr, const GPUSettingsProcessing* p = nullptr, const GPURecoStepConfiguration* w = nullptr);
84 void UpdateSettings(const GPUSettingsGRP* g, const GPUSettingsProcessing* p = nullptr, const GPURecoStepConfiguration* w = nullptr, const GPUSettingsRecDynamic* d = nullptr);
85 void UpdateBzOnly(float newSolenoidBz);
86 void UpdateRun3ClusterErrors(const float* yErrorParam, const float* zErrorParam);
87#endif
88
89 GPUd() float Alpha(int32_t iSector) const
90 {
91 if (iSector >= GPUCA_NSECTORS / 2) {
92 iSector -= GPUCA_NSECTORS / 2;
93 }
94 if (iSector >= GPUCA_NSECTORS / 4) {
95 iSector -= GPUCA_NSECTORS / 2;
96 }
97 return 0.174533f + par.dAlpha * iSector;
98 }
99 GPUd() float GetClusterErrorSeeding(int32_t yz, int32_t type, float zDiff, float angle2, float unscaledMult) const;
100 GPUd() void GetClusterErrorsSeeding2(uint8_t sector, int32_t row, float z, float sinPhi, float DzDs, float time, float& ErrY2, float& ErrZ2) const;
101 GPUd() float GetSystematicClusterErrorIFC2(float trackX, float trackY, float z, bool sideC) const;
102 GPUd() float GetSystematicClusterErrorC122(float trackX, float trackY, uint8_t sector) const;
103
104 GPUd() float GetClusterError2(int32_t yz, int32_t type, float zDiff, float angle2, float unscaledMult, float scaledAvgInvCharge, float scaledInvCharge) const;
105 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;
106 GPUd() void UpdateClusterError2ByState(int16_t clusterState, float& ErrY2, float& ErrZ2) const;
107 GPUd() float GetUnscaledMult(float time) const;
108
109 GPUd() void Sector2Global(int32_t iSector, float x, float y, float z, float* X, float* Y, float* Z) const;
110 GPUd() void Global2Sector(int32_t iSector, float x, float y, float z, float* X, float* Y, float* Z) const;
111
112 GPUd() bool rejectEdgeClusterByY(float uncorrectedY, int32_t iRow, float trackSigmaY) const;
113};
114
115} // namespace o2::gpu
116
117#endif
#define GPUCA_NSECTORS
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:182
int32_t float float sinPhi
Definition GPUParam.h:100
int32_t float float float unscaledMult
Definition GPUParam.h:104
int32_t float float float unscaledMult const
Definition GPUParam.h:99
GPUd() float Alpha(int32_t iSector) const
Definition GPUParam.h:89
int32_t float float float float scaledAvgInvCharge
Definition GPUParam.h:104
float float float float float * Y
Definition GPUParam.h:109
void SetDefaults(float solenoidBz)
Definition GPUParam.cxx:32
int32_t float float angle2
Definition GPUParam.h:99
int32_t float float float float float avgInvCharge
Definition GPUParam.h:105
int32_t float float float float float & ErrY2
Definition GPUParam.h:100
int32_t float zDiff
Definition GPUParam.h:99
void UpdateRun3ClusterErrors(const float *yErrorParam, const float *zErrorParam)
Definition GPUParam.cxx:173
void UpdateSettings(const GPUSettingsGRP *g, const GPUSettingsProcessing *p=nullptr, const GPURecoStepConfiguration *w=nullptr, const GPUSettingsRecDynamic *d=nullptr)
Definition GPUParam.cxx:121
int32_t float float float float float float invCharge
Definition GPUParam.h:105
float float float float * X
Definition GPUParam.h:109
int32_t float float float float time
Definition GPUParam.h:100
int32_t float float float DzDs
Definition GPUParam.h:100
void UpdateBzOnly(float newSolenoidBz)
Definition GPUParam.cxx:148
GPUParamSector SectorParam[GPUCA_NSECTORS]
Definition GPUParam.h:67
const uint32_t * occupancyMap
Definition GPUParam.h:64
float ParamS0Par[2][3][6]
Definition GPUParam.h:74
GPUTPCGMPolynomialField polynomialField
Definition GPUParam.h:63
float ParamErrorsSeeding0[2][3][4]
Definition GPUParam.h:73
GPUTPCGeometry tpcGeometry
Definition GPUParam.h:62