]>
Commit | Line | Data |
---|---|---|
8168d1ea | 1 | #ifndef ALIMCPARTICLE_H |
2 | #define ALIMCPARTICLE_H | |
415d9f5c | 3 | /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | //------------------------------------------------------------------------- | |
9 | // AliVParticle realisation for MC Particles | |
93df0e9b | 10 | // Author: Andreas Morsch, CERN |
415d9f5c | 11 | //------------------------------------------------------------------------- |
12 | ||
13 | #include <Rtypes.h> | |
415d9f5c | 14 | #include <TParticle.h> |
15 | #include <TParticlePDG.h> | |
69fcabe8 | 16 | #include <TObjArray.h> |
415d9f5c | 17 | |
93df0e9b | 18 | #include "AliTrackReference.h" |
19 | #include "AliVParticle.h" | |
415d9f5c | 20 | |
93df0e9b | 21 | class AliMCParticle: public AliVParticle { |
415d9f5c | 22 | public: |
23 | AliMCParticle(); | |
69fcabe8 | 24 | AliMCParticle(TParticle* part, TObjArray* rarray = 0, Int_t label=-1); |
f1ac8a97 | 25 | virtual ~AliMCParticle(); |
415d9f5c | 26 | AliMCParticle(const AliMCParticle& mcPart); |
27 | AliMCParticle& operator=(const AliMCParticle& mcPart); | |
28 | ||
93df0e9b | 29 | // Kinematics |
415d9f5c | 30 | virtual Double_t Px() const; |
31 | virtual Double_t Py() const; | |
32 | virtual Double_t Pz() const; | |
33 | virtual Double_t Pt() const; | |
34 | virtual Double_t P() const; | |
c683ddc2 | 35 | virtual Bool_t PxPyPz(Double_t p[3]) const; |
36 | ||
415d9f5c | 37 | virtual Double_t OneOverPt() const; |
38 | virtual Double_t Phi() const; | |
39 | virtual Double_t Theta() const; | |
40 | ||
7162633f | 41 | virtual Double_t Xv() const; |
42 | virtual Double_t Yv() const; | |
43 | virtual Double_t Zv() const; | |
c683ddc2 | 44 | virtual Bool_t XvYvZv(Double_t x[3]) const; |
5e6a3170 | 45 | virtual Double_t T() const; |
c683ddc2 | 46 | |
eee13e8d | 47 | virtual Double_t E() const; |
48 | virtual Double_t M() const; | |
415d9f5c | 49 | |
eee13e8d | 50 | virtual Double_t Eta() const; |
51 | virtual Double_t Y() const; | |
415d9f5c | 52 | |
eee13e8d | 53 | virtual Short_t Charge() const; |
54 | ||
7162633f | 55 | virtual Int_t Label() const; |
56 | virtual Int_t GetLabel() const {return Label();} | |
57 | virtual Int_t PdgCode() const {return fParticle->GetPdgCode();} | |
58 | virtual TParticle* Particle() const {return fParticle;} | |
59 | ||
415d9f5c | 60 | // PID |
61 | virtual const Double_t *PID() const {return 0;} // return PID object (to be defined, still) | |
93df0e9b | 62 | |
63 | // Track References | |
5e6a3170 | 64 | Int_t GetNumberOfTrackReferences() const {return fNTrackRef;} |
93df0e9b | 65 | AliTrackReference* GetTrackReference(Int_t i) |
f1ac8a97 | 66 | {return dynamic_cast<AliTrackReference*>((*fTrackReferences)[i]);} |
7162633f | 67 | |
68 | // "Trackable" criteria | |
56a69855 | 69 | Float_t GetTPCTrackLength(Float_t bz, Float_t ptmin, Int_t &counter, Float_t deadWidth, Float_t zMax=230. ); |
93836e1b | 70 | // Navigation |
4e0b0eb8 | 71 | virtual Int_t GetMother() const {return fMother;} |
93836e1b | 72 | Int_t GetFirstDaughter() const {return fFirstDaughter;} |
73 | Int_t GetLastDaughter() const {return fLastDaughter;} | |
74 | void SetMother(Int_t idx) {fMother = idx;} | |
75 | void SetFirstDaughter(Int_t idx) {fFirstDaughter = idx;} | |
76 | void SetLastDaughter(Int_t idx) {fLastDaughter = idx;} | |
77 | void SetLabel(Int_t label) {fLabel = label;} | |
11762dd0 | 78 | virtual void SetGeneratorIndex(Short_t i) {fGeneratorIndex = i;} |
79 | virtual Short_t GetGeneratorIndex() const {return fGeneratorIndex;} | |
80 | ||
415d9f5c | 81 | private: |
93df0e9b | 82 | TParticle *fParticle; // The wrapped TParticle |
69fcabe8 | 83 | TObjArray *fTrackReferences; // Array to track references |
93df0e9b | 84 | Int_t fNTrackRef; // Number of track references |
eee13e8d | 85 | Int_t fLabel; // fParticle Label in the Stack |
93836e1b | 86 | Int_t fMother; // Mother particles |
87 | Int_t fFirstDaughter; // First daughter | |
88 | Int_t fLastDaughter; // LastDaughter | |
11762dd0 | 89 | Short_t fGeneratorIndex; // !Generator index in cocktail |
415d9f5c | 90 | ClassDef(AliMCParticle,0) // AliVParticle realisation for MCParticles |
91 | }; | |
92 | ||
93 | inline Double_t AliMCParticle::Px() const {return fParticle->Px();} | |
94 | inline Double_t AliMCParticle::Py() const {return fParticle->Py();} | |
95 | inline Double_t AliMCParticle::Pz() const {return fParticle->Pz();} | |
96 | inline Double_t AliMCParticle::Pt() const {return fParticle->Pt();} | |
97 | inline Double_t AliMCParticle::P() const {return fParticle->P(); } | |
98 | inline Double_t AliMCParticle::OneOverPt() const {return 1. / fParticle->Pt();} | |
c683ddc2 | 99 | inline Bool_t AliMCParticle::PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; } |
415d9f5c | 100 | inline Double_t AliMCParticle::Phi() const {return fParticle->Phi();} |
101 | inline Double_t AliMCParticle::Theta() const {return fParticle->Theta();} | |
c683ddc2 | 102 | inline Double_t AliMCParticle::Xv() const {return fParticle->Vx();} |
103 | inline Double_t AliMCParticle::Yv() const {return fParticle->Vy();} | |
104 | inline Double_t AliMCParticle::Zv() const {return fParticle->Vz();} | |
105 | inline Bool_t AliMCParticle::XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; } | |
5e6a3170 | 106 | inline Double_t AliMCParticle::T() const {return fParticle->T();} |
415d9f5c | 107 | inline Double_t AliMCParticle::E() const {return fParticle->Energy();} |
108 | inline Double_t AliMCParticle::Eta() const {return fParticle->Eta();} | |
109 | ||
7162633f | 110 | |
415d9f5c | 111 | inline Double_t AliMCParticle::M() const |
112 | { | |
113 | TParticlePDG* pdg = fParticle->GetPDG(); | |
114 | if (pdg) { | |
115 | return (pdg->Mass()); | |
116 | } else { | |
117 | return (fParticle->GetCalcMass()); | |
118 | } | |
119 | } | |
120 | ||
121 | ||
122 | inline Double_t AliMCParticle::Y() const | |
123 | { | |
124 | Double_t e = E(); | |
6a2ade18 | 125 | Double_t pz = Pz(); |
126 | ||
ecb9c83e | 127 | if ( TMath::Abs(e - TMath::Abs(pz)) > FLT_EPSILON ) { |
415d9f5c | 128 | return 0.5*TMath::Log((e+pz)/(e-pz)); |
129 | } else { | |
130 | return -999.; | |
131 | } | |
132 | } | |
133 | ||
134 | inline Short_t AliMCParticle::Charge() const | |
135 | { | |
136 | TParticlePDG* pdg = fParticle->GetPDG(); | |
137 | if (pdg) { | |
138 | return (Short_t (pdg->Charge())); | |
139 | } else { | |
140 | return -99; | |
141 | } | |
142 | } | |
143 | ||
eee13e8d | 144 | inline Int_t AliMCParticle::Label() const {return fLabel;} |
145 | ||
415d9f5c | 146 | #endif |