AliRoot Core  3dc7879 (3dc7879)
AliTrackReference.h
Go to the documentation of this file.
1 #ifndef ALITRACKREFERENCE_H
2 #define ALITRACKREFERENCE_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 /* $Id$ */
7 
8 //
9 // Track Reference object is created every time particle is
10 // crossing detector bounds.
11 // The object is created by Step Manager
12 //
13 
14 #include "TObject.h"
15 #include "TMath.h"
16 
17 class AliTrackReference : public TObject {
18 public:
19 
20  enum constants {kDisappeared = -1,
21  kITS = 0,
22  kTPC = 1,
23  kFRAME = 2,
24  kTRD = 3,
25  kTOF = 4,
26  kMUON = 5,
27  kHMPID = 6,
28  kT0 = 7,
29  kEMCAL = 8,
30  kPMD = 10,
31  kFMD = 12,
32  kVZERO = 14,
33  kZDC = 15,
34  kMFT = 16,
35  kHALL = 17,
36  kFIT = 18, //alla
37  kAD = 19
38  };
40  AliTrackReference(Int_t label, Int_t id = -999);
42  virtual ~AliTrackReference() {}
43 
44 // static AliExternalTrackParam * MakeTrack(const AliTrackReference *ref, Double_t mass);
45  virtual Int_t GetTrack() const {return fTrack;}
46  virtual void SetTrack(Int_t track) {fTrack=track;}
47  virtual void SetLength(Float_t length){fLength=length;}
48  virtual void SetTime(Float_t time) {fTime = time;}
49  virtual Float_t GetLength() const {return fLength;}
50  virtual Float_t GetTime() const {return fTime;}
51  virtual Int_t Label() const {return fTrack;}
52  virtual void SetLabel(Int_t track) {fTrack=track;}
53  virtual Float_t R() const {return TMath::Sqrt(fX*fX+fY*fY);}
54  virtual Float_t Pt() const {return TMath::Sqrt(fPx*fPx+fPy*fPy);}
55  virtual Float_t Phi() const {return TMath::Pi()+TMath::ATan2(-fPy,-fPx);}
56  virtual Float_t Theta() const {return (fPz==0)?TMath::Pi()/2:TMath::ACos(fPz/P());}
57  virtual Float_t X() const {return fX;}
58  virtual Float_t Y() const {return fY;}
59  virtual Float_t Z() const {return fZ;}
60  virtual Float_t Px() const {return fPx;}
61  virtual Float_t Py() const {return fPy;}
62  virtual Float_t Pz() const {return fPz;}
63  virtual Float_t P() const {return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz);}
64  virtual Int_t UserId() const {return fUserId;}
65  virtual Int_t DetectorId() const {return fDetectorId;}
66  virtual void SetDetectorId(Int_t id){fDetectorId = id;}
67  virtual void SetPosition(Float_t x, Float_t y, Float_t z){fX=x; fY=y; fZ=z;}
68  virtual void SetMomentum(Float_t px, Float_t py, Float_t pz){fPx=px; fPy=py; fPz=pz;}
69  virtual void SetUserId(Int_t userId){fUserId=userId;}
70 
71  // Methods to get position of the track reference in
72  // in the TPC/TRD/TOF Tracking coordinate system
73 
74  virtual Float_t PhiPos() const {return TMath::Pi()+TMath::ATan2(-fY, -fX);}
75  virtual Float_t Alpha() const
76  {return TMath::Pi()*(20*((((Int_t)(PhiPos()*180/TMath::Pi()))/20))+10)/180.;}
77  virtual Float_t LocalX() const {return fX*TMath::Cos(-Alpha()) - fY*TMath::Sin(-Alpha());}
78  virtual Float_t LocalY() const {return fX*TMath::Sin(-Alpha()) + fY*TMath::Cos(-Alpha());}
79 
80  Bool_t IsSortable() const {return kTRUE;}
81  Int_t Compare(const TObject *obj) const {
82  Int_t ll = ((AliTrackReference*)obj)->GetTrack();
83  if (ll < fTrack) return 1;
84  if (ll > fTrack) return -1;
85  return 0;
86  }
87 
88  virtual void Print(Option_t* opt="") const;
89 
90 protected:
91  Int_t fTrack; // Track number
92  Float_t fX; // X reference position of the track
93  Float_t fY; // Y reference position of the track
94  Float_t fZ; // Z reference position of the track
95  Float_t fPx; // momentum
96  Float_t fPy; // momentum
97  Float_t fPz; // momentum
98  Float_t fLength; // track lenght from its origin in cm
99  Float_t fTime; // time of flight in cm
100  Int_t fUserId; // optional Id defined by user
101  Int_t fDetectorId; // Detector Id
102  ClassDef(AliTrackReference,7) //Base class for all Alice track references
103 };
104 #endif
virtual void SetUserId(Int_t userId)
virtual Float_t GetLength() const
virtual void SetTime(Float_t time)
virtual Float_t R() const
virtual void Print(Option_t *opt="") const
Int_t Compare(const TObject *obj) const
virtual Float_t LocalX() const
virtual void SetMomentum(Float_t px, Float_t py, Float_t pz)
virtual Float_t Alpha() const
virtual Float_t P() const
Bool_t IsSortable() const
AliTPCfastTrack * track
virtual Float_t Px() const
virtual Float_t Pz() const
virtual Float_t Pt() const
virtual Float_t PhiPos() const
virtual Int_t GetTrack() const
virtual Float_t Py() const
virtual Float_t Y() const
virtual Float_t Theta() const
virtual void SetPosition(Float_t x, Float_t y, Float_t z)
virtual void SetLength(Float_t length)
virtual void SetLabel(Int_t track)
virtual void SetDetectorId(Int_t id)
virtual Int_t Label() const
virtual Float_t Z() const
virtual Float_t LocalY() const
virtual Int_t UserId() const
virtual Float_t GetTime() const
virtual Float_t X() const
virtual void SetTrack(Int_t track)
virtual Float_t Phi() const
virtual Int_t DetectorId() const
virtual ~AliTrackReference()