]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliMCParticle.h
syst. check that reads the MC information for the case of TPC-only
[u/mrichter/AliRoot.git] / STEER / AliMCParticle.h
CommitLineData
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 21class AliMCParticle: public AliVParticle {
415d9f5c 22public:
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
3c43fb2b 54 virtual Int_t Label() const;
55 virtual Int_t GetLabel() const {return Label();}
eee13e8d 56 virtual TParticle* Particle() const {return fParticle;}
57
415d9f5c 58 // PID
59 virtual const Double_t *PID() const {return 0;} // return PID object (to be defined, still)
93df0e9b 60
61 // Track References
62 Int_t GetNumberOfTrackReferences() {return fNTrackRef;}
63 AliTrackReference* GetTrackReference(Int_t i)
f1ac8a97 64 {return dynamic_cast<AliTrackReference*>((*fTrackReferences)[i]);}
415d9f5c 65 private:
93df0e9b 66 TParticle *fParticle; // The wrapped TParticle
67 TRefArray *fTrackReferences; // Reference array to track references
68 Int_t fNTrackRef; // Number of track references
eee13e8d 69 Int_t fLabel; // fParticle Label in the Stack
415d9f5c 70
71 ClassDef(AliMCParticle,0) // AliVParticle realisation for MCParticles
72};
73
74inline Double_t AliMCParticle::Px() const {return fParticle->Px();}
75inline Double_t AliMCParticle::Py() const {return fParticle->Py();}
76inline Double_t AliMCParticle::Pz() const {return fParticle->Pz();}
77inline Double_t AliMCParticle::Pt() const {return fParticle->Pt();}
78inline Double_t AliMCParticle::P() const {return fParticle->P(); }
79inline Double_t AliMCParticle::OneOverPt() const {return 1. / fParticle->Pt();}
c683ddc2 80inline Bool_t AliMCParticle::PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
415d9f5c 81inline Double_t AliMCParticle::Phi() const {return fParticle->Phi();}
82inline Double_t AliMCParticle::Theta() const {return fParticle->Theta();}
c683ddc2 83inline Double_t AliMCParticle::Xv() const {return fParticle->Vx();}
84inline Double_t AliMCParticle::Yv() const {return fParticle->Vy();}
85inline Double_t AliMCParticle::Zv() const {return fParticle->Vz();}
86inline Bool_t AliMCParticle::XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }
415d9f5c 87inline Double_t AliMCParticle::E() const {return fParticle->Energy();}
88inline Double_t AliMCParticle::Eta() const {return fParticle->Eta();}
89
90inline Double_t AliMCParticle::M() const
91{
92 TParticlePDG* pdg = fParticle->GetPDG();
93 if (pdg) {
94 return (pdg->Mass());
95 } else {
96 return (fParticle->GetCalcMass());
97 }
98}
99
100
101inline Double_t AliMCParticle::Y() const
102{
103 Double_t e = E();
6a2ade18 104 Double_t pz = Pz();
105
106 if (e != TMath::Abs(pz)) {
415d9f5c 107 return 0.5*TMath::Log((e+pz)/(e-pz));
108 } else {
109 return -999.;
110 }
111}
112
113inline Short_t AliMCParticle::Charge() const
114{
115 TParticlePDG* pdg = fParticle->GetPDG();
116 if (pdg) {
117 return (Short_t (pdg->Charge()));
118 } else {
119 return -99;
120 }
121}
122
eee13e8d 123inline Int_t AliMCParticle::Label() const {return fLabel;}
124
415d9f5c 125#endif