]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnMiniPair.h
Classes for 'mini' subpackage for RSN analysis framework
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnMiniPair.h
CommitLineData
03d23846 1#ifndef ALIRSNMINIPAIR_H
2#define ALIRSNMINIPAIR_H
3
4//
5// This object is used as lightweight temporary container
6// of all information needed from any input object and
7// useful for resonance analysis.
8//
9
10#include <TObject.h>
11#include <TLorentzVector.h>
12
13class AliRsnMiniParticle;
14
15class AliRsnMiniPair : public TObject {
16public:
17
18 AliRsnMiniPair() : fMother(-1), fMotherPDG(0) { }
19
20 Int_t& Mother() {return fMother;}
21 Int_t& MotherPDG() {return fMotherPDG;}
22 void Fill(AliRsnMiniParticle *p1, AliRsnMiniParticle *p2, Double_t m1, Double_t m2, Double_t refMass);
23 void FillRef(Double_t mass);
24
25 Int_t ID(Bool_t mc) const {if (mc) return 1; else return 0;}
26
27 TLorentzVector& P1 (Bool_t mc) {return fP1 [ID(mc)];}
28 TLorentzVector& P2 (Bool_t mc) {return fP2 [ID(mc)];}
29 TLorentzVector& Sum(Bool_t mc) {return fSum[ID(mc)];}
30 TLorentzVector& Ref(Bool_t mc) {return fRef[ID(mc)];}
31
32 Double_t Pt(Bool_t mc) const {return fSum[ID(mc)].Pt();}
33 Double_t Pz(Bool_t mc) const {return fSum[ID(mc)].Pz();}
34 Double_t Eta(Bool_t mc) const {return fSum[ID(mc)].Eta();}
35 Double_t InvMass(Bool_t mc) const {return fSum[ID(mc)].M();}
36 Double_t InvMassRes() const;
37 Double_t Mt(Bool_t mc) const {return fRef[ID(mc)].Mt();}
38 Double_t Y(Bool_t mc) const {return fRef[ID(mc)].Rapidity();}
39 Double_t PtRatio(Bool_t mc) const;
40 Double_t DipAngle(Bool_t mc) const;
41 Double_t CosThetaStar(Bool_t mc);
42
43private:
44
45 TLorentzVector fP1 [2]; // 1st daughter momentum
46 TLorentzVector fP2 [2]; // 2nd daughter momentum
47 TLorentzVector fSum[2]; // sum of momenta
48 TLorentzVector fRef[2]; // same as 'fSum' but with nominal resonance mass
49
50 Int_t fMother; // label of mothers (when common)
51 Int_t fMotherPDG; // PDG code of mother (when common)
52
53 ClassDef(AliRsnMiniPair,1)
54};
55
56inline void AliRsnMiniPair::FillRef(Double_t mass)
57{
58//
59// Fill ref 4-vectors using the passed mass and the values in 'sum'
60//
61
62 Int_t i;
63 for (i = 0; i < 2; i++) {
64 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), mass);
65 }
66}
67
68inline Double_t AliRsnMiniPair::InvMassRes() const
69{
70//
71// Return invariant mass resolution
72//
73
74 if (fSum[1].M() <= 0.0) return 1E20;
75
76 return (fSum[0].M() - fSum[1].M()) / fSum[1].M();
77}
78
79inline Double_t AliRsnMiniPair::PtRatio(Bool_t mc) const
80{
81//
82// Return ratio of transverse momenta of daughters
83//
84
85 Double_t num = TMath::Abs(fP1[ID(mc)].Perp() - fP2[ID(mc)].Perp());
86 Double_t den = TMath::Abs(fP1[ID(mc)].Perp() + fP2[ID(mc)].Perp());
87
88 if (den <= 0.0) return 1E20;
89
90 return num / den;
91}
92
93inline Double_t AliRsnMiniPair::DipAngle(Bool_t mc) const
94{
95//
96// Opening angle in a Z-T space
97//
98
99 const TLorentzVector &p1 = fP1[ID(mc)];
100 const TLorentzVector &p2 = fP2[ID(mc)];
101
102 return ((p1.Perp() * p2.Perp() + p1.Z() * p2.Z()) / p1.Mag() / p2.Mag());
103}
104
105#endif