]>
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(); | |
93df0e9b | 24 | AliMCParticle(TParticle* part, TRefArray* rarray = 0); |
415d9f5c | 25 | virtual ~AliMCParticle() {} |
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; | |
35 | ||
36 | virtual Double_t OneOverPt() const; | |
37 | virtual Double_t Phi() const; | |
38 | virtual Double_t Theta() const; | |
39 | ||
40 | ||
41 | virtual Double_t E() const; | |
42 | virtual Double_t M() const; | |
43 | ||
44 | virtual Double_t Eta() const; | |
45 | virtual Double_t Y() const; | |
46 | ||
47 | virtual Short_t Charge() const; | |
48 | ||
49 | // PID | |
50 | virtual const Double_t *PID() const {return 0;} // return PID object (to be defined, still) | |
93df0e9b | 51 | |
52 | // Track References | |
53 | Int_t GetNumberOfTrackReferences() {return fNTrackRef;} | |
54 | AliTrackReference* GetTrackReference(Int_t i) | |
55 | {return dynamic_cast<AliTrackReference*>((*fTrackReferences)[i]);} | |
415d9f5c | 56 | private: |
93df0e9b | 57 | TParticle *fParticle; // The wrapped TParticle |
58 | TRefArray *fTrackReferences; // Reference array to track references | |
59 | Int_t fNTrackRef; // Number of track references | |
415d9f5c | 60 | |
61 | ClassDef(AliMCParticle,0) // AliVParticle realisation for MCParticles | |
62 | }; | |
63 | ||
64 | inline Double_t AliMCParticle::Px() const {return fParticle->Px();} | |
65 | inline Double_t AliMCParticle::Py() const {return fParticle->Py();} | |
66 | inline Double_t AliMCParticle::Pz() const {return fParticle->Pz();} | |
67 | inline Double_t AliMCParticle::Pt() const {return fParticle->Pt();} | |
68 | inline Double_t AliMCParticle::P() const {return fParticle->P(); } | |
69 | inline Double_t AliMCParticle::OneOverPt() const {return 1. / fParticle->Pt();} | |
70 | inline Double_t AliMCParticle::Phi() const {return fParticle->Phi();} | |
71 | inline Double_t AliMCParticle::Theta() const {return fParticle->Theta();} | |
72 | inline Double_t AliMCParticle::E() const {return fParticle->Energy();} | |
73 | inline Double_t AliMCParticle::Eta() const {return fParticle->Eta();} | |
74 | ||
75 | inline Double_t AliMCParticle::M() const | |
76 | { | |
77 | TParticlePDG* pdg = fParticle->GetPDG(); | |
78 | if (pdg) { | |
79 | return (pdg->Mass()); | |
80 | } else { | |
81 | return (fParticle->GetCalcMass()); | |
82 | } | |
83 | } | |
84 | ||
85 | ||
86 | inline Double_t AliMCParticle::Y() const | |
87 | { | |
88 | Double_t e = E(); | |
89 | Double_t pz = TMath::Abs(Pz()); | |
90 | if (e != pz) { | |
91 | return 0.5*TMath::Log((e+pz)/(e-pz)); | |
92 | } else { | |
93 | return -999.; | |
94 | } | |
95 | } | |
96 | ||
97 | inline Short_t AliMCParticle::Charge() const | |
98 | { | |
99 | TParticlePDG* pdg = fParticle->GetPDG(); | |
100 | if (pdg) { | |
101 | return (Short_t (pdg->Charge())); | |
102 | } else { | |
103 | return -99; | |
104 | } | |
105 | } | |
106 | ||
107 | #endif |