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 "GPUO2InterfaceConfiguration.inc"
17#include "GPUSettings.h"
18#include "GPUTRDRecoParam.h"
19#include "GPUCommonLogger.h"
20#include "GPUCommonMath.h"
21
22using namespace o2::gpu;
23
24// error parameterizations taken from http://cds.cern.ch/record/2724259 Appendix A
26{
27 float resRPhiIdeal2 = 1.6e-3f;
28 if (rec) {
29 resRPhiIdeal2 = rec->trd.trkltResRPhiIdeal * rec->trd.trkltResRPhiIdeal;
30 }
31#ifndef GPUCA_STANDALONE
32 else {
33 const auto& rtrd = GPU_GET_CONFIG(GPUSettingsRecTRD);
34 resRPhiIdeal2 = rtrd.trkltResRPhiIdeal * rtrd.trkltResRPhiIdeal;
35 }
36#endif
37
38 if (CAMath::Abs(CAMath::Abs(bz) - 2) < 0.1) {
39 if (bz > 0) {
40 // magnetic field +0.2 T
41 mRPhiC2 = 4.55e-2f;
42 } else {
43 // magnetic field -0.2 T
44 mRPhiC2 = 4.55e-2f;
45 }
46 } else if (CAMath::Abs(CAMath::Abs(bz) - 5) < 0.1) {
47 if (bz > 0) {
48 // magnetic field +0.5 T
49 mRPhiC2 = 0.0961f;
50 } else {
51 // magnetic field -0.5 T
52 mRPhiC2 = 0.1156f;
53 }
54 } else {
55 LOGP(warning, "No error parameterization available for Bz= {}. Keeping default value (sigma_y = const. = 1cm)", bz);
56 }
57
58 mRPhiA2 = resRPhiIdeal2;
59 mLorentzAngle = -0.02f + 0.13f * bz / 5.f;
60
61 mDyA2 = 6e-3f;
62 mDyC2 = 0.3f;
63 mCorrYDyA = 0.27f;
64 mCorrYDyC = -0.44f;
65
66 LOGP(info, "Loaded parameterizations for Bz={}: PhiRes:[{},{},{}] DyRes:[{},{},{}] CorrYDy:[{},{},{}]",
67 bz, mRPhiA2, mLorentzAngle, mRPhiC2, mDyA2, mLorentzAngle, mDyC2, mCorrYDyA, mLorentzAngle, mCorrYDyC);
68}
69
70void GPUTRDRecoParam::recalcTrkltCov(const float tilt, const float snp, const float rowSize, float* cov) const
71{
72 float t2 = tilt * tilt; // tan^2 (tilt)
73 float c2 = 1.f / (1.f + t2); // cos^2 (tilt)
74 float sy2 = getRPhiRes(snp);
75 float sz2 = rowSize * rowSize / 12.f;
76 cov[0] = c2 * (sy2 + t2 * sz2);
77 cov[1] = c2 * tilt * (sz2 - sy2);
78 cov[2] = c2 * (t2 * sy2 + sz2);
79}
void init(float bz, const GPUSettingsRec *rec=nullptr)
Load parameterization for given magnetic field.
const float const float rowSize
GPUReconstruction * rec