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