AliRoot Core  3dc7879 (3dc7879)
AliESDMuonGlobalTrack.cxx
Go to the documentation of this file.
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 //====================================================================================================================================================
17 //
18 // ESD description of an ALICE muon forward track, combining the information of the Muon Spectrometer and the Muon Forward Tracker
19 //
20 // Contact author: antonio.uras@cern.ch
21 //
22 //====================================================================================================================================================
23 
24 #include "AliESDMuonGlobalTrack.h"
25 #include "AliESDEvent.h"
26 
27 #include "TClonesArray.h"
28 #include "TLorentzVector.h"
29 #include "TMath.h"
30 #include "TDatabasePDG.h"
31 
32 ClassImp(AliESDMuonGlobalTrack)
33 
34 //====================================================================================================================================================
35 
37  AliVParticle(),
38  fCharge(0),
39  fMatchTrigger(0),
40  fNMFTClusters(0),
41  fNWrongMFTClustersMC(-1),
42  fMFTClusterPattern(0),
43  fPx(0),
44  fPy(0),
45  fPz(0),
46  fPt(0),
47  fP(0),
48  fEta(0),
49  fRapidity(0),
50  fFirstTrackingPointX(0),
51  fFirstTrackingPointY(0),
52  fFirstTrackingPointZ(0),
53  fXAtVertex(0),
54  fYAtVertex(0),
55  fRAtAbsorberEnd(0),
56  fCovariances(0),
57  fChi2OverNdf(0),
58  fChi2MatchTrigger(0),
59  fLabel(-1),
60  fMuonClusterMap(0),
61  fHitsPatternInTrigCh(0),
62  fHitsPatternInTrigChTrk(0),
63  fLoCircuit(0),
64  fIsConnected(kFALSE),
65  fESDEvent(0)
66 {
67 
68  // Default constructor
69 
70  fProdVertexXYZ[0]=0;
71  fProdVertexXYZ[1]=0;
72  fProdVertexXYZ[2]=0;
73 
74 }
75 
76 //====================================================================================================================================================
77 
78 AliESDMuonGlobalTrack::AliESDMuonGlobalTrack(Double_t px, Double_t py, Double_t pz):
79  AliVParticle(),
80  fCharge(0),
81  fMatchTrigger(0),
82  fNMFTClusters(0),
83  fNWrongMFTClustersMC(-1),
84  fMFTClusterPattern(0),
85  fPx(0),
86  fPy(0),
87  fPz(0),
88  fPt(0),
89  fP(0),
90  fEta(0),
91  fRapidity(0),
92  fFirstTrackingPointX(0),
93  fFirstTrackingPointY(0),
94  fFirstTrackingPointZ(0),
95  fXAtVertex(0),
96  fYAtVertex(0),
97  fRAtAbsorberEnd(0),
98  fCovariances(0),
99  fChi2OverNdf(0),
100  fChi2MatchTrigger(0),
101  fLabel(-1),
102  fMuonClusterMap(0),
103  fHitsPatternInTrigCh(0),
104  fHitsPatternInTrigChTrk(0),
105  fLoCircuit(0),
106  fIsConnected(kFALSE),
107  fESDEvent(0)
108 {
109 
110  // Constructor with kinematics
111 
112  SetPxPyPz(px, py, pz);
113 
114  fProdVertexXYZ[0]=0;
115  fProdVertexXYZ[1]=0;
116  fProdVertexXYZ[2]=0;
117 
118 }
119 
120 //====================================================================================================================================================
121 
123  AliVParticle(muonTrack),
124  fCharge(muonTrack.fCharge),
125  fMatchTrigger(muonTrack.fMatchTrigger),
126  fNMFTClusters(muonTrack.fNMFTClusters),
129  fPx(muonTrack.fPx),
130  fPy(muonTrack.fPy),
131  fPz(muonTrack.fPz),
132  fPt(muonTrack.fPt),
133  fP(muonTrack.fP),
134  fEta(muonTrack.fEta),
135  fRapidity(muonTrack.fRapidity),
139  fXAtVertex(muonTrack.fXAtVertex),
140  fYAtVertex(muonTrack.fYAtVertex),
141  fRAtAbsorberEnd(muonTrack.fRAtAbsorberEnd),
142  fCovariances(0),
143  fChi2OverNdf(muonTrack.fChi2OverNdf),
145  fLabel(muonTrack.fLabel),
146  fMuonClusterMap(muonTrack.fMuonClusterMap),
149  fLoCircuit(muonTrack.fLoCircuit),
150  fIsConnected(muonTrack.fIsConnected),
151  fESDEvent(muonTrack.fESDEvent)
152 {
153 
154  // Copy constructor
155 
156  fProdVertexXYZ[0]=muonTrack.fProdVertexXYZ[0];
157  fProdVertexXYZ[1]=muonTrack.fProdVertexXYZ[1];
158  fProdVertexXYZ[2]=muonTrack.fProdVertexXYZ[2];
159 
160  if (muonTrack.fCovariances) fCovariances = new TMatrixD(*(muonTrack.fCovariances));
161 
162 }
163 
164 //====================================================================================================================================================
165 
167 
168  // Assignment operator
169 
170  if (this == &muonTrack) return *this;
171 
172  // Base class assignement
173  AliVParticle::operator=(muonTrack);
174 
175  fCharge = muonTrack.fCharge;
176  fMatchTrigger = muonTrack.fMatchTrigger;
177  fNMFTClusters = muonTrack.fNMFTClusters;
180  fPx = muonTrack.fPx;
181  fPy = muonTrack.fPy;
182  fPz = muonTrack.fPz;
183  fPt = muonTrack.fPt;
184  fP = muonTrack.fP;
185  fEta = muonTrack.fEta;
186  fRapidity = muonTrack.fRapidity;
190  fXAtVertex = muonTrack.fXAtVertex;
191  fYAtVertex = muonTrack.fYAtVertex;
192  fRAtAbsorberEnd = muonTrack.fRAtAbsorberEnd;
193  fChi2OverNdf = muonTrack.fChi2OverNdf;
195  fLabel = muonTrack.fLabel;
196  fMuonClusterMap = muonTrack.fMuonClusterMap;
199  fLoCircuit = muonTrack.fLoCircuit;
200  fIsConnected = muonTrack.fIsConnected;
201  fESDEvent = muonTrack.fESDEvent;
202 
203  fProdVertexXYZ[0]=muonTrack.fProdVertexXYZ[0];
204  fProdVertexXYZ[1]=muonTrack.fProdVertexXYZ[1];
205  fProdVertexXYZ[2]=muonTrack.fProdVertexXYZ[2];
206 
207  if (muonTrack.fCovariances) {
208  if (fCovariances) *fCovariances = *(muonTrack.fCovariances);
209  else fCovariances = new TMatrixD(*(muonTrack.fCovariances));
210  }
211  else {
212  delete fCovariances;
213  fCovariances = 0x0;
214  }
215 
216  return *this;
217 
218 }
219 
220 //====================================================================================================================================================
221 
222 void AliESDMuonGlobalTrack::Copy(TObject &obj) const {
223 
224  // This overwrites the virtual TObject::Copy()
225  // to allow run time copying without casting
226  // in AliESDEvent
227 
228  if (this==&obj) return;
229  AliESDMuonGlobalTrack *robj = dynamic_cast<AliESDMuonGlobalTrack*>(&obj);
230  if (!robj) return; // not an AliESDMuonGlobalTrack
231  *robj = *this;
232 
233 }
234 
235 //====================================================================================================================================================
236 
237 void AliESDMuonGlobalTrack::SetPxPyPz(Double_t px, Double_t py, Double_t pz) {
238 
239  Double_t mMu = TDatabasePDG::Instance()->GetParticle("mu-")->Mass();
240  Double_t eMu = TMath::Sqrt(mMu*mMu + px*px + py*py + pz*pz);
241 
242  TLorentzVector kinem(px, py, pz, eMu);
243 
244  fPx = kinem.Px();
245  fPy = kinem.Py();
246  fPz = kinem.Pz();
247  fP = kinem.P();
248  fPt = kinem.Pt();
249  fEta = kinem.Eta();
250  fRapidity = kinem.Rapidity();
251 
252 }
253 
254 //====================================================================================================================================================
255 
256 const TMatrixD& AliESDMuonGlobalTrack::GetCovariances() const {
257 
258  // Return the covariance matrix (create it before if needed)
259 
260  if (!fCovariances) {
261  fCovariances = new TMatrixD(5,5);
262  fCovariances->Zero();
263  }
264  return *fCovariances;
265 
266 }
267 
268 //====================================================================================================================================================
269 
270 void AliESDMuonGlobalTrack::SetCovariances(const TMatrixD& covariances) {
271 
272  // Set the covariance matrix
273 
274  if (fCovariances) *fCovariances = covariances;
275  else fCovariances = new TMatrixD(covariances);
276 
277 }
278 
279 //====================================================================================================================================================
void SetPxPyPz(Double_t px, Double_t py, Double_t pz)
AliVParticle & operator=(const AliVParticle &vPart)
const TMatrixD & GetCovariances() const
void SetCovariances(const TMatrixD &covariances)
virtual void Copy(TObject &obj) const
AliESDMuonGlobalTrack & operator=(const AliESDMuonGlobalTrack &esdTrack)