]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnPairParticle.h
Package upgrade.
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnPairParticle.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * See cxx source for full Copyright notice                               *
4  **************************************************************************/
5
6 //
7 // Class AliRsnPairParticle
8 //
9 // Implementation of a pair of tracks, for several purposes
10 // - computing the total 4-momentum & inv. mass for output histos filling
11 // - evaluating cut checks on the pair of particles
12 //
13 // author: Martin Vala (martin.vala@cern.ch)
14 // revised by: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
15 //
16
17 #ifndef ALIRSNPAIRPARTICLE_H
18 #define ALIRSNPAIRPARTICLE_H
19
20 #include <TMath.h>
21
22 #include "AliRsnDaughter.h"
23 #include "AliRsnMCInfo.h"
24
25 class AliRsnPairParticle : public TObject
26 {
27 public:
28
29     AliRsnPairParticle();
30     AliRsnPairParticle(const AliRsnPairParticle &obj);
31     AliRsnPairParticle& operator=(const AliRsnPairParticle &obj);
32     virtual ~AliRsnPairParticle();
33
34     Double_t   GetInvMass (Double_t m1 = -1.0, Double_t m2 = -1.0);
35     Double_t   GetInvMassMC (Double_t m1 = -1.0, Double_t m2 = -1.0);
36     Double_t   GetDaughterEnergy(const Int_t &index, const Double_t &mass);
37     Double_t   GetDaughterEnergyMC(const Int_t &index, const Double_t &mass);
38
39     Double_t   GetP2() const {return (fPTot[0]*fPTot[0] + fPTot[1]*fPTot[1] + fPTot[2]*fPTot[2]);}
40     Double_t   GetPt2() const {return (fPTot[0]*fPTot[0] + fPTot[1]*fPTot[1]);}
41     Double_t   GetP() const {return TMath::Sqrt(GetP2());}
42     Double_t   GetP(Int_t index) const {return fPTot[index];}
43     Double_t   GetPt() const {return TMath::Sqrt(GetPt2());}
44
45     Double_t   GetP2MC() const {return (fPTotMC[0]*fPTotMC[0] + fPTotMC[1]*fPTotMC[1] + fPTotMC[2]*fPTotMC[2]);}
46     Double_t   GetPt2MC() const {return (fPTotMC[0]*fPTotMC[0] + fPTotMC[1]*fPTotMC[1]);}
47     Double_t   GetPMC() const {return TMath::Sqrt(GetP2MC());}
48     Double_t   GetPMC(Int_t index) const {return fPTotMC[index];}
49     Double_t   GetPtMC() const {return TMath::Sqrt(GetPt2MC());}
50
51     Int_t      GetPDG(const Int_t &index);
52     Int_t      GetType(const Int_t &index) const {return (Int_t) fDaughter[index]->PIDType();}
53     Int_t      GetLabel(const Int_t &index) const {return (Int_t) fDaughter[index]->Label();}
54     Int_t      GetIndex(const Int_t &index) const {return (Int_t) fDaughter[index]->Index();}
55     Double_t   GetMass() const {return fMass;}
56     AliRsnDaughter* GetDaughter(const Int_t &index) const {return fDaughter[index];}
57
58     Bool_t     IsPDGEqual() {return abs(GetPDG(0)) == abs(GetPDG(1));}
59     Bool_t     IsTypeEqual() {return GetType(0) == GetType(1);}
60     Bool_t     IsLabelEqual() {return abs(GetLabel(0)) == abs(GetLabel(1));}
61     Bool_t     IsIndexEqual() {return GetIndex(0) == GetIndex(1);}
62     Bool_t     IsTruePair(Int_t refPDG = 0);
63
64     void       SetMass(Double_t mass) {fMass = mass;}
65     void       SetPair(AliRsnDaughter *daughter1, AliRsnDaughter *daughter2);
66     void       PrintInfo (const Option_t *option = "");
67
68 private:
69
70     Double_t         fPTot[3];          // total momentum computed with rec. values
71     Double_t         fPTotMC[3];        // total momentum computed with MC values
72     Double_t         fPTrack[2][3];     // rec. momentum of single tracks
73     Double_t         fPTrackMC[2][3];   // MC momentum of single tracks
74
75     Double_t         fMass;             // mass hypothesis for resonance
76
77     Int_t            fMotherLabel[2];   // GEANT label of tracks
78     Int_t            fMotherPDG[2];     // PDG code of mother of tracks
79
80     AliRsnDaughter  *fDaughter[2];      // elements of the pair
81
82     ClassDef (AliRsnPairParticle,1)
83 };
84
85 #endif