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 */
8 /// @file AliHLTMUONFullTracker.h
9 /// @author Indranil Das <indra.das@saha.ac.in> | <indra.ehep@gmail.com>
11 /// @brief For full tracking in the dimuon HLT.
15 /**********************************************************************
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
20 **********************************************************************/
27 #include "AliHLTMUONDataBlockReader.h"
28 #include "AliHLTMUONDataBlockWriter.h"
31 class AliHLTMUONUtils;
32 class AliHLTMUONDataTypes;
33 class AliHLTMUONConstants;
37 class AliMpDEIterator;
39 class AliMpSegmentation;
41 class AliMUONTrackParam;
42 class AliMUONGeometryTransformer;
43 class AliMUONConstants;
44 class AliMUONTrackExtrap;
45 class AliMUONTrackParam;
46 class AliMUONTrackExtrap;
52 class TGeoGlobalMagField;
57 typedef std::map<Int_t, Int_t> DetElemList;
59 class AliHLTMUONFullTracker : public AliHLTLogging
64 AliHLTMUONFullTracker() ;
66 virtual ~AliHLTMUONFullTracker();
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
75 Bool_t Run(int iEvent,AliHLTMUONTrackStruct *data, AliHLTUInt32_t& size);
76 ///To be called once from DoInit method of component
78 ///Max number of points per chamber
79 int MaxNofPointsPerCh(){return fgkMaxNofPointsPerCh;}
84 AliHLTMUONFullTracker(const AliHLTMUONFullTracker& rhs);
85 /// assignment operator
86 AliHLTMUONFullTracker& operator=(const AliHLTMUONFullTracker& rhs);
90 /// intger pair needed for QuadTrackSeg method
92 Int_t fFirst,fSecond; /// First and second
94 ///Structure for internal track segments
96 Int_t fIndex[4]; /// index array for cluster address
97 AliHLTInt32_t fTrigRec; /// trigrec
100 ///Sructure for clusters
102 Float_t fX,fY,fZ; /// position
103 Float_t fErrX2,fErrY2; /// error in position
106 ///Sructure for clusters
108 Float_t fPx,fPy,fPz; /// momentum
109 Int_t fCharge; /// charge
112 static const Float_t fgkTrackDetCoordinate[3]; /// set the constant value for third station position and size
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
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
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
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
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
150 /// Slat Track segments
151 Bool_t SlatTrackSeg();
152 /// Calculate preliminary momentum
153 Bool_t PrelimMomCalc();
154 /// Quad Track segments
155 Bool_t QuadTrackSeg();
157 Bool_t KalmanChi2Test();
158 /// track extrapolation through dipole magnet to connect front and back track seg
159 Bool_t SelectFront();
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);
163 /// extrapolate to origin
164 Bool_t ExtrapolateToOrigin(Bool_t extrap);
165 /// Clean after each run
170 inline Double_t Angle(const AliHLTMUONRecHitStruct *v1, const AliHLTMUONRecHitStruct *v2);
171 /// Subtracktion of two point
172 inline void Sub(const AliHLTMUONRecHitStruct *v1, const AliHLTMUONRecHitStruct *v2, AliHLTMUONRecHitStruct *v3) const;
174 inline Double_t KalmanFilter(AliMUONTrackParam &trackParamAtCluster, Cluster *cluster);
176 inline Double_t TryOneCluster(const AliMUONTrackParam &trackParam, Cluster* cluster,
177 AliMUONTrackParam &trackParamAtCluster, Bool_t updatePropagator);
178 inline Bool_t TryOneClusterFast(const AliMUONTrackParam &trackParam, const Cluster* cluster);
180 /// MCS effect correction
181 inline void CorrectMCSEffectInAbsorber(AliMUONTrackParam* param,
182 Double_t xVtx, Double_t yVtx, Double_t zVtx,
184 Double_t f1, Double_t f2);
185 /// Covariant handling function
186 inline void Cov2CovP(const TMatrixD ¶m, TMatrixD &cov);
187 /// Covariant handling function
188 inline void CovP2Cov(const TMatrixD ¶m, TMatrixD &covP);
189 /// Energy loss coreection in front absorber
190 inline void CorrectELossEffectInAbsorber(AliMUONTrackParam* param, Double_t eLoss);
191 /// Linear Extrapolation to Z position
192 inline void LinearExtrapToZ(AliMUONTrackParam* trackParam, Double_t zEnd);
194 inline Double_t EnergyLossFluctuation2(Double_t pTotal, Double_t pathLength, Double_t rho, Double_t atomicA, Double_t atomicZ);
195 /// Bethe Bloch formula of enrgy loss
196 inline Double_t BetheBloch(Double_t pTotal, Double_t pathLength, Double_t rho, Double_t atomicA, Double_t atomicZ);
198 /// Runge Kutta method of track extrapolation through mag field
199 inline void OneStepRungekutta(Double_t charge, Double_t step, const Double_t* vect, Double_t* vout);
200 /// Helix3 method of track extrapolation through mag field
201 inline void OneStepHelix3(Double_t field, Double_t step, const Double_t *vect, Double_t *vout) const;
202 /// Fill the tracks to output pointer
203 Bool_t FillOutData(AliHLTMUONTrackStruct *data, AliHLTUInt32_t& size);
206 #endif // ALIHLTMUONMANSOTRACKERFSM_H