]>
Commit | Line | Data |
---|---|---|
672b5f43 | 1 | #ifndef ALIESDMUONTRACK_H |
2 | #define ALIESDMUONTRACK_H | |
3 | ||
af7ba10c | 4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
d5efea33 | 5 | * See cxx source for full Copyright notice */ |
af7ba10c | 6 | |
7 | /* $Id$ */ | |
8 | ||
67c201be | 9 | /// \class AliESDMuonTrack |
10 | /// \brief Class to describe the MUON tracks in the Event Summary Data class | |
af7ba10c | 11 | // Author: G.Martinez |
12 | ||
13 | ||
ad85871a | 14 | #include <TMath.h> |
60765b06 | 15 | #include <TMatrixD.h> |
16 | #include <TDatabasePDG.h> | |
ad85871a | 17 | |
18 | #include "AliVParticle.h" | |
672b5f43 | 19 | |
d5efea33 | 20 | class AliESDMuonCluster; |
daf100e1 | 21 | class AliESDEvent; |
d5efea33 | 22 | class TClonesArray; |
39b8d0dd | 23 | class TLorentzVector; |
24 | ||
ad85871a | 25 | class AliESDMuonTrack : public AliVParticle { |
5ec1b3bc | 26 | public: |
90e48c0c | 27 | AliESDMuonTrack(); //Constructor |
d5efea33 | 28 | virtual ~AliESDMuonTrack(); // Destructor |
af7ba10c | 29 | AliESDMuonTrack(const AliESDMuonTrack& esdm); |
30 | AliESDMuonTrack& operator=(const AliESDMuonTrack& esdm); | |
732a24fe | 31 | virtual void Copy(TObject &obj) const; |
5ec1b3bc | 32 | |
4c510ac5 | 33 | virtual void Clear(Option_t* opt = ""); |
34 | ||
12186235 | 35 | void Reset(); |
36 | ||
37 | // Return kTRUE if the track contain tracker data | |
38 | Bool_t ContainTrackerData() const {return (fMuonClusterMap>0) ? kTRUE : kFALSE;} | |
39 | // Return kTRUE if the track contain trigger data | |
40 | Bool_t ContainTriggerData() const {return (LoCircuit()>0) ? kTRUE : kFALSE;} | |
41 | ||
d5efea33 | 42 | // Get and Set methods for data at vertex |
5ec1b3bc | 43 | Double_t GetInverseBendingMomentum(void) const {return fInverseBendingMomentum;} |
39b8d0dd | 44 | void SetInverseBendingMomentum(Double_t InverseBendingMomentum) |
45 | {fInverseBendingMomentum = InverseBendingMomentum;} | |
5ec1b3bc | 46 | Double_t GetThetaX(void) const {return fThetaX;} |
39b8d0dd | 47 | void SetThetaX(Double_t ThetaX) {fThetaX = ThetaX;} |
5ec1b3bc | 48 | Double_t GetThetaY(void) const {return fThetaY;} |
39b8d0dd | 49 | void SetThetaY(Double_t ThetaY) {fThetaY = ThetaY;} |
5ec1b3bc | 50 | Double_t GetZ(void) const {return fZ;} |
39b8d0dd | 51 | void SetZ(Double_t Z) {fZ = Z;} |
5ec1b3bc | 52 | Double_t GetBendingCoor(void) const {return fBendingCoor;} |
39b8d0dd | 53 | void SetBendingCoor(Double_t BendingCoor) {fBendingCoor = BendingCoor;} |
5ec1b3bc | 54 | Double_t GetNonBendingCoor(void) const {return fNonBendingCoor;} |
39b8d0dd | 55 | void SetNonBendingCoor(Double_t NonBendingCoor) {fNonBendingCoor = NonBendingCoor;} |
56 | ||
d5efea33 | 57 | // Get and Set methods for data at Distance of Closest Approach in the vertex plane |
58 | Double_t GetInverseBendingMomentumAtDCA(void) const {return fInverseBendingMomentumAtDCA;} | |
59 | void SetInverseBendingMomentumAtDCA(Double_t InverseBendingMomentum) | |
60 | {fInverseBendingMomentumAtDCA = InverseBendingMomentum;} | |
61 | Double_t GetThetaXAtDCA(void) const {return fThetaXAtDCA;} | |
62 | void SetThetaXAtDCA(Double_t ThetaX) {fThetaXAtDCA = ThetaX;} | |
63 | Double_t GetThetaYAtDCA(void) const {return fThetaYAtDCA;} | |
64 | void SetThetaYAtDCA(Double_t ThetaY) {fThetaYAtDCA = ThetaY;} | |
65 | Double_t GetBendingCoorAtDCA(void) const {return fBendingCoorAtDCA;} | |
66 | void SetBendingCoorAtDCA(Double_t BendingCoor) {fBendingCoorAtDCA = BendingCoor;} | |
67 | Double_t GetNonBendingCoorAtDCA(void) const {return fNonBendingCoorAtDCA;} | |
68 | void SetNonBendingCoorAtDCA(Double_t NonBendingCoor) {fNonBendingCoorAtDCA = NonBendingCoor;} | |
69 | Double_t GetDCA(void) const {return TMath::Sqrt(fNonBendingCoorAtDCA*fNonBendingCoorAtDCA + | |
70 | fBendingCoorAtDCA*fBendingCoorAtDCA);} | |
71 | ||
72 | // Get and Set methods for data at first station | |
39b8d0dd | 73 | Double_t GetInverseBendingMomentumUncorrected(void) const {return fInverseBendingMomentumUncorrected;} |
74 | void SetInverseBendingMomentumUncorrected(Double_t InverseBendingMomentum) | |
75 | {fInverseBendingMomentumUncorrected = InverseBendingMomentum;} | |
76 | Double_t GetThetaXUncorrected(void) const {return fThetaXUncorrected;} | |
77 | void SetThetaXUncorrected(Double_t ThetaX) {fThetaXUncorrected = ThetaX;} | |
78 | Double_t GetThetaYUncorrected(void) const {return fThetaYUncorrected;} | |
79 | void SetThetaYUncorrected(Double_t ThetaY) {fThetaYUncorrected = ThetaY;} | |
80 | Double_t GetZUncorrected(void) const {return fZUncorrected;} | |
81 | void SetZUncorrected(Double_t Z) {fZUncorrected = Z;} | |
82 | Double_t GetBendingCoorUncorrected(void) const {return fBendingCoorUncorrected;} | |
83 | void SetBendingCoorUncorrected(Double_t BendingCoor) {fBendingCoorUncorrected = BendingCoor;} | |
84 | Double_t GetNonBendingCoorUncorrected(void) const {return fNonBendingCoorUncorrected;} | |
85 | void SetNonBendingCoorUncorrected(Double_t NonBendingCoor) {fNonBendingCoorUncorrected = NonBendingCoor;} | |
d5efea33 | 86 | |
87 | // Get and Set methods for covariance matrix of data at first station | |
60765b06 | 88 | void GetCovariances(TMatrixD& cov) const; |
89 | void SetCovariances(const TMatrixD& cov); | |
90 | void GetCovarianceXYZPxPyPz(Double_t cov[21]) const; | |
d5efea33 | 91 | |
f43586f0 | 92 | // Get and Set methods for the transverse position r of the track at the end of the absorber |
93 | Double_t GetRAtAbsorberEnd() const { return fRAtAbsorberEnd; } | |
94 | void SetRAtAbsorberEnd(Double_t r) { fRAtAbsorberEnd = r; } | |
95 | ||
d5efea33 | 96 | // Get and Set methods for global tracking info |
5ec1b3bc | 97 | Double_t GetChi2(void) const {return fChi2;} |
39b8d0dd | 98 | void SetChi2(Double_t Chi2) {fChi2 = Chi2;} |
4f036e6e | 99 | UChar_t GetNHit(void) const {return fNHit;} |
39b8d0dd | 100 | void SetNHit(UInt_t NHit) {fNHit = NHit;} |
d5efea33 | 101 | |
102 | // Get and Set methods for trigger matching | |
423b32ca | 103 | Int_t GetMatchTrigger() const; |
2200238e | 104 | Bool_t MatchTriggerDigits() const; |
8252d536 | 105 | Double_t GetChi2MatchTrigger() const {return fChi2MatchTrigger;} |
39b8d0dd | 106 | void SetChi2MatchTrigger(Double_t Chi2MatchTrigger) {fChi2MatchTrigger = Chi2MatchTrigger;} |
fbc3395d | 107 | UShort_t GetHitsPatternInTrigCh() const {return fHitsPatternInTrigCh;} |
108 | void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) {fHitsPatternInTrigCh = hitsPatternInTrigCh;} | |
423b32ca | 109 | void SetLocalTrigger(Int_t locTrig) { fLocalTrigger = locTrig; } |
01413742 | 110 | Int_t LoCircuit(void) const { return fLocalTrigger & 0xFF; } |
423b32ca | 111 | Int_t LoStripX(void) const { return fLocalTrigger >> 8 & 0x1F; } |
112 | Int_t LoStripY(void) const { return fLocalTrigger >> 13 & 0x0F; } | |
113 | Int_t LoDev(void) const { return fLocalTrigger >> 17 & 0x1F; } | |
114 | Int_t LoLpt(void) const { return fLocalTrigger >> 22 & 0x03; } | |
115 | Int_t LoHpt(void) const { return fLocalTrigger >> 24 & 0x03; } | |
90a0fc16 | 116 | Int_t GetTriggerWithoutChamber(void) const { return fLocalTrigger >> 26 & 0xF; } |
117 | Bool_t TriggerFiredWithoutChamber(Int_t ich) const { return GetTriggerWithoutChamber() >> (3 - ich) & 0x1; } | |
67c201be | 118 | |
9dea53d8 | 119 | // Get and Set methods for the hit strips pattern in the trigger chambers |
12186235 | 120 | UShort_t GetTriggerX1Pattern() const { return fX1Pattern; } |
121 | UShort_t GetTriggerY1Pattern() const { return fY1Pattern; } | |
122 | UShort_t GetTriggerX2Pattern() const { return fX2Pattern; } | |
123 | UShort_t GetTriggerY2Pattern() const { return fY2Pattern; } | |
124 | UShort_t GetTriggerX3Pattern() const { return fX3Pattern; } | |
125 | UShort_t GetTriggerY3Pattern() const { return fY3Pattern; } | |
126 | UShort_t GetTriggerX4Pattern() const { return fX4Pattern; } | |
127 | UShort_t GetTriggerY4Pattern() const { return fY4Pattern; } | |
9dea53d8 | 128 | void SetTriggerX1Pattern(UShort_t pat) { fX1Pattern = pat; } |
129 | void SetTriggerY1Pattern(UShort_t pat) { fY1Pattern = pat; } | |
130 | void SetTriggerX2Pattern(UShort_t pat) { fX2Pattern = pat; } | |
131 | void SetTriggerY2Pattern(UShort_t pat) { fY2Pattern = pat; } | |
132 | void SetTriggerX3Pattern(UShort_t pat) { fX3Pattern = pat; } | |
133 | void SetTriggerY3Pattern(UShort_t pat) { fY3Pattern = pat; } | |
134 | void SetTriggerX4Pattern(UShort_t pat) { fX4Pattern = pat; } | |
135 | void SetTriggerY4Pattern(UShort_t pat) { fY4Pattern = pat; } | |
136 | ||
d5efea33 | 137 | // Get and Set methods for muon cluster map |
60765b06 | 138 | UInt_t GetMuonClusterMap() const {return fMuonClusterMap;} |
139 | void SetMuonClusterMap(UInt_t muonClusterMap) {fMuonClusterMap = muonClusterMap;} | |
12186235 | 140 | void AddInMuonClusterMap(Int_t chamber) {fMuonClusterMap |= BIT(chamber);} |
141 | Bool_t IsInMuonClusterMap(Int_t chamber) const {return (Bool_t) ((fMuonClusterMap & BIT(chamber)) != 0);} | |
60765b06 | 142 | |
5c15a68b | 143 | // Identify the tracks sharing cluster(s) with another (use the last bit of fMuonClusterMap) |
144 | void Connected(Bool_t flag = kTRUE) {flag ? SETBIT(fMuonClusterMap,31) : CLRBIT(fMuonClusterMap,31);} | |
145 | Bool_t IsConnected() const {return TESTBIT(fMuonClusterMap,31);} | |
146 | ||
d5efea33 | 147 | // Methods to get, fill and check the array of associated clusters |
4c510ac5 | 148 | Int_t GetNClusters() const; |
d5efea33 | 149 | TClonesArray& GetClusters() const; |
150 | void AddCluster(const AliESDMuonCluster &cluster); | |
151 | Bool_t ClustersStored() const; | |
152 | ||
153 | // Methods to compute track momentum | |
39b8d0dd | 154 | Double_t Px() const; |
155 | Double_t Py() const; | |
156 | Double_t Pz() const; | |
157 | Double_t P() const; | |
c683ddc2 | 158 | Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; } |
39b8d0dd | 159 | void LorentzP(TLorentzVector& vP) const; |
d5efea33 | 160 | Double_t PxAtDCA() const; |
161 | Double_t PyAtDCA() const; | |
162 | Double_t PzAtDCA() const; | |
163 | Double_t PAtDCA() const; | |
164 | Bool_t PxPyPzAtDCA(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; } | |
165 | void LorentzPAtDCA(TLorentzVector& vP) const; | |
39b8d0dd | 166 | Double_t PxUncorrected() const; |
167 | Double_t PyUncorrected() const; | |
168 | Double_t PzUncorrected() const; | |
169 | Double_t PUncorrected() const; | |
d5efea33 | 170 | Bool_t PxPyPzUncorrected(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; } |
39b8d0dd | 171 | void LorentzPUncorrected(TLorentzVector& vP) const; |
172 | ||
ad85871a | 173 | // additional methods to comply with AliVParticle |
c683ddc2 | 174 | Double_t Xv() const {return -999.;} // put reasonable values here |
175 | Double_t Yv() const {return -999.;} // | |
176 | Double_t Zv() const {return -999.;} // | |
177 | Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; } | |
ad85871a | 178 | Double_t Pt() const { return TMath::Sqrt(Px()*Px() + Py()*Py()); } |
4c510ac5 | 179 | Double_t OneOverPt() const { return (Pt() != 0.) ? 1./Pt() : FLT_MAX; } |
ccc7dc72 | 180 | Double_t Phi() const { return TMath::Pi()+TMath::ATan2(-Py(), -Px()); } |
ad85871a | 181 | Double_t Theta() const { return TMath::ATan2(Pt(), Pz()); } |
60765b06 | 182 | Double_t E() const { return TMath::Sqrt(M()*M() + P()*P()); } |
183 | Double_t M() const { return TDatabasePDG::Instance()->GetParticle("mu-")->Mass(); } | |
ad85871a | 184 | Double_t Eta() const { return -TMath::Log(TMath::Tan(0.5 * Theta()));} |
4c510ac5 | 185 | Double_t Y() const { return (Pz()/E() != 1.) ? TMath::ATanH(Pz()/E()) : FLT_MAX; } |
60765b06 | 186 | Short_t Charge() const { return (Short_t)TMath::Sign(1., GetInverseBendingMomentum()); } |
6a8e543a | 187 | |
188 | ||
189 | // Dummy | |
ad85871a | 190 | const Double_t *PID() const { return (Double_t*)0x0; } |
6a8e543a | 191 | Int_t PdgCode() const {return 0;} |
2e2d0c44 | 192 | |
193 | /// Set the corresponding MC track number | |
194 | void SetLabel(Int_t label) {fLabel = label;} | |
195 | /// Return the corresponding MC track number | |
196 | Int_t GetLabel() const {return fLabel;} | |
67c201be | 197 | |
198 | /// Additional methods to decode hit pattern | |
199 | /// The hit pattern is a UShort_t with: | |
200 | /// <pre> | |
201 | /// 0 | 1 0 0 0 1 | 1 1 | 1 1 0 1 | 1 1 0 1 | |
202 | /// | | | | | |
203 | /// unused | RPC (0-17) | flag | Bend plane | Non-bend plane | |
204 | /// | or | | Match chamber | Match chamber | |
205 | /// | further info | | 11 12 13 14 | 11 12 13 14 | |
206 | /// | (20-24) | | | | |
207 | /// </pre> | |
208 | enum EAliTriggerChPatternFlag { | |
209 | kNoEff, ///< Track is not good for chamber efficiency evaluation | |
210 | kChEff, ///< Track crosses different RPCs | |
211 | kSlatEff, ///< Track crosses the same RPC in all planes | |
212 | kBoardEff ///< Track crosses the same board in all planes | |
213 | }; | |
214 | enum EAliTriggerChPatternInfo { | |
215 | kCrossDifferentSlats = 20, ///< The RPC cannot be univoquely determined | |
216 | kTrackMatchesManyPads = 21, ///< Track not good for effciency calculation since it matches many pads | |
217 | kTrackMatchesFewPads = 22, ///< Track not good for effciency calculation since it matches pads in less than 3/4 chambers | |
218 | kTrackOutsideGeometry = 23, ///< Problems in pattern determination since track extrapolation is outside trigger chambers | |
219 | kTrackerTrackPattern = 24 ///< The pattern was calculated from a tracker track not matching trigger track | |
220 | }; | |
221 | /// Set hits pattern | |
222 | static void SetFiredChamber(UShort_t& pattern, Int_t cathode, Int_t chamber); | |
223 | /// Add efficiency flag and crossed RPC or info on rejected track | |
224 | static void AddEffInfo(UShort_t& pattern, Int_t slatOrInfo, EAliTriggerChPatternFlag effType = kNoEff); | |
225 | /// Chamber was hit | |
226 | static Bool_t IsChamberHit(UShort_t pattern, Int_t cathode, Int_t chamber); | |
227 | /// Get Efficiency flag | |
228 | static Int_t GetEffFlag(UShort_t pattern); | |
229 | /// Getting crossed slat or info | |
230 | static Int_t GetSlatOrInfo(UShort_t pattern); | |
231 | ||
daf100e1 | 232 | AliESDEvent* GetESDEvent() const {return fESDEvent;} |
233 | void SetESDEvent(AliESDEvent* evt) {fESDEvent = evt;} | |
39b8d0dd | 234 | |
5ec1b3bc | 235 | protected: |
d5efea33 | 236 | // parameters at vertex |
60765b06 | 237 | Double32_t fInverseBendingMomentum; ///< Inverse bending momentum (GeV/c ** -1) times the charge |
238 | Double32_t fThetaX; ///< Angle of track at vertex in X direction (rad) | |
239 | Double32_t fThetaY; ///< Angle of track at vertex in Y direction (rad) | |
240 | Double32_t fZ; ///< Z coordinate (cm) | |
241 | Double32_t fBendingCoor; ///< bending coordinate (cm) | |
242 | Double32_t fNonBendingCoor; ///< non bending coordinate (cm) | |
39b8d0dd | 243 | |
d5efea33 | 244 | // parameters at Distance of Closest Approach in the vertex plane |
245 | Double32_t fInverseBendingMomentumAtDCA; ///< Inverse bending momentum (GeV/c ** -1) times the charge | |
246 | Double32_t fThetaXAtDCA; ///< Angle of track at vertex in X direction (rad) | |
247 | Double32_t fThetaYAtDCA; ///< Angle of track at vertex in Y direction (rad) | |
248 | Double32_t fBendingCoorAtDCA; ///< bending coordinate (cm) | |
249 | Double32_t fNonBendingCoorAtDCA; ///< non bending coordinate (cm) | |
250 | ||
251 | // parameters at first tracking station | |
60765b06 | 252 | Double32_t fInverseBendingMomentumUncorrected; ///< Inverse bending momentum (GeV/c ** -1) times the charge |
253 | Double32_t fThetaXUncorrected; ///< Angle of track at vertex in X direction (rad) | |
254 | Double32_t fThetaYUncorrected; ///< Angle of track at vertex in Y direction (rad) | |
255 | Double32_t fZUncorrected; ///< Z coordinate (cm) | |
256 | Double32_t fBendingCoorUncorrected; ///< bending coordinate (cm) | |
257 | Double32_t fNonBendingCoorUncorrected; ///< non bending coordinate (cm) | |
39b8d0dd | 258 | |
d5efea33 | 259 | /// reduced covariance matrix of UNCORRECTED track parameters, ordered as follow: <pre> |
260 | /// [0] = <X,X> | |
261 | /// [1] =<X,ThetaX> [2] =<ThetaX,ThetaX> | |
262 | /// [3] = <X,Y> [4] = <Y,ThetaX> [5] = <Y,Y> | |
263 | /// [6] =<X,ThetaY> [7] =<ThetaX,ThetaY> [8] =<Y,ThetaY> [9] =<ThetaY,ThetaY> | |
264 | /// [10]=<X,InvP_yz> [11]=<ThetaX,InvP_yz> [12]=<Y,InvP_yz> [13]=<ThetaY,InvP_yz> [14]=<InvP_yz,InvP_yz> </pre> | |
60765b06 | 265 | Double32_t fCovariances[15]; ///< \brief reduced covariance matrix of parameters AT FIRST CHAMBER |
423b32ca | 266 | |
f43586f0 | 267 | Double32_t fRAtAbsorberEnd; ///< transverse position r of the track at the end of the absorber |
268 | ||
d5efea33 | 269 | // global tracking info |
60765b06 | 270 | Double32_t fChi2; ///< chi2 in the MUON track fit |
60765b06 | 271 | Double32_t fChi2MatchTrigger; ///< chi2 of trigger/track matching |
4f036e6e | 272 | Int_t fLocalTrigger; ///< packed local trigger information |
9dea53d8 | 273 | |
274 | // hit strips pattern in the trigger chambers | |
275 | UShort_t fX1Pattern; ///< x-strips pattern in st6/ch1 | |
276 | UShort_t fY1Pattern; ///< y-strips pattern in st6/ch1 | |
277 | UShort_t fX2Pattern; ///< x-strips pattern in st6/ch2 | |
278 | UShort_t fY2Pattern; ///< y-strips pattern in st6/ch2 | |
279 | UShort_t fX3Pattern; ///< x-strips pattern in st7/ch1 | |
280 | UShort_t fY3Pattern; ///< y-strips pattern in st7/ch1 | |
281 | UShort_t fX4Pattern; ///< x-strips pattern in st7/ch2 | |
282 | UShort_t fY4Pattern; ///< y-strips pattern in st7/ch2 | |
d5efea33 | 283 | |
12186235 | 284 | UInt_t fMuonClusterMap; ///< Map of clusters in tracking chambers |
285 | UShort_t fHitsPatternInTrigCh; ///< Word containing info on the hits left in trigger chambers | |
286 | UChar_t fNHit; ///< number of hit in the track | |
d5efea33 | 287 | |
288 | mutable TClonesArray* fClusters; ///< Array of clusters attached to the track | |
289 | ||
2e2d0c44 | 290 | Int_t fLabel; ///< point to the corresponding MC track |
daf100e1 | 291 | |
292 | AliESDEvent* fESDEvent; //!Pointer back to event to which the track belongs | |
2e2d0c44 | 293 | |
f43586f0 | 294 | ClassDef(AliESDMuonTrack,13) // MUON ESD track class |
672b5f43 | 295 | }; |
296 | ||
297 | #endif |