Project
Loading...
Searching...
No Matches
GPUTRDRecoParam.cxx
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
15
16#include "GPUSettings.h"
17#include "GPUTRDRecoParam.h"
18#include "GPUCommonLogger.h"
19#include "GPUCommonMath.h"
20
21using namespace o2::gpu;
22
23// error parameterizations taken from http://cds.cern.ch/record/2724259 Appendix A
25{
26 float resRPhiIdeal2 = rec ? rec->trd.trkltResRPhiIdeal * rec->trd.trkltResRPhiIdeal : 1.6e-3f;
27
28 if (CAMath::Abs(CAMath::Abs(bz) - 2) < 0.1) {
29 if (bz > 0) {
30 // magnetic field +0.2 T
31 mRPhiA2 = resRPhiIdeal2;
32 mRPhiB = -1.43e-2f;
33 mRPhiC2 = 4.55e-2f;
34
35 mDyA2 = 1.225e-3f;
36 mDyB = -9.8e-3f;
37 mDyC2 = 3.88e-2f;
38
39 mAngleToDyA = -0.1f;
40 mAngleToDyB = 1.89f;
41 mAngleToDyC = -0.4f;
42 } else {
43 // magnetic field -0.2 T
44 mRPhiA2 = resRPhiIdeal2;
45 mRPhiB = 1.43e-2f;
46 mRPhiC2 = 4.55e-2f;
47
48 mDyA2 = 1.225e-3f;
49 mDyB = 9.8e-3f;
50 mDyC2 = 3.88e-2f;
51
52 mAngleToDyA = 0.1f;
53 mAngleToDyB = 1.89f;
54 mAngleToDyC = 0.4f;
55 }
56 } else if (CAMath::Abs(CAMath::Abs(bz) - 5) < 0.1) {
57 if (bz > 0) {
58 // magnetic field +0.5 T
59 mRPhiA2 = resRPhiIdeal2;
60 mRPhiB = 0.125f;
61 mRPhiC2 = 0.0961f;
62
63 mDyA2 = 1.681e-3f;
64 mDyB = 0.15f;
65 mDyC2 = 0.1849f;
66
67 mAngleToDyA = 0.13f;
68 mAngleToDyB = 2.43f;
69 mAngleToDyC = -0.58f;
70 } else {
71 // magnetic field -0.5 T
72 mRPhiA2 = resRPhiIdeal2;
73 mRPhiB = -0.14f;
74 mRPhiC2 = 0.1156f;
75
76 mDyA2 = 2.209e-3f;
77 mDyB = -0.15f;
78 mDyC2 = 0.2025f;
79
80 mAngleToDyA = -0.15f;
81 mAngleToDyB = 2.34f;
82 mAngleToDyC = 0.56f;
83 }
84 } else {
85 LOGP(warning, "No error parameterization available for Bz= {}. Keeping default value (sigma_y = const. = 1cm)", bz);
86 }
87 LOGP(info, "Loaded parameterizations for Bz={}: PhiRes:[{},{},{}] DyRes:[{},{},{}] Angle2Dy:[{},{},{}]",
88 bz, mRPhiA2, mRPhiB, mRPhiC2, mDyA2, mDyB, mDyC2, mAngleToDyA, mAngleToDyB, mAngleToDyC);
89}
90
91void GPUTRDRecoParam::recalcTrkltCov(const float tilt, const float snp, const float rowSize, float* cov) const
92{
93 float t2 = tilt * tilt; // tan^2 (tilt)
94 float c2 = 1.f / (1.f + t2); // cos^2 (tilt)
95 float sy2 = getRPhiRes(snp);
96 float sz2 = rowSize * rowSize / 12.f;
97 cov[0] = c2 * (sy2 + t2 * sz2);
98 cov[1] = c2 * tilt * (sz2 - sy2);
99 cov[2] = c2 * (t2 * sy2 + sz2);
100}
void init(float bz, const GPUSettingsRec *rec=nullptr)
Load parameterization for given magnetic field.
const float const float rowSize
GPUReconstruction * rec