]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/ESD/AliESDMuonGlobalTrack.h
Changes form Antonio
[u/mrichter/AliRoot.git] / STEER / ESD / AliESDMuonGlobalTrack.h
1 #ifndef AliESDMuonGlobalTrack_H
2 #define AliESDMuonGlobalTrack_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 //====================================================================================================================================================
8 //
9 //      ESD description of an ALICE muon forward track, combining the information of the Muon Spectrometer and the Muon Forward Tracker
10 //
11 //      Contact author: antonio.uras@cern.ch
12 //
13 //====================================================================================================================================================
14
15 #include "TMath.h"
16 #include "TMatrixD.h"
17 #include "TDatabasePDG.h"
18 #include "TArrayI.h"
19 #include "TLorentzVector.h"
20 #include "AliESDVertex.h"
21 #include "TRef.h"
22
23 #include "AliVParticle.h"
24
25 class AliESDEvent;
26 class TClonesArray;
27
28 //====================================================================================================================================================
29
30 class AliESDMuonGlobalTrack : public AliVParticle {
31
32 public:
33
34   AliESDMuonGlobalTrack();
35   AliESDMuonGlobalTrack(Double_t px, Double_t py, Double_t pz);
36   virtual ~AliESDMuonGlobalTrack() {;}
37   AliESDMuonGlobalTrack(const AliESDMuonGlobalTrack& esdTrack);
38   AliESDMuonGlobalTrack& operator=(const AliESDMuonGlobalTrack& esdTrack);
39   virtual void Copy(TObject &obj) const;
40
41   void  SetCharge(Int_t charge) { fCharge = charge; } 
42   Short_t GetCharge() const { return fCharge; }
43
44   /* Double_t GetOffset(Double_t x, Double_t y, Double_t z); */
45   /* Double_t GetOffsetX(Double_t x, Double_t z); */
46   /* Double_t GetOffsetY(Double_t y, Double_t z); */
47
48   // Set and Get methods for kinematics at primary vertex
49   void SetPxPyPz(Double_t px, Double_t py, Double_t pz);
50
51   // Get and Set methods for global tracking info
52   Double_t GetChi2OverNdf() const { return fChi2OverNdf; }            // chi2/ndf
53   void     SetChi2OverNdf(Double_t chi2) { fChi2OverNdf = chi2; }     // chi2/ndf
54
55   Double_t GetChi2MatchTrigger() const { return fChi2MatchTrigger; }
56   void     SetChi2MatchTrigger(Double_t chi2MatchTrigger) { fChi2MatchTrigger = chi2MatchTrigger; }
57
58   // Get and Set methods for various info copied and pasted from the MUON track
59   UShort_t GetHitsPatternInTrigCh() const {return fHitsPatternInTrigCh;}
60   void     SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) {fHitsPatternInTrigCh = hitsPatternInTrigCh;}
61   UInt_t   GetHitsPatternInTrigChTrk() const {return fHitsPatternInTrigChTrk;}
62   void     SetHitsPatternInTrigChTrk(UInt_t hitsPatternInTrigChTrk) {fHitsPatternInTrigChTrk = hitsPatternInTrigChTrk;}
63   UInt_t   GetMuonClusterMap() const {return fMuonClusterMap;}
64   void     SetMuonClusterMap(UInt_t muonClusterMap) {fMuonClusterMap = muonClusterMap;}
65   Int_t    GetLoCircuit() const { return fLoCircuit; }
66   void     SetLoCircuit(Int_t loCircuit) { fLoCircuit = loCircuit; }
67   Bool_t   IsConnected() const { return fIsConnected; }
68   void     Connected(Bool_t flag) { fIsConnected = flag; }
69
70   // Get and Set methods for trigger matching
71   void  SetMatchTrigger(Int_t matchTrigger) { fMatchTrigger = matchTrigger; }
72   Int_t GetMatchTrigger() { return fMatchTrigger; }
73
74   void SetNMFTClusters(Int_t nMFTClusters) { fNMFTClusters = nMFTClusters; }
75   Short_t GetNMFTClusters() { return fNMFTClusters; }
76
77   void SetNWrongMFTClustersMC(Int_t nWrongMFTClustersMC) { fNWrongMFTClustersMC = nWrongMFTClustersMC; }
78   Short_t GetNWrongMFTClustersMC() { return fNWrongMFTClustersMC; }
79
80   void SetMFTClusterPattern(ULong_t mftClusterPattern) { fMFTClusterPattern = mftClusterPattern; }
81   ULong_t GetMFTClusterPattern() { return fMFTClusterPattern; }
82
83   // Kinematics
84   Double_t Pt()       const { return fPt;  }
85   Double_t Eta()      const { return fEta; }
86   Double_t Rapidity() const { return fRapidity; }
87   Double_t Px()       const { return fPx; }
88   Double_t Py()       const { return fPy; }
89   Double_t Pz()       const { return fPz; }
90   Double_t P()        const { return fP;  }
91
92   Bool_t   PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
93
94   void SetFirstTrackingPoint(Double_t x, Double_t y, Double_t z) {fFirstTrackingPointX = x; fFirstTrackingPointY = y; fFirstTrackingPointZ = z; }
95   void GetFirstTrackingPoint(Double_t x[3]) { x[0] = fFirstTrackingPointX; x[1] = fFirstTrackingPointY; x[2] = fFirstTrackingPointZ; }
96
97   void SetXYAtVertex(Double_t x, Double_t y) { fXAtVertex = x; fYAtVertex = y; }
98   void GetXYAtVertex(Double_t x[2]) { x[0] = fXAtVertex; x[1] = fYAtVertex; }
99
100   Double_t GetRAtAbsorberEnd() { return fRAtAbsorberEnd; }
101   void SetRAtAbsorberEnd(Double_t r) { fRAtAbsorberEnd = r; }
102
103   // Additional methods to comply with AliVParticle
104   Double_t Xv() const {return -999.;} // put reasonable values here
105   Double_t Yv() const {return -999.;} //
106   Double_t Zv() const {return -999.;} //
107   Bool_t   XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }  
108   Double_t OneOverPt() const { return (Pt() != 0.) ? 1./Pt() : FLT_MAX; }
109   Double_t Phi() const { return TMath::Pi()+TMath::ATan2(-Py(), -Px()); }
110   Double_t Theta() const { return TMath::ATan2(Pt(), Pz()); }
111   Double_t E() const { return TMath::Sqrt(M()*M() + P()*P()); }
112   Double_t M() const { return TDatabasePDG::Instance()->GetParticle("mu-")->Mass(); }
113   Double_t Y() const { return Rapidity(); }
114   Short_t  Charge() const { return fCharge; }
115
116   // Return kTRUE if the track contain tracker data
117   Bool_t ContainTrackerData() const {return (fMuonClusterMap>0) ? kTRUE : kFALSE;}
118
119   // Dummy
120   const Double_t *PID() const { return (Double_t*)0x0; }
121   Int_t PdgCode() const { return 0; }
122   
123   // Set the corresponding MC track number
124   void  SetLabel(Int_t label) { fLabel = label; }
125   // Return the corresponding MC track number
126   Int_t GetLabel() const { return fLabel; }
127
128   void SetProdVertexXYZ(Double_t x, Double_t y, Double_t z) { fProdVertexXYZ[0]=x; fProdVertexXYZ[1]=y; fProdVertexXYZ[2]=z; }
129   void GetProdVertexXYZ(Double_t *vertex) { vertex[0]=fProdVertexXYZ[0]; vertex[1]=fProdVertexXYZ[1]; vertex[2]=fProdVertexXYZ[2]; }
130
131   AliESDEvent* GetESDEvent() const { return fESDEvent; }
132   void         SetESDEvent(AliESDEvent* evt) { fESDEvent = evt; }  
133   
134 protected:
135
136   Short_t fCharge, fMatchTrigger, fNMFTClusters, fNWrongMFTClustersMC;
137   ULong_t fMFTClusterPattern;  // Tells us which MFT clusters are contained in the track, and which one is a good one (if MC)
138
139   // kinematics at vertex
140   Double_t fPx, fPy, fPz, fPt, fP, fEta, fRapidity;
141
142   // coordinates of the first tracking point
143   Double_t fFirstTrackingPointX, fFirstTrackingPointY, fFirstTrackingPointZ;
144
145   // transverse coordinates at DCA to the primary vertex (offset)
146   Double_t fXAtVertex, fYAtVertex;
147
148   Double_t fRAtAbsorberEnd;
149
150   // global tracking info
151   Double_t fChi2OverNdf;            //  chi2/ndf in the MUON+MFT track fit
152   Double_t fChi2MatchTrigger;       //  chi2 of trigger/track matching
153
154   Int_t fLabel;                     //  point to the corresponding MC track
155
156   UInt_t   fMuonClusterMap;         // Map of clusters in MUON tracking chambers
157   UShort_t fHitsPatternInTrigCh;    // Word containing info on the hits left in trigger chambers
158   UInt_t   fHitsPatternInTrigChTrk; // Trigger hit map from tracker track extrapolation
159   Int_t    fLoCircuit;
160   Bool_t   fIsConnected;
161   
162   Double_t fProdVertexXYZ[3];       // vertex of origin
163
164   AliESDEvent *fESDEvent;           //! Pointer back to event to which the track belongs
165   
166   ClassDef(AliESDMuonGlobalTrack,3) // MUON+MFT ESD track class 
167
168 };
169
170 //====================================================================================================================================================
171
172 #endif