]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/RESONANCES/AliRsnMiniPair.cxx
Added daughters' p and pt to the type list of AliRsnMiniValue + modified macros for...
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnMiniPair.cxx
CommitLineData
03d23846 1#include "AliRsnMiniParticle.h"
2#include "AliRsnMiniPair.h"
3
4ClassImp(AliRsnMiniPair)
5
6//__________________________________________________________________________________________________
7void AliRsnMiniPair::Fill
8(AliRsnMiniParticle *p1, AliRsnMiniParticle *p2, Double_t m1, Double_t m2, Double_t refMass)
9{
10//
11// Fill this object with data coming
12// from arguments
13//
14
15 p1->Set4Vector(fP1[0], m1, kFALSE);
16 p2->Set4Vector(fP2[0], m2, kFALSE);
17 p1->Set4Vector(fP1[1], m1, kTRUE );
18 p2->Set4Vector(fP2[1], m2, kTRUE );
61f275d1 19
03d23846 20 fMother = -1;
21 if (p1->Mother() == p2->Mother()) {
22 fMother = p1->Mother();
23 fMotherPDG = p1->MotherPDG();
24 }
61f275d1 25
03d23846 26 Int_t i;
27 for (i = 0; i < 2; i++) {
28 fSum[i] = fP1[i] + fP2[i];
29 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), refMass);
30 }
31}
32
33//__________________________________________________________________________________________________
34Double_t AliRsnMiniPair::CosThetaStar(Bool_t useMC)
35{
36//
37// Return cosine of angle of one daughter to the resonance momentum in its rest frame
38//
61f275d1 39
03d23846 40 TLorentzVector &mother = fSum[ID(useMC)];
41 TLorentzVector &daughter0 = fP1[ID(useMC)];
74d60285 42// TLorentzVector &daughter1 = fP2[ID(useMC)];
03d23846 43 TVector3 momentumM(mother.Vect());
44 TVector3 normal(mother.Y() / momentumM.Mag(), -mother.X() / momentumM.Mag(), 0.0);
45
46 // Computes first the invariant mass of the mother
74d60285 47// Double_t mass0 = daughter0.M();
48// Double_t mass1 = daughter1.M();
49// Double_t p0 = daughter0.Vect().Mag();
50// Double_t p1 = daughter1.Vect().Mag();
51// Double_t E0 = TMath::Sqrt(mass0 * mass0 + p0 * p0);
52// Double_t E1 = TMath::Sqrt(mass1 * mass1 + p1 * p1);
53// Double_t MotherMass = TMath::Sqrt((E0 + E1) * (E0 + E1) - (p0 * p0 + 2.0 * daughter0.Vect().Dot(daughter1.Vect()) + p1 * p1));
54// MotherMass = mother.M();
03d23846 55
56 // Computes components of beta
57 Double_t betaX = -mother.X() / mother.E();
58 Double_t betaY = -mother.Y() / mother.E();
59 Double_t betaZ = -mother.Z() / mother.E();
60
61 // Computes Lorentz transformation of the momentum of the first daughter
62 // into the rest frame of the mother and theta*
63 daughter0.Boost(betaX, betaY, betaZ);
64 TVector3 momentumD = daughter0.Vect();
65
66 Double_t cosThetaStar = normal.Dot(momentumD) / momentumD.Mag();
67
68 return cosThetaStar;
69}
6aaeb33c 70
71//__________________________________________________________________________________________________
72void AliRsnMiniPair::InvertP(Bool_t first)
73{
74//
75// Inverts one 4-momentum and recompute sum
76//
77
78 Int_t i;
79 for (i = 0; i < 2; i++) {
80 if (first) fP1[i].Vect() *= -1.0;
81 else fP2[i].Vect() *= -1.0;
82 fSum[i] = fP1[i] + fP2[i];
83 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), fRef[i].M());
84 }
85}
397c0062 86
87//__________________________________________________________________________________________________
88void AliRsnMiniPair::FillRef(Double_t mass)
89{
90//
91// Fill ref 4-vectors using the passed mass and the values in 'sum'
92//
93
94 Int_t i;
95 for (i = 0; i < 2; i++) {
96 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), mass);
97 }
98}
99
100//__________________________________________________________________________________________________
101Double_t AliRsnMiniPair::InvMassRes() const
102{
103//
104// Return invariant mass resolution
105//
106
107 if (fSum[1].M() <= 0.0) return 1E20;
108
109 return (fSum[0].M() - fSum[1].M()) / fSum[1].M();
110}
111
112//__________________________________________________________________________________________________
113Double_t AliRsnMiniPair::InvMassDiff() const
114{
115//
116// Return invariant mass resolution
117//
118
119 if (fSum[1].M() <= 0.0) return 1E20;
120
121 return (fSum[0].M() - fSum[1].M());
122}
123
124//__________________________________________________________________________________________________
125Double_t AliRsnMiniPair::PtRatio(Bool_t mc) const
126{
127//
128// Return ratio of transverse momenta of daughters
129//
130
131 Double_t num = TMath::Abs(fP1[ID(mc)].Perp() - fP2[ID(mc)].Perp());
132 Double_t den = TMath::Abs(fP1[ID(mc)].Perp() + fP2[ID(mc)].Perp());
133
134 if (den <= 0.0) return 1E20;
135
136 return num / den;
137}
138
139//__________________________________________________________________________________________________
140Double_t AliRsnMiniPair::DipAngle(Bool_t mc) const
141{
142//
143// Opening angle in a Z-T space
144//
145
146 const TLorentzVector &p1 = fP1[ID(mc)];
147 const TLorentzVector &p2 = fP2[ID(mc)];
148
149 return ((p1.Perp() * p2.Perp() + p1.Z() * p2.Z()) / p1.Mag() / p2.Mag());
150}
151
152//__________________________________________________________________________________________________
153Double_t AliRsnMiniPair::DaughterPt(Int_t daughterId, Bool_t mc)
154{
155 //returns pt of the <id> daughter
156 // if MC returns generated momenta
157 if (daughterId==0)
158 return fP1[ID(mc)].Pt();
159 else
160 return fP2[ID(mc)].Pt();
161}
162
163//__________________________________________________________________________________________________
164void AliRsnMiniPair::DaughterPxPyPz(Int_t daughterId, Bool_t mc, Double_t *pxpypz)
165{
166 //returns px,py,pz of the <id> daughter by saving them into pxpypz
167 // if MC returns generated momenta
168 if (!pxpypz) return;
169
170 if (daughterId==0){
171 pxpypz[0]=fP1[ID(mc)].Px();
172 pxpypz[1]=fP1[ID(mc)].Py();
173 pxpypz[2]=fP1[ID(mc)].Pz();
174 } else {
175 pxpypz[0]=fP2[ID(mc)].Px();
176 pxpypz[1]=fP2[ID(mc)].Py();
177 pxpypz[2]=fP2[ID(mc)].Pz();
178 }
179 return;
180}