Project
Loading...
Searching...
No Matches
TrackExtrap.h
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
16
17#ifndef O2_MCH_TRACKEXTRAP_H_
18#define O2_MCH_TRACKEXTRAP_H_
19
20#include <cstddef>
21#include <optional>
22
23#include <TMatrixD.h>
24
25namespace o2
26{
27namespace mch
28{
29
30class TrackParam;
31
34{
35 public:
36 // static class
37 TrackExtrap() = delete;
38 ~TrackExtrap() = delete;
39
40 TrackExtrap(const TrackExtrap&) = delete;
44
45 static void setField();
46
48 static bool isFieldON() { return sFieldON; }
49
51 static void useExtrapV2(bool extrapV2 = true) { sExtrapV2 = extrapV2; }
52
53 static double getImpactParamFromBendingMomentum(double bendingMomentum);
54 static double getBendingMomentumFromImpactParam(double impactParam);
55
56 static void linearExtrapToZ(TrackParam& trackParam, double zEnd);
57 static void linearExtrapToZCov(TrackParam& trackParam, double zEnd, bool updatePropagator = false);
58
59 static bool extrapToZ(TrackParam& trackParam, double zEnd);
60 static bool extrapToZCov(TrackParam& trackParam, double zEnd, bool updatePropagator = false);
61
62 static bool extrapToVertex(TrackParam& trackParam, double xVtx, double yVtx, double zVtx, double errXVtx, double errYVtx)
63 {
66 return extrapToVertex(trackParam, xVtx, yVtx, zVtx, errXVtx, errYVtx, true, true);
67 }
68 static bool extrapToVertexWithoutELoss(TrackParam& trackParam, double xVtx, double yVtx, double zVtx, double errXVtx, double errYVtx)
69 {
72 return extrapToVertex(trackParam, xVtx, yVtx, zVtx, errXVtx, errYVtx, true, false);
73 }
74 static bool extrapToVertexWithoutBranson(TrackParam& trackParam, double zVtx,
75 double xUpstream = 0., double yUpstream = 0.,
76 std::optional<double> zUpstream = std::nullopt)
77 {
80 return extrapToVertex(trackParam, 0., 0., zVtx, 0., 0., false, true, xUpstream, yUpstream, zUpstream);
81 }
82 static bool extrapToVertexUncorrected(TrackParam& trackParam, double zVtx,
83 double xUpstream = 0., double yUpstream = 0.,
84 std::optional<double> zUpstream = std::nullopt)
85 {
88 return extrapToVertex(trackParam, 0., 0., zVtx, 0., 0., false, false, xUpstream, yUpstream, zUpstream);
89 }
90
91 static bool extrapToMID(TrackParam& trackParam);
92
93 static double getMCSAngle2(const TrackParam& param, double dZ, double x0);
94 static void addMCSEffect(TrackParam& trackParam, double dZ, double x0);
95
96 static void printNCalls();
97
98 private:
99 static bool extrapToVertex(TrackParam& trackParam, double xVtx, double yVtx, double zVtx,
100 double errXVtx, double errYVtx, bool correctForMCS, bool correctForEnergyLoss,
101 double xUpstream = 0., double yUpstream = 0., std::optional<double> zUpstream = std::nullopt);
102
103 static bool getAbsorberCorrectionParam(double trackXYZIn[3], double trackXYZOut[3], double pTotal,
104 double& pathLength, double& f0, double& f1, double& f2,
105 double& meanRho, double& totalELoss, double& sigmaELoss2);
106
107 static void addMCSEffectInAbsorber(TrackParam& param, double signedPathLength, double f0, double f1, double f2);
108
109 static double betheBloch(double pTotal, double pathLength, double rho, double atomicZ, double atomicZoverA);
110 static double energyLossFluctuation(double pTotal, double pathLength, double rho, double atomicZoverA);
111
112 static bool correctMCSEffectInAbsorber(TrackParam& param, double xVtx, double yVtx, double zVtx, double errXVtx, double errYVtx,
113 double absZBeg, double pathLength, double f0, double f1, double f2);
114 static void correctELossEffectInAbsorber(TrackParam& param, double eLoss, double sigmaELoss2);
115
116 static void cov2CovP(const TMatrixD& param, TMatrixD& cov);
117 static void covP2Cov(const TMatrixD& param, TMatrixD& covP);
118
119 static void convertTrackParamForExtrap(TrackParam& trackParam, double forwardBackward, double* v3);
120 static void recoverTrackParam(double* v3, double Charge, TrackParam& trackParam);
121
122 static bool extrapToZRungekutta(TrackParam& trackParam, double zEnd);
123 static bool extrapToZRungekuttaV2(TrackParam& trackParam, double zEnd);
124 static bool extrapOneStepRungekutta(double charge, double step, const double* vect, double* vout);
125
126 static constexpr double SMuMass = 0.105658;
127 static constexpr double SAbsZBeg = -90.;
128 static constexpr double SAbsZEnd = -505.;
129 static constexpr double SSimpleBPosition = -0.5 * (994.05 + 986.6);
130 static constexpr double SSimpleBLength = 0.5 * (502.1 + 309.4);
131 static constexpr int SMaxStepNumber = 5000;
132 static constexpr double SRungeKuttaMaxResidue = 0.002;
133 static constexpr double SRungeKuttaMaxResidueV2 = 0.01;
136 static constexpr double SMostProbBendingMomentum = 2.;
137 static constexpr double SMuonFilterZBeg = -1471.;
138 static constexpr double SMuonFilterThickness = 120.;
140 static constexpr double SMuonFilterZEnd = SMuonFilterZBeg - SMuonFilterThickness;
141 static constexpr double SMuonFilterX0 = 1.76;
142 static constexpr double SMIDZ = -1603.5;
143
144 static bool sExtrapV2;
145
146 static double sSimpleBValue;
147 static bool sFieldON;
148
149 static std::size_t sNCallExtrapToZCov;
150 static std::size_t sNCallField;
151};
152
153} // namespace mch
154} // namespace o2
155
156#endif // O2_MCH_TRACKEXTRAP_H_
int16_t charge
Definition RawEventData.h:5
Class holding tools for track extrapolation.
Definition TrackExtrap.h:34
TrackExtrap(TrackExtrap &&)=delete
static void useExtrapV2(bool extrapV2=true)
Switch to Runge-Kutta extrapolation v2.
Definition TrackExtrap.h:51
static bool extrapToZ(TrackParam &trackParam, double zEnd)
static void addMCSEffect(TrackParam &trackParam, double dZ, double x0)
static bool isFieldON()
Return true if the field is switched ON.
Definition TrackExtrap.h:48
static void setField()
static bool extrapToVertex(TrackParam &trackParam, double xVtx, double yVtx, double zVtx, double errXVtx, double errYVtx)
Definition TrackExtrap.h:62
static void linearExtrapToZ(TrackParam &trackParam, double zEnd)
static bool extrapToVertexWithoutELoss(TrackParam &trackParam, double xVtx, double yVtx, double zVtx, double errXVtx, double errYVtx)
Definition TrackExtrap.h:68
static double getMCSAngle2(const TrackParam &param, double dZ, double x0)
static bool extrapToZCov(TrackParam &trackParam, double zEnd, bool updatePropagator=false)
static double getBendingMomentumFromImpactParam(double impactParam)
static bool extrapToVertexWithoutBranson(TrackParam &trackParam, double zVtx, double xUpstream=0., double yUpstream=0., std::optional< double > zUpstream=std::nullopt)
Definition TrackExtrap.h:74
static bool extrapToMID(TrackParam &trackParam)
TrackExtrap & operator=(TrackExtrap &&)=delete
static bool extrapToVertexUncorrected(TrackParam &trackParam, double zVtx, double xUpstream=0., double yUpstream=0., std::optional< double > zUpstream=std::nullopt)
Definition TrackExtrap.h:82
static double getImpactParamFromBendingMomentum(double bendingMomentum)
TrackExtrap(const TrackExtrap &)=delete
static void printNCalls()
static void linearExtrapToZCov(TrackParam &trackParam, double zEnd, bool updatePropagator=false)
TrackExtrap & operator=(const TrackExtrap &)=delete
track parameters for internal use
Definition TrackParam.h:34
GLuint GLfloat x0
Definition glcorearb.h:5034
GLfloat GLfloat GLfloat GLfloat v3
Definition glcorearb.h:814
GLenum GLfloat param
Definition glcorearb.h:271
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...