]>
Commit | Line | Data |
---|---|---|
415d9f5c | 1 | #ifndef AliMCParticle_H |
2 | #define AliMCParticle_H | |
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> | |
93df0e9b | 16 | #include <TRefArray.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(); | |
eee13e8d | 24 | AliMCParticle(TParticle* part, TRefArray* 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 | ||
c683ddc2 | 41 | virtual Double_t Xv() const; |
42 | virtual Double_t Yv() const; | |
43 | virtual Double_t Zv() const; | |
44 | virtual Bool_t XvYvZv(Double_t x[3]) const; | |
45 | ||
eee13e8d | 46 | virtual Double_t E() const; |
47 | virtual Double_t M() const; | |
415d9f5c | 48 | |
eee13e8d | 49 | virtual Double_t Eta() const; |
50 | virtual Double_t Y() const; | |
415d9f5c | 51 | |
eee13e8d | 52 | virtual Short_t Charge() const; |
53 | ||
54 | virtual Int_t Label() const; | |
55 | virtual TParticle* Particle() const {return fParticle;} | |
56 | ||
415d9f5c | 57 | // PID |
58 | virtual const Double_t *PID() const {return 0;} // return PID object (to be defined, still) | |
93df0e9b | 59 | |
60 | // Track References | |
61 | Int_t GetNumberOfTrackReferences() {return fNTrackRef;} | |
62 | AliTrackReference* GetTrackReference(Int_t i) | |
f1ac8a97 | 63 | {return dynamic_cast<AliTrackReference*>((*fTrackReferences)[i]);} |
415d9f5c | 64 | private: |
93df0e9b | 65 | TParticle *fParticle; // The wrapped TParticle |
66 | TRefArray *fTrackReferences; // Reference array to track references | |
67 | Int_t fNTrackRef; // Number of track references | |
eee13e8d | 68 | Int_t fLabel; // fParticle Label in the Stack |
415d9f5c | 69 | |
70 | ClassDef(AliMCParticle,0) // AliVParticle realisation for MCParticles | |
71 | }; | |
72 | ||
73 | inline Double_t AliMCParticle::Px() const {return fParticle->Px();} | |
74 | inline Double_t AliMCParticle::Py() const {return fParticle->Py();} | |
75 | inline Double_t AliMCParticle::Pz() const {return fParticle->Pz();} | |
76 | inline Double_t AliMCParticle::Pt() const {return fParticle->Pt();} | |
77 | inline Double_t AliMCParticle::P() const {return fParticle->P(); } | |
78 | inline Double_t AliMCParticle::OneOverPt() const {return 1. / fParticle->Pt();} | |
c683ddc2 | 79 | inline Bool_t AliMCParticle::PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; } |
415d9f5c | 80 | inline Double_t AliMCParticle::Phi() const {return fParticle->Phi();} |
81 | inline Double_t AliMCParticle::Theta() const {return fParticle->Theta();} | |
c683ddc2 | 82 | inline Double_t AliMCParticle::Xv() const {return fParticle->Vx();} |
83 | inline Double_t AliMCParticle::Yv() const {return fParticle->Vy();} | |
84 | inline Double_t AliMCParticle::Zv() const {return fParticle->Vz();} | |
85 | inline Bool_t AliMCParticle::XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; } | |
415d9f5c | 86 | inline Double_t AliMCParticle::E() const {return fParticle->Energy();} |
87 | inline Double_t AliMCParticle::Eta() const {return fParticle->Eta();} | |
88 | ||
89 | inline Double_t AliMCParticle::M() const | |
90 | { | |
91 | TParticlePDG* pdg = fParticle->GetPDG(); | |
92 | if (pdg) { | |
93 | return (pdg->Mass()); | |
94 | } else { | |
95 | return (fParticle->GetCalcMass()); | |
96 | } | |
97 | } | |
98 | ||
99 | ||
100 | inline Double_t AliMCParticle::Y() const | |
101 | { | |
102 | Double_t e = E(); | |
103 | Double_t pz = TMath::Abs(Pz()); | |
104 | if (e != pz) { | |
105 | return 0.5*TMath::Log((e+pz)/(e-pz)); | |
106 | } else { | |
107 | return -999.; | |
108 | } | |
109 | } | |
110 | ||
111 | inline Short_t AliMCParticle::Charge() const | |
112 | { | |
113 | TParticlePDG* pdg = fParticle->GetPDG(); | |
114 | if (pdg) { | |
115 | return (Short_t (pdg->Charge())); | |
116 | } else { | |
117 | return -99; | |
118 | } | |
119 | } | |
120 | ||
eee13e8d | 121 | inline Int_t AliMCParticle::Label() const {return fLabel;} |
122 | ||
415d9f5c | 123 | #endif |