Project
Loading...
Searching...
No Matches
RecoParam.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 "TRDBase/RecoParam.h"
17#include <fairlogger/Logger.h>
18#include <cmath>
19
20using namespace o2::trd;
21
22// error parameterizations taken from http://cds.cern.ch/record/2724259 Appendix A
24{
25 if (std::fabs(std::fabs(bz) - 2) < 0.1) {
26 if (bz > 0) {
27 // magnetic field +0.2 T
28 mA2 = 1.6e-3f;
29 mB = -1.43e-2f;
30 mC2 = 4.55e-2f;
31 } else {
32 // magnetic field -0.2 T
33 mA2 = 1.6e-3f;
34 mB = 1.43e-2f;
35 mC2 = 4.55e-2f;
36 }
37 } else if (std::fabs(std::fabs(bz) - 5) < 0.1) {
38 if (bz > 0) {
39 // magnetic field +0.5 T
40 mA2 = 1.6e-3f;
41 mB = 0.125f;
42 mC2 = 0.0961f;
43 } else {
44 // magnetic field -0.5 T
45 mA2 = 1.6e-3f;
46 mB = -0.14f;
47 mC2 = 0.1156f;
48 }
49 } else {
50 LOG(warning) << "No error parameterization available for Bz= " << bz << ". Keeping default value (sigma_y = const. = 1cm)";
51 }
52 LOG(info) << "Loaded error parameterization for Bz = " << bz;
53}
54
55void RecoParam::recalcTrkltCov(const float tilt, const float snp, const float rowSize, std::array<float, 3>& cov) const
56{
57 float t2 = tilt * tilt; // tan^2 (tilt)
58 float c2 = 1.f / (1.f + t2); // cos^2 (tilt)
59 float sy2 = getRPhiRes(snp);
60 float sz2 = rowSize * rowSize / 12.f;
61 cov[0] = c2 * (sy2 + t2 * sz2);
62 cov[1] = c2 * tilt * (sz2 - sy2);
63 cov[2] = c2 * (t2 * sy2 + sz2);
64}
bool const GPUTPCGMMerger::trackCluster const clcomparestruct * c2
Error parameterizations and helper functions for TRD reconstruction.
void recalcTrkltCov(const float tilt, const float snp, const float rowSize, std::array< float, 3 > &cov) const
Recalculate tracklet covariance based on phi angle of related track.
Definition RecoParam.cxx:55
void setBfield(float bz)
Load parameterization for given magnetic field.
Definition RecoParam.cxx:23
float getRPhiRes(float snp) const
Definition RecoParam.h:46
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"