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