]>
Commit | Line | Data |
---|---|---|
af7ba10c | 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 | ||
672b5f43 | 28 | #include "AliESDMuonTrack.h" |
d5efea33 | 29 | #include "AliESDMuonCluster.h" |
672b5f43 | 30 | |
d5efea33 | 31 | #include <TClonesArray.h> |
39b8d0dd | 32 | #include <TLorentzVector.h> |
33 | #include <TMath.h> | |
34 | ||
af7ba10c | 35 | ClassImp(AliESDMuonTrack) |
36 | ||
90e48c0c | 37 | //_____________________________________________________________________________ |
38 | AliESDMuonTrack::AliESDMuonTrack (): | |
ad85871a | 39 | AliVParticle(), |
90e48c0c | 40 | fInverseBendingMomentum(0), |
41 | fThetaX(0), | |
42 | fThetaY(0), | |
43 | fZ(0), | |
44 | fBendingCoor(0), | |
45 | fNonBendingCoor(0), | |
d5efea33 | 46 | fInverseBendingMomentumAtDCA(0), |
47 | fThetaXAtDCA(0), | |
48 | fThetaYAtDCA(0), | |
49 | fBendingCoorAtDCA(0), | |
50 | fNonBendingCoorAtDCA(0), | |
39b8d0dd | 51 | fInverseBendingMomentumUncorrected(0), |
52 | fThetaXUncorrected(0), | |
53 | fThetaYUncorrected(0), | |
54 | fZUncorrected(0), | |
55 | fBendingCoorUncorrected(0), | |
56 | fNonBendingCoorUncorrected(0), | |
90e48c0c | 57 | fChi2(0), |
fbc3395d | 58 | fChi2MatchTrigger(0), |
01413742 | 59 | fLocalTrigger(0), |
9dea53d8 | 60 | fX1Pattern(0), |
61 | fY1Pattern(0), | |
62 | fX2Pattern(0), | |
63 | fY2Pattern(0), | |
64 | fX3Pattern(0), | |
65 | fY3Pattern(0), | |
66 | fX4Pattern(0), | |
67 | fY4Pattern(0), | |
4f036e6e | 68 | fMuonClusterMap(0), |
60765b06 | 69 | fHitsPatternInTrigCh(0), |
d5efea33 | 70 | fNHit(0), |
71 | fClusters(0x0) | |
90e48c0c | 72 | { |
60765b06 | 73 | // |
90e48c0c | 74 | // Default constructor |
60765b06 | 75 | // |
76 | for (Int_t i = 0; i < 15; i++) fCovariances[i] = 0; | |
90e48c0c | 77 | } |
78 | ||
79 | ||
af7ba10c | 80 | //_____________________________________________________________________________ |
4c510ac5 | 81 | AliESDMuonTrack::AliESDMuonTrack (const AliESDMuonTrack& muonTrack): |
82 | AliVParticle(muonTrack), | |
83 | fInverseBendingMomentum(muonTrack.fInverseBendingMomentum), | |
84 | fThetaX(muonTrack.fThetaX), | |
85 | fThetaY(muonTrack.fThetaY), | |
86 | fZ(muonTrack.fZ), | |
87 | fBendingCoor(muonTrack.fBendingCoor), | |
88 | fNonBendingCoor(muonTrack.fNonBendingCoor), | |
89 | fInverseBendingMomentumAtDCA(muonTrack.fInverseBendingMomentumAtDCA), | |
90 | fThetaXAtDCA(muonTrack.fThetaXAtDCA), | |
91 | fThetaYAtDCA(muonTrack.fThetaYAtDCA), | |
92 | fBendingCoorAtDCA(muonTrack.fBendingCoorAtDCA), | |
93 | fNonBendingCoorAtDCA(muonTrack.fNonBendingCoorAtDCA), | |
94 | fInverseBendingMomentumUncorrected(muonTrack.fInverseBendingMomentumUncorrected), | |
95 | fThetaXUncorrected(muonTrack.fThetaXUncorrected), | |
96 | fThetaYUncorrected(muonTrack.fThetaYUncorrected), | |
97 | fZUncorrected(muonTrack.fZUncorrected), | |
98 | fBendingCoorUncorrected(muonTrack.fBendingCoorUncorrected), | |
99 | fNonBendingCoorUncorrected(muonTrack.fNonBendingCoorUncorrected), | |
100 | fChi2(muonTrack.fChi2), | |
101 | fChi2MatchTrigger(muonTrack.fChi2MatchTrigger), | |
102 | fLocalTrigger(muonTrack.fLocalTrigger), | |
9dea53d8 | 103 | fX1Pattern(muonTrack.fX1Pattern), |
104 | fY1Pattern(muonTrack.fY1Pattern), | |
105 | fX2Pattern(muonTrack.fX2Pattern), | |
106 | fY2Pattern(muonTrack.fY2Pattern), | |
107 | fX3Pattern(muonTrack.fX3Pattern), | |
108 | fY3Pattern(muonTrack.fY3Pattern), | |
109 | fX4Pattern(muonTrack.fX4Pattern), | |
110 | fY4Pattern(muonTrack.fY4Pattern), | |
4c510ac5 | 111 | fMuonClusterMap(muonTrack.fMuonClusterMap), |
112 | fHitsPatternInTrigCh(muonTrack.fHitsPatternInTrigCh), | |
113 | fNHit(muonTrack.fNHit), | |
d5efea33 | 114 | fClusters(0x0) |
5ec1b3bc | 115 | { |
af7ba10c | 116 | // |
117 | // Copy constructor | |
118 | // Deep copy implemented | |
119 | // | |
4c510ac5 | 120 | for (Int_t i = 0; i < 15; i++) fCovariances[i] = muonTrack.fCovariances[i]; |
d5efea33 | 121 | |
122 | // necessary to make a copy of the objects and not only the pointers in TClonesArray | |
4c510ac5 | 123 | if (muonTrack.fClusters) { |
124 | fClusters = new TClonesArray("AliESDMuonCluster",muonTrack.fClusters->GetEntriesFast()); | |
125 | AliESDMuonCluster *cluster = (AliESDMuonCluster*) muonTrack.fClusters->First(); | |
d5efea33 | 126 | while (cluster) { |
127 | new ((*fClusters)[fClusters->GetEntriesFast()]) AliESDMuonCluster(*cluster); | |
4c510ac5 | 128 | cluster = (AliESDMuonCluster*) muonTrack.fClusters->After(cluster); |
d5efea33 | 129 | } |
130 | } | |
5ec1b3bc | 131 | } |
132 | ||
af7ba10c | 133 | //_____________________________________________________________________________ |
4c510ac5 | 134 | AliESDMuonTrack& AliESDMuonTrack::operator=(const AliESDMuonTrack& muonTrack) |
5ec1b3bc | 135 | { |
af7ba10c | 136 | // |
137 | // Equal operator for a deep copy | |
138 | // | |
4c510ac5 | 139 | if (this == &muonTrack) |
5ec1b3bc | 140 | return *this; |
141 | ||
4c510ac5 | 142 | AliVParticle::operator=(muonTrack); // don't forget to invoke the base class' assignment operator |
ad85871a | 143 | |
4c510ac5 | 144 | fInverseBendingMomentum = muonTrack.fInverseBendingMomentum; |
145 | fThetaX = muonTrack.fThetaX; | |
146 | fThetaY = muonTrack.fThetaY; | |
147 | fZ = muonTrack.fZ; | |
148 | fBendingCoor = muonTrack.fBendingCoor; | |
149 | fNonBendingCoor = muonTrack.fNonBendingCoor; | |
39b8d0dd | 150 | |
4c510ac5 | 151 | fInverseBendingMomentumAtDCA = muonTrack.fInverseBendingMomentumAtDCA; |
152 | fThetaXAtDCA = muonTrack.fThetaXAtDCA; | |
153 | fThetaYAtDCA = muonTrack.fThetaYAtDCA; | |
154 | fBendingCoorAtDCA = muonTrack.fBendingCoorAtDCA; | |
155 | fNonBendingCoorAtDCA = muonTrack.fNonBendingCoorAtDCA; | |
d5efea33 | 156 | |
4c510ac5 | 157 | fInverseBendingMomentumUncorrected = muonTrack.fInverseBendingMomentumUncorrected; |
158 | fThetaXUncorrected = muonTrack.fThetaXUncorrected; | |
159 | fThetaYUncorrected = muonTrack.fThetaYUncorrected; | |
160 | fZUncorrected = muonTrack.fZUncorrected; | |
161 | fBendingCoorUncorrected = muonTrack.fBendingCoorUncorrected; | |
162 | fNonBendingCoorUncorrected = muonTrack.fNonBendingCoorUncorrected; | |
39b8d0dd | 163 | |
4c510ac5 | 164 | for (Int_t i = 0; i < 15; i++) fCovariances[i] = muonTrack.fCovariances[i]; |
60765b06 | 165 | |
4c510ac5 | 166 | fChi2 = muonTrack.fChi2; |
167 | fNHit = muonTrack.fNHit; | |
8252d536 | 168 | |
4c510ac5 | 169 | fLocalTrigger = muonTrack.fLocalTrigger; |
9dea53d8 | 170 | fX1Pattern = muonTrack.fX1Pattern; |
171 | fY1Pattern = muonTrack.fY1Pattern; | |
172 | fX2Pattern = muonTrack.fX2Pattern; | |
173 | fY2Pattern = muonTrack.fY2Pattern; | |
174 | fX3Pattern = muonTrack.fX3Pattern; | |
175 | fY3Pattern = muonTrack.fY3Pattern; | |
176 | fX4Pattern = muonTrack.fX4Pattern; | |
177 | fY4Pattern = muonTrack.fY4Pattern; | |
4c510ac5 | 178 | fChi2MatchTrigger = muonTrack.fChi2MatchTrigger; |
fbc3395d | 179 | |
4c510ac5 | 180 | fHitsPatternInTrigCh = muonTrack.fHitsPatternInTrigCh; |
8252d536 | 181 | |
4c510ac5 | 182 | fMuonClusterMap = muonTrack.fMuonClusterMap; |
60765b06 | 183 | |
d5efea33 | 184 | // necessary to make a copy of the objects and not only the pointers in TClonesArray |
185 | delete fClusters; | |
4c510ac5 | 186 | if (muonTrack.fClusters) { |
187 | fClusters = new TClonesArray("AliESDMuonCluster",muonTrack.fClusters->GetEntriesFast()); | |
188 | AliESDMuonCluster *cluster = (AliESDMuonCluster*) muonTrack.fClusters->First(); | |
d5efea33 | 189 | while (cluster) { |
190 | new ((*fClusters)[fClusters->GetEntriesFast()]) AliESDMuonCluster(*cluster); | |
4c510ac5 | 191 | cluster = (AliESDMuonCluster*) muonTrack.fClusters->After(cluster); |
d5efea33 | 192 | } |
193 | } else fClusters = 0x0; | |
194 | ||
5ec1b3bc | 195 | return *this; |
196 | } | |
197 | ||
732a24fe | 198 | void AliESDMuonTrack::Copy(TObject &obj) const { |
199 | ||
200 | // this overwrites the virtual TOBject::Copy() | |
201 | // to allow run time copying without casting | |
202 | // in AliESDEvent | |
203 | ||
204 | if(this==&obj)return; | |
205 | AliESDMuonTrack *robj = dynamic_cast<AliESDMuonTrack*>(&obj); | |
206 | if(!robj)return; // not an AliESDMuonTrack | |
207 | *robj = *this; | |
208 | ||
209 | } | |
210 | ||
211 | ||
d5efea33 | 212 | //__________________________________________________________________________ |
213 | AliESDMuonTrack::~AliESDMuonTrack() | |
214 | { | |
215 | /// Destructor | |
216 | delete fClusters; | |
217 | } | |
218 | ||
219 | //__________________________________________________________________________ | |
220 | void AliESDMuonTrack::Clear(Option_t* opt) | |
221 | { | |
222 | /// Clear arrays | |
223 | if (fClusters) fClusters->Clear(opt); | |
224 | } | |
225 | ||
60765b06 | 226 | //_____________________________________________________________________________ |
227 | void AliESDMuonTrack::GetCovariances(TMatrixD& cov) const | |
228 | { | |
229 | // return covariance matrix of uncorrected parameters | |
230 | cov.ResizeTo(5,5); | |
231 | for (Int_t i = 0; i < 5; i++) | |
232 | for (Int_t j = 0; j <= i; j++) | |
233 | cov(i,j) = cov (j,i) = fCovariances[i*(i+1)/2 + j]; | |
234 | } | |
235 | ||
236 | //_____________________________________________________________________________ | |
237 | void AliESDMuonTrack::SetCovariances(const TMatrixD& cov) | |
238 | { | |
239 | // set reduced covariance matrix of uncorrected parameters | |
240 | for (Int_t i = 0; i < 5; i++) | |
241 | for (Int_t j = 0; j <= i; j++) | |
242 | fCovariances[i*(i+1)/2 + j] = cov(i,j); | |
243 | ||
244 | } | |
245 | ||
246 | //_____________________________________________________________________________ | |
247 | void AliESDMuonTrack::GetCovarianceXYZPxPyPz(Double_t cov[21]) const | |
248 | { | |
249 | // return reduced covariance matrix of uncorrected parameters in (X,Y,Z,Px,Py,Pz) coordinate system | |
250 | // | |
251 | // Cov(x,x) ... : cov[0] | |
252 | // Cov(y,x) ... : cov[1] cov[2] | |
253 | // Cov(z,x) ... : cov[3] cov[4] cov[5] | |
254 | // Cov(px,x)... : cov[6] cov[7] cov[8] cov[9] | |
255 | // Cov(py,x)... : cov[10] cov[11] cov[12] cov[13] cov[14] | |
256 | // Cov(pz,x)... : cov[15] cov[16] cov[17] cov[18] cov[19] cov[20] | |
257 | // | |
258 | // Get ESD covariance matrix into a TMatrixD | |
259 | TMatrixD covESD(5,5); | |
260 | GetCovariances(covESD); | |
261 | ||
262 | // compute Jacobian to change the coordinate system | |
263 | // from (X,thetaX,Y,thetaY,c/pYZ) to (X,Y,Z,pX,pY,pZ) | |
264 | Double_t tanThetaX = TMath::Tan(fThetaXUncorrected); | |
265 | Double_t tanThetaY = TMath::Tan(fThetaYUncorrected); | |
266 | Double_t cosThetaX2 = TMath::Cos(fThetaXUncorrected) * TMath::Cos(fThetaXUncorrected); | |
267 | Double_t cosThetaY2 = TMath::Cos(fThetaYUncorrected) * TMath::Cos(fThetaYUncorrected); | |
268 | Double_t pZ = PzUncorrected(); | |
269 | Double_t dpZdthetaY = - fInverseBendingMomentumUncorrected * fInverseBendingMomentumUncorrected * | |
270 | pZ * pZ * pZ * tanThetaY / cosThetaY2; | |
4c510ac5 | 271 | Double_t dpZdinvpYZ = (fInverseBendingMomentumUncorrected != 0.) ? - pZ / fInverseBendingMomentumUncorrected : - FLT_MAX; |
60765b06 | 272 | TMatrixD jacob(6,5); |
273 | jacob.Zero(); | |
274 | jacob(0,0) = 1.; | |
275 | jacob(1,2) = 1.; | |
276 | jacob(3,1) = pZ / cosThetaX2; | |
277 | jacob(3,3) = dpZdthetaY * tanThetaX; | |
278 | jacob(3,4) = dpZdinvpYZ * tanThetaX; | |
279 | jacob(4,3) = dpZdthetaY * tanThetaY + pZ / cosThetaY2; | |
280 | jacob(4,4) = dpZdinvpYZ * tanThetaY; | |
281 | jacob(5,3) = dpZdthetaY; | |
282 | jacob(5,4) = dpZdinvpYZ; | |
283 | ||
284 | // compute covariance matrix in AOD coordinate system | |
285 | TMatrixD tmp(covESD,TMatrixD::kMultTranspose,jacob); | |
286 | TMatrixD covAOD(jacob,TMatrixD::kMult,tmp); | |
287 | ||
288 | // Get AOD covariance matrix into co[21] | |
289 | for (Int_t i = 0; i < 6; i++) | |
290 | for (Int_t j = 0; j <= i; j++) | |
291 | cov[i*(i+1)/2 + j] = covAOD(i,j); | |
292 | ||
293 | } | |
294 | ||
39b8d0dd | 295 | //_____________________________________________________________________________ |
296 | Double_t AliESDMuonTrack::Px() const | |
297 | { | |
298 | // return p_x from track parameters | |
299 | Double_t nonBendingSlope = TMath::Tan(fThetaX); | |
300 | Double_t bendingSlope = TMath::Tan(fThetaY); | |
4c510ac5 | 301 | Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : - FLT_MAX; |
39b8d0dd | 302 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
303 | return pZ * nonBendingSlope; | |
304 | } | |
305 | ||
306 | //_____________________________________________________________________________ | |
307 | Double_t AliESDMuonTrack::Py() const | |
308 | { | |
309 | // return p_y from track parameters | |
310 | Double_t bendingSlope = TMath::Tan(fThetaY); | |
4c510ac5 | 311 | Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : - FLT_MAX; |
39b8d0dd | 312 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
313 | return pZ * bendingSlope; | |
314 | } | |
315 | ||
316 | //_____________________________________________________________________________ | |
317 | Double_t AliESDMuonTrack::Pz() const | |
318 | { | |
319 | // return p_z from track parameters | |
320 | Double_t bendingSlope = TMath::Tan(fThetaY); | |
4c510ac5 | 321 | Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : - FLT_MAX; |
39b8d0dd | 322 | return -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
323 | } | |
324 | ||
325 | //_____________________________________________________________________________ | |
326 | Double_t AliESDMuonTrack::P() const | |
327 | { | |
328 | // return p from track parameters | |
329 | Double_t nonBendingSlope = TMath::Tan(fThetaX); | |
330 | Double_t bendingSlope = TMath::Tan(fThetaY); | |
4c510ac5 | 331 | Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : - FLT_MAX; |
39b8d0dd | 332 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
333 | return -pZ * TMath::Sqrt(1.0 + bendingSlope*bendingSlope + nonBendingSlope*nonBendingSlope); | |
334 | } | |
335 | ||
336 | //_____________________________________________________________________________ | |
337 | void AliESDMuonTrack::LorentzP(TLorentzVector& vP) const | |
338 | { | |
339 | // return Lorentz momentum vector from track parameters | |
60765b06 | 340 | Double_t muonMass = M(); |
39b8d0dd | 341 | Double_t nonBendingSlope = TMath::Tan(fThetaX); |
342 | Double_t bendingSlope = TMath::Tan(fThetaY); | |
4c510ac5 | 343 | Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : - FLT_MAX; |
39b8d0dd | 344 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
345 | Double_t pX = pZ * nonBendingSlope; | |
346 | Double_t pY = pZ * bendingSlope; | |
347 | Double_t e = TMath::Sqrt(muonMass*muonMass + pX*pX + pY*pY + pZ*pZ); | |
348 | vP.SetPxPyPzE(pX, pY, pZ, e); | |
349 | } | |
350 | ||
d5efea33 | 351 | //_____________________________________________________________________________ |
352 | Double_t AliESDMuonTrack::PxAtDCA() const | |
353 | { | |
354 | // return p_x from track parameters | |
355 | Double_t nonBendingSlope = TMath::Tan(fThetaXAtDCA); | |
356 | Double_t bendingSlope = TMath::Tan(fThetaYAtDCA); | |
4c510ac5 | 357 | Double_t pYZ = (fInverseBendingMomentumAtDCA != 0.) ? TMath::Abs(1. / fInverseBendingMomentumAtDCA) : - FLT_MAX; |
d5efea33 | 358 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
359 | return pZ * nonBendingSlope; | |
360 | } | |
361 | ||
362 | //_____________________________________________________________________________ | |
363 | Double_t AliESDMuonTrack::PyAtDCA() const | |
364 | { | |
365 | // return p_y from track parameters | |
366 | Double_t bendingSlope = TMath::Tan(fThetaYAtDCA); | |
4c510ac5 | 367 | Double_t pYZ = (fInverseBendingMomentumAtDCA != 0.) ? TMath::Abs(1. / fInverseBendingMomentumAtDCA) : - FLT_MAX; |
d5efea33 | 368 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
369 | return pZ * bendingSlope; | |
370 | } | |
371 | ||
372 | //_____________________________________________________________________________ | |
373 | Double_t AliESDMuonTrack::PzAtDCA() const | |
374 | { | |
375 | // return p_z from track parameters | |
376 | Double_t bendingSlope = TMath::Tan(fThetaYAtDCA); | |
4c510ac5 | 377 | Double_t pYZ = (fInverseBendingMomentumAtDCA != 0.) ? TMath::Abs(1. / fInverseBendingMomentumAtDCA) : - FLT_MAX; |
d5efea33 | 378 | return -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
379 | } | |
380 | ||
381 | //_____________________________________________________________________________ | |
382 | Double_t AliESDMuonTrack::PAtDCA() const | |
383 | { | |
384 | // return p from track parameters | |
385 | Double_t nonBendingSlope = TMath::Tan(fThetaXAtDCA); | |
386 | Double_t bendingSlope = TMath::Tan(fThetaYAtDCA); | |
4c510ac5 | 387 | Double_t pYZ = (fInverseBendingMomentumAtDCA != 0.) ? TMath::Abs(1. / fInverseBendingMomentumAtDCA) : - FLT_MAX; |
d5efea33 | 388 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
389 | return -pZ * TMath::Sqrt(1.0 + bendingSlope*bendingSlope + nonBendingSlope*nonBendingSlope); | |
390 | } | |
391 | ||
392 | //_____________________________________________________________________________ | |
393 | void AliESDMuonTrack::LorentzPAtDCA(TLorentzVector& vP) const | |
394 | { | |
395 | // return Lorentz momentum vector from track parameters | |
396 | Double_t muonMass = M(); | |
397 | Double_t nonBendingSlope = TMath::Tan(fThetaXAtDCA); | |
398 | Double_t bendingSlope = TMath::Tan(fThetaYAtDCA); | |
4c510ac5 | 399 | Double_t pYZ = (fInverseBendingMomentumAtDCA != 0.) ? TMath::Abs(1. / fInverseBendingMomentumAtDCA) : - FLT_MAX; |
d5efea33 | 400 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
401 | Double_t pX = pZ * nonBendingSlope; | |
402 | Double_t pY = pZ * bendingSlope; | |
403 | Double_t e = TMath::Sqrt(muonMass*muonMass + pX*pX + pY*pY + pZ*pZ); | |
404 | vP.SetPxPyPzE(pX, pY, pZ, e); | |
405 | } | |
406 | ||
39b8d0dd | 407 | //_____________________________________________________________________________ |
408 | Double_t AliESDMuonTrack::PxUncorrected() const | |
409 | { | |
410 | // return p_x from track parameters | |
411 | Double_t nonBendingSlope = TMath::Tan(fThetaXUncorrected); | |
412 | Double_t bendingSlope = TMath::Tan(fThetaYUncorrected); | |
4c510ac5 | 413 | Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : - FLT_MAX; |
39b8d0dd | 414 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
415 | return pZ * nonBendingSlope; | |
416 | } | |
417 | ||
418 | //_____________________________________________________________________________ | |
419 | Double_t AliESDMuonTrack::PyUncorrected() const | |
420 | { | |
421 | // return p_y from track parameters | |
422 | Double_t bendingSlope = TMath::Tan(fThetaYUncorrected); | |
4c510ac5 | 423 | Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : - FLT_MAX; |
39b8d0dd | 424 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
425 | return pZ * bendingSlope; | |
426 | } | |
427 | ||
428 | //_____________________________________________________________________________ | |
429 | Double_t AliESDMuonTrack::PzUncorrected() const | |
430 | { | |
431 | // return p_z from track parameters | |
432 | Double_t bendingSlope = TMath::Tan(fThetaYUncorrected); | |
4c510ac5 | 433 | Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : - FLT_MAX; |
39b8d0dd | 434 | return -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
435 | } | |
436 | ||
437 | //_____________________________________________________________________________ | |
438 | Double_t AliESDMuonTrack::PUncorrected() const | |
439 | { | |
440 | // return p from track parameters | |
441 | Double_t nonBendingSlope = TMath::Tan(fThetaXUncorrected); | |
442 | Double_t bendingSlope = TMath::Tan(fThetaYUncorrected); | |
4c510ac5 | 443 | Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : - FLT_MAX; |
39b8d0dd | 444 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
445 | return -pZ * TMath::Sqrt(1.0 + bendingSlope*bendingSlope + nonBendingSlope*nonBendingSlope); | |
446 | } | |
447 | ||
448 | //_____________________________________________________________________________ | |
449 | void AliESDMuonTrack::LorentzPUncorrected(TLorentzVector& vP) const | |
450 | { | |
451 | // return Lorentz momentum vector from track parameters | |
60765b06 | 452 | Double_t muonMass = M(); |
39b8d0dd | 453 | Double_t nonBendingSlope = TMath::Tan(fThetaXUncorrected); |
454 | Double_t bendingSlope = TMath::Tan(fThetaYUncorrected); | |
4c510ac5 | 455 | Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : - FLT_MAX; |
39b8d0dd | 456 | Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0) |
457 | Double_t pX = pZ * nonBendingSlope; | |
458 | Double_t pY = pZ * bendingSlope; | |
459 | Double_t e = TMath::Sqrt(muonMass*muonMass + pX*pX + pY*pY + pZ*pZ); | |
460 | vP.SetPxPyPzE(pX, pY, pZ, e); | |
461 | } | |
672b5f43 | 462 | |
423b32ca | 463 | //_____________________________________________________________________________ |
464 | Int_t AliESDMuonTrack::GetMatchTrigger() const | |
465 | { | |
466 | // backward compatibility after replacing fMatchTrigger by fLocalTrigger | |
467 | // 0 track does not match trigger | |
468 | // 1 track match but does not pass pt cut | |
469 | // 2 track match Low pt cut | |
470 | // 3 track match High pt cut | |
471 | ||
01413742 | 472 | if (!LoCircuit()) { |
423b32ca | 473 | return 0; |
474 | } else if (LoLpt() == 0 && LoHpt() == 0) { | |
475 | return 1; | |
476 | } else if (LoLpt() > 0 && LoHpt() == 0) { | |
477 | return 2; | |
478 | } else { | |
479 | return 3; | |
480 | } | |
481 | ||
482 | } | |
483 | ||
60765b06 | 484 | //_____________________________________________________________________________ |
485 | void AliESDMuonTrack::AddInMuonClusterMap(Int_t chamber) | |
486 | { | |
487 | // Update the muon cluster map by adding this chamber(0..) | |
488 | ||
489 | static const UInt_t kMask[10] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200}; | |
490 | ||
491 | fMuonClusterMap |= kMask[chamber]; | |
492 | ||
493 | } | |
494 | ||
495 | //_____________________________________________________________________________ | |
496 | Bool_t AliESDMuonTrack::IsInMuonClusterMap(Int_t chamber) const | |
497 | { | |
498 | // return kTRUE if this chamber(0..) is in the muon cluster map | |
499 | ||
500 | static const UInt_t kMask[10] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200}; | |
501 | ||
502 | return ((fMuonClusterMap | kMask[chamber]) == fMuonClusterMap) ? kTRUE : kFALSE; | |
503 | ||
504 | } | |
505 | ||
4c510ac5 | 506 | //_____________________________________________________________________________ |
507 | Int_t AliESDMuonTrack::GetNClusters() const | |
508 | { | |
509 | // return the number of clusters associated to the track | |
510 | if (!fClusters) return 0; | |
511 | ||
512 | return fClusters->GetEntriesFast(); | |
513 | } | |
514 | ||
d5efea33 | 515 | //_____________________________________________________________________________ |
516 | TClonesArray& AliESDMuonTrack::GetClusters() const | |
517 | { | |
518 | // return the array of clusters associated to the track | |
519 | if (!fClusters) fClusters = new TClonesArray("AliESDMuonCluster",10); | |
520 | ||
521 | return *fClusters; | |
522 | } | |
523 | ||
524 | //_____________________________________________________________________________ | |
525 | void AliESDMuonTrack::AddCluster(const AliESDMuonCluster &cluster) | |
526 | { | |
527 | // add a cluster to the TClonesArray of clusters associated to the track | |
528 | if (!fClusters) fClusters = new TClonesArray("AliESDMuonCluster",10); | |
529 | ||
530 | new ((*fClusters)[fClusters->GetEntriesFast()]) AliESDMuonCluster(cluster); | |
531 | } | |
532 | ||
533 | //_____________________________________________________________________________ | |
534 | Bool_t AliESDMuonTrack::ClustersStored() const | |
535 | { | |
536 | // return kTRUE if the clusters associated to the track are registered | |
4c510ac5 | 537 | if (GetNClusters() == 0) return kFALSE; |
d5efea33 | 538 | |
539 | return kTRUE; | |
540 | } | |
541 |