]>
Commit | Line | Data |
---|---|---|
06351446 | 1 | // |
2 | // Class AliRsnPairParticle | |
3 | // | |
4 | // Implementation of a pair of tracks, for several purposes | |
5 | // - computing the total 4-momentum & inv. mass for output histos filling | |
6 | // - evaluating cut checks on the pair of particles | |
e0baff8c | 7 | // - evaluating any kind of kinematic value over their sum |
06351446 | 8 | // |
e0baff8c | 9 | // authors: Martin Vala (martin.vala@cern.ch) |
10 | // Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it) | |
06351446 | 11 | // |
12 | ||
13 | #ifndef ALIRSNPAIRPARTICLE_H | |
14 | #define ALIRSNPAIRPARTICLE_H | |
15 | ||
16 | #include <TMath.h> | |
17 | ||
18 | #include "AliRsnDaughter.h" | |
06351446 | 19 | |
4fbb2459 | 20 | class AliRsnPairDef; |
21 | ||
06351446 | 22 | class AliRsnPairParticle : public TObject |
23 | { | |
aec0ec32 | 24 | public: |
06351446 | 25 | |
26 | AliRsnPairParticle(); | |
27 | AliRsnPairParticle(const AliRsnPairParticle &obj); | |
28 | AliRsnPairParticle& operator=(const AliRsnPairParticle &obj); | |
29 | virtual ~AliRsnPairParticle(); | |
30 | ||
aec0ec32 | 31 | Double_t GetInvMass(Double_t m1, Double_t m2); |
32 | Double_t GetInvMassMC(Double_t m1, Double_t m2); | |
33 | ||
34 | Double_t GetEtot(Double_t m1, Double_t m2) const; | |
bd6bf3ee | 35 | Double_t GetEtot(Double_t mass) const {return TMath::Sqrt(mass*mass + GetP2());} |
e2bafbbc | 36 | Double_t GetP2() const {return (fPTot[0]*fPTot[0] + fPTot[1]*fPTot[1] + fPTot[2]*fPTot[2]);} |
37 | Double_t GetPt2() const {return (fPTot[0]*fPTot[0] + fPTot[1]*fPTot[1]);} | |
38 | Double_t GetP() const {return TMath::Sqrt(GetP2());} | |
39 | Double_t GetPx() const {return fPTot[0];} | |
40 | Double_t GetPy() const {return fPTot[1];} | |
41 | Double_t GetPz() const {return fPTot[2];} | |
42 | Double_t GetPt() const {return TMath::Sqrt(GetPt2());} | |
aec0ec32 | 43 | Double_t GetPhi() const {return TMath::Pi() + TMath::ATan2(-fPTot[1], -fPTot[0]);} |
4fbb2459 | 44 | Double_t GetTheta() const { |
45 | if (fPTot[2]==0.0) {return TMath::PiOver2();} | |
46 | else {return TMath::ACos(fPTot[2]/GetP());} | |
47 | } | |
48 | Double_t GetEta() const {Double_t a = TMath::Tan(0.5*GetTheta()); if (a > 0.) return -TMath::Log(a); return 999999.0;} | |
aec0ec32 | 49 | Double_t GetY(Double_t m1, Double_t m2) const {return 0.5*TMath::Log((GetEtot(m1,m2)+fPTot[2])/(GetEtot(m1,m2)-fPTot[2]));} |
bd6bf3ee | 50 | Double_t GetY(Double_t mass) const {return 0.5*TMath::Log((GetEtot(mass)+fPTot[2])/(GetEtot(mass)-fPTot[2]));} |
e2bafbbc | 51 | |
aec0ec32 | 52 | Double_t GetEtotMC(Double_t m1, Double_t m2) const; |
bd6bf3ee | 53 | Double_t GetEtotMC(Double_t mass) const {return TMath::Sqrt(mass*mass + GetP2MC());} |
e2bafbbc | 54 | Double_t GetP2MC() const {return (fPTotMC[0]*fPTotMC[0] + fPTotMC[1]*fPTotMC[1] + fPTotMC[2]*fPTotMC[2]);} |
55 | Double_t GetPt2MC() const {return (fPTotMC[0]*fPTotMC[0] + fPTotMC[1]*fPTotMC[1]);} | |
56 | Double_t GetPMC() const {return TMath::Sqrt(GetP2MC());} | |
57 | Double_t GetPxMC() const {return fPTotMC[0];} | |
58 | Double_t GetPyMC() const {return fPTotMC[1];} | |
59 | Double_t GetPzMC() const {return fPTotMC[2];} | |
60 | Double_t GetPtMC() const {return TMath::Sqrt(GetPt2MC());} | |
aec0ec32 | 61 | Double_t GetPhiMC() const {return TMath::Pi() + TMath::ATan2(-fPTotMC[1], -fPTotMC[0]);} |
4fbb2459 | 62 | Double_t GetThetaMC() const { |
63 | if (fPTotMC[2]==0.0) {return TMath::PiOver2();} | |
64 | else {return TMath::ACos(fPTotMC[2]/GetPMC());} | |
65 | } | |
5acd0c9b | 66 | Double_t GetEtaMC() const {return -TMath::Log(TMath::Tan(0.5*GetThetaMC()));} |
aec0ec32 | 67 | Double_t GetYMC(Double_t m1, Double_t m2) const {return 0.5*TMath::Log((GetEtotMC(m1,m2)+fPTotMC[2])/(GetEtotMC(m1,m2)-fPTotMC[2]));} |
bd6bf3ee | 68 | Double_t GetYMC(Double_t mass) const {return 0.5*TMath::Log((GetEtotMC(mass)+fPTot[2])/(GetEtotMC(mass)-fPTot[2]));} |
aec0ec32 | 69 | |
e2bafbbc | 70 | Double_t GetAngle() const; |
71 | ||
72 | AliRsnDaughter* GetDaughter(const Int_t &index) const {return fDaughter[index];} | |
73 | ||
5eb970a4 | 74 | Bool_t IsLabelEqual() {return abs(fDaughter[0]->GetLabel()) == abs(fDaughter[1]->GetLabel());} |
75 | Bool_t IsIndexEqual() {return (fDaughter[0]->GetID() == fDaughter[1]->GetID());} | |
e2bafbbc | 76 | Bool_t IsTruePair(Int_t refPDG = 0); |
5eb970a4 | 77 | Int_t CommonMother(); |
e2bafbbc | 78 | |
4fbb2459 | 79 | void SetPair(AliRsnDaughter * const daughter1, AliRsnDaughter * const daughter2); |
e0baff8c | 80 | void ResetPair(); |
5eb970a4 | 81 | void RotateTrack(Int_t i, Double_t angle, Bool_t isDegrees = kTRUE); |
82 | void PrintInfo(const Option_t *option = "ALL"); | |
4fbb2459 | 83 | Bool_t MatchesDef(AliRsnPairDef *def); |
06351446 | 84 | |
aec0ec32 | 85 | private: |
06351446 | 86 | |
87 | Double_t fPTot[3]; // total momentum computed with rec. values | |
88 | Double_t fPTotMC[3]; // total momentum computed with MC values | |
89 | Double_t fPTrack[2][3]; // rec. momentum of single tracks | |
90 | Double_t fPTrackMC[2][3]; // MC momentum of single tracks | |
91 | ||
06351446 | 92 | Int_t fMotherLabel[2]; // GEANT label of tracks |
93 | Int_t fMotherPDG[2]; // PDG code of mother of tracks | |
94 | ||
95 | AliRsnDaughter *fDaughter[2]; // elements of the pair | |
96 | ||
aec0ec32 | 97 | ClassDef(AliRsnPairParticle,1) |
06351446 | 98 | }; |
99 | ||
100 | #endif |