o add Reset function to CalPad and CalROC o Add functionality to AliTPCdataQA - Reset...
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackExtrap.h
CommitLineData
c04e3238 1#ifndef ALIMUONTRACKEXTRAP_H
2#define ALIMUONTRACKEXTRAP_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/*$Id$*/
7// Revision of includes 07/05/2004
8
9/// \ingroup rec
10/// \class AliMUONTrackExtrap
11/// \brief Track parameters in ALICE dimuon spectrometer
12///
13//////////////////////////////////////////////////////////////
14/// Tools for track extrapolation in ALICE dimuon spectrometer
15//////////////////////////////////////////////////////////////
16
17#include <TObject.h>
690d2205 18#include <TMatrixD.h>
c04e3238 19
20class AliMagF;
21class AliMUONTrackParam;
22
23class AliMUONTrackExtrap : public TObject
24{
25 public:
26 /// Constructor
27 AliMUONTrackExtrap() : TObject(){};
28 /// Destructor
29 virtual ~AliMUONTrackExtrap(){};
30
f7a1cc68 31 static void SetField();
9f093251 32
33 /// return kTRUE if the field is switched ON
34 static Bool_t IsFieldON() {return fgFieldON;}
c04e3238 35
208f139e 36 static Double_t GetImpactParamFromBendingMomentum(Double_t bendingMomentum);
37 static Double_t GetBendingMomentumFromImpactParam(Double_t impactParam);
38
3fe6651e 39 // Linearly extrapolate track parameters
40 static void LinearExtrapToZ(AliMUONTrackParam* trackParam, Double_t zEnd);
41
690d2205 42 // Linearly extrapolate track parameters and covariances
3fe6651e 43 static void LinearExtrapToZCov(AliMUONTrackParam* trackParam, Double_t zEnd, Bool_t updatePropagator = kFALSE);
690d2205 44
45 // Extrapolate track parameters in magnetic field
4ea3f013 46 static Bool_t ExtrapToZ(AliMUONTrackParam *trackParam, Double_t zEnd);
690d2205 47
48 // Extrapolate track parameters and covariances in magnetic field
4ea3f013 49 static Bool_t ExtrapToZCov(AliMUONTrackParam* trackParam, Double_t zEnd, Bool_t updatePropagator = kFALSE);
690d2205 50
51 // Extrapolate track parameters to vertex, corrected for multiple scattering and energy loss effects
52 // Add branson correction resolution and energy loss fluctuation to parameter covariances
53 static void ExtrapToVertex(AliMUONTrackParam* trackParam,
54 Double_t xVtx, Double_t yVtx, Double_t zVtx,
55 Double_t errXVtx, Double_t errYVtx);
56
57 // Extrapolate track parameters to vertex, corrected for multiple scattering effects only
58 // Add branson correction resolution to parameter covariances
59 static void ExtrapToVertexWithoutELoss(AliMUONTrackParam* trackParam,
60 Double_t xVtx, Double_t yVtx, Double_t zVtx,
61 Double_t errXVtx, Double_t errYVtx);
62
63 // Extrapolate track parameters to vertex, corrected for energy loss effects only
64 // Add dispersion due to multiple scattering and energy loss fluctuation to parameter covariances
65 static void ExtrapToVertexWithoutBranson(AliMUONTrackParam* trackParam, Double_t zVtx);
66
67 // Extrapolate track parameters to vertex without multiple scattering and energy loss corrections
68 // Add dispersion due to multiple scattering to parameter covariances
208f139e 69 static void ExtrapToVertexUncorrected(AliMUONTrackParam* trackParam, Double_t zVtx);
fac70e25 70
71 static Double_t TotalMomentumEnergyLoss(AliMUONTrackParam* trackParam, Double_t xVtx, Double_t yVtx, Double_t zVtx);
c04e3238 72
ea94c18b 73 static Double_t GetMCSAngle2(const AliMUONTrackParam& param, Double_t dZ, Double_t x0);
74 static void AddMCSEffect(AliMUONTrackParam *param, Double_t dZ, Double_t x0);
208f139e 75
57e2ad1a 76 static Bool_t ExtrapOneStepRungekutta(Double_t charge, Double_t step, const Double_t* vect, Double_t* vout);
c04e3238 77
78
79 private:
9f093251 80 static const Double_t fgkSimpleBPosition; //!< position of the dipole
81 static const Double_t fgkSimpleBLength; //!< length of the dipole
82 static Double_t fgSimpleBValue; //!< magnetic field value at the centre
83 static Bool_t fgFieldON; //!< kTRUE if the field is switched ON
4284483e 84 static const Bool_t fgkUseHelix; //!< Tell whether to use Helix or not (default is Runge-Kutta)
85 static const Int_t fgkMaxStepNumber; //!< Maximum number of steps for track extrapolation
86 static const Double_t fgkHelixStepLength; //!< Step lenght for track extrapolation (used in Helix)
87 static const Double_t fgkRungeKuttaMaxResidue;//!< Maximal distance (in Z) to destination to stop the track extrapolation (used in Runge-Kutta)
88
c04e3238 89 // Functions
71a2d3aa 90
91 /// Not implemented
c04e3238 92 AliMUONTrackExtrap(const AliMUONTrackExtrap& trackExtrap);
71a2d3aa 93 /// Not implemented
c04e3238 94 AliMUONTrackExtrap& operator=(const AliMUONTrackExtrap& trackExtrap);
95
4ea3f013 96 static Bool_t ExtrapToZHelix(AliMUONTrackParam *trackParam, Double_t Z);
97 static Bool_t ExtrapToZRungekutta(AliMUONTrackParam *trackParam, Double_t Z);
4284483e 98
99 static void ConvertTrackParamForExtrap(AliMUONTrackParam* trackParam, Double_t forwardBackward, Double_t *v3);
eb3178e9 100 static void RecoverTrackParam(Double_t *v3, Double_t Charge, AliMUONTrackParam* trackParam);
c04e3238 101
690d2205 102 static void ExtrapToVertex(AliMUONTrackParam* trackParam,
103 Double_t xVtx, Double_t yVtx, Double_t zVtx,
104 Double_t errXVtx, Double_t errYVtx,
105 Bool_t correctForMCS, Bool_t correctForEnergyLoss);
106
37a615ac 107 static void AddMCSEffectInAbsorber(AliMUONTrackParam* trackParam, Double_t signedPathLength, Double_t f0, Double_t f1, Double_t f2);
690d2205 108 static void CorrectMCSEffectInAbsorber(AliMUONTrackParam* param,
109 Double_t xVtx, Double_t yVtx, Double_t zVtx,
110 Double_t errXVtx, Double_t errYVtx,
111 Double_t absZBeg, Double_t pathLength, Double_t f0, Double_t f1, Double_t f2);
112 static void CorrectELossEffectInAbsorber(AliMUONTrackParam* param, Double_t eLoss, Double_t sigmaELoss2);
18abc511 113 static Bool_t GetAbsorberCorrectionParam(Double_t trackXYZIn[3], Double_t trackXYZOut[3], Double_t pTotal,
114 Double_t &pathLength, Double_t &f0, Double_t &f1, Double_t &f2,
115 Double_t &meanRho, Double_t &totalELoss, Double_t &sigmaELoss2);
8cde4af5 116
fa5e35be 117 static Double_t BetheBloch(Double_t pTotal, Double_t pathLength, Double_t rho, Double_t atomicZ, Double_t atomicZoverA);
00d38895 118 static Double_t EnergyLossFluctuation(Double_t pTotal, Double_t pathLength, Double_t rho, Double_t atomicZoverA);
690d2205 119
120 static void Cov2CovP(const TMatrixD &param, TMatrixD &cov);
121 static void CovP2Cov(const TMatrixD &param, TMatrixD &cov);
c04e3238 122
57e2ad1a 123 static void ExtrapOneStepHelix(Double_t charge, Double_t step, const Double_t *vect, Double_t *vout);
124 static void ExtrapOneStepHelix3(Double_t field, Double_t step, const Double_t *vect, Double_t *vout);
c04e3238 125
126 ClassDef(AliMUONTrackExtrap, 0) // Tools for track extrapolation in ALICE dimuon spectrometer
127};
128
129#endif