]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnMCInfo.h
a few more checks
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnMCInfo.h
1 //
2 // Class AliRsnMCInfo
3 //
4 // Contains informations from the MonteCarlo particle is associated to a track.
5 // It is used when looking at "perfect" PID and at "true" pairs, but the user
6 // does not need to access its methods.
7 //
8 // authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
9 //          M. Vala (martin.vala@cern.ch)
10 //
11
12 #ifndef ALIRSNMCINFO_H
13 #define ALIRSNMCINFO_H
14
15 #include <TParticle.h>
16 #include <TMath.h>
17
18 class AliRsnMCInfo : public TObject
19 {
20   public:
21
22     AliRsnMCInfo();
23     AliRsnMCInfo(const AliRsnMCInfo &copy);
24
25     ~AliRsnMCInfo();
26     void Adopt(TParticle *part);
27
28     // 4-momentum
29     Double_t E()  const {return fEnergy;}
30     Double_t E(Double_t mass) {return TMath::Sqrt(mass*mass + P2());}
31     Double_t M()  const {return TMath::Sqrt(fEnergy*fEnergy - P2());}
32     Double_t P2() const {return Px()*Px() + Py()*Py() + Pz()*Pz();}
33     Double_t P()  const {return TMath::Sqrt(P2());}
34     Double_t Px() const {return fP[0];}
35     Double_t Py() const {return fP[1];}
36     Double_t Pz() const {return fP[2];}
37     Double_t Pt() const {return TMath::Sqrt(Px() *Px() + Py() *Py());}
38     Double_t OneOverPt() const {return 1.0 / Pt();}
39     Bool_t   PxPyPz(Double_t p[3]) const {p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE;}
40
41     Double_t Phi() const {return TMath::ATan2(Py(), Px());}
42     Double_t Theta() const {return TMath::ATan2(Pt(), Pz());}
43     Double_t Eta() const {return -TMath::Log(TMath::Tan(0.5*Theta()));}
44     Double_t Y() const {return 0.5 * TMath::Log((E() + Pz()) / (E() - Pz()));}
45
46     void     SetPx(Double_t value) {fP[0] = value;}
47     void     SetPy(Double_t value) {fP[1] = value;}
48     void     SetPz(Double_t value) {fP[2] = value;}
49     void     SetP(Double_t px, Double_t py, Double_t pz) {SetPx(px); SetPy(py); SetPz(pz);}
50     void     SetE(Double_t e) {fEnergy = e;}
51
52     Double_t Vx() const {return fV[0];}
53     Double_t Vy() const {return fV[1];}
54     Double_t Vz() const {return fV[2];}
55     Double_t Dr() const {return TMath::Sqrt(Vx()*Vx() + Vy()*Vy());}
56     void     ShiftZero(Double_t x, Double_t y, Double_t z){fV[0]-=x;fV[1]-=y;fV[2]-=z;}
57
58     void     SetVx(Double_t value) {fV[0] = value;}
59     void     SetVy(Double_t value) {fV[1] = value;}
60     void     SetVz(Double_t value) {fV[2] = value;}
61     void     SetV(Double_t x, Double_t y, Double_t z) {SetVx(x); SetVy(y); SetVz(z);}
62
63     Int_t    PDG() const {return fPDG;}
64     Int_t    Mother() const {return fMother;}
65     Short_t  MotherPDG() const {return fMotherPDG;}
66     void     SetPDG(Int_t pdg) {fPDG = pdg;}
67     void     SetMother(Int_t mlabel) {fMother = mlabel;}
68     void     SetMotherPDG(Int_t pdg) {fMotherPDG = (Short_t) pdg;}
69
70   private:
71
72     Double_t  fP[3];          // MC momentum
73     Double_t  fV[3];          // MC position
74     Double_t  fEnergy;        // MC energy
75     Int_t     fPDG;           // PDG code
76     Int_t     fMother;        // GEANT label of mother particle
77     Short_t   fMotherPDG;     // PDG code of mother particle
78
79     ClassDef(AliRsnMCInfo,1)
80 };
81
82 #endif