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 resRPhiIdeal = 0.04f;
28 float resVsTanPhiMisalign = 0.f;
29 if (rec) {
30 resRPhiIdeal = rec->trd.trkltResRPhiIdeal;
31 resVsTanPhiMisalign = rec->trd.trkltResVsTanPhiMisalign;
32 mPileUpRangeBefore = -rec->trd.pileupBwdNBC;
33 mPileUpRangeAfter = rec->trd.pileupFwdNBC;
34 }
35#ifndef GPUCA_STANDALONE
36 else {
37 const auto& rtrd = GPU_GET_CONFIG(GPUSettingsRecTRD);
38 resRPhiIdeal = rtrd.trkltResRPhiIdeal;
39 resVsTanPhiMisalign = rtrd.trkltResVsTanPhiMisalign;
40 mPileUpRangeBefore = -rtrd.pileupBwdNBC;
41 mPileUpRangeAfter = rtrd.pileupFwdNBC;
42 }
43#endif
44
45 if (CAMath::Abs(CAMath::Abs(bz) - 2) < 0.1) {
46 if (bz > 0) {
47 // magnetic field +0.2 T
48 mRPhiC2 = 4.55e-2f;
49 } else {
50 // magnetic field -0.2 T
51 mRPhiC2 = 4.55e-2f;
52 }
53 } else if (CAMath::Abs(CAMath::Abs(bz) - 5) < 0.1) {
54 if (bz > 0) {
55 // magnetic field +0.5 T
56 mRPhiC2 = 0.0961f;
57 } else {
58 // magnetic field -0.5 T
59 mRPhiC2 = 0.1156f;
60 }
61 } else {
62 LOGP(warning, "No error parameterization available for Bz= {}. Keeping default value (sigma_y = const. = 1cm)", bz);
63 }
64
65 mRPhiA = resRPhiIdeal;
66 mRPhiATgp = resVsTanPhiMisalign;
67 mLorentzAngle = -0.02f + 0.13f * bz / 5.f;
68
69 mDyA2 = 6e-3f;
70 mDyC2 = 0.3f;
71
72 LOGP(info, "Loaded parameterizations for Bz={}: PhiRes:[{},{},{},{}] DyRes:[{},{},{}]",
73 bz, mRPhiA, mRPhiATgp, mLorentzAngle, mRPhiC2, mDyA2, mLorentzAngle, mDyC2);
74}
75
76void GPUTRDRecoParam::recalcTrkltCov(const float tilt, const float snp, const float rowSize, float* cov, const float pull, const int occupancy) const
77{
78 float t2 = tilt * tilt; // tan^2 (tilt)
79 float c2 = 1.f / (1.f + t2); // cos^2 (tilt)
80 float sy2 = getRPhiRes(snp, CAMath::Abs(pull), occupancy);
81 float sz2 = rowSize * rowSize / 12.f;
82 cov[0] = c2 * (sy2 + t2 * sz2);
83 cov[1] = c2 * tilt * (sz2 - sy2);
84 cov[2] = c2 * (t2 * sy2 + sz2);
85}
void init(float bz, const GPUSettingsRec *rec=nullptr)
Load parameterization for given magnetic field.
const float const float std::array< float, 3 > & cov
const float const float rowSize
const float const float std::array< float, 3 > const float pull
const float const float std::array< float, 3 > const float const int occupancy
GPUReconstruction * rec