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