1 #include "AliRsnMiniParticle.h"
2 #include "AliRsnMiniPair.h"
4 ClassImp(AliRsnMiniPair)
6 //__________________________________________________________________________________________________
7 void AliRsnMiniPair::Fill
8 (AliRsnMiniParticle *p1, AliRsnMiniParticle *p2, Double_t m1, Double_t m2, Double_t refMass)
11 // Fill this object with data coming
14 p1->Set4Vector(fP1[0], m1, kFALSE);
15 p2->Set4Vector(fP2[0], m2, kFALSE);
16 p1->Set4Vector(fP1[1], m1, kTRUE );
17 p2->Set4Vector(fP2[1], m2, kTRUE );
23 if (p1->Mother() == p2->Mother()) {
24 fMother = p1->Mother();
25 fMotherPDG = p1->MotherPDG();
29 for (i = 0; i < 2; i++) {
30 fSum[i] = fP1[i] + fP2[i];
31 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), refMass);
35 //__________________________________________________________________________________________________
36 Double_t AliRsnMiniPair::CosThetaStar(Bool_t useMC)
39 // Return cosine of angle of one daughter to the resonance momentum in its rest frame
42 TLorentzVector &mother = fSum[ID(useMC)];
43 TLorentzVector &daughter0 = fP1[ID(useMC)];
44 // TLorentzVector &daughter1 = fP2[ID(useMC)];
45 TVector3 momentumM(mother.Vect());
46 TVector3 normal(mother.Y() / momentumM.Mag(), -mother.X() / momentumM.Mag(), 0.0);
48 // Computes first the invariant mass of the mother
49 // Double_t mass0 = daughter0.M();
50 // Double_t mass1 = daughter1.M();
51 // Double_t p0 = daughter0.Vect().Mag();
52 // Double_t p1 = daughter1.Vect().Mag();
53 // Double_t E0 = TMath::Sqrt(mass0 * mass0 + p0 * p0);
54 // Double_t E1 = TMath::Sqrt(mass1 * mass1 + p1 * p1);
55 // Double_t MotherMass = TMath::Sqrt((E0 + E1) * (E0 + E1) - (p0 * p0 + 2.0 * daughter0.Vect().Dot(daughter1.Vect()) + p1 * p1));
56 // MotherMass = mother.M();
58 // Computes components of beta
59 Double_t betaX = -mother.X() / mother.E();
60 Double_t betaY = -mother.Y() / mother.E();
61 Double_t betaZ = -mother.Z() / mother.E();
63 // Computes Lorentz transformation of the momentum of the first daughter
64 // into the rest frame of the mother and theta*
65 daughter0.Boost(betaX, betaY, betaZ);
66 TVector3 momentumD = daughter0.Vect();
68 Double_t cosThetaStar = normal.Dot(momentumD) / momentumD.Mag();
73 //__________________________________________________________________________________________________
74 void AliRsnMiniPair::InvertP(Bool_t first)
77 // Inverts one 4-momentum and recompute sum
81 for (i = 0; i < 2; i++) {
82 if (first) fP1[i].Vect() *= -1.0;
83 else fP2[i].Vect() *= -1.0;
84 fSum[i] = fP1[i] + fP2[i];
85 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), fRef[i].M());
89 //__________________________________________________________________________________________________
90 void AliRsnMiniPair::FillRef(Double_t mass)
93 // Fill ref 4-vectors using the passed mass and the values in 'sum'
97 for (i = 0; i < 2; i++) {
98 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), mass);
102 //__________________________________________________________________________________________________
103 Double_t AliRsnMiniPair::InvMassRes() const
106 // Return invariant mass resolution
109 if (fSum[1].M() <= 0.0) return 1E20;
111 return (fSum[0].M() - fSum[1].M()) / fSum[1].M();
114 //__________________________________________________________________________________________________
115 Double_t AliRsnMiniPair::InvMassDiff() const
118 // Return invariant mass resolution
121 if (fSum[1].M() <= 0.0) return 1E20;
123 return (fSum[0].M() - fSum[1].M());
126 //__________________________________________________________________________________________________
127 Double_t AliRsnMiniPair::PtRatio(Bool_t mc) const
130 // Return ratio of transverse momenta of daughters
133 Double_t num = TMath::Abs(fP1[ID(mc)].Perp() - fP2[ID(mc)].Perp());
134 Double_t den = TMath::Abs(fP1[ID(mc)].Perp() + fP2[ID(mc)].Perp());
136 if (den <= 0.0) return 1E20;
141 //__________________________________________________________________________________________________
142 Double_t AliRsnMiniPair::DipAngle(Bool_t mc) const
145 // Opening angle in a Z-T space
148 const TLorentzVector &p1 = fP1[ID(mc)];
149 const TLorentzVector &p2 = fP2[ID(mc)];
151 return ((p1.Perp() * p2.Perp() + p1.Z() * p2.Z()) / p1.Mag() / p2.Mag());
154 //__________________________________________________________________________________________________
155 Double_t AliRsnMiniPair::DaughterPt(Int_t daughterId, Bool_t mc)
157 //returns pt of the <id> daughter
158 // if MC returns generated momenta
160 return fP1[ID(mc)].Pt();
162 return fP2[ID(mc)].Pt();
165 //__________________________________________________________________________________________________
166 Double_t AliRsnMiniPair::DaughterDCA(Int_t daughterId)
169 //returns dca to Primary Vertex of the <id> daughter
178 //__________________________________________________________________________________________________
179 Double_t AliRsnMiniPair::DCAProduct()
182 //returns products of the DCA of the 2 daughters
188 //__________________________________________________________________________________________________
189 void AliRsnMiniPair::DaughterPxPyPz(Int_t daughterId, Bool_t mc, Double_t *pxpypz)
191 //returns px,py,pz of the <id> daughter by saving them into pxpypz
192 // if MC returns generated momenta
196 pxpypz[0]=fP1[ID(mc)].Px();
197 pxpypz[1]=fP1[ID(mc)].Py();
198 pxpypz[2]=fP1[ID(mc)].Pz();
200 pxpypz[0]=fP2[ID(mc)].Px();
201 pxpypz[1]=fP2[ID(mc)].Py();
202 pxpypz[2]=fP2[ID(mc)].Pz();