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 );
24 fIsQuarkFound = kFALSE;
28 if (p1->Mother() == p2->Mother()) {
29 fMother = p1->Mother();
30 fMotherPDG = p1->MotherPDG();
31 fPmother[0] = p1->PmotherX();
32 fPmother[1] = p1->PmotherY();
33 fPmother[2] = p1->PmotherZ();
34 fIsFromB = p1->IsFromB();
35 fIsQuarkFound = p1->IsQuarkFound();
39 for (i = 0; i < 2; i++) {
40 fSum[i] = fP1[i] + fP2[i];
41 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), refMass);
45 if (p1->NTotSisters()==p2->NTotSisters()) fNSisters = p1->NTotSisters();
48 //__________________________________________________________________________________________________
49 Double_t AliRsnMiniPair::CosThetaStar(Bool_t useMC)
52 // Return cosine of angle of one daughter to the resonance momentum in its rest frame
55 TLorentzVector &mother = fSum[ID(useMC)];
56 TLorentzVector &daughter0 = fP1[ID(useMC)];
57 // TLorentzVector &daughter1 = fP2[ID(useMC)];
58 TVector3 momentumM(mother.Vect());
59 TVector3 normal(mother.Y() / momentumM.Mag(), -mother.X() / momentumM.Mag(), 0.0);
61 // Computes first the invariant mass of the mother
62 // Double_t mass0 = daughter0.M();
63 // Double_t mass1 = daughter1.M();
64 // Double_t p0 = daughter0.Vect().Mag();
65 // Double_t p1 = daughter1.Vect().Mag();
66 // Double_t E0 = TMath::Sqrt(mass0 * mass0 + p0 * p0);
67 // Double_t E1 = TMath::Sqrt(mass1 * mass1 + p1 * p1);
68 // Double_t MotherMass = TMath::Sqrt((E0 + E1) * (E0 + E1) - (p0 * p0 + 2.0 * daughter0.Vect().Dot(daughter1.Vect()) + p1 * p1));
69 // MotherMass = mother.M();
71 // Computes components of beta
72 Double_t betaX = -mother.X() / mother.E();
73 Double_t betaY = -mother.Y() / mother.E();
74 Double_t betaZ = -mother.Z() / mother.E();
76 // Computes Lorentz transformation of the momentum of the first daughter
77 // into the rest frame of the mother and theta*
78 daughter0.Boost(betaX, betaY, betaZ);
79 TVector3 momentumD = daughter0.Vect();
81 Double_t cosThetaStar = normal.Dot(momentumD) / momentumD.Mag();
86 //__________________________________________________________________________________________________
87 void AliRsnMiniPair::InvertP(Bool_t first)
90 // Inverts one 4-momentum and recompute sum
94 for (i = 0; i < 2; i++) {
95 if (first) fP1[i].SetVect(fP1[i].Vect() *= -1.0);
96 else fP2[i].SetVect(fP2[i].Vect() *= -1.0);
97 fSum[i] = fP1[i] + fP2[i];
98 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), fRef[i].M());
102 //__________________________________________________________________________________________________
103 void AliRsnMiniPair::FillRef(Double_t mass)
106 // Fill ref 4-vectors using the passed mass and the values in 'sum'
110 for (i = 0; i < 2; i++) {
111 fRef[i].SetXYZM(fSum[i].X(), fSum[i].Y(), fSum[i].Z(), mass);
115 //__________________________________________________________________________________________________
116 Double_t AliRsnMiniPair::InvMassRes() const
119 // Return invariant mass resolution
122 if (fSum[1].M() <= 0.0) return 1E20;
124 return (fSum[0].M() - fSum[1].M()) / fSum[1].M();
127 //__________________________________________________________________________________________________
128 Double_t AliRsnMiniPair::InvMassDiff() const
131 // Return invariant mass resolution
134 if (fSum[1].M() <= 0.0) return 1E20;
136 return (fSum[0].M() - fSum[1].M());
139 //__________________________________________________________________________________________________
140 Double_t AliRsnMiniPair::PtRatio(Bool_t mc) const
143 // Return ratio of transverse momenta of daughters
146 Double_t num = TMath::Abs(fP1[ID(mc)].Perp() - fP2[ID(mc)].Perp());
147 Double_t den = TMath::Abs(fP1[ID(mc)].Perp() + fP2[ID(mc)].Perp());
149 if (den <= 0.0) return 1E20;
154 //__________________________________________________________________________________________________
155 Double_t AliRsnMiniPair::DipAngle(Bool_t mc) const
158 // Opening angle in a Z-T space
161 const TLorentzVector &p1 = fP1[ID(mc)];
162 const TLorentzVector &p2 = fP2[ID(mc)];
164 return ((p1.Perp() * p2.Perp() + p1.Z() * p2.Z()) / p1.Mag() / p2.Mag());
167 //__________________________________________________________________________________________________
168 Double_t AliRsnMiniPair::DaughterPt(Int_t daughterId, Bool_t mc)
170 //returns pt of the <id> daughter
171 // if MC returns generated momenta
173 return fP1[ID(mc)].Pt();
175 return fP2[ID(mc)].Pt();
178 //__________________________________________________________________________________________________
179 Double_t AliRsnMiniPair::DaughterDCA(Int_t daughterId)
182 //returns dca to Primary Vertex of the <id> daughter
191 //__________________________________________________________________________________________________
192 Double_t AliRsnMiniPair::DCAProduct()
195 //returns products of the DCA of the 2 daughters
201 //__________________________________________________________________________________________________
202 void AliRsnMiniPair::DaughterPxPyPz(Int_t daughterId, Bool_t mc, Double_t *pxpypz)
204 //returns px,py,pz of the <id> daughter by saving them into pxpypz
205 // if MC returns generated momenta
209 pxpypz[0]=fP1[ID(mc)].Px();
210 pxpypz[1]=fP1[ID(mc)].Py();
211 pxpypz[2]=fP1[ID(mc)].Pz();
213 pxpypz[0]=fP2[ID(mc)].Px();
214 pxpypz[1]=fP2[ID(mc)].Py();
215 pxpypz[2]=fP2[ID(mc)].Pz();