1 /*************************************************************************
2 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////
18 // Dielectron Pair class. Internally it makes use of AliKFParticle. //
20 ///////////////////////////////////////////////////////////////////////////
23 #include "AliDielectronPair.h"
24 #include "AliVTrack.h"
27 ClassImp(AliDielectronPair)
29 AliDielectronPair::AliDielectronPair() :
39 // Default Constructor
44 //______________________________________________
45 AliDielectronPair::AliDielectronPair(AliVTrack * const particle1, Int_t pid1,
46 AliVTrack * const particle2, Int_t pid2, Char_t type) :
56 // Constructor with tracks
58 SetTracks(particle1, pid1, particle2, pid2);
61 //______________________________________________
62 AliDielectronPair::~AliDielectronPair()
70 //______________________________________________
71 void AliDielectronPair::SetTracks(AliVTrack * const particle1, Int_t pid1,
72 AliVTrack * const particle2, Int_t pid2)
75 // Sort particles by pt, first particle larget Pt
76 // set AliKF daughters and pair
82 AliKFParticle kf1(*particle1,pid1);
83 AliKFParticle kf2(*particle2,pid2);
85 fPair.AddDaughter(kf1);
86 fPair.AddDaughter(kf2);
88 if (particle1->Pt()>particle2->Pt()){
101 //______________________________________________
102 void AliDielectronPair::GetThetaPhiCM(Double_t &thetaHE, Double_t &phiHE, Double_t &thetaCS, Double_t &phiCS) const
105 // Calculate theta and phi in helicity and Collins-Soper coordinate frame
107 const Double_t kBeamEnergy = 3500.;
108 Double_t pxyz1[3]={0,0,0};
109 Double_t pxyz2[3]={0,0,0};
110 Double_t eleMass=AliPID::ParticleMass(AliPID::kElectron);
111 Double_t proMass=AliPID::ParticleMass(AliPID::kProton);
113 AliVParticle *d1 = static_cast<AliVParticle*>(fRefD1.GetObject());
114 AliVParticle *d2 = static_cast<AliVParticle*>(fRefD2.GetObject());
119 TLorentzVector projMom(0.,0.,-kBeamEnergy,TMath::Sqrt(kBeamEnergy*kBeamEnergy+proMass*proMass));
120 TLorentzVector targMom(0.,0., kBeamEnergy,TMath::Sqrt(kBeamEnergy*kBeamEnergy+proMass*proMass));
122 // first & second daughter 4-mom
123 TLorentzVector p1Mom(pxyz1[0],pxyz1[1],pxyz1[2],
124 TMath::Sqrt(pxyz1[0]*pxyz1[0]+pxyz1[1]*pxyz1[1]+pxyz1[2]*pxyz1[2]+eleMass*eleMass));
125 TLorentzVector p2Mom(pxyz2[0],pxyz2[1],pxyz2[2],
126 TMath::Sqrt(pxyz2[0]*pxyz2[0]+pxyz2[1]*pxyz2[1]+pxyz2[2]*pxyz2[2]+eleMass*eleMass));
127 // J/Psi 4-momentum vector
128 TLorentzVector motherMom=p1Mom+p2Mom;
130 // boost all the 4-mom vectors to the mother rest frame
131 TVector3 beta = (-1.0/motherMom.E())*motherMom.Vect();
138 TVector3 zAxisHE = (motherMom.Vect()).Unit();
139 TVector3 zAxisCS = ((projMom.Vect()).Unit()-(targMom.Vect()).Unit()).Unit();
140 TVector3 yAxis = ((projMom.Vect()).Cross(targMom.Vect())).Unit();
141 TVector3 xAxisHE = (yAxis.Cross(zAxisHE)).Unit();
142 TVector3 xAxisCS = (yAxis.Cross(zAxisCS)).Unit();
144 // fill theta and phi
146 thetaHE = zAxisHE.Dot((p1Mom.Vect()).Unit());
147 thetaCS = zAxisCS.Dot((p1Mom.Vect()).Unit());
148 phiHE = TMath::ATan2((p1Mom.Vect()).Dot(yAxis), (p1Mom.Vect()).Dot(xAxisHE));
149 phiCS = TMath::ATan2((p1Mom.Vect()).Dot(yAxis), (p1Mom.Vect()).Dot(xAxisCS));
151 thetaHE = zAxisHE.Dot((p2Mom.Vect()).Unit());
152 thetaCS = zAxisCS.Dot((p2Mom.Vect()).Unit());
153 phiHE = TMath::ATan2((p2Mom.Vect()).Dot(yAxis), (p2Mom.Vect()).Dot(xAxisHE));
154 phiCS = TMath::ATan2((p2Mom.Vect()).Dot(yAxis), (p2Mom.Vect()).Dot(xAxisCS));
158 //______________________________________________
159 Double_t AliDielectronPair::ThetaPhiCM(const AliVParticle* d1, const AliVParticle* d2,
160 const Bool_t isHE, const Bool_t isTheta)
162 // The function calculates theta and phi in the mother rest frame with
163 // respect to the helicity coordinate system and Collins-Soper coordinate system
164 // TO DO: generalize for different decays (only J/Psi->e+e- now)
166 // Laboratory frame 4-vectors:
167 // projectile beam & target beam 4-mom
168 // TODO: need to retrieve the beam energy from somewhere
169 const Double_t kBeamEnergy = 3500.;
170 Double_t px1=d1->Px();
171 Double_t py1=d1->Py();
172 Double_t pz1=d1->Pz();
173 Double_t px2=d2->Px();
174 Double_t py2=d2->Py();
175 Double_t pz2=d2->Pz();
176 Double_t eleMass=AliPID::ParticleMass(AliPID::kElectron);
177 Double_t proMass=AliPID::ParticleMass(AliPID::kProton);
179 TLorentzVector projMom(0.,0.,-kBeamEnergy,TMath::Sqrt(kBeamEnergy*kBeamEnergy+proMass*proMass));
180 TLorentzVector targMom(0.,0., kBeamEnergy,TMath::Sqrt(kBeamEnergy*kBeamEnergy+proMass*proMass));
182 // first & second daughter 4-mom
183 TLorentzVector p1Mom(px1,py1,pz1,TMath::Sqrt(px1*px1+py1*py1+pz1*pz1+eleMass*eleMass));
184 TLorentzVector p2Mom(px2,py2,pz2,TMath::Sqrt(px2*px2+py2*py2+pz2*pz2+eleMass*eleMass));
185 // J/Psi 4-momentum vector
186 TLorentzVector motherMom=p1Mom+p2Mom;
188 // boost all the 4-mom vectors to the mother rest frame
189 TVector3 beta = (-1.0/motherMom.E())*motherMom.Vect();
197 if(isHE) zAxis = (motherMom.Vect()).Unit();
198 else zAxis = ((projMom.Vect()).Unit()-(targMom.Vect()).Unit()).Unit();
199 TVector3 yAxis = ((projMom.Vect()).Cross(targMom.Vect())).Unit();
200 TVector3 xAxis = (yAxis.Cross(zAxis)).Unit();
202 // return either theta or phi
205 return zAxis.Dot((p1Mom.Vect()).Unit());
207 return zAxis.Dot((p2Mom.Vect()).Unit());
212 return TMath::ATan2((p1Mom.Vect()).Dot(yAxis), (p1Mom.Vect()).Dot(xAxis));
214 return TMath::ATan2((p2Mom.Vect()).Dot(yAxis), (p2Mom.Vect()).Dot(xAxis));
218 //______________________________________________
219 Double_t AliDielectronPair::ThetaPhiCM(const Bool_t isHE, const Bool_t isTheta) const {
220 // The function calculates theta and phi in the mother rest frame with
221 // respect to the helicity coordinate system and Collins-Soper coordinate system
222 // TO DO: generalize for different decays (only J/Psi->e+e- now)
224 // Laboratory frame 4-vectors:
225 // projectile beam & target beam 4-mom
226 AliVParticle *d1 = dynamic_cast<AliVParticle*>(fRefD1.GetObject());
227 AliVParticle *d2 = dynamic_cast<AliVParticle*>(fRefD2.GetObject());
229 const Double_t kBeamEnergy = 3500.;
230 Double_t px1=d1->Px();
231 Double_t py1=d1->Py();
232 Double_t pz1=d1->Pz();
233 Double_t px2=d2->Px();
234 Double_t py2=d2->Py();
235 Double_t pz2=d2->Pz();
236 Double_t eleMass=AliPID::ParticleMass(AliPID::kElectron);
237 Double_t proMass=AliPID::ParticleMass(AliPID::kProton);
239 TLorentzVector projMom(0.,0.,-kBeamEnergy,TMath::Sqrt(kBeamEnergy*kBeamEnergy+proMass*proMass));
240 TLorentzVector targMom(0.,0., kBeamEnergy,TMath::Sqrt(kBeamEnergy*kBeamEnergy+proMass*proMass));
242 // first & second daughter 4-mom
243 // first & second daughter 4-mom
244 TLorentzVector p1Mom(px1,py1,pz1,TMath::Sqrt(px1*px1+py1*py1+pz1*pz1+eleMass*eleMass));
245 TLorentzVector p2Mom(px2,py2,pz2,TMath::Sqrt(px2*px2+py2*py2+pz2*pz2+eleMass*eleMass));
246 // J/Psi 4-momentum vector
247 TLorentzVector motherMom=p1Mom+p2Mom;
249 // boost all the 4-mom vectors to the mother rest frame
250 TVector3 beta = (-1.0/motherMom.E())*motherMom.Vect();
258 if(isHE) zAxis = (motherMom.Vect()).Unit();
259 else zAxis = ((projMom.Vect()).Unit()-(targMom.Vect()).Unit()).Unit();
260 TVector3 yAxis = ((projMom.Vect()).Cross(targMom.Vect())).Unit();
261 TVector3 xAxis = (yAxis.Cross(zAxis)).Unit();
263 // return either theta or phi
266 return zAxis.Dot((p1Mom.Vect()).Unit());
268 return zAxis.Dot((p2Mom.Vect()).Unit());
272 return TMath::ATan2((p1Mom.Vect()).Dot(yAxis), (p1Mom.Vect()).Dot(xAxis));
274 return TMath::ATan2((p2Mom.Vect()).Dot(yAxis), (p2Mom.Vect()).Dot(xAxis));