|
| 1 | +// Copyright CERN and copyright holders of ALICE O2. This software is |
| 2 | +// distributed under the terms of the GNU General Public License v3 (GPL |
| 3 | +// Version 3), copied verbatim in the file "COPYING". |
| 4 | +// |
| 5 | +// See http://alice-o2.web.cern.ch/license for full licensing information. |
| 6 | +// |
| 7 | +// In applying this license CERN does not waive the privileges and immunities |
| 8 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 9 | +// or submit itself to any jurisdiction. |
| 10 | + |
| 11 | +/// \file GPUParam.inc |
| 12 | +/// \author David Rohr, Sergey Gorbunov |
| 13 | + |
| 14 | +#ifndef GPUPARAM_INC |
| 15 | +#define GPUPARAM_INC |
| 16 | + |
| 17 | +#include "GPUParam.h" |
| 18 | +#include "GPUTPCGMMergedTrackHit.h" |
| 19 | + |
| 20 | +namespace GPUCA_NAMESPACE |
| 21 | +{ |
| 22 | +namespace gpu |
| 23 | +{ |
| 24 | + |
| 25 | +MEM_CLASS_PRE() |
| 26 | +GPUdi() void MEM_LG(GPUParam)::Slice2Global(int iSlice, float x, float y, float z, float* X, float* Y, float* Z) const |
| 27 | +{ |
| 28 | + // conversion of coorinates sector->global |
| 29 | + *X = x * SliceParam[iSlice].CosAlpha - y * SliceParam[iSlice].SinAlpha; |
| 30 | + *Y = y * SliceParam[iSlice].CosAlpha + x * SliceParam[iSlice].SinAlpha; |
| 31 | + *Z = z; |
| 32 | +} |
| 33 | + |
| 34 | +MEM_CLASS_PRE() |
| 35 | +GPUdi() void MEM_LG(GPUParam)::Global2Slice(int iSlice, float X, float Y, float Z, float* x, float* y, float* z) const |
| 36 | +{ |
| 37 | + // conversion of coorinates global->sector |
| 38 | + *x = X * SliceParam[iSlice].CosAlpha + Y * SliceParam[iSlice].SinAlpha; |
| 39 | + *y = Y * SliceParam[iSlice].CosAlpha - X * SliceParam[iSlice].SinAlpha; |
| 40 | + *z = Z; |
| 41 | +} |
| 42 | + |
| 43 | +MEM_CLASS_PRE() |
| 44 | +GPUdi() float MEM_LG(GPUParam)::GetClusterRMS(int yz, int type, float z, float angle2) const |
| 45 | +{ |
| 46 | + //* recalculate the cluster error wih respect to the track slope |
| 47 | + |
| 48 | + MakeType(const float*) c = ParamRMS0[yz][type]; |
| 49 | + float v = c[0] + c[1] * z + c[2] * angle2; |
| 50 | + v = CAMath::Abs(v); |
| 51 | + return v; |
| 52 | +} |
| 53 | + |
| 54 | +MEM_CLASS_PRE() |
| 55 | +GPUdi() void MEM_LG(GPUParam)::GetClusterRMS2(int iRow, float z, float sinPhi, float DzDs, float& ErrY2, float& ErrZ2) const |
| 56 | +{ |
| 57 | + int rowType = tpcGeometry.GetROC(iRow); |
| 58 | + if (rowType > 2) { |
| 59 | + rowType = 2; // TODO: Add type 3 |
| 60 | + } |
| 61 | + z = CAMath::Abs((250.f - 0.275f) - CAMath::Abs(z)); |
| 62 | + float s2 = sinPhi * sinPhi; |
| 63 | + if (s2 > 0.95f * 0.95f) { |
| 64 | + s2 = 0.95f * 0.95f; |
| 65 | + } |
| 66 | + float sec2 = 1.f / (1.f - s2); |
| 67 | + float angleY2 = s2 * sec2; // dy/dx |
| 68 | + float angleZ2 = DzDs * DzDs * sec2; // dz/dx |
| 69 | + |
| 70 | + ErrY2 = GetClusterRMS(0, rowType, z, angleY2); |
| 71 | + ErrZ2 = GetClusterRMS(1, rowType, z, angleZ2); |
| 72 | + ErrY2 *= ErrY2; |
| 73 | + ErrZ2 *= ErrZ2; |
| 74 | +} |
| 75 | + |
| 76 | +MEM_CLASS_PRE() |
| 77 | +GPUdi() float MEM_LG(GPUParam)::GetClusterError2(int yz, int type, float z, float angle2) const |
| 78 | +{ |
| 79 | + //* recalculate the cluster error wih respect to the track slope |
| 80 | + |
| 81 | + MakeType(const float*) c = ParamS0Par[yz][type]; |
| 82 | + float v = c[0] + c[1] * z + c[2] * angle2 + c[3] * z * z + c[4] * angle2 * angle2 + c[5] * z * angle2; |
| 83 | + v = CAMath::Abs(v); |
| 84 | + if (v < 0.01f) { |
| 85 | + v = 0.01f; |
| 86 | + } |
| 87 | + v *= yz ? rec.ClusterError2CorrectionZ : rec.ClusterError2CorrectionY; |
| 88 | + return v; |
| 89 | +} |
| 90 | + |
| 91 | +MEM_CLASS_PRE() |
| 92 | +GPUdi() void MEM_LG(GPUParam)::GetClusterErrors2(int iRow, float z, float sinPhi, float DzDs, float& ErrY2, float& ErrZ2) const |
| 93 | +{ |
| 94 | + // Calibrated cluster error from OCDB for Y and Z |
| 95 | + int rowType = tpcGeometry.GetROC(iRow); |
| 96 | + if (rowType > 2) { |
| 97 | + rowType = 2; // TODO: Add type 3 |
| 98 | + } |
| 99 | + z = CAMath::Abs((250.f - 0.275f) - CAMath::Abs(z)); |
| 100 | + float s2 = sinPhi * sinPhi; |
| 101 | + if (s2 > 0.95f * 0.95f) { |
| 102 | + s2 = 0.95f * 0.95f; |
| 103 | + } |
| 104 | + float sec2 = 1.f / (1.f - s2); |
| 105 | + float angleY2 = s2 * sec2; // dy/dx |
| 106 | + float angleZ2 = DzDs * DzDs * sec2; // dz/dx |
| 107 | + |
| 108 | + ErrY2 = GetClusterError2(0, rowType, z, angleY2); |
| 109 | + ErrZ2 = GetClusterError2(1, rowType, z, angleZ2); |
| 110 | +} |
| 111 | + |
| 112 | +MEM_CLASS_PRE() |
| 113 | +GPUdi() void MEM_LG(GPUParam)::UpdateClusterError2ByState(short clusterState, float& ErrY2, float& ErrZ2) const |
| 114 | +{ |
| 115 | + if (clusterState & GPUTPCGMMergedTrackHit::flagEdge) { |
| 116 | + ErrY2 += 0.35f; |
| 117 | + ErrZ2 += 0.15f; |
| 118 | + } |
| 119 | + if (clusterState & GPUTPCGMMergedTrackHit::flagSingle) { |
| 120 | + ErrY2 += 0.2f; |
| 121 | + ErrZ2 += 0.2f; |
| 122 | + } |
| 123 | + if (clusterState & (GPUTPCGMMergedTrackHit::flagSplitPad | GPUTPCGMMergedTrackHit::flagShared | GPUTPCGMMergedTrackHit::flagSingle)) { |
| 124 | + ErrY2 += 0.03f; |
| 125 | + ErrY2 *= 3; |
| 126 | + } |
| 127 | + if (clusterState & (GPUTPCGMMergedTrackHit::flagSplitTime | GPUTPCGMMergedTrackHit::flagShared | GPUTPCGMMergedTrackHit::flagSingle)) { |
| 128 | + ErrZ2 += 0.03f; |
| 129 | + ErrZ2 *= 3; |
| 130 | + } |
| 131 | +} |
| 132 | + |
| 133 | +} // namespace gpu |
| 134 | +} // namespace GPUCA_NAMESPACE |
| 135 | + |
| 136 | +#endif |
0 commit comments