1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
17 #include "AliDecayerExodus.h"
18 #include <Riostream.h>
23 #include <TParticle.h>
24 #include <TDatabasePDG.h>
26 #include <TLorentzVector.h>
27 #include <TClonesArray.h>
30 ClassImp(AliDecayerExodus)
32 //---------------------------------------------------------------------------------------------------
34 // Generate electron-pair mass distributions for Dalitz decays according
35 // to the Kroll-Wada parametrization: N. Kroll, W. Wada: Phys. Rev 98(1955)1355
36 // and generate electron-pair mass distributions for resonances according
37 // to the Gounaris-Sakurai parametrization: G.J. Gounaris, J.J. Sakurai: Phys.Rev.Lett. 21(1968)244
39 // For the electromagnetic form factor the parameterization from
40 // Lepton-G is used: L.G. Landsberg et al.: Phys. Rep. 128(1985)301
42 // Ralf Averbeck (R.Averbeck@gsi.de)
43 // Irem Erdemir (irem.erdemir@cern.ch)
45 //---------------------------------------------------------------------------------------------------
48 AliDecayerExodus::AliDecayerExodus():
55 fEPMassOmegaDalitz(0),
66 void AliDecayerExodus::Init()
72 Double_t min, maxpion, maxeta, maxomega, maxetaprime, maxphi, binwidth_pion, binwidth_eta, binwidth_omega, binwidth_etaprime, binwidth_phi;
73 Double_t pionmass, etamass, omegamass, etaprimemass, phimass, emass, omasspion, omasseta, omassgamma;
74 Double_t epsilon_pion, epsilon_eta, epsilon_omega, epsilon_etaprime, epsilon_phi;
75 Double_t delta_pion, delta_eta, delta_omega, delta_etaprime, delta_phi;
76 Double_t mLL_pion, mLL_eta, mLL_omega, mLL_etaprime, mLL_phi;
77 Double_t q_pion, q_eta, q_omega, q_etaprime, q_phi;
78 Double_t kwHelp_pion, kwHelp_eta, kwHelp_omega, kwHelp_etaprime, kwHelp_phi;
79 Double_t krollWada_pion, krollWada_eta, krollWada_omega, krollWada_etaprime, krollWada_phi;
80 Double_t formFactor_pion, formFactor_eta, formFactor_omega, formFactor_etaprime, formFactor_phi;
81 Double_t weight_pion, weight_eta, weight_omega_dalitz, weight_etaprime, weight_phi_dalitz;
84 Float_t mass_bin, mass_min, mass_max;
85 Double_t vmass_rho, vmass_omega, vmass_phi, vmass_jpsi, vwidth_rho, vwidth_omega, vwidth_phi, vwidth_jpsi;
86 Double_t weight_rho, weight_omega, weight_phi, weight_jpsi;
88 //================================================================================//
89 // Create electron pair mass histograms from dalitz decays //
90 //================================================================================//
92 // Get the particle masses
97 pionmass = (TDatabasePDG::Instance()->GetParticle(111))->Mass();
98 etamass = (TDatabasePDG::Instance()->GetParticle(221))->Mass();
99 omegamass = (TDatabasePDG::Instance()->GetParticle(223))->Mass();
100 etaprimemass = (TDatabasePDG::Instance()->GetParticle(331))->Mass();
101 phimass = (TDatabasePDG::Instance()->GetParticle(333))->Mass();
103 emass = (TDatabasePDG::Instance()->GetParticle(11))->Mass();
104 // child - other : third childs from Dalitz decays
105 omasspion = pionmass;
110 maxpion = pionmass - omassgamma;
111 maxeta = etamass - omassgamma;
112 maxomega = omegamass - pionmass;
113 maxetaprime = etaprimemass - omassgamma;
114 maxphi = phimass - omasseta;
116 binwidth_pion = (maxpion - min) / (Double_t)nbins;
117 binwidth_eta = (maxeta - min) / (Double_t)nbins;
118 binwidth_omega = (maxomega - min) / (Double_t)nbins;
119 binwidth_etaprime = (maxetaprime - min) / (Double_t)nbins;
120 binwidth_phi = (maxphi - min) / (Double_t)nbins;
123 epsilon_pion = (emass / pionmass) * (emass / pionmass);
124 epsilon_eta = (emass / etamass) * (emass / etamass);
125 epsilon_omega = (emass / omegamass) * (emass / omegamass);
126 epsilon_etaprime = (emass / etaprimemass) * (emass / etaprimemass);
127 epsilon_phi = (emass / phimass) * (emass / phimass);
130 delta_pion = (omassgamma / pionmass) * (omassgamma / pionmass);
131 delta_eta = (omassgamma / etamass) * (omassgamma / etamass);
132 delta_omega = (omasspion / omegamass) * (omasspion / omegamass);
133 delta_etaprime = (omassgamma / etaprimemass) * (omassgamma / etaprimemass);
134 delta_phi = (omasseta / phimass) * (omasseta / phimass);
138 // create pair mass histograms for Dalitz decays of pi0, eta, omega, eta' and phi
139 if (!fEPMassPion) {delete fEPMassPion; fEPMassPion = new TH1F("fEPMassPion", "Dalitz electron pair from pion", nbins, min, maxpion); }
140 if (!fEPMassEta) {delete fEPMassEta; fEPMassEta = new TH1F("fEPMassEta", "Dalitz electron pair from eta", nbins, min, maxeta);}
141 if (!fEPMassOmegaDalitz) {delete fEPMassOmegaDalitz; fEPMassOmegaDalitz = new TH1F("fEPMassOmegaDalitz", "Dalitz electron pair from omega ", nbins, min, maxomega);}
142 if (!fEPMassEtaPrime) {delete fEPMassEtaPrime; fEPMassEtaPrime = new TH1F("fEPMassEtaPrime", "Dalitz electron pair from etaprime", nbins, min, maxetaprime);}
143 if (!fEPMassPhiDalitz) {delete fEPMassPhiDalitz; fEPMassPhiDalitz = new TH1F("fEPMassPhiDalitz", "Dalitz electron pair from phi ", nbins, min, maxphi);}
146 mLL_pion = mLL_eta = mLL_omega = mLL_etaprime = mLL_phi = 0.;
148 for (ibin = 1; ibin <= nbins; ibin++ )
150 mLL_pion = min + (Double_t)(ibin - 1) * binwidth_pion + binwidth_pion / 2.0;
151 mLL_eta = min + (Double_t)(ibin - 1) * binwidth_eta + binwidth_eta / 2.0;
152 mLL_omega = min + (Double_t)(ibin - 1) * binwidth_omega + binwidth_omega / 2.0;
153 mLL_etaprime = min + (Double_t)(ibin - 1) * binwidth_etaprime + binwidth_etaprime / 2.0;
154 mLL_phi = min + (Double_t)(ibin - 1) * binwidth_phi + binwidth_phi / 2.0;
157 q_pion = (mLL_pion / pionmass) * (mLL_pion / pionmass);
158 q_eta = (mLL_eta / etamass) * (mLL_eta / etamass);
159 q_omega = (mLL_omega / omegamass)*(mLL_omega / omegamass);
160 q_etaprime = (mLL_etaprime / etaprimemass) * (mLL_etaprime / etaprimemass);
161 q_phi = (mLL_phi / phimass) * (mLL_phi / phimass);
163 if ( q_pion <= 4.0 * epsilon_pion || q_eta <= 4.0 * epsilon_eta || q_omega <= 4.0 * epsilon_omega || q_etaprime <= 4.0 * epsilon_etaprime || q_phi <= 4.0 * epsilon_phi )
165 AliFatal("Error in calculating Dalitz mass histogram binning!");
169 kwHelp_pion = (1.0 + q_pion / (1.0 - delta_pion)) * (1.0 + q_pion / (1.0 - delta_pion))
170 - 4.0 * q_pion / ((1.0 - delta_pion) * (1.0 - delta_pion));
172 kwHelp_eta = (1.0 + q_eta / (1.0 - delta_eta)) * (1.0 + q_eta / (1.0 - delta_eta))
173 - 4.0 * q_eta / ((1.0 - delta_eta) * (1.0 - delta_eta));
175 kwHelp_omega = (1.0 + q_omega / (1.0 - delta_omega)) * (1.0 + q_omega / (1.0 - delta_omega))
176 - 4.0 * q_omega / ((1.0 - delta_omega) * (1.0 - delta_omega));
178 kwHelp_etaprime = (1.0 + q_etaprime / (1.0 - delta_etaprime)) * (1.0 + q_etaprime / (1.0 - delta_etaprime))
179 - 4.0 * q_etaprime / ((1.0 - delta_etaprime) * (1.0 - delta_etaprime));
181 kwHelp_phi = (1.0 + q_phi / (1.0 - delta_phi)) * (1.0 + q_phi / (1.0 - delta_phi))
182 - 4.0 * q_phi / ((1.0 - delta_phi) * (1.0 - delta_phi));
187 if ( kwHelp_pion <= 0.0 || kwHelp_eta <= 0.0 || kwHelp_omega <= 0.0 || kwHelp_etaprime <= 0.0 || kwHelp_phi <= 0.0 )
189 AliFatal("Error in calculating Dalitz mass histogram binning!");
194 // Invariant mass distributions of electron pairs from Dalitz decays
195 // using Kroll-Wada function
197 krollWada_pion = (2.0 / mLL_pion) * TMath::Exp(1.5 * TMath::Log(kwHelp_pion))
198 * TMath::Sqrt(1.0 - 4.0 * epsilon_pion / q_pion)
199 * (1.0 + 2.0 * epsilon_pion / q_pion);
202 krollWada_eta = (2.0 / mLL_eta) * TMath::Exp(1.5 * TMath::Log(kwHelp_eta))
203 * TMath::Sqrt(1.0 - 4.0 * epsilon_eta / q_eta)
204 * (1.0 + 2.0 * epsilon_eta / q_eta);
207 krollWada_omega = (2.0 / mLL_omega) * TMath::Exp(1.5 * TMath::Log(kwHelp_omega))
208 * TMath::Sqrt(1.0 - 4.0 * epsilon_omega / q_omega)
209 * (1.0 + 2.0 * epsilon_omega / q_omega);
212 krollWada_etaprime = (2.0 / mLL_etaprime) * TMath::Exp(1.5 * TMath::Log(kwHelp_etaprime))
213 * TMath::Sqrt(1.0 - 4.0 * epsilon_etaprime / q_etaprime)
214 * (1.0 + 2.0 * epsilon_etaprime / q_etaprime);
216 krollWada_phi = (2.0 / mLL_phi) * TMath::Exp(1.5 * TMath::Log(kwHelp_phi))
217 * TMath::Sqrt(1.0 - 4.0 * epsilon_phi / q_phi)
218 * (1.0 + 2.0 * epsilon_phi / q_phi);
222 // Form factors from Lepton-G
223 formFactor_pion = 1.0/(1.0-5.5*mLL_pion*mLL_pion);
224 formFactor_eta = 1.0/(1.0-1.9*mLL_eta*mLL_eta);
225 formFactor_omega = (TMath::Power(TMath::Power(0.6519,2),2))
226 /(TMath::Power(TMath::Power(0.6519,2)-TMath::Power(mLL_omega, 2), 2)
227 + TMath::Power(0.04198, 2)*TMath::Power(0.6519, 2));
228 formFactor_etaprime = (TMath::Power(TMath::Power(0.764,2),2))
229 /(TMath::Power(TMath::Power(0.764,2)-TMath::Power(mLL_etaprime, 2), 2)
230 + TMath::Power(0.1020, 2)*TMath::Power(0.764, 2));
231 formFactor_phi = 1.0;
236 weight_pion = krollWada_pion * formFactor_pion * formFactor_pion;
237 weight_eta = krollWada_eta * formFactor_eta * formFactor_eta;
238 weight_omega_dalitz = krollWada_omega * formFactor_omega;
239 weight_etaprime = krollWada_etaprime * formFactor_etaprime;
240 weight_phi_dalitz = krollWada_phi * formFactor_phi * formFactor_phi;
243 // Fill histograms of electron pair masses from dalitz decays
244 fEPMassPion ->AddBinContent(ibin, weight_pion);
245 fEPMassEta ->AddBinContent(ibin, weight_eta);
246 fEPMassOmegaDalitz->AddBinContent(ibin, weight_omega_dalitz);
247 fEPMassEtaPrime ->AddBinContent(ibin, weight_etaprime);
248 fEPMassPhiDalitz ->AddBinContent(ibin, weight_phi_dalitz);
254 //===================================================================================//
255 // Create electron pair mass histograms from resonance decays //
256 //===================================================================================//
258 Double_t pimass = 0.13956995;
260 // Get the particle masses
262 vmass_rho = (TDatabasePDG::Instance()->GetParticle(113))->Mass();
263 vmass_omega = (TDatabasePDG::Instance()->GetParticle(223))->Mass();
264 vmass_phi = (TDatabasePDG::Instance()->GetParticle(333))->Mass();
265 vmass_jpsi = (TDatabasePDG::Instance()->GetParticle(443))->Mass();
266 // Get the particle widths
268 vwidth_rho = (TDatabasePDG::Instance()->GetParticle(113))->Width();
269 vwidth_omega = (TDatabasePDG::Instance()->GetParticle(223))->Width();
270 vwidth_phi = (TDatabasePDG::Instance()->GetParticle(333))->Width();
271 vwidth_jpsi = (TDatabasePDG::Instance()->GetParticle(443))->Width();
274 if ( mass_min == 0. && mass_max == 0. )
276 mass_min = 2.*pimass;
280 binwidth = (mass_max-mass_min)/(Double_t)nbins;
282 // create pair mass histograms for resonances of rho, omega, phi and jpsi
283 if (!fEPMassRho) {delete fEPMassRho; fEPMassRho = new TH1F("fEPMassRho","mass rho",nbins,mass_min,mass_max);}
284 if (!fEPMassOmega) {delete fEPMassOmega; fEPMassOmega = new TH1F("fEPMassOmega","mass omega",nbins,mass_min,mass_max);}
285 if (!fEPMassPhi) {delete fEPMassPhi; fEPMassPhi = new TH1F("fEPMassPhi","mass phi",nbins,mass_min,mass_max);}
286 if (!fEPMassJPsi) {delete fEPMassJPsi; fEPMassJPsi = new TH1F("fEPMassJPsi","mass jpsi",nbins,mass_min,mass_max);}
289 for (ibin=1; ibin<=nbins; ibin++ )
291 mass_bin = mass_min+(Double_t)(ibin-1)*binwidth+binwidth/2.0;
293 weight_rho = (Float_t)GounarisSakurai(mass_bin,vmass_rho,vwidth_rho,emass);
294 weight_omega = (Float_t)GounarisSakurai(mass_bin,vmass_omega,vwidth_omega,emass);
295 weight_phi = (Float_t)GounarisSakurai(mass_bin,vmass_phi,vwidth_phi,emass);
296 weight_jpsi = (Float_t)Lorentz(mass_bin,vmass_jpsi,vwidth_jpsi);
298 // Fill histograms of electron pair masses from resonance decays
299 fEPMassRho ->AddBinContent(ibin,weight_rho);
300 fEPMassOmega->AddBinContent(ibin,weight_omega);
301 fEPMassPhi ->AddBinContent(ibin,weight_phi);
302 fEPMassJPsi ->AddBinContent(ibin,weight_jpsi);
307 Double_t AliDecayerExodus::GounarisSakurai(Float_t mass, Double_t vmass, Double_t vwidth, Double_t emass)
309 // Invariant mass distributions of electron pairs from resonance decays
310 // of rho, omega and phi
311 // using Gounaris-Sakurai function
314 Double_t epsilon = 0.;
315 Double_t weight = 0.;
317 Double_t pimass = 0.13956995;
320 corr = vwidth*(vmass/mass)*exp(1.5*log((mass*mass/4.0-pimass*pimass)
321 /(vmass*vmass/4.0-pimass*pimass)));
324 epsilon = (emass/mass)*(emass/mass);
326 if ( 1.0-4.0*epsilon>=0.0 )
328 weight = sqrt(1.0-4.0*epsilon)*(1.0+2.0*epsilon)/
329 ((vmass*vmass-mass*mass)*(vmass*vmass-mass*mass)+
330 (vmass*corr)*(vmass*corr));
336 Double_t AliDecayerExodus::Lorentz(Float_t mass, Double_t vmass, Double_t vwidth)
338 // Invariant mass distributions of electron pairs from resonance decay
339 // of jpsi (and it can also be used for other particles except rho, omega and phi)
340 // using Lorentz function
344 weight = (vwidth*vwidth/4.0)/(vwidth*vwidth/4.0+(vmass-mass)*(vmass-mass));
350 void AliDecayerExodus::Decay(Int_t idpart, TLorentzVector* pparent)
359 Double_t pmass_pion, pmass_eta, pmass_omega_dalitz, pmass_etaprime, pmass_phi_dalitz;
360 Double_t emass, omass_pion, omass_eta, omass_gamma, epmass_pion, epmass_eta, epmass_omega_dalitz, epmass_etaprime, epmass_phi_dalitz;
361 Double_t e1_pion, e1_eta, e1_omega, e1_etaprime, e1_phi;
362 Double_t p1_pion, p1_eta, p1_omega, p1_etaprime, p1_phi;
363 Double_t e3_gamma_pion, e3_gamma_eta, e3_pion, e3_gamma_etaprime, e3_eta;
364 Double_t p3_gamma_pion, p3_gamma_eta, p3_pion, p3_gamma_etaprime, p3_eta;
366 Double_t wp_rho, wp_omega, wp_phi, wp_jpsi, epmass_rho, epmass_omega, epmass_phi, epmass_jpsi;
367 Double_t mp_rho, mp_omega, mp_phi, mp_jpsi, md_rho, md_omega, md_phi, md_jpsi;
368 Double_t Ed_rho, Ed_omega, Ed_phi, Ed_jpsi, pd_rho, pd_omega, pd_phi, pd_jpsi;
371 md_rho = md_omega = md_phi = md_jpsi = 0.;
374 Double_t costheta, sintheta, cosphi, sinphi, phi;
376 // Get the particle masses of daughters
377 emass = (TDatabasePDG::Instance()->GetParticle(11)) ->Mass();
378 omass_pion = (TDatabasePDG::Instance()->GetParticle(111))->Mass();
379 omass_eta = (TDatabasePDG::Instance()->GetParticle(221))->Mass();
380 omass_gamma = (TDatabasePDG::Instance()->GetParticle(22)) ->Mass();
382 // Get the particle widths of mothers for resonances
383 wp_rho = (TDatabasePDG::Instance()->GetParticle(113))->Width();
384 wp_omega = (TDatabasePDG::Instance()->GetParticle(223))->Width();
385 wp_phi = (TDatabasePDG::Instance()->GetParticle(333))->Width();
386 wp_jpsi = (TDatabasePDG::Instance()->GetParticle(443))->Width();
388 costheta = (2.0 * gRandom->Rndm()) - 1.;
389 sintheta = TMath::Sqrt((1. + costheta) * (1. - costheta));
390 phi = 2.0 * TMath::ACos(-1.) * gRandom->Rndm();
391 sinphi = TMath::Sin(phi);
392 cosphi = TMath::Cos(phi);
395 //-----------------------------------------------------------------------------//
396 // Generate Pizero Dalitz decay //
397 //-----------------------------------------------------------------------------//
400 pmass_pion = pparent->M();
403 // Sample the electron pair mass from a histogram
404 epmass_pion = fEPMassPion->GetRandom();
405 if (pmass_pion-omass_gamma>epmass_pion && epmass_pion/2.>emass) break;
408 // electron pair kinematics in virtual photon rest frame
409 e1_pion = epmass_pion / 2.;
410 p1_pion = TMath::Sqrt((e1_pion + emass) * (e1_pion - emass));
412 // momentum vectors of electrons in virtual photon rest frame
413 Double_t pProd1_pion[3] = {p1_pion * sintheta * cosphi,
414 p1_pion * sintheta * sinphi,
417 Double_t pProd2_pion[3] = {-1.0 * p1_pion * sintheta * cosphi,
418 -1.0 * p1_pion * sintheta * sinphi,
419 -1.0 * p1_pion * costheta};
422 // third child kinematics in parent meson rest frame
423 e3_gamma_pion = (pmass_pion * pmass_pion - epmass_pion * epmass_pion)/(2. * pmass_pion);
424 p3_gamma_pion = TMath::Sqrt((e3_gamma_pion * e3_gamma_pion));
427 // third child 4-vector in parent meson rest frame
428 fProducts_pion[2].SetPx(p3_gamma_pion * sintheta * cosphi);
429 fProducts_pion[2].SetPy(p3_gamma_pion * sintheta * sinphi);
430 fProducts_pion[2].SetPz(p3_gamma_pion * costheta);
431 fProducts_pion[2].SetE(e3_gamma_pion);
434 // electron 4-vectors in properly rotated virtual photon rest frame
435 Double_t pRot1_pion[3] = {0.};
436 Rot(pProd1_pion, pRot1_pion, costheta, -sintheta, -cosphi, -sinphi);
437 Double_t pRot2_pion[3] = {0.};
438 Rot(pProd2_pion, pRot2_pion, costheta, -sintheta, -cosphi, -sinphi);
439 fProducts_pion[0].SetPx(pRot1_pion[0]);
440 fProducts_pion[0].SetPy(pRot1_pion[1]);
441 fProducts_pion[0].SetPz(pRot1_pion[2]);
442 fProducts_pion[0].SetE(e1_pion);
443 fProducts_pion[1].SetPx(pRot2_pion[0]);
444 fProducts_pion[1].SetPy(pRot2_pion[1]);
445 fProducts_pion[1].SetPz(pRot2_pion[2]);
446 fProducts_pion[1].SetE(e1_pion);
448 // boost the dielectron into the parent meson's rest frame
449 Double_t eLPparent_pion = TMath::Sqrt(p3_gamma_pion * p3_gamma_pion + epmass_pion * epmass_pion);
450 TVector3 boostPair_pion( -1.0 * fProducts_pion[2].Px() / eLPparent_pion,
451 -1.0 * fProducts_pion[2].Py() / eLPparent_pion,
452 -1.0 * fProducts_pion[2].Pz() / eLPparent_pion);
453 fProducts_pion[0].Boost(boostPair_pion);
454 fProducts_pion[1].Boost(boostPair_pion);
456 // boost all decay products into the lab frame
457 TVector3 boostLab_pion(pparent->Px() / pparent->E(),
458 pparent->Py() / pparent->E(),
459 pparent->Pz() / pparent->E());
461 fProducts_pion[0].Boost(boostLab_pion);
462 fProducts_pion[1].Boost(boostLab_pion);
463 fProducts_pion[2].Boost(boostLab_pion);
468 //-----------------------------------------------------------------------------//
469 // Generate Rho resonance decay //
470 //-----------------------------------------------------------------------------//
472 else if(idpart==113){
473 // calculate rho mass
475 mp_rho = pparent->M();
478 Double_t x_rho=pparent->Px(); Double_t y_rho=pparent->Py(); Double_t z_rho=pparent->Pz();
479 Double_t t_rho=pparent->E();
480 Double_t p_rho=x_rho*x_rho+y_rho*y_rho+z_rho*z_rho;
481 Double_t Q2_rho=abs((t_rho*t_rho)-(p_rho*p_rho));
482 mp_rho = sqrt(Q2_rho);
485 if ( mp_rho < 2.*md_rho )
487 printf("Rho into ee Decay kinematically impossible! \n");
492 // Sample the electron pair mass from a histogram
493 epmass_rho = fEPMassRho->GetRandom();
494 if ( mp_rho < 2.*epmass_rho ) break;
497 // electron pair kinematics in virtual photon rest frame
498 Ed_rho = epmass_rho/2.;
499 pd_rho = TMath::Sqrt((Ed_rho+md_rho)*(Ed_rho-md_rho));
501 // momentum vectors of electrons in virtual photon rest frame
502 Double_t pProd1_rho[3] = {pd_rho * sintheta * cosphi,
503 pd_rho * sintheta * sinphi,
506 Double_t pProd2_rho[3] = {-1.0 * pd_rho * sintheta * cosphi,
507 -1.0 * pd_rho * sintheta * sinphi,
508 -1.0 * pd_rho * costheta};
511 // electron 4 vectors in properly rotated virtual photon rest frame
512 Double_t pRot1_rho[3] = {0.};
513 Rot(pProd1_rho, pRot1_rho, costheta, -sintheta, -cosphi, -sinphi);
514 Double_t pRot2_rho[3] = {0.};
515 Rot(pProd2_rho, pRot2_rho, costheta, -sintheta, -cosphi, -sinphi);
516 fProducts_rho[0].SetPx(pRot1_rho[0]);
517 fProducts_rho[0].SetPy(pRot1_rho[1]);
518 fProducts_rho[0].SetPz(pRot1_rho[2]);
519 fProducts_rho[0].SetE(Ed_rho);
520 fProducts_rho[1].SetPx(pRot2_rho[0]);
521 fProducts_rho[1].SetPy(pRot2_rho[1]);
522 fProducts_rho[1].SetPz(pRot2_rho[2]);
523 fProducts_rho[1].SetE(Ed_rho);
526 // boost decay products into the lab frame
527 TVector3 boostLab_rho(pparent->Px() / pparent->E(),
528 pparent->Py() / pparent->E(),
529 pparent->Pz() / pparent->E());
531 fProducts_rho[0].Boost(boostLab_rho);
532 fProducts_rho[1].Boost(boostLab_rho);
536 //-----------------------------------------------------------------------------//
537 // Generate Eta Dalitz decay //
538 //-----------------------------------------------------------------------------//
540 else if(idpart==221){
541 pmass_eta = pparent->M();
544 // Sample the electron pair mass from a histogram
545 epmass_eta = fEPMassEta->GetRandom();
546 if(pmass_eta-omass_gamma>epmass_eta && epmass_eta/2.>emass)
550 // electron pair kinematics in virtual photon rest frame
551 e1_eta = epmass_eta / 2.;
552 p1_eta = TMath::Sqrt((e1_eta + emass) * (e1_eta - emass));
554 // momentum vectors of electrons in virtual photon rest frame
555 Double_t pProd1_eta[3] = {p1_eta * sintheta * cosphi,
556 p1_eta * sintheta * sinphi,
558 Double_t pProd2_eta[3] = {-1.0 * p1_eta * sintheta * cosphi,
559 -1.0 * p1_eta * sintheta * sinphi,
560 -1.0 * p1_eta * costheta};
562 // third child kinematics in parent meson rest frame
563 e3_gamma_eta = (pmass_eta * pmass_eta - epmass_eta * epmass_eta)/(2. * pmass_eta);
564 p3_gamma_eta = TMath::Sqrt((e3_gamma_eta * e3_gamma_eta));
567 // third child 4-vector in parent meson rest frame
568 fProducts_eta[2].SetPx(p3_gamma_eta * sintheta * cosphi);
569 fProducts_eta[2].SetPy(p3_gamma_eta * sintheta * sinphi);
570 fProducts_eta[2].SetPz(p3_gamma_eta * costheta);
571 fProducts_eta[2].SetE(e3_gamma_eta);
573 // electron 4-vectors in properly rotated virtual photon rest frame
574 Double_t pRot1_eta[3] = {0.};
575 Rot(pProd1_eta, pRot1_eta, costheta, -sintheta, -cosphi, -sinphi);
576 Double_t pRot2_eta[3] = {0.};
577 Rot(pProd2_eta, pRot2_eta, costheta, -sintheta, -cosphi, -sinphi);
578 fProducts_eta[0].SetPx(pRot1_eta[0]);
579 fProducts_eta[0].SetPy(pRot1_eta[1]);
580 fProducts_eta[0].SetPz(pRot1_eta[2]);
581 fProducts_eta[0].SetE(e1_eta);
582 fProducts_eta[1].SetPx(pRot2_eta[0]);
583 fProducts_eta[1].SetPy(pRot2_eta[1]);
584 fProducts_eta[1].SetPz(pRot2_eta[2]);
585 fProducts_eta[1].SetE(e1_eta);
587 // boost the dielectron into the parent meson's rest frame
588 Double_t eLPparent_eta = TMath::Sqrt(p3_gamma_eta * p3_gamma_eta + epmass_eta * epmass_eta);
589 TVector3 boostPair_eta( -1.0 * fProducts_eta[2].Px() / eLPparent_eta,
590 -1.0 * fProducts_eta[2].Py() / eLPparent_eta,
591 -1.0 * fProducts_eta[2].Pz() / eLPparent_eta);
592 fProducts_eta[0].Boost(boostPair_eta);
593 fProducts_eta[1].Boost(boostPair_eta);
595 // boost all decay products into the lab frame
596 TVector3 boostLab_eta(pparent->Px() / pparent->E(),
597 pparent->Py() / pparent->E(),
598 pparent->Pz() / pparent->E());
600 fProducts_eta[0].Boost(boostLab_eta);
601 fProducts_eta[1].Boost(boostLab_eta);
602 fProducts_eta[2].Boost(boostLab_eta);
607 //-----------------------------------------------------------------------------//
608 // Generate Omega Dalitz decay //
609 //-----------------------------------------------------------------------------//
611 else if(idpart==223){
612 pmass_omega_dalitz = pparent->M();
614 // Sample the electron pair mass from a histogram
615 epmass_omega_dalitz = fEPMassOmegaDalitz->GetRandom();
616 if(pmass_omega_dalitz-omass_pion>epmass_omega_dalitz && epmass_omega_dalitz/2.>emass)
619 // electron pair kinematics in virtual photon rest frame
620 e1_omega = epmass_omega_dalitz / 2.;
621 p1_omega = TMath::Sqrt((e1_omega + emass) * (e1_omega - emass));
623 // momentum vectors of electrons in virtual photon rest frame
624 Double_t pProd1_omega_dalitz[3] = {p1_omega * sintheta * cosphi,
625 p1_omega * sintheta * sinphi,
626 p1_omega * costheta};
627 Double_t pProd2_omega_dalitz[3] = {-1.0 * p1_omega * sintheta * cosphi,
628 -1.0 * p1_omega * sintheta * sinphi,
629 -1.0 * p1_omega * costheta};
631 // third child kinematics in parent meson rest frame
632 e3_pion = (pmass_omega_dalitz * pmass_omega_dalitz + omass_pion * omass_pion - epmass_omega_dalitz * epmass_omega_dalitz)/(2. * pmass_omega_dalitz);
633 p3_pion = TMath::Sqrt((e3_pion + omass_pion) * (e3_pion - omass_pion));
635 // third child 4-vector in parent meson rest frame
636 fProducts_omega_dalitz[2].SetPx(p3_pion * sintheta * cosphi);
637 fProducts_omega_dalitz[2].SetPy(p3_pion * sintheta * sinphi);
638 fProducts_omega_dalitz[2].SetPz(p3_pion * costheta);
639 fProducts_omega_dalitz[2].SetE(e3_pion);
641 // lepton 4-vectors in properly rotated virtual photon rest frame
642 Double_t pRot1_omega_dalitz[3] = {0.};
643 Rot(pProd1_omega_dalitz, pRot1_omega_dalitz, costheta, -sintheta, -cosphi, -sinphi);
644 Double_t pRot2_omega_dalitz[3] = {0.};
645 Rot(pProd2_omega_dalitz, pRot2_omega_dalitz, costheta, -sintheta, -cosphi, -sinphi);
646 fProducts_omega_dalitz[0].SetPx(pRot1_omega_dalitz[0]);
647 fProducts_omega_dalitz[0].SetPy(pRot1_omega_dalitz[1]);
648 fProducts_omega_dalitz[0].SetPz(pRot1_omega_dalitz[2]);
649 fProducts_omega_dalitz[0].SetE(e1_omega);
650 fProducts_omega_dalitz[1].SetPx(pRot2_omega_dalitz[0]);
651 fProducts_omega_dalitz[1].SetPy(pRot2_omega_dalitz[1]);
652 fProducts_omega_dalitz[1].SetPz(pRot2_omega_dalitz[2]);
653 fProducts_omega_dalitz[1].SetE(e1_omega);
655 // boost the dielectron into the parent meson's rest frame
656 Double_t eLPparent_omega = TMath::Sqrt(p3_pion * p3_pion + epmass_omega_dalitz * epmass_omega_dalitz);
657 TVector3 boostPair_omega( -1.0 * fProducts_omega_dalitz[2].Px() / eLPparent_omega,
658 -1.0 * fProducts_omega_dalitz[2].Py() / eLPparent_omega,
659 -1.0 * fProducts_omega_dalitz[2].Pz() / eLPparent_omega);
660 fProducts_omega_dalitz[0].Boost(boostPair_omega);
661 fProducts_omega_dalitz[1].Boost(boostPair_omega);
663 // boost all decay products into the lab frame
664 TVector3 boostLab_omega_dalitz(pparent->Px() / pparent->E(),
665 pparent->Py() / pparent->E(),
666 pparent->Pz() / pparent->E());
668 fProducts_omega_dalitz[0].Boost(boostLab_omega_dalitz);
669 fProducts_omega_dalitz[1].Boost(boostLab_omega_dalitz);
670 fProducts_omega_dalitz[2].Boost(boostLab_omega_dalitz);
673 //-----------------------------------------------------------------------------//
674 // Generate Omega resonance decay //
675 //-----------------------------------------------------------------------------//
678 // calculate omega mass
679 mp_omega = pparent->M();
682 Double_t x_omega=pparent->Px(); Double_t y_omega=pparent->Py(); Double_t z_omega=pparent->Pz();
683 Double_t t_omega=pparent->E();
684 Double_t p_omega=x_omega*x_omega+y_omega*y_omega+z_omega*z_omega;
685 Double_t Q2_omega= abs((t_omega*t_omega)-(p_omega*p_omega));
686 mp_omega = sqrt(Q2_omega);
690 if ( mp_omega< 2.*md_omega )
692 printf("Omega into ee Decay kinematically impossible! \n");
697 // Sample the electron pair mass from a histogram
698 epmass_omega = fEPMassOmega->GetRandom();
699 if( mp_omega < 2.*epmass_omega ) break;
702 // electron pair kinematics in virtual photon rest frame
703 Ed_omega = epmass_omega/2.;
704 pd_omega = TMath::Sqrt((Ed_omega+md_omega)*(Ed_omega-md_omega));
706 // momentum vectors of electrons in virtual photon rest frame
707 Double_t pProd1_omega[3] = {pd_omega * sintheta * cosphi,
708 pd_omega * sintheta * sinphi,
709 pd_omega * costheta};
711 Double_t pProd2_omega[3] = {-1.0 * pd_omega * sintheta * cosphi,
712 -1.0 * pd_omega * sintheta * sinphi,
713 -1.0 * pd_omega * costheta};
716 // lepton 4 vectors in properly rotated virtual photon rest frame
717 Double_t pRot1_omega[3] = {0.};
718 Rot(pProd1_omega, pRot1_omega, costheta, -sintheta, -cosphi, -sinphi);
719 Double_t pRot2_omega[3] = {0.};
720 Rot(pProd2_omega, pRot2_omega, costheta, -sintheta, -cosphi, -sinphi);
721 fProducts_omega[0].SetPx(pRot1_omega[0]);
722 fProducts_omega[0].SetPy(pRot1_omega[1]);
723 fProducts_omega[0].SetPz(pRot1_omega[2]);
724 fProducts_omega[0].SetE(Ed_omega);
725 fProducts_omega[1].SetPx(pRot2_omega[0]);
726 fProducts_omega[1].SetPy(pRot2_omega[1]);
727 fProducts_omega[1].SetPz(pRot2_omega[2]);
728 fProducts_omega[1].SetE(Ed_omega);
730 // boost decay products into the lab frame
731 TVector3 boostLab_omega(pparent->Px() / pparent->E(),
732 pparent->Py() / pparent->E(),
733 pparent->Pz() / pparent->E());
735 fProducts_omega[0].Boost(boostLab_omega);
736 fProducts_omega[1].Boost(boostLab_omega);
740 //-----------------------------------------------------------------------------//
741 // Generate Etaprime Dalitz decay //
742 //-----------------------------------------------------------------------------//
744 else if(idpart==331){
745 pmass_etaprime = pparent->M();
747 // Sample the electron pair mass from a histogram
748 epmass_etaprime = fEPMassEtaPrime->GetRandom();
749 if(pmass_etaprime-omass_gamma>epmass_etaprime && epmass_etaprime/2.>emass)
752 // electron pair kinematics in virtual photon rest frame
753 e1_etaprime = epmass_etaprime / 2.;
754 p1_etaprime = TMath::Sqrt((e1_etaprime + emass) * (e1_etaprime - emass));
756 // momentum vectors of electrons in virtual photon rest frame
757 Double_t pProd1_etaprime[3] = {p1_etaprime * sintheta * cosphi,
758 p1_etaprime * sintheta * sinphi,
759 p1_etaprime * costheta};
760 Double_t pProd2_etaprime[3] = {-1.0 * p1_etaprime * sintheta * cosphi,
761 -1.0 * p1_etaprime * sintheta * sinphi,
762 -1.0 * p1_etaprime * costheta};
764 // third child kinematics in parent meson rest frame
765 e3_gamma_etaprime = (pmass_etaprime * pmass_etaprime + omass_gamma * omass_gamma - epmass_etaprime * epmass_etaprime)/(2. * pmass_etaprime);
766 p3_gamma_etaprime = TMath::Sqrt((e3_gamma_etaprime + omass_gamma) * (e3_gamma_etaprime - omass_gamma));
768 // third child 4-vector in parent meson rest frame
769 fProducts_etaprime[2].SetPx(p3_gamma_etaprime * sintheta * cosphi);
770 fProducts_etaprime[2].SetPy(p3_gamma_etaprime * sintheta * sinphi);
771 fProducts_etaprime[2].SetPz(p3_gamma_etaprime * costheta);
772 fProducts_etaprime[2].SetE(e3_gamma_etaprime);
774 // electron 4-vectors in properly rotated virtual photon rest frame
775 Double_t pRot1_etaprime[3] = {0.};
776 Rot(pProd1_etaprime, pRot1_etaprime, costheta, -sintheta, -cosphi, -sinphi);
777 Double_t pRot2_etaprime[3] = {0.};
778 Rot(pProd2_etaprime, pRot2_etaprime, costheta, -sintheta, -cosphi, -sinphi);
779 fProducts_etaprime[0].SetPx(pRot1_etaprime[0]);
780 fProducts_etaprime[0].SetPy(pRot1_etaprime[1]);
781 fProducts_etaprime[0].SetPz(pRot1_etaprime[2]);
782 fProducts_etaprime[0].SetE(e1_etaprime);
783 fProducts_etaprime[1].SetPx(pRot2_etaprime[0]);
784 fProducts_etaprime[1].SetPy(pRot2_etaprime[1]);
785 fProducts_etaprime[1].SetPz(pRot2_etaprime[2]);
786 fProducts_etaprime[1].SetE(e1_etaprime);
788 // boost the dielectron into the parent meson's rest frame
789 Double_t eLPparent_etaprime = TMath::Sqrt(p3_gamma_etaprime * p3_gamma_etaprime + epmass_etaprime * epmass_etaprime);
790 TVector3 boostPair_etaprime( -1.0 * fProducts_etaprime[2].Px() / eLPparent_etaprime,
791 -1.0 * fProducts_etaprime[2].Py() / eLPparent_etaprime,
792 -1.0 * fProducts_etaprime[2].Pz() / eLPparent_etaprime);
793 fProducts_etaprime[0].Boost(boostPair_etaprime);
794 fProducts_etaprime[1].Boost(boostPair_etaprime);
796 // boost all decay products into the lab frame
797 TVector3 boostLab_etaprime(pparent->Px() / pparent->E(),
798 pparent->Py() / pparent->E(),
799 pparent->Pz() / pparent->E());
801 fProducts_etaprime[0].Boost(boostLab_etaprime);
802 fProducts_etaprime[1].Boost(boostLab_etaprime);
803 fProducts_etaprime[2].Boost(boostLab_etaprime);
807 //-----------------------------------------------------------------------------//
808 // Generate Phi Dalitz decay //
809 //-----------------------------------------------------------------------------//
811 else if(idpart==333){
812 pmass_phi_dalitz = pparent->M();
814 // Sample the electron pair mass from a histogram
815 epmass_phi_dalitz = fEPMassPhiDalitz->GetRandom();
816 if(pmass_phi_dalitz-omass_eta>epmass_phi_dalitz && epmass_phi_dalitz/2.>emass)
819 // electron pair kinematics in virtual photon rest frame
820 e1_phi = epmass_phi_dalitz / 2.;
821 p1_phi = TMath::Sqrt((e1_phi + emass) * (e1_phi - emass));
823 // momentum vectors of electrons in virtual photon rest frame
824 Double_t pProd1_phi_dalitz[3] = {p1_phi * sintheta * cosphi,
825 p1_phi * sintheta * sinphi,
827 Double_t pProd2_phi_dalitz[3] = {-1.0 * p1_phi * sintheta * cosphi,
828 -1.0 * p1_phi * sintheta * sinphi,
829 -1.0 * p1_phi * costheta};
831 // third child kinematics in parent meson rest frame
832 e3_eta = (pmass_phi_dalitz * pmass_phi_dalitz + omass_eta * omass_eta - epmass_phi_dalitz * epmass_phi_dalitz)/(2. * pmass_phi_dalitz);
833 p3_eta = TMath::Sqrt((e3_eta + omass_eta) * (e3_eta - omass_eta));
835 // third child 4-vector in parent meson rest frame
836 fProducts_phi_dalitz[2].SetPx(p3_eta * sintheta * cosphi);
837 fProducts_phi_dalitz[2].SetPy(p3_eta * sintheta * sinphi);
838 fProducts_phi_dalitz[2].SetPz(p3_eta * costheta);
839 fProducts_phi_dalitz[2].SetE(e3_eta);
841 // electron 4-vectors in properly rotated virtual photon rest frame
842 Double_t pRot1_phi_dalitz[3] = {0.};
843 Rot(pProd1_phi_dalitz, pRot1_phi_dalitz, costheta, -sintheta, -cosphi, -sinphi);
844 Double_t pRot2_phi_dalitz[3] = {0.};
845 Rot(pProd2_phi_dalitz, pRot2_phi_dalitz, costheta, -sintheta, -cosphi, -sinphi);
846 fProducts_phi_dalitz[0].SetPx(pRot1_phi_dalitz[0]);
847 fProducts_phi_dalitz[0].SetPy(pRot1_phi_dalitz[1]);
848 fProducts_phi_dalitz[0].SetPz(pRot1_phi_dalitz[2]);
849 fProducts_phi_dalitz[0].SetE(e1_phi);
850 fProducts_phi_dalitz[1].SetPx(pRot2_phi_dalitz[0]);
851 fProducts_phi_dalitz[1].SetPy(pRot2_phi_dalitz[1]);
852 fProducts_phi_dalitz[1].SetPz(pRot2_phi_dalitz[2]);
853 fProducts_phi_dalitz[1].SetE(e1_phi);
855 // boost the dielectron into the parent meson's rest frame
856 Double_t eLPparent_phi = TMath::Sqrt(p3_eta * p3_eta + epmass_phi_dalitz * epmass_phi_dalitz);
857 TVector3 boostPair_phi( -1.0 * fProducts_phi_dalitz[2].Px() / eLPparent_phi,
858 -1.0 * fProducts_phi_dalitz[2].Py() / eLPparent_phi,
859 -1.0 * fProducts_phi_dalitz[2].Pz() / eLPparent_phi);
860 fProducts_phi_dalitz[0].Boost(boostPair_phi);
861 fProducts_phi_dalitz[1].Boost(boostPair_phi);
863 // boost all decay products into the lab frame
864 TVector3 boostLab_phi_dalitz(pparent->Px() / pparent->E(),
865 pparent->Py() / pparent->E(),
866 pparent->Pz() / pparent->E());
868 fProducts_phi_dalitz[0].Boost(boostLab_phi_dalitz);
869 fProducts_phi_dalitz[1].Boost(boostLab_phi_dalitz);
870 fProducts_phi_dalitz[2].Boost(boostLab_phi_dalitz);
873 //-----------------------------------------------------------------------------//
874 // Generate Phi resonance decay //
875 //-----------------------------------------------------------------------------//
878 // calculate phi mass
879 mp_phi = pparent->M();
882 Double_t x_phi=pparent->Px(); Double_t y_phi=pparent->Py(); Double_t z_phi=pparent->Pz();
883 Double_t t_phi=pparent->E();
884 Double_t p_phi=x_phi*x_phi+y_phi*y_phi+z_phi*z_phi;
885 Double_t Q2_phi= abs((t_phi*t_phi)-(p_phi*p_phi));
886 mp_phi = sqrt(Q2_phi);
889 if ( mp_phi< 2.*md_phi )
891 printf("Phi into ee Decay kinematically impossible! \n");
896 // Sample the electron pair mass from a histogram
897 epmass_phi = fEPMassPhi->GetRandom();
898 if(mp_phi < 2.*epmass_phi) break;
901 // electron pair kinematics in virtual photon rest frame
902 Ed_phi = epmass_phi/2.;
903 pd_phi = TMath::Sqrt((Ed_phi+md_phi)*(Ed_phi-md_phi));
905 // momentum vectors of electrons in virtual photon rest frame
906 Double_t pProd1_phi[3] = {pd_phi * sintheta * cosphi,
907 pd_phi * sintheta * sinphi,
909 Double_t pProd2_phi[3] = {-1.0 * pd_phi * sintheta * cosphi,
910 -1.0 * pd_phi * sintheta * sinphi,
911 -1.0 * pd_phi * costheta};
913 // electron 4 vectors in properly rotated virtual photon rest frame
914 Double_t pRot1_phi[3] = {0.};
915 Rot(pProd1_phi, pRot1_phi, costheta, -sintheta, -cosphi, -sinphi);
916 Double_t pRot2_phi[3] = {0.};
917 Rot(pProd2_phi, pRot2_phi, costheta, -sintheta, -cosphi, -sinphi);
918 fProducts_phi[0].SetPx(pRot1_phi[0]);
919 fProducts_phi[0].SetPy(pRot1_phi[1]);
920 fProducts_phi[0].SetPz(pRot1_phi[2]);
921 fProducts_phi[0].SetE(Ed_phi);
922 fProducts_phi[1].SetPx(pRot2_phi[0]);
923 fProducts_phi[1].SetPy(pRot2_phi[1]);
924 fProducts_phi[1].SetPz(pRot2_phi[2]);
925 fProducts_phi[1].SetE(Ed_phi);
927 // boost decay products into the lab frame
928 TVector3 boostLab_phi(pparent->Px() / pparent->E(),
929 pparent->Py() / pparent->E(),
930 pparent->Pz() / pparent->E());
932 fProducts_phi[0].Boost(boostLab_phi);
933 fProducts_phi[1].Boost(boostLab_phi);
937 //-----------------------------------------------------------------------------//
938 // Generate Jpsi resonance decay //
939 //-----------------------------------------------------------------------------//
941 else if(idpart==443){
942 // calculate jpsi mass
944 mp_jpsi = pparent->M();
947 /*Double_t x_jpsi=pparent->Px();
948 Double_t y_jpsi=pparent->Py();
949 Double_t z_jpsi=pparent->Pz();
950 Double_t t_jpsi=pparent->E();
951 Double_t p_jpsi=x_jpsi*x_jpsi+y_jpsi*y_jpsi+z_jpsi*z_jpsi;
952 Double_t Q2_jpsi= abs((t_jpsi*t_jpsi)-(p_jpsi*p_jpsi));
953 mp_jpsi = sqrt(Q2_jpsi);*/
960 if ( mp_jpsi < 2.*md_jpsi )
962 printf("JPsi into ee Decay kinematically impossible! \n");
967 // Sample the electron pair mass from a histogram
968 epmass_jpsi = fEPMassJPsi->GetRandom();
969 if ( mp_jpsi < 2.*epmass_jpsi ) break;
971 // electron pair kinematics in virtual photon rest frame
972 Ed_jpsi = epmass_jpsi/2.;
973 pd_jpsi = TMath::Sqrt((Ed_jpsi+md_jpsi)*(Ed_jpsi-md_jpsi));
975 // momentum vectors of electrons in virtual photon rest frame
976 Double_t pProd1_jpsi[3] = {pd_jpsi * sintheta * cosphi,
977 pd_jpsi * sintheta * sinphi,
980 Double_t pProd2_jpsi[3] = {-1.0 * pd_jpsi * sintheta * cosphi,
981 -1.0 * pd_jpsi * sintheta * sinphi,
982 -1.0 * pd_jpsi * costheta};
985 // electron 4 vectors in properly rotated virtual photon rest frame
986 Double_t pRot1_jpsi[3] = {0.};
987 Rot(pProd1_jpsi, pRot1_jpsi, costheta, -sintheta, -cosphi, -sinphi);
988 Double_t pRot2_jpsi[3] = {0.};
989 Rot(pProd2_jpsi, pRot2_jpsi, costheta, -sintheta, -cosphi, -sinphi);
990 fProducts_jpsi[0].SetPx(pRot1_jpsi[0]);
991 fProducts_jpsi[0].SetPy(pRot1_jpsi[1]);
992 fProducts_jpsi[0].SetPz(pRot1_jpsi[2]);
993 fProducts_jpsi[0].SetE(Ed_jpsi);
994 fProducts_jpsi[1].SetPx(pRot2_jpsi[0]);
995 fProducts_jpsi[1].SetPy(pRot2_jpsi[1]);
996 fProducts_jpsi[1].SetPz(pRot2_jpsi[2]);
997 fProducts_jpsi[1].SetE(Ed_jpsi);
1000 // boost decay products into the lab frame
1001 TVector3 boostLab_jpsi(pparent->Px() / pparent->E(),
1002 pparent->Py() / pparent->E(),
1003 pparent->Pz() / pparent->E());
1005 fProducts_jpsi[0].Boost(boostLab_jpsi);
1006 fProducts_jpsi[1].Boost(boostLab_jpsi);
1013 void AliDecayerExodus::Rot(Double_t pin[3], Double_t pout[3], Double_t costheta, Double_t sintheta,
1014 Double_t cosphi, Double_t sinphi) const
1017 pout[0] = pin[0]*costheta*cosphi-pin[1]*sinphi+pin[2]*sintheta*cosphi;
1018 pout[1] = pin[0]*costheta*sinphi+pin[1]*cosphi+pin[2]*sintheta*sinphi;
1019 pout[2] = -1.0 * pin[0] * sintheta + pin[2] * costheta;
1024 Int_t AliDecayerExodus::ImportParticles(TClonesArray *particles)
1027 // Import particles for Dalitz and resonance decays
1030 TClonesArray &clonesParticles = *particles;
1033 Double_t px, py, pz, e;
1035 Int_t pdgD [3][3] = { {kElectron, -kElectron, 22}, // pizero, eta, etaprime
1036 {kElectron, -kElectron, 111}, // omega dalitz
1037 {kElectron, -kElectron, 221} }; // phi dalitz
1039 Int_t pdgR [2] = {kElectron, -kElectron}; // rho, omega, phi, jpsi
1043 Int_t parentD[3] = { 0, 0, -1};
1044 Int_t dauD1 [3] = {-1, -1, 1};
1045 Int_t dauD2 [3] = {-1, -1, 2};
1047 Int_t parentR[2] = { 0, 0};
1048 Int_t dauR1 [2] = { -1, -1};
1049 Int_t dauR2 [2] = { -1, -1};
1051 for (Int_t j = 0; j < 9; j++){
1055 for (i = 2; i > -1; i--) {
1056 px = fProducts_pion[i].Px();
1057 py = fProducts_pion[i].Py();
1058 pz = fProducts_pion[i].Pz();
1059 e = fProducts_pion[i].E();
1060 new(clonesParticles[2 - i]) TParticle(pdgD[0][i], 1, parentD[i], -1, dauD1[i], dauD2[i], px, py, pz, e, 0., 0., 0., 0.);
1067 for (k = 1; k > -1; k--) {
1068 px = fProducts_rho[k].Px();
1069 py = fProducts_rho[k].Py();
1070 pz = fProducts_rho[k].Pz();
1071 e = fProducts_rho[k].E();
1072 new(clonesParticles[1 - k]) TParticle(pdgR[k], 1, parentR[k], -1, dauR1[k], dauR2[k], px, py, pz, e, 0., 0., 0., 0.);
1079 for (i = 2; i > -1; i--) {
1080 px = fProducts_eta[i].Px();
1081 py = fProducts_eta[i].Py();
1082 pz = fProducts_eta[i].Pz();
1083 e = fProducts_eta[i].E();
1084 new(clonesParticles[2 - i]) TParticle(pdgD[0][i], 1, parentD[i], -1, dauD1[i], dauD2[i], px, py, pz, e, 0., 0., 0., 0.);
1091 for (i = 2; i > -1; i--) {
1092 px = fProducts_omega_dalitz[i].Px();
1093 py = fProducts_omega_dalitz[i].Py();
1094 pz = fProducts_omega_dalitz[i].Pz();
1095 e = fProducts_omega_dalitz[i].E();
1096 new(clonesParticles[2 - i]) TParticle(pdgD[1][i], 1, parentD[i], -1, dauD1[i], dauD2[i], px, py, pz, e, 0., 0., 0., 0.);
1103 for (k = 1; k > -1; k--) {
1104 px = fProducts_rho[k].Px();
1105 py = fProducts_rho[k].Py();
1106 pz = fProducts_rho[k].Pz();
1107 e = fProducts_rho[k].E();
1108 new(clonesParticles[1 - k]) TParticle(pdgR[k], 1, parentR[k], -1, dauR1[k], dauR2[k], px, py, pz, e, 0., 0., 0., 0.);
1115 for (i = 2; i > -1; i--) {
1116 px = fProducts_etaprime[i].Px();
1117 py = fProducts_etaprime[i].Py();
1118 pz = fProducts_etaprime[i].Pz();
1119 e = fProducts_etaprime[i].E();
1120 new(clonesParticles[2 - i]) TParticle(pdgD[0][i], 1, parentD[i], -1, dauD1[i], dauD2[i], px, py, pz, e, 0., 0., 0., 0.);
1127 for (i = 2; i > -1; i--) {
1128 px = fProducts_phi_dalitz[i].Px();
1129 py = fProducts_phi_dalitz[i].Py();
1130 pz = fProducts_phi_dalitz[i].Pz();
1131 e = fProducts_phi_dalitz[i].E();
1132 new(clonesParticles[2 - i]) TParticle(pdgD[2][i], 1, parentD[i], -1, dauD1[i], dauD2[i], px, py, pz, e, 0., 0., 0., 0.);
1140 for (k = 1; k > -1; k--) {
1141 px = fProducts_phi[k].Px();
1142 py = fProducts_phi[k].Py();
1143 pz = fProducts_phi[k].Pz();
1144 e = fProducts_phi[k].E();
1145 new(clonesParticles[1 - k]) TParticle(pdgR[k], 1, parentR[k], -1, dauR1[k], dauR2[k], px, py, pz, e, 0., 0., 0., 0.);
1152 for (k = 1; k > -1; k--) {
1153 px = fProducts_jpsi[k].Px();
1154 py = fProducts_jpsi[k].Py();
1155 pz = fProducts_jpsi[k].Pz();
1156 e = fProducts_jpsi[k].E();
1157 new(clonesParticles[1 - k]) TParticle(pdgR[k], 1, parentR[k], -1, dauR1[k], dauR2[k], px, py, pz, e, 0., 0., 0., 0.);
1164 return particles->GetEntries();
1169 void AliDecayerExodus::Decay(TClonesArray *array)
1171 // Replace all Dalitz(pi0,eta,omega,eta',phi) and resonance(rho,omega,phi,jpsi) decays with the correct matrix element decays
1172 // for di-electron cocktail calculations
1175 Int_t nt = array->GetEntriesFast();
1178 Int_t fd3, ld3, fd2, ld2, fd, ld;
1181 for (Int_t i = 0; i < nt; i++) {
1182 TParticle* part = (TParticle*) (array->At(i));
1183 if (part->GetPdgCode() != 111 || part->GetPdgCode() != 221 || part->GetPdgCode() != 223 || part->GetPdgCode() != 331 || part->GetPdgCode() != 333 || part->GetPdgCode() != 443 ) continue;
1188 if(part->GetPdgCode() == 111){
1190 fd3 = part->GetFirstDaughter() - 1;
1191 ld3 = part->GetLastDaughter() - 1;
1193 if (fd3 < 0) continue;
1194 if ((ld3 - fd3) != 2) continue;
1196 for (j = 0; j < 3; j++) dp3[j] = (TParticle*) (array->At(fd3+j));
1198 if((dp3[0]->GetPdgCode() != 22) && (TMath::Abs(dp3[1]->GetPdgCode()) != 11)) continue;
1200 TLorentzVector Pizero(part->Px(), part->Py(), part->Pz(), part->Energy());
1201 Decay(111, &Pizero);
1202 for (j = 0; j < 3; j++) dp3[j]->SetMomentum(fProducts_pion[2-j]);
1210 if(part->GetPdgCode() == 221){
1212 fd3 = part->GetFirstDaughter() - 1;
1213 ld3 = part->GetLastDaughter() - 1;
1215 if (fd3 < 0) continue;
1216 if ((ld3 - fd3) != 2) continue;
1218 for (j = 0; j < 3; j++) dp3[j] = (TParticle*) (array->At(fd3+j));
1220 if((dp3[0]->GetPdgCode() != 22) && ((TMath::Abs(dp3[1]->GetPdgCode()) != 11))) continue;
1222 TLorentzVector Eta(part->Px(), part->Py(), part->Pz(), part->Energy());
1224 for (j = 0; j < 3; j++) dp3[j]->SetMomentum(fProducts_eta[2-j]);
1231 if(part->GetPdgCode() == 113){
1233 fd2 = part->GetFirstDaughter() - 1;
1234 ld2 = part->GetLastDaughter() - 1;
1236 if (fd2 < 0) continue;
1237 if ((ld2 - fd2) != 1) continue;
1239 for (k = 0; k < 2; k++) dp2[k] = (TParticle*) (array->At(fd2+k));
1241 if((dp2[0]->GetPdgCode() != 11) && ((TMath::Abs(dp2[1]->GetPdgCode()) != 11))) continue;
1243 TLorentzVector Rho(part->Px(), part->Py(), part->Pz(), part->Energy());
1245 for (k = 0; k < 2; k++) dp2[k]->SetMomentum(fProducts_rho[1-k]);
1249 // Omega dalitz and direct
1252 if(part->GetPdgCode() == 223){
1254 fd = part->GetFirstDaughter() - 1;
1255 ld = part->GetLastDaughter() - 1;
1257 if (fd < 0) continue;
1259 if ((ld - fd) == 2){
1261 for (j = 0; j < 3; j++) dp3[j] = (TParticle*) (array->At(fd+j));
1262 if( dp3[0]->GetPdgCode() != 111 && (TMath::Abs(dp3[1]->GetPdgCode()) != 11)) continue;
1264 TLorentzVector Omegadalitz(part->Px(), part->Py(), part->Pz(), part->Energy());
1265 Decay(223, &Omegadalitz);
1266 for (j = 0; j < 3; j++) dp3[j]->SetMomentum(fProducts_omega_dalitz[2-j]);
1269 else if ((ld - fd) == 1) {
1271 for (k = 0; k < 2; k++) dp2[k] = (TParticle*) (array->At(fd+k));
1272 if( dp2[0]->GetPdgCode() != 11 && (TMath::Abs(dp2[1]->GetPdgCode()) != 11)) continue;
1274 TLorentzVector Omega(part->Px(), part->Py(), part->Pz(), part->Energy());
1276 for (k = 0; k < 2; k++) dp2[k]->SetMomentum(fProducts_omega[1-k]);
1284 if(part->GetPdgCode() == 331){
1286 fd3 = part->GetFirstDaughter() - 1;
1287 ld3 = part->GetLastDaughter() - 1;
1289 if (fd3 < 0) continue;
1290 if ((ld3 - fd3) != 2) continue;
1292 for (j = 0; j < 3; j++) dp3[j] = (TParticle*) (array->At(fd3+j));
1294 if((dp3[0]->GetPdgCode() != 22) && ((TMath::Abs(dp3[1]->GetPdgCode()) != 11))) continue;
1296 TLorentzVector Etaprime(part->Px(), part->Py(), part->Pz(), part->Energy());
1297 Decay(331, &Etaprime);
1298 for (j = 0; j < 3; j++) dp3[j]->SetMomentum(fProducts_etaprime[2-j]);
1302 // Phi dalitz and direct
1304 if(part->GetPdgCode() == 333){
1306 fd = part->GetFirstDaughter() - 1;
1307 ld = part->GetLastDaughter() - 1;
1309 if (fd < 0) continue;
1310 if ((ld - fd) == 2){
1311 for (j = 0; j < 3; j++) dp3[j] = (TParticle*) (array->At(fd+j));
1312 if( dp3[0]->GetPdgCode() != 221 && (TMath::Abs(dp3[1]->GetPdgCode()) != 11)) continue;
1314 TLorentzVector Phidalitz(part->Px(), part->Py(), part->Pz(), part->Energy());
1315 Decay(333, &Phidalitz);
1316 for (j = 0; j < 3; j++) dp3[j]->SetMomentum(fProducts_phi_dalitz[2-j]);
1319 else if ((ld - fd) == 1) {
1320 for (k = 0; k < 2; k++) dp2[k] = (TParticle*) (array->At(fd+k));
1321 if( dp2[0]->GetPdgCode() != 11 && (TMath::Abs(dp2[1]->GetPdgCode()) != 11)) continue;
1323 TLorentzVector Phi(part->Px(), part->Py(), part->Pz(), part->Energy());
1325 for (k = 0; k < 2; k++) dp2[k]->SetMomentum(fProducts_phi[1-k]);
1333 if(part->GetPdgCode() == 443){
1335 fd2 = part->GetFirstDaughter() - 1;
1336 ld2 = part->GetLastDaughter() - 1;
1338 if (fd2 < 0) continue;
1339 if ((ld2 - fd2) != 1) continue;
1341 for (k = 0; k < 2; k++) dp2[k] = (TParticle*) (array->At(fd2+k));
1343 if((dp2[0]->GetPdgCode() != 11) && ((TMath::Abs(dp2[1]->GetPdgCode()) != 11))) continue;
1345 TLorentzVector JPsi(part->Px(), part->Py(), part->Pz(), part->Energy());
1347 for (k = 0; k < 2; k++) dp2[k]->SetMomentum(fProducts_jpsi[1-k]);
1354 AliDecayerExodus& AliDecayerExodus::operator=(const AliDecayerExodus& rhs)
1356 // Assignment operator
1361 void AliDecayerExodus::Copy(TObject&) const
1366 Fatal("Copy","Not implemented!\n");
1370 AliDecayerExodus::AliDecayerExodus(const AliDecayerExodus &decayer)
1377 fEPMassOmegaDalitz(0),
1379 fEPMassPhiDalitz(0),
1384 decayer.Copy(*this);