]>
Commit | Line | Data |
---|---|---|
52c6d8aa | 1 | #ifndef ALIHLTMUONFULLTRACKER_H |
2 | #define ALIHLTMUONFULLTRACKER_H | |
3 | /* This file is property of and copyright by the ALICE HLT Project * | |
4 | * ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
fd5b812e | 6 | |
7 | /// | |
8 | /// @file AliHLTMUONFullTracker.h | |
9 | /// @author Indranil Das <indra.das@saha.ac.in> | <indra.ehep@gmail.com> | |
10 | /// @date 09 Feb 2010 | |
11 | /// @brief For full tracking in the dimuon HLT. | |
12 | /// | |
13 | ||
14 | ||
52c6d8aa | 15 | /********************************************************************** |
fd5b812e | 16 | Created on : 08/12/2009 |
17 | Purpose : First version implementation of the Full tracker for dHLT. | |
18 | Author : Indranil Das, HEP Division, SINP | |
19 | Email : indra.das@saha.ac.in | indra.ehep@gmail.com | |
52c6d8aa | 20 | **********************************************************************/ |
21 | ||
fd5b812e | 22 | #include <iostream> |
23 | #include <map> | |
52c6d8aa | 24 | |
fd5b812e | 25 | #include "TMatrixD.h" |
26 | #include "TMath.h" | |
27 | #include "AliHLTMUONDataBlockReader.h" | |
28 | #include "AliHLTMUONDataBlockWriter.h" | |
29 | ||
30 | ||
31 | class AliHLTMUONUtils; | |
32 | class AliHLTMUONDataTypes; | |
33 | class AliHLTMUONConstants; | |
34 | class AliRunInfo; | |
35 | class AliLog; | |
36 | class AliCDBEntry; | |
37 | class AliMpDEIterator; | |
38 | class AliMpCDB; | |
39 | class AliMpSegmentation; | |
40 | class AliMpDDLStore; | |
41 | class AliMUONTrackParam; | |
42 | class AliMUONGeometryTransformer; | |
43 | class AliMUONConstants; | |
44 | class AliMUONTrackExtrap; | |
45 | class AliMUONTrackParam; | |
46 | class AliMUONTrackExtrap; | |
47 | class AliGRPObject; | |
48 | class AliGeomManager; | |
49 | class AliCDBStorage; | |
50 | class AliCDBManager; | |
51 | class AliMagF; | |
52 | class TGeoGlobalMagField; | |
53 | class TVector3; | |
54 | class TString; | |
55 | class TMap; | |
56 | ||
57 | typedef std::map<Int_t, Int_t> DetElemList; | |
52c6d8aa | 58 | |
59 | class AliHLTMUONFullTracker : public AliHLTLogging | |
60 | { | |
61 | ||
62 | public : | |
63 | ///Constructor | |
64 | AliHLTMUONFullTracker() ; | |
65 | ///Destructor | |
fd5b812e | 66 | virtual ~AliHLTMUONFullTracker(); |
52c6d8aa | 67 | |
68 | ///Print message | |
69 | void Print(); | |
70 | ///Set the input of trigrec blocks | |
71 | Bool_t SetInput(AliHLTInt32_t ddl, const AliHLTMUONTriggerRecordStruct *data, AliHLTInt32_t size); | |
72 | ///Set the input of rechit blocks | |
73 | Bool_t SetInput(AliHLTInt32_t ddl, const AliHLTMUONRecHitStruct *data, AliHLTInt32_t size); | |
74 | ///Main method to run and compute the tracks | |
d24a4636 | 75 | Bool_t Run(int iEvent,AliHLTMUONTrackStruct *data, AliHLTUInt32_t& size); |
52c6d8aa | 76 | ///To be called once from DoInit method of component |
77 | Bool_t Init(); | |
fd5b812e | 78 | ///Max number of points per chamber |
79 | int MaxNofPointsPerCh(){return fgkMaxNofPointsPerCh;} | |
80 | ||
52c6d8aa | 81 | protected: |
82 | ||
83 | /// copy constructor | |
84 | AliHLTMUONFullTracker(const AliHLTMUONFullTracker& rhs); | |
85 | /// assignment operator | |
86 | AliHLTMUONFullTracker& operator=(const AliHLTMUONFullTracker& rhs); | |
87 | ||
88 | private : | |
89 | ||
90 | /// intger pair needed for QuadTrackSeg method | |
91 | struct IntPair{ | |
fd5b812e | 92 | Int_t fFirst,fSecond; /// First and second |
52c6d8aa | 93 | }; |
94 | ///Structure for internal track segments | |
95 | struct TrackSeg{ | |
fd5b812e | 96 | Int_t fIndex[4]; /// index array for cluster address |
97 | AliHLTInt32_t fTrigRec; /// trigrec | |
52c6d8aa | 98 | }; |
99 | ||
100 | ///Sructure for clusters | |
101 | struct Cluster{ | |
fd5b812e | 102 | Float_t fX,fY,fZ; /// position |
103 | Float_t fErrX2,fErrY2; /// error in position | |
52c6d8aa | 104 | }; |
fd5b812e | 105 | |
106 | ///Sructure for clusters | |
107 | struct HalfTrack{ | |
108 | Float_t fPx,fPy,fPz; /// momentum | |
109 | Int_t fCharge; /// charge | |
110 | }; | |
52c6d8aa | 111 | |
eb672fd1 | 112 | static const Float_t fgkTrackDetCoordinate[3]; /// set the constant value for third station position and size |
52c6d8aa | 113 | |
114 | static const Double_t fgkAbsoedge[4] ; /// edge of the absorber | |
115 | static const Double_t fgkRadLen[3] ; /// radiation length of the main three matirials of the front absorber | |
116 | static const Double_t fgkRho[3] ; /// density of the main three matirials of the front absorber | |
117 | static const Double_t fgkAtomicZ[3] ; /// atomic number the main three matirials of the front absorber | |
118 | static const Double_t fgkAtomicA[3] ; /// atomic mass of the main three matirials of the front absorber | |
119 | ||
120 | static const Int_t fgkMaxNofCellsPerCh ; /// maximum number of cell are allowed to create | |
121 | static const Int_t fgkMaxNofPointsPerCh ; /// maximim number of points per chamber | |
122 | static const Int_t fgkMaxNofCh ; /// maximum number of chambrs | |
123 | static const Int_t fgkMaxNofTracks; /// maximum number of allowed tracks | |
124 | static const Int_t fgkMaxNofConnectedTracks; /// maximum number of back to front connected tracks | |
125 | ||
fd5b812e | 126 | AliMUONGeometryTransformer *fChamberGeometryTransformer; /// Pointer to AliMUONGeometryTransformer |
127 | AliHLTMUONRecHitStruct ***fChPoint; /// array of pointer to rechit data | |
128 | AliHLTMUONTriggerRecordStruct **fChPoint11; ///array of pointer to trigrec data | |
129 | TrackSeg *fBackTrackSeg; /// track segments at the rear part of the spectrometer | |
130 | TrackSeg *fFrontTrackSeg; /// track segments close the part of interaction point of ALICE | |
131 | Float_t *fExtrapSt3X ; /// Extrapolated x position in third station | |
132 | Float_t *fExtrapSt3Y ; /// Extrapolated y position in third station | |
133 | Float_t *fInclinationBack; /// values of inclination angle of back track segments | |
134 | ||
135 | Int_t *fNofConnectedfrontTrackSeg ; /// nof connected tracks in front direction for each back track segments | |
136 | Int_t **fBackToFront; /// Pointer to back to front segment mapping | |
137 | Int_t *fNofPoints ; /// Number of points for each stations | |
138 | AliMUONTrackParam *fTrackParam ; /// track parameters; | |
139 | HalfTrack *fHalfTrack; /// momentum parameters for the tracks which doesnot have tracksegment in quadrants | |
140 | ||
141 | Int_t fTotNofPoints; /// Total number of points received from all rechit source | |
142 | Int_t fTotTrackSeg; /// Total number of track segments | |
143 | Int_t fNofCells[2]; // nof cell count per station | |
144 | Int_t fNofbackTrackSeg; /// number of back track segments | |
145 | Int_t fNoffrontTrackSeg; /// number of front track segments | |
146 | Int_t fNofConnected ; /// number of connected track segments | |
147 | AliHLTUInt32_t fNofTracks; /// number of connected track segments | |
148 | DetElemList fDetElemList; ///Map for valid detelem | |
52c6d8aa | 149 | |
150 | /// Slat Track segments | |
151 | Bool_t SlatTrackSeg(); | |
fd5b812e | 152 | /// Calculate preliminary momentum |
153 | Bool_t PrelimMomCalc(); | |
52c6d8aa | 154 | /// Quad Track segments |
155 | Bool_t QuadTrackSeg(); | |
156 | /// Kalman Chi2 test | |
157 | Bool_t KalmanChi2Test(); | |
158 | /// track extrapolation through dipole magnet to connect front and back track seg | |
159 | Bool_t SelectFront(); | |
160 | /// Propagate tracks | |
fd5b812e | 161 | void PropagateTracks(Double_t charge, Float_t& px, Float_t& py, Float_t& pz, |
162 | Float_t& xr, Float_t& yr, Float_t& zr, Float_t zprop); | |
52c6d8aa | 163 | /// extrapolate to origin |
eb672fd1 | 164 | Bool_t ExtrapolateToOrigin(Bool_t extrap); |
52c6d8aa | 165 | /// Clean after each run |
166 | Bool_t Clear(); | |
167 | ||
168 | ||
169 | /// Angle calculate | |
fd5b812e | 170 | inline Double_t Angle(const AliHLTMUONRecHitStruct *v1, const AliHLTMUONRecHitStruct *v2); |
52c6d8aa | 171 | /// Subtracktion of two point |
fd5b812e | 172 | inline void Sub(const AliHLTMUONRecHitStruct *v1, const AliHLTMUONRecHitStruct *v2, AliHLTMUONRecHitStruct *v3) const; |
52c6d8aa | 173 | /// Kalman Filter |
fd5b812e | 174 | inline Double_t KalmanFilter(AliMUONTrackParam &trackParamAtCluster, Cluster *cluster); |
52c6d8aa | 175 | /// Try onecluster |
fd5b812e | 176 | inline Double_t TryOneCluster(const AliMUONTrackParam &trackParam, Cluster* cluster, |
52c6d8aa | 177 | AliMUONTrackParam &trackParamAtCluster, Bool_t updatePropagator); |
fd5b812e | 178 | inline Bool_t TryOneClusterFast(const AliMUONTrackParam &trackParam, const Cluster* cluster); |
52c6d8aa | 179 | |
180 | /// MCS effect correction | |
fd5b812e | 181 | inline void CorrectMCSEffectInAbsorber(AliMUONTrackParam* param, |
52c6d8aa | 182 | Double_t xVtx, Double_t yVtx, Double_t zVtx, |
183 | Double_t absZBeg, | |
184 | Double_t f1, Double_t f2); | |
185 | /// Covariant handling function | |
fd5b812e | 186 | inline void Cov2CovP(const TMatrixD ¶m, TMatrixD &cov); |
52c6d8aa | 187 | /// Covariant handling function |
fd5b812e | 188 | inline void CovP2Cov(const TMatrixD ¶m, TMatrixD &covP); |
52c6d8aa | 189 | /// Energy loss coreection in front absorber |
fd5b812e | 190 | inline void CorrectELossEffectInAbsorber(AliMUONTrackParam* param, Double_t eLoss); |
52c6d8aa | 191 | /// Linear Extrapolation to Z position |
fd5b812e | 192 | inline void LinearExtrapToZ(AliMUONTrackParam* trackParam, Double_t zEnd); |
52c6d8aa | 193 | /// Energy loss |
fd5b812e | 194 | inline Double_t EnergyLossFluctuation2(Double_t pTotal, Double_t pathLength, Double_t rho, Double_t atomicA, Double_t atomicZ); |
52c6d8aa | 195 | /// Bethe Bloch formula of enrgy loss |
fd5b812e | 196 | inline Double_t BetheBloch(Double_t pTotal, Double_t pathLength, Double_t rho, Double_t atomicA, Double_t atomicZ); |
52c6d8aa | 197 | |
198 | /// Runge Kutta method of track extrapolation through mag field | |
fd5b812e | 199 | inline void OneStepRungekutta(Double_t charge, Double_t step, const Double_t* vect, Double_t* vout); |
52c6d8aa | 200 | /// Helix3 method of track extrapolation through mag field |
fd5b812e | 201 | inline void OneStepHelix3(Double_t field, Double_t step, const Double_t *vect, Double_t *vout) const; |
52c6d8aa | 202 | /// Fill the tracks to output pointer |
d24a4636 | 203 | Bool_t FillOutData(AliHLTMUONTrackStruct *data, AliHLTUInt32_t& size); |
52c6d8aa | 204 | |
205 | }; | |
206 | #endif // ALIHLTMUONMANSOTRACKERFSM_H |