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 if (p1->NTotSisters()==p2->NTotSisters()) fNSisters = p1->NTotSisters();
38 //__________________________________________________________________________________________________
39 Double_t AliRsnMiniPair::CosThetaStar(Bool_t useMC)
42 // Return cosine of angle of one daughter to the resonance momentum in its rest frame
45 TLorentzVector &mother = fSum[ID(useMC)];
46 TLorentzVector &daughter0 = fP1[ID(useMC)];
47 // TLorentzVector &daughter1 = fP2[ID(useMC)];
48 TVector3 momentumM(mother.Vect());
49 TVector3 normal(mother.Y() / momentumM.Mag(), -mother.X() / momentumM.Mag(), 0.0);
51 // Computes first the invariant mass of the mother
52 // Double_t mass0 = daughter0.M();
53 // Double_t mass1 = daughter1.M();
54 // Double_t p0 = daughter0.Vect().Mag();
55 // Double_t p1 = daughter1.Vect().Mag();
56 // Double_t E0 = TMath::Sqrt(mass0 * mass0 + p0 * p0);
57 // Double_t E1 = TMath::Sqrt(mass1 * mass1 + p1 * p1);
58 // Double_t MotherMass = TMath::Sqrt((E0 + E1) * (E0 + E1) - (p0 * p0 + 2.0 * daughter0.Vect().Dot(daughter1.Vect()) + p1 * p1));
59 // MotherMass = mother.M();
61 // Computes components of beta
62 Double_t betaX = -mother.X() / mother.E();
63 Double_t betaY = -mother.Y() / mother.E();
64 Double_t betaZ = -mother.Z() / mother.E();
66 // Computes Lorentz transformation of the momentum of the first daughter
67 // into the rest frame of the mother and theta*
68 daughter0.Boost(betaX, betaY, betaZ);
69 TVector3 momentumD = daughter0.Vect();
71 Double_t cosThetaStar = normal.Dot(momentumD) / momentumD.Mag();
76 //__________________________________________________________________________________________________
77 void AliRsnMiniPair::InvertP(Bool_t first)
80 // Inverts one 4-momentum and recompute sum
84 for (i = 0; i < 2; i++) {
85 if (first) fP1[i].SetVect(fP1[i].Vect() *= -1.0);
86 else fP2[i].SetVect(fP2[i].Vect() *= -1.0);
87 fSum[i] = fP1[i] + fP2[i];
88 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), fRef[i].M());
92 //__________________________________________________________________________________________________
93 void AliRsnMiniPair::FillRef(Double_t mass)
96 // Fill ref 4-vectors using the passed mass and the values in 'sum'
100 for (i = 0; i < 2; i++) {
101 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), mass);
105 //__________________________________________________________________________________________________
106 Double_t AliRsnMiniPair::InvMassRes() const
109 // Return invariant mass resolution
112 if (fSum[1].M() <= 0.0) return 1E20;
114 return (fSum[0].M() - fSum[1].M()) / fSum[1].M();
117 //__________________________________________________________________________________________________
118 Double_t AliRsnMiniPair::InvMassDiff() const
121 // Return invariant mass resolution
124 if (fSum[1].M() <= 0.0) return 1E20;
126 return (fSum[0].M() - fSum[1].M());
129 //__________________________________________________________________________________________________
130 Double_t AliRsnMiniPair::PtRatio(Bool_t mc) const
133 // Return ratio of transverse momenta of daughters
136 Double_t num = TMath::Abs(fP1[ID(mc)].Perp() - fP2[ID(mc)].Perp());
137 Double_t den = TMath::Abs(fP1[ID(mc)].Perp() + fP2[ID(mc)].Perp());
139 if (den <= 0.0) return 1E20;
144 //__________________________________________________________________________________________________
145 Double_t AliRsnMiniPair::DipAngle(Bool_t mc) const
148 // Opening angle in a Z-T space
151 const TLorentzVector &p1 = fP1[ID(mc)];
152 const TLorentzVector &p2 = fP2[ID(mc)];
154 return ((p1.Perp() * p2.Perp() + p1.Z() * p2.Z()) / p1.Mag() / p2.Mag());
157 //__________________________________________________________________________________________________
158 Double_t AliRsnMiniPair::DaughterPt(Int_t daughterId, Bool_t mc)
160 //returns pt of the <id> daughter
161 // if MC returns generated momenta
163 return fP1[ID(mc)].Pt();
165 return fP2[ID(mc)].Pt();
168 //__________________________________________________________________________________________________
169 Double_t AliRsnMiniPair::DaughterDCA(Int_t daughterId)
172 //returns dca to Primary Vertex of the <id> daughter
181 //__________________________________________________________________________________________________
182 Double_t AliRsnMiniPair::DCAProduct()
185 //returns products of the DCA of the 2 daughters
191 //__________________________________________________________________________________________________
192 void AliRsnMiniPair::DaughterPxPyPz(Int_t daughterId, Bool_t mc, Double_t *pxpypz)
194 //returns px,py,pz of the <id> daughter by saving them into pxpypz
195 // if MC returns generated momenta
199 pxpypz[0]=fP1[ID(mc)].Px();
200 pxpypz[1]=fP1[ID(mc)].Py();
201 pxpypz[2]=fP1[ID(mc)].Pz();
203 pxpypz[0]=fP2[ID(mc)].Px();
204 pxpypz[1]=fP2[ID(mc)].Py();
205 pxpypz[2]=fP2[ID(mc)].Pz();