]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDMuonTrack.cxx
Consistency changes, bug fix, and new conditions on the kITSrefit and kTPCrefit bits...
[u/mrichter/AliRoot.git] / STEER / AliESDMuonTrack.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //
20 //  Class to describe the MUON tracks
21 //  in the Event Summary Data class
22 //  This is where the results of reconstruction
23 //  are stored for the muons
24 //  Author: G.Martinez
25 //
26 ///////////////////////////////////////////////////////////////////////////////
27
28 #include "AliESDMuonTrack.h"
29
30 #include <TLorentzVector.h>
31 #include <TMath.h>
32
33 ClassImp(AliESDMuonTrack)
34
35 //_____________________________________________________________________________
36 AliESDMuonTrack::AliESDMuonTrack ():
37   AliVParticle(),
38   fInverseBendingMomentum(0),
39   fThetaX(0),
40   fThetaY(0),
41   fZ(0),
42   fBendingCoor(0),
43   fNonBendingCoor(0),
44   fInverseBendingMomentumUncorrected(0),
45   fThetaXUncorrected(0),
46   fThetaYUncorrected(0),
47   fZUncorrected(0),
48   fBendingCoorUncorrected(0),
49   fNonBendingCoorUncorrected(0),
50   fChi2(0),
51   fNHit(0),
52   fLocalTrigger(234),
53   fChi2MatchTrigger(0),
54   fHitsPatternInTrigCh(0)
55 {
56   // Default constructor
57 }
58
59
60 //_____________________________________________________________________________
61 AliESDMuonTrack::AliESDMuonTrack (const AliESDMuonTrack& MUONTrack):
62   AliVParticle(MUONTrack),
63   fInverseBendingMomentum(MUONTrack.fInverseBendingMomentum),
64   fThetaX(MUONTrack.fThetaX),
65   fThetaY(MUONTrack.fThetaY),
66   fZ(MUONTrack.fZ),
67   fBendingCoor(MUONTrack.fBendingCoor),
68   fNonBendingCoor(MUONTrack.fNonBendingCoor),
69   fInverseBendingMomentumUncorrected(MUONTrack.fInverseBendingMomentumUncorrected),
70   fThetaXUncorrected(MUONTrack.fThetaXUncorrected),
71   fThetaYUncorrected(MUONTrack.fThetaYUncorrected),
72   fZUncorrected(MUONTrack.fZUncorrected),
73   fBendingCoorUncorrected(MUONTrack.fBendingCoorUncorrected),
74   fNonBendingCoorUncorrected(MUONTrack.fNonBendingCoorUncorrected),
75   fChi2(MUONTrack.fChi2),
76   fNHit(MUONTrack.fNHit),
77   fLocalTrigger(MUONTrack.fLocalTrigger),
78   fChi2MatchTrigger(MUONTrack.fChi2MatchTrigger),
79   fHitsPatternInTrigCh(MUONTrack.fHitsPatternInTrigCh)
80 {
81   //
82   // Copy constructor
83   // Deep copy implemented
84   //
85 }
86
87 //_____________________________________________________________________________
88 AliESDMuonTrack& AliESDMuonTrack::operator=(const AliESDMuonTrack& MUONTrack)
89 {
90   // 
91   // Equal operator for a deep copy
92   //
93   if (this == &MUONTrack)
94     return *this;
95
96   AliVParticle::operator=(MUONTrack); // don't forget to invoke the base class' assignment operator
97   
98   fInverseBendingMomentum = MUONTrack.fInverseBendingMomentum; 
99   fThetaX                 = MUONTrack.fThetaX;           
100   fThetaY                 = MUONTrack.fThetaY;           
101   fZ                      = MUONTrack.fZ;                
102   fBendingCoor            = MUONTrack.fBendingCoor;      
103   fNonBendingCoor         = MUONTrack.fNonBendingCoor;   
104   
105   fInverseBendingMomentumUncorrected = MUONTrack.fInverseBendingMomentumUncorrected; 
106   fThetaXUncorrected                 = MUONTrack.fThetaXUncorrected;           
107   fThetaYUncorrected                 = MUONTrack.fThetaYUncorrected;           
108   fZUncorrected                      = MUONTrack.fZUncorrected;                
109   fBendingCoorUncorrected            = MUONTrack.fBendingCoorUncorrected;      
110   fNonBendingCoorUncorrected         = MUONTrack.fNonBendingCoorUncorrected;   
111   
112   fChi2                   = MUONTrack.fChi2;             
113   fNHit                   = MUONTrack.fNHit; 
114
115   fLocalTrigger           = MUONTrack.fLocalTrigger;  
116   fChi2MatchTrigger       = MUONTrack.fChi2MatchTrigger; 
117
118   fHitsPatternInTrigCh    = MUONTrack.fHitsPatternInTrigCh;
119  
120   return *this;
121 }
122
123 //_____________________________________________________________________________
124 Double_t AliESDMuonTrack::Px() const
125 {
126   // return p_x from track parameters
127   Double_t nonBendingSlope = TMath::Tan(fThetaX);
128   Double_t bendingSlope    = TMath::Tan(fThetaY);
129   Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : 0.;
130   Double_t pZ  = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);  // spectro. (z<0)
131   return pZ * nonBendingSlope;
132 }
133
134 //_____________________________________________________________________________
135 Double_t AliESDMuonTrack::Py() const
136 {
137   // return p_y from track parameters
138   Double_t bendingSlope = TMath::Tan(fThetaY);
139   Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : 0.;
140   Double_t pZ  = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);  // spectro. (z<0)
141   return pZ * bendingSlope;
142 }
143
144 //_____________________________________________________________________________
145 Double_t AliESDMuonTrack::Pz() const
146 {
147   // return p_z from track parameters
148   Double_t bendingSlope = TMath::Tan(fThetaY);
149   Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : 0.;
150   return -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);  // spectro. (z<0)
151 }
152
153 //_____________________________________________________________________________
154 Double_t AliESDMuonTrack::P() const
155 {
156   // return p from track parameters
157   Double_t nonBendingSlope = TMath::Tan(fThetaX);
158   Double_t bendingSlope    = TMath::Tan(fThetaY);
159   Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : 0.;
160   Double_t pZ  = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);  // spectro. (z<0)
161   return -pZ * TMath::Sqrt(1.0 + bendingSlope*bendingSlope + nonBendingSlope*nonBendingSlope);
162 }
163
164 //_____________________________________________________________________________
165 void AliESDMuonTrack::LorentzP(TLorentzVector& vP) const
166 {
167   // return Lorentz momentum vector from track parameters
168   Double_t muonMass = 0.105658369;
169   Double_t nonBendingSlope = TMath::Tan(fThetaX);
170   Double_t bendingSlope    = TMath::Tan(fThetaY);
171   Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : 0.;
172   Double_t pZ  = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);  // spectro. (z<0)
173   Double_t pX  = pZ * nonBendingSlope;
174   Double_t pY  = pZ * bendingSlope;
175   Double_t e   = TMath::Sqrt(muonMass*muonMass + pX*pX + pY*pY + pZ*pZ);
176   vP.SetPxPyPzE(pX, pY, pZ, e);
177 }
178
179 //_____________________________________________________________________________
180 Double_t AliESDMuonTrack::PxUncorrected() const
181 {
182   // return p_x from track parameters
183   Double_t nonBendingSlope = TMath::Tan(fThetaXUncorrected);
184   Double_t bendingSlope    = TMath::Tan(fThetaYUncorrected);
185   Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : 0.;
186   Double_t pZ  = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);  // spectro. (z<0)
187   return pZ * nonBendingSlope;
188 }
189
190 //_____________________________________________________________________________
191 Double_t AliESDMuonTrack::PyUncorrected() const
192 {
193   // return p_y from track parameters
194   Double_t bendingSlope = TMath::Tan(fThetaYUncorrected);
195   Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : 0.;
196   Double_t pZ  = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);  // spectro. (z<0)
197   return pZ * bendingSlope;
198 }
199
200 //_____________________________________________________________________________
201 Double_t AliESDMuonTrack::PzUncorrected() const
202 {
203   // return p_z from track parameters
204   Double_t bendingSlope = TMath::Tan(fThetaYUncorrected);
205   Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : 0.;
206   return -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);  // spectro. (z<0)
207 }
208
209 //_____________________________________________________________________________
210 Double_t AliESDMuonTrack::PUncorrected() const
211 {
212   // return p from track parameters
213   Double_t nonBendingSlope = TMath::Tan(fThetaXUncorrected);
214   Double_t bendingSlope    = TMath::Tan(fThetaYUncorrected);
215   Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : 0.;
216   Double_t pZ  = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);  // spectro. (z<0)
217   return -pZ * TMath::Sqrt(1.0 + bendingSlope*bendingSlope + nonBendingSlope*nonBendingSlope);
218 }
219
220 //_____________________________________________________________________________
221 void AliESDMuonTrack::LorentzPUncorrected(TLorentzVector& vP) const
222 {
223   // return Lorentz momentum vector from track parameters
224   Double_t muonMass = 0.105658369;
225   Double_t nonBendingSlope = TMath::Tan(fThetaXUncorrected);
226   Double_t bendingSlope    = TMath::Tan(fThetaYUncorrected);
227   Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : 0.;
228   Double_t pZ  = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);  // spectro. (z<0)
229   Double_t pX  = pZ * nonBendingSlope;
230   Double_t pY  = pZ * bendingSlope;
231   Double_t e   = TMath::Sqrt(muonMass*muonMass + pX*pX + pY*pY + pZ*pZ);
232   vP.SetPxPyPzE(pX, pY, pZ, e);
233 }
234
235 //_____________________________________________________________________________
236 Int_t AliESDMuonTrack::GetMatchTrigger() const
237 {
238   //  backward compatibility after replacing fMatchTrigger by fLocalTrigger
239   //  0 track does not match trigger
240   //  1 track match but does not pass pt cut
241   //  2 track match Low pt cut
242   //  3 track match High pt cut
243
244   if (LoCircuit() == -1) {
245     return 0;
246   } else if (LoLpt() == 0 && LoHpt() == 0) {
247     return 1;
248   } else if (LoLpt() >  0 && LoHpt() == 0) {
249     return 2;
250   } else {
251     return 3;
252   }
253
254 }
255