AliRoot Core  3dc7879 (3dc7879)
AliESDMuonTrack.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 /* $Id$ */
17 
19 //
25 //
27 
28 #include "AliESDMuonTrack.h"
29 #include "AliESDMuonCluster.h"
30 #include "AliESDEvent.h"
31 
32 #include <TClonesArray.h>
33 #include <TLorentzVector.h>
34 #include <TMath.h>
35 
36 ClassImp(AliESDMuonTrack)
37 
38 //_____________________________________________________________________________
40  AliVParticle(),
41  fInverseBendingMomentum(FLT_MAX),
42  fThetaX(0),
43  fThetaY(0),
44  fZ(0),
45  fBendingCoor(0),
46  fNonBendingCoor(0),
47  fInverseBendingMomentumAtDCA(FLT_MAX),
48  fThetaXAtDCA(0),
49  fThetaYAtDCA(0),
50  fBendingCoorAtDCA(0),
51  fNonBendingCoorAtDCA(0),
52  fInverseBendingMomentumUncorrected(FLT_MAX),
53  fThetaXUncorrected(0),
54  fThetaYUncorrected(0),
55  fZUncorrected(0),
56  fBendingCoorUncorrected(0),
57  fNonBendingCoorUncorrected(0),
58  fRAtAbsorberEnd(0),
59  fChi2(0),
60  fChi2MatchTrigger(0),
61  fLocalTrigger(0),
62  fX1Pattern(0),
63  fY1Pattern(0),
64  fX2Pattern(0),
65  fY2Pattern(0),
66  fX3Pattern(0),
67  fY3Pattern(0),
68  fX4Pattern(0),
69  fY4Pattern(0),
70  fMuonClusterMap(0),
71  fHitsPatternInTrigCh(0),
72  fHitsPatternInTrigChTrk(0),
73  fNHit(0),
74  fClusters(0x0),
75  fClustersId(0x0),
76  fLabel(-1),
77  fESDEvent(0)
78 
79 {
80  //
82  //
83  for (Int_t i = 0; i < 15; i++) fCovariances[i] = 0;
84 }
85 
86 
87 //_____________________________________________________________________________
89  AliVParticle(muonTrack),
90  fInverseBendingMomentum(muonTrack.fInverseBendingMomentum),
91  fThetaX(muonTrack.fThetaX),
92  fThetaY(muonTrack.fThetaY),
93  fZ(muonTrack.fZ),
94  fBendingCoor(muonTrack.fBendingCoor),
95  fNonBendingCoor(muonTrack.fNonBendingCoor),
96  fInverseBendingMomentumAtDCA(muonTrack.fInverseBendingMomentumAtDCA),
97  fThetaXAtDCA(muonTrack.fThetaXAtDCA),
98  fThetaYAtDCA(muonTrack.fThetaYAtDCA),
99  fBendingCoorAtDCA(muonTrack.fBendingCoorAtDCA),
100  fNonBendingCoorAtDCA(muonTrack.fNonBendingCoorAtDCA),
101  fInverseBendingMomentumUncorrected(muonTrack.fInverseBendingMomentumUncorrected),
102  fThetaXUncorrected(muonTrack.fThetaXUncorrected),
103  fThetaYUncorrected(muonTrack.fThetaYUncorrected),
104  fZUncorrected(muonTrack.fZUncorrected),
105  fBendingCoorUncorrected(muonTrack.fBendingCoorUncorrected),
106  fNonBendingCoorUncorrected(muonTrack.fNonBendingCoorUncorrected),
107  fRAtAbsorberEnd(muonTrack.fRAtAbsorberEnd),
108  fChi2(muonTrack.fChi2),
109  fChi2MatchTrigger(muonTrack.fChi2MatchTrigger),
110  fLocalTrigger(muonTrack.fLocalTrigger),
111  fX1Pattern(muonTrack.fX1Pattern),
112  fY1Pattern(muonTrack.fY1Pattern),
113  fX2Pattern(muonTrack.fX2Pattern),
114  fY2Pattern(muonTrack.fY2Pattern),
115  fX3Pattern(muonTrack.fX3Pattern),
116  fY3Pattern(muonTrack.fY3Pattern),
117  fX4Pattern(muonTrack.fX4Pattern),
118  fY4Pattern(muonTrack.fY4Pattern),
119  fMuonClusterMap(muonTrack.fMuonClusterMap),
120  fHitsPatternInTrigCh(muonTrack.fHitsPatternInTrigCh),
121  fHitsPatternInTrigChTrk(muonTrack.fHitsPatternInTrigChTrk),
122  fNHit(muonTrack.fNHit),
123  fClusters(0x0),
124  fClustersId(0x0),
125  fLabel(muonTrack.fLabel),
126  fESDEvent(muonTrack.fESDEvent)
127 {
128  //
131  //
132  for (Int_t i = 0; i < 15; i++) fCovariances[i] = muonTrack.fCovariances[i];
133 
134  // necessary to make a copy of the objects and not only the pointers in TClonesArray
135  if (muonTrack.fClusters) {
136  fClusters = new TClonesArray("AliESDMuonCluster",muonTrack.fClusters->GetEntriesFast());
137  AliESDMuonCluster *cluster = (AliESDMuonCluster*) muonTrack.fClusters->First();
138  while (cluster) {
139  new ((*fClusters)[fClusters->GetEntriesFast()]) AliESDMuonCluster(*cluster);
140  cluster = (AliESDMuonCluster*) muonTrack.fClusters->After(cluster);
141  }
142  }
143 
144  // copy of cluster Ids
145  if (muonTrack.fClustersId) fClustersId = new TArrayI(*(muonTrack.fClustersId));
146 
147 }
148 
149 //_____________________________________________________________________________
151 {
152  //
154  //
155  if (this == &muonTrack)
156  return *this;
157 
158  AliVParticle::operator=(muonTrack); // don't forget to invoke the base class' assignment operator
159 
161  fThetaX = muonTrack.fThetaX;
162  fThetaY = muonTrack.fThetaY;
163  fZ = muonTrack.fZ;
164  fBendingCoor = muonTrack.fBendingCoor;
165  fNonBendingCoor = muonTrack.fNonBendingCoor;
166 
168  fThetaXAtDCA = muonTrack.fThetaXAtDCA;
169  fThetaYAtDCA = muonTrack.fThetaYAtDCA;
172 
176  fZUncorrected = muonTrack.fZUncorrected;
179 
180  for (Int_t i = 0; i < 15; i++) fCovariances[i] = muonTrack.fCovariances[i];
181 
182  fRAtAbsorberEnd = muonTrack.fRAtAbsorberEnd;
183 
184  fChi2 = muonTrack.fChi2;
185  fNHit = muonTrack.fNHit;
186 
187  fLocalTrigger = muonTrack.fLocalTrigger;
188  fX1Pattern = muonTrack.fX1Pattern;
189  fY1Pattern = muonTrack.fY1Pattern;
190  fX2Pattern = muonTrack.fX2Pattern;
191  fY2Pattern = muonTrack.fY2Pattern;
192  fX3Pattern = muonTrack.fX3Pattern;
193  fY3Pattern = muonTrack.fY3Pattern;
194  fX4Pattern = muonTrack.fX4Pattern;
195  fY4Pattern = muonTrack.fY4Pattern;
197 
200 
201  fMuonClusterMap = muonTrack.fMuonClusterMap;
202 
203  fLabel = muonTrack.fLabel;
204 
205  fESDEvent = muonTrack.fESDEvent;
206 
207  // necessary to make a copy of the objects and not only the pointers in TClonesArray
208  delete fClusters;
209  if (muonTrack.fClusters) {
210  fClusters = new TClonesArray("AliESDMuonCluster",muonTrack.fClusters->GetEntriesFast());
211  AliESDMuonCluster *cluster = (AliESDMuonCluster*) muonTrack.fClusters->First();
212  while (cluster) {
213  new ((*fClusters)[fClusters->GetEntriesFast()]) AliESDMuonCluster(*cluster);
214  cluster = (AliESDMuonCluster*) muonTrack.fClusters->After(cluster);
215  }
216  } else fClusters = 0x0;
217 
218  // copy of cluster Ids
219  if (muonTrack.fClustersId) {
220  if (fClustersId) *fClustersId = *(muonTrack.fClustersId);
221  else fClustersId = new TArrayI(*(muonTrack.fClustersId));
222  } else {
223  delete fClustersId;
224  fClustersId = 0x0;
225  }
226 
227  return *this;
228 }
229 
230 //__________________________________________________________________________
231 void AliESDMuonTrack::Copy(TObject &obj) const {
232 
236 
237  if(this==&obj)return;
238  AliESDMuonTrack *robj = dynamic_cast<AliESDMuonTrack*>(&obj);
239  if(!robj)return; // not an AliESDMuonTrack
240  *robj = *this;
241 
242 }
243 
244 //__________________________________________________________________________
246 {
248  delete fClusters;
249  delete fClustersId;
250 }
251 
252 //__________________________________________________________________________
253 void AliESDMuonTrack::Clear(Option_t* opt)
254 {
256  if (opt && opt[0] == 'C') {
257  if (fClusters) fClusters->Clear("C");
258  } else {
259  delete fClusters; fClusters = 0x0;
260  }
261  delete fClustersId; fClustersId = 0x0;
262  fNHit = 0;
263 }
264 
265 //__________________________________________________________________________
267 {
269  SetUniqueID(0);
270  fInverseBendingMomentum = FLT_MAX;
271  fThetaX = 0.;
272  fThetaY = 0.;
273  fZ = 0.;
274  fBendingCoor = 0.;
275  fNonBendingCoor = 0.;
277  fThetaXAtDCA = 0.;
278  fThetaYAtDCA = 0.;
279  fBendingCoorAtDCA = 0.;
282  fThetaXUncorrected = 0.;
283  fThetaYUncorrected = 0.;
284  fZUncorrected = 0.;
287  fRAtAbsorberEnd = 0.;
288  fChi2 = 0.;
289  fChi2MatchTrigger = 0.;
290  fLocalTrigger = 0;
291  fX1Pattern = 0;
292  fY1Pattern = 0;
293  fX2Pattern = 0;
294  fY2Pattern = 0;
295  fX3Pattern = 0;
296  fY3Pattern = 0;
297  fX4Pattern = 0;
298  fY4Pattern = 0;
299  fMuonClusterMap = 0;
302  fNHit = 0;
303  delete fClusters; fClusters = 0x0;
304  delete fClustersId; fClustersId = 0x0;
305  for (Int_t i = 0; i < 15; i++) fCovariances[i] = 0.;
306  fLabel = -1;
307  fESDEvent = 0;
308 }
309 
310 //_____________________________________________________________________________
311 void AliESDMuonTrack::GetCovariances(TMatrixD& cov) const
312 {
314  cov.ResizeTo(5,5);
315  for (Int_t i = 0; i < 5; i++)
316  for (Int_t j = 0; j <= i; j++)
317  cov(i,j) = cov (j,i) = fCovariances[i*(i+1)/2 + j];
318 }
319 
320 //_____________________________________________________________________________
321 void AliESDMuonTrack::SetCovariances(const TMatrixD& cov)
322 {
324  for (Int_t i = 0; i < 5; i++)
325  for (Int_t j = 0; j <= i; j++)
326  fCovariances[i*(i+1)/2 + j] = cov(i,j);
327 
328 }
329 
330 //_____________________________________________________________________________
331 void AliESDMuonTrack::GetCovarianceXYZPxPyPz(Double_t cov[21]) const
332 {
343  TMatrixD covESD(5,5);
344  GetCovariances(covESD);
345 
346  // compute Jacobian to change the coordinate system
347  // from (X,thetaX,Y,thetaY,c/pYZ) to (X,Y,Z,pX,pY,pZ)
348  Double_t tanThetaX = TMath::Tan(fThetaXUncorrected);
349  Double_t tanThetaY = TMath::Tan(fThetaYUncorrected);
350  Double_t cosThetaX2 = TMath::Cos(fThetaXUncorrected) * TMath::Cos(fThetaXUncorrected);
351  Double_t cosThetaY2 = TMath::Cos(fThetaYUncorrected) * TMath::Cos(fThetaYUncorrected);
352  Double_t pZ = PzUncorrected();
354  pZ * pZ * pZ * tanThetaY / cosThetaY2;
355  Double_t dpZdinvpYZ = (fInverseBendingMomentumUncorrected != 0.) ? - pZ / fInverseBendingMomentumUncorrected : - FLT_MAX;
356  TMatrixD jacob(6,5);
357  jacob.Zero();
358  jacob(0,0) = 1.;
359  jacob(1,2) = 1.;
360  jacob(3,1) = pZ / cosThetaX2;
361  jacob(3,3) = dpZdthetaY * tanThetaX;
362  jacob(3,4) = dpZdinvpYZ * tanThetaX;
363  jacob(4,3) = dpZdthetaY * tanThetaY + pZ / cosThetaY2;
364  jacob(4,4) = dpZdinvpYZ * tanThetaY;
365  jacob(5,3) = dpZdthetaY;
366  jacob(5,4) = dpZdinvpYZ;
367 
368  // compute covariance matrix in AOD coordinate system
369  TMatrixD tmp(covESD,TMatrixD::kMultTranspose,jacob);
370  TMatrixD covAOD(jacob,TMatrixD::kMult,tmp);
371 
372  // Get AOD covariance matrix into co[21]
373  for (Int_t i = 0; i < 6; i++)
374  for (Int_t j = 0; j <= i; j++)
375  cov[i*(i+1)/2 + j] = covAOD(i,j);
376 
377 }
378 
379 //_____________________________________________________________________________
380 Double_t AliESDMuonTrack::Px() const
381 {
383  Double_t nonBendingSlope = TMath::Tan(fThetaX);
384  Double_t bendingSlope = TMath::Tan(fThetaY);
385  Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : - FLT_MAX;
386  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
387  return pZ * nonBendingSlope;
388 }
389 
390 //_____________________________________________________________________________
391 Double_t AliESDMuonTrack::Py() const
392 {
394  Double_t bendingSlope = TMath::Tan(fThetaY);
395  Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : - FLT_MAX;
396  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
397  return pZ * bendingSlope;
398 }
399 
400 //_____________________________________________________________________________
401 Double_t AliESDMuonTrack::Pz() const
402 {
404  Double_t bendingSlope = TMath::Tan(fThetaY);
405  Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : - FLT_MAX;
406  return -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
407 }
408 
409 //_____________________________________________________________________________
410 Double_t AliESDMuonTrack::P() const
411 {
413  Double_t nonBendingSlope = TMath::Tan(fThetaX);
414  Double_t bendingSlope = TMath::Tan(fThetaY);
415  Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : - FLT_MAX;
416  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
417  return -pZ * TMath::Sqrt(1.0 + bendingSlope*bendingSlope + nonBendingSlope*nonBendingSlope);
418 }
419 
420 //_____________________________________________________________________________
421 void AliESDMuonTrack::LorentzP(TLorentzVector& vP) const
422 {
424  Double_t muonMass = M();
425  Double_t nonBendingSlope = TMath::Tan(fThetaX);
426  Double_t bendingSlope = TMath::Tan(fThetaY);
427  Double_t pYZ = (fInverseBendingMomentum != 0.) ? TMath::Abs(1. / fInverseBendingMomentum) : - FLT_MAX;
428  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
429  Double_t pX = pZ * nonBendingSlope;
430  Double_t pY = pZ * bendingSlope;
431  Double_t e = TMath::Sqrt(muonMass*muonMass + pX*pX + pY*pY + pZ*pZ);
432  vP.SetPxPyPzE(pX, pY, pZ, e);
433 }
434 
435 //_____________________________________________________________________________
436 Double_t AliESDMuonTrack::PxAtDCA() const
437 {
439  Double_t nonBendingSlope = TMath::Tan(fThetaXAtDCA);
440  Double_t bendingSlope = TMath::Tan(fThetaYAtDCA);
441  Double_t pYZ = (fInverseBendingMomentumAtDCA != 0.) ? TMath::Abs(1. / fInverseBendingMomentumAtDCA) : - FLT_MAX;
442  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
443  return pZ * nonBendingSlope;
444 }
445 
446 //_____________________________________________________________________________
447 Double_t AliESDMuonTrack::PyAtDCA() const
448 {
450  Double_t bendingSlope = TMath::Tan(fThetaYAtDCA);
451  Double_t pYZ = (fInverseBendingMomentumAtDCA != 0.) ? TMath::Abs(1. / fInverseBendingMomentumAtDCA) : - FLT_MAX;
452  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
453  return pZ * bendingSlope;
454 }
455 
456 //_____________________________________________________________________________
457 Double_t AliESDMuonTrack::PzAtDCA() const
458 {
460  Double_t bendingSlope = TMath::Tan(fThetaYAtDCA);
461  Double_t pYZ = (fInverseBendingMomentumAtDCA != 0.) ? TMath::Abs(1. / fInverseBendingMomentumAtDCA) : - FLT_MAX;
462  return -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
463 }
464 
465 //_____________________________________________________________________________
466 Double_t AliESDMuonTrack::PAtDCA() const
467 {
469  Double_t nonBendingSlope = TMath::Tan(fThetaXAtDCA);
470  Double_t bendingSlope = TMath::Tan(fThetaYAtDCA);
471  Double_t pYZ = (fInverseBendingMomentumAtDCA != 0.) ? TMath::Abs(1. / fInverseBendingMomentumAtDCA) : - FLT_MAX;
472  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
473  return -pZ * TMath::Sqrt(1.0 + bendingSlope*bendingSlope + nonBendingSlope*nonBendingSlope);
474 }
475 
476 //_____________________________________________________________________________
477 void AliESDMuonTrack::LorentzPAtDCA(TLorentzVector& vP) const
478 {
480  Double_t muonMass = M();
481  Double_t nonBendingSlope = TMath::Tan(fThetaXAtDCA);
482  Double_t bendingSlope = TMath::Tan(fThetaYAtDCA);
483  Double_t pYZ = (fInverseBendingMomentumAtDCA != 0.) ? TMath::Abs(1. / fInverseBendingMomentumAtDCA) : - FLT_MAX;
484  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
485  Double_t pX = pZ * nonBendingSlope;
486  Double_t pY = pZ * bendingSlope;
487  Double_t e = TMath::Sqrt(muonMass*muonMass + pX*pX + pY*pY + pZ*pZ);
488  vP.SetPxPyPzE(pX, pY, pZ, e);
489 }
490 
491 //_____________________________________________________________________________
493 {
495  Double_t nonBendingSlope = TMath::Tan(fThetaXUncorrected);
496  Double_t bendingSlope = TMath::Tan(fThetaYUncorrected);
497  Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : - FLT_MAX;
498  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
499  return pZ * nonBendingSlope;
500 }
501 
502 //_____________________________________________________________________________
504 {
506  Double_t bendingSlope = TMath::Tan(fThetaYUncorrected);
507  Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : - FLT_MAX;
508  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
509  return pZ * bendingSlope;
510 }
511 
512 //_____________________________________________________________________________
514 {
516  Double_t bendingSlope = TMath::Tan(fThetaYUncorrected);
517  Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : - FLT_MAX;
518  return -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
519 }
520 
521 //_____________________________________________________________________________
523 {
525  Double_t nonBendingSlope = TMath::Tan(fThetaXUncorrected);
526  Double_t bendingSlope = TMath::Tan(fThetaYUncorrected);
527  Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : - FLT_MAX;
528  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
529  return -pZ * TMath::Sqrt(1.0 + bendingSlope*bendingSlope + nonBendingSlope*nonBendingSlope);
530 }
531 
532 //_____________________________________________________________________________
533 void AliESDMuonTrack::LorentzPUncorrected(TLorentzVector& vP) const
534 {
536  Double_t muonMass = M();
537  Double_t nonBendingSlope = TMath::Tan(fThetaXUncorrected);
538  Double_t bendingSlope = TMath::Tan(fThetaYUncorrected);
539  Double_t pYZ = (fInverseBendingMomentumUncorrected != 0.) ? TMath::Abs(1. / fInverseBendingMomentumUncorrected) : - FLT_MAX;
540  Double_t pZ = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope); // spectro. (z<0)
541  Double_t pX = pZ * nonBendingSlope;
542  Double_t pY = pZ * bendingSlope;
543  Double_t e = TMath::Sqrt(muonMass*muonMass + pX*pX + pY*pY + pZ*pZ);
544  vP.SetPxPyPzE(pX, pY, pZ, e);
545 }
546 
547 //_____________________________________________________________________________
549 {
551 
552  Int_t ndf = 2 * static_cast<Int_t>(fNHit) - 5;
553  return (ndf > 0) ? ndf : 0;
554 }
555 
556 //_____________________________________________________________________________
558 {
560 
561  Int_t ndf = GetNDF();
562  return (ndf > 0) ? fChi2 / static_cast<Double_t>(ndf) : 0.;
563 }
564 
565 //_____________________________________________________________________________
567 {
573 
574  if (!LoCircuit()) {
575  return 0;
576  } else if (LoLpt() == 0 && LoHpt() == 0) {
577  return 1;
578  } else if (LoLpt() > 0 && LoHpt() == 0) {
579  return 2;
580  } else {
581  return 3;
582  }
583 
584 }
585 
586 //_____________________________________________________________________________
587 Bool_t AliESDMuonTrack::MatchTriggerDigits(Bool_t fromTrack) const
588 {
590 
591  UShort_t pattern = ( fromTrack ) ? fHitsPatternInTrigChTrk : fHitsPatternInTrigCh;
592  Int_t nMatchedChambers = 0;
593  for (Int_t ich=0; ich<4; ich++)
594  if (IsChamberHit(pattern, 0, ich) &&
595  IsChamberHit(pattern, 1, ich)) nMatchedChambers++;
596 
597  return (nMatchedChambers >= 2);
598 }
599 
600 //_____________________________________________________________________________
602 {
604  Int_t deviation = LoDev();
605  if ( deviation > 15 ) return 1;
606  else if ( deviation < 15 ) return -1;
607  else return 0;
608 }
609 
610 //_____________________________________________________________________________
611 void AliESDMuonTrack::AddClusterId(UInt_t clusterId)
612 {
614  if (!fClustersId) fClustersId = new TArrayI(5);
615  if (fClustersId->GetSize() <= fNHit) fClustersId->Set(fNHit+1);
616  fClustersId->AddAt(static_cast<Int_t>(clusterId), fNHit++);
617 }
618 
619 //_____________________________________________________________________________
621 {
623  if (!fClusters) return;
624  fNHit = 0;
625  for (Int_t i = 0; i < fClusters->GetEntriesFast(); i++) {
626  AliESDMuonCluster *cluster = static_cast<AliESDMuonCluster*>(fClusters->UncheckedAt(i));
627  cluster->MovePadsToESD(esd);
628  AliESDMuonCluster *newCluster = esd.NewMuonCluster();
629  *newCluster = *cluster;
630  AddClusterId(newCluster->GetUniqueID());
631  }
632  delete fClusters;
633  fClusters = 0x0;
634 }
635 
636 //_____________________________________________________________________________
637 void AliESDMuonTrack::SetFiredChamber(UInt_t& pattern, Int_t cathode, Int_t chamber)
638 {
640  pattern |= (0x1 << ( 7 - ( 4*cathode + chamber )));
641 }
642 
643 //_____________________________________________________________________________
644 void AliESDMuonTrack::AddEffInfo(UInt_t& pattern, Int_t slatOrInfo, Int_t board, EAliTriggerChPatternFlag effType)
645 {
647  if ( slatOrInfo > 0x1F ) {
648  AliErrorClass(Form("slatOrInfo is 0x%x should be at most 0x1f",slatOrInfo));
649  return;
650  }
651  if ( board > 242 ) {
652  AliErrorClass(Form("board is %i should be at most 242",board));
653  return;
654  }
655  if ( effType > 0x3 ) {
656  AliErrorClass(Form("effType is 0x%x should be at most 0x3",effType));
657  return;
658  }
659  pattern |= effType << 8;
660  pattern |= slatOrInfo << 10;
661  pattern |= board << 15;
662 }
663 
664 //_____________________________________________________________________________
665 Bool_t AliESDMuonTrack::IsChamberHit(UInt_t pattern, Int_t cathode, Int_t chamber)
666 {
668  return (pattern >> (7 - ( 4*cathode + chamber ))) & 0x1;
669 }
670 
671 //_____________________________________________________________________________
672 Int_t AliESDMuonTrack::GetEffFlag(UInt_t pattern)
673 {
675  return (pattern >> 8) & 0x3;
676 }
677 
678 //_____________________________________________________________________________
679 Int_t AliESDMuonTrack::GetSlatOrInfo(UInt_t pattern)
680 {
682  return (pattern >> 10) & 0x1F;
683 }
684 
685 //_____________________________________________________________________________
686 Int_t AliESDMuonTrack::GetCrossedBoard(UInt_t pattern)
687 {
689  return ( pattern >> 15 ) & 0xFF;
690 }
691 
692 
693 //_____________________________________________________________________________
694 void AliESDMuonTrack::AddMuonTrigDevSignInfo ( UInt_t &pattern ) const
695 {
704 
705  // First clean bits
706  pattern &= 0x3FFFFFFF;
707  // Then add info
708  UInt_t info = ((UInt_t)(GetMuonTrigDevSign()+2)&0x3)<<30;
709  pattern |= info;
710 }
Double_t P() const
Double32_t fInverseBendingMomentumAtDCA
Inverse bending momentum (GeV/c ** -1) times the charge.
TArrayI * fClustersId
Array of clusters&#39;Id attached to the track.
Double32_t fCovariances[15]
reduced covariance matrix of parameters AT FIRST CHAMBER
Double32_t fThetaXUncorrected
Angle of track at vertex in X direction (rad)
Int_t GetNDF() const
UShort_t fY1Pattern
y-strips pattern in st6/ch1
Class to describe the MUON tracks in the Event Summary Data class.
AliESDEvent * fESDEvent
virtual ~AliESDMuonTrack()
Double32_t fThetaYAtDCA
Angle of track at vertex in Y direction (rad)
UShort_t fY4Pattern
y-strips pattern in st7/ch2
Double32_t fNonBendingCoorUncorrected
non bending coordinate (cm)
AliVParticle & operator=(const AliVParticle &vPart)
Int_t LoDev(void) const
Double_t PxUncorrected() const
void LorentzPAtDCA(TLorentzVector &vP) const
UShort_t fHitsPatternInTrigCh
Word containing info on the hits left in trigger chambers.
Double_t M() const
virtual void Copy(TObject &obj) const
void GetCovariances(TMatrixD &cov) const
Double_t GetNormalizedChi2() const
UChar_t fNHit
number of clusters attached to the track
UShort_t fX3Pattern
x-strips pattern in st7/ch1
Double_t Py() const
static void AddEffInfo(UInt_t &pattern, Int_t slatOrInfo, Int_t board=0, EAliTriggerChPatternFlag effType=kNoEff)
Add efficiency flag and crossed RPC or info on rejected track.
Double32_t fRAtAbsorberEnd
transverse position r of the track at the end of the absorber
UShort_t fX2Pattern
x-strips pattern in st6/ch2
virtual void Clear(Option_t *opt="")
AliExternalInfo info
Int_t LoHpt(void) const
Double_t PyAtDCA() const
Int_t fLabel
point to the corresponding MC track
Int_t LoCircuit(void) const
static Int_t GetSlatOrInfo(UInt_t pattern)
Getting crossed slat or info.
#define AliErrorClass(message)
Definition: AliLog.h:596
Double_t PyUncorrected() const
Int_t fLocalTrigger
packed local trigger information
Double32_t fInverseBendingMomentum
Inverse bending momentum (GeV/c ** -1) times the charge.
UShort_t fX1Pattern
x-strips pattern in st6/ch1
Class to describe the MUON clusters in the Event Summary Data.
Double32_t fInverseBendingMomentumUncorrected
Inverse bending momentum (GeV/c ** -1) times the charge.
Double_t PzUncorrected() const
if(!cinput1) cinput1
Double_t PxAtDCA() const
void LorentzP(TLorentzVector &vP) const
TClonesArray * fClusters
Array of clusters attached to the track – deprecated.
static Bool_t IsChamberHit(UInt_t pattern, Int_t cathode, Int_t chamber)
Chamber was hit.
Double32_t fThetaXAtDCA
Angle of track at vertex in X direction (rad)
Bool_t MatchTriggerDigits(Bool_t fromTrack) const
Double32_t fChi2MatchTrigger
chi2 of trigger/track matching
Double32_t fBendingCoor
bending coordinate (cm)
void LorentzPUncorrected(TLorentzVector &vP) const
Int_t GetMatchTrigger() const
void AddMuonTrigDevSignInfo(UInt_t &pattern) const
AliESDMuonCluster * NewMuonCluster()
void MovePadsToESD(AliESDEvent &esd)
Double_t PzAtDCA() const
UShort_t fX4Pattern
x-strips pattern in st7/ch2
Double32_t fZ
Z coordinate (cm)
Double32_t fThetaX
Angle of track at vertex in X direction (rad)
Double_t Px() const
void GetCovarianceXYZPxPyPz(Double_t cov[21]) const
Double32_t fThetaYUncorrected
Angle of track at vertex in Y direction (rad)
Int_t GetMuonTrigDevSign() const
Double32_t fThetaY
Angle of track at vertex in Y direction (rad)
void AddClusterId(UInt_t clusterId)
static void SetFiredChamber(UInt_t &pattern, Int_t cathode, Int_t chamber)
Set hits pattern.
UShort_t fY3Pattern
y-strips pattern in st7/ch1
Double_t PUncorrected() const
Double32_t fBendingCoorUncorrected
bending coordinate (cm)
Int_t LoLpt(void) const
Double32_t fNonBendingCoorAtDCA
non bending coordinate (cm)
Double32_t fChi2
chi2 in the MUON track fit
Double_t PAtDCA() const
UShort_t fY2Pattern
y-strips pattern in st6/ch2
Double32_t fBendingCoorAtDCA
bending coordinate (cm)
static Int_t GetCrossedBoard(UInt_t pattern)
Getting crossed board.
Double32_t fZUncorrected
Z coordinate (cm)
UInt_t fMuonClusterMap
Map of clusters in tracking chambers.
void SetCovariances(const TMatrixD &cov)
static Int_t GetEffFlag(UInt_t pattern)
Get Efficiency flag.
Double_t Pz() const
AliESDMuonTrack & operator=(const AliESDMuonTrack &esdm)
UInt_t fHitsPatternInTrigChTrk
Trigger hit map from tracker track extrapolation.
void MoveClustersToESD(AliESDEvent &esd)
Double32_t fNonBendingCoor
non bending coordinate (cm)