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 **************************************************************************/
18 // Implementation of AliDecayer using Pythia8
19 // Author: andreas.morsch@cern.ch
23 #include "AliDecayerPythia8.h"
24 #include "ParticleData.h"
26 ClassImp(AliDecayerPythia8)
28 AliDecayerPythia8::AliDecayerPythia8():
36 void AliDecayerPythia8::ForceDecay()
39 // Force a particle decay mode
40 // Switch heavy flavour production off if requested
41 if (!fHeavyFlavour) SwitchOffHeavyFlavour();
43 Decay_t decay = fDecay;
44 TPythia8::Instance()->ReadString("HadronLevel:Decay = on");
46 if (decay == kNoDecayHeavy) return;
60 products1[2] = 100443;
64 ForceParticleDecay( 511, products1, mult1, 3);
65 ForceParticleDecay( 521, products1, mult1, 3);
66 ForceParticleDecay( 531, products1, mult1, 3);
67 ForceParticleDecay( 5122, products1, mult1, 3);
68 ForceParticleDecay( 5132, products1, mult1, 3);
69 ForceParticleDecay( 5232, products1, mult1, 3);
70 ForceParticleDecay( 5332, products1, mult1, 3);
71 ForceParticleDecay( 100443, 443, 1); // Psi' -> J/Psi X
72 ForceParticleDecay( 443, 13, 2); // J/Psi -> mu+ mu-
73 ForceParticleDecay( 411,13,1); // D+/-
74 ForceParticleDecay( 421,13,1); // D0
75 ForceParticleDecay( 431,13,1); // D_s
76 ForceParticleDecay( 4122,13,1); // Lambda_c
77 ForceParticleDecay( 4132,13,1); // Xsi_c
78 ForceParticleDecay( 4232,13,1); // Sigma_c
79 ForceParticleDecay( 4332,13,1); // Omega_c
81 case kChiToJpsiGammaToMuonMuon:
86 ForceParticleDecay( 20443, products, mult, 2); // Chi_1c -> J/Psi Gamma
87 ForceParticleDecay( 445, products, mult, 2); // Chi_2c -> J/Psi Gamma
88 ForceParticleDecay( 443, 13, 2); // J/Psi -> mu+ mu-
90 case kChiToJpsiGammaToElectronElectron:
95 ForceParticleDecay( 20443, products, mult, 2); // Chi_1c -> J/Psi Gamma
96 ForceParticleDecay( 445, products, mult, 2); // Chi_2c -> J/Psi Gamma
97 ForceParticleDecay( 443, 11, 2); // J/Psi -> e+ e-
101 ForceParticleDecay( 511,13,1); // B0
102 ForceParticleDecay( 521,13,1); // B+/-
103 ForceParticleDecay( 531,13,1); // B_s
104 ForceParticleDecay( 5122,13,1); // Lambda_b
105 ForceParticleDecay( 5132,13,1); // Xsi_b
106 ForceParticleDecay( 5232,13,1); // Sigma_b
107 ForceParticleDecay( 5332,13,1); // Omega_b
110 ForceParticleDecay( 411,13,1); // D+/-
111 ForceParticleDecay( 421,13,1); // D0
112 ForceParticleDecay( 431,13,1); // D_s
113 ForceParticleDecay( 4122,13,1); // Lambda_c
114 ForceParticleDecay( 4132,13,1); // Xsi_c
115 ForceParticleDecay( 4232,13,1); // Sigma_c
116 ForceParticleDecay( 4332,13,1); // Omega_c
117 ForceParticleDecay( 511,13,1); // B0
118 ForceParticleDecay( 521,13,1); // B+/-
119 ForceParticleDecay( 531,13,1); // B_s
120 ForceParticleDecay( 5122,13,1); // Lambda_b
121 ForceParticleDecay( 5132,13,1); // Xsi_b
122 ForceParticleDecay( 5232,13,1); // Sigma_b
123 ForceParticleDecay( 5332,13,1); // Omega_b
126 ForceParticleDecay( 113,13,2); // rho
127 ForceParticleDecay( 221,13,2); // eta
128 ForceParticleDecay( 223,13,2); // omega
129 ForceParticleDecay( 333,13,2); // phi
130 ForceParticleDecay( 443,13,2); // J/Psi
131 ForceParticleDecay(100443,13,2);// Psi'
132 ForceParticleDecay( 553,13,2); // Upsilon
133 ForceParticleDecay(100553,13,2);// Upsilon'
134 ForceParticleDecay(200553,13,2);// Upsilon''
136 case kBSemiElectronic:
137 ForceParticleDecay( 511,11,1); // B0
138 ForceParticleDecay( 521,11,1); // B+/-
139 ForceParticleDecay( 531,11,1); // B_s
140 ForceParticleDecay( 5122,11,1); // Lambda_b
141 ForceParticleDecay( 5132,11,1); // Xsi_b
142 ForceParticleDecay( 5232,11,1); // Sigma_b
143 ForceParticleDecay( 5332,11,1); // Omega_b
145 case kSemiElectronic:
146 ForceParticleDecay( 411,11,1); // D+/-
147 ForceParticleDecay( 421,11,1); // D0
148 ForceParticleDecay( 431,11,1); // D_s
149 ForceParticleDecay( 4122,11,1); // Lambda_c
150 ForceParticleDecay( 4132,11,1); // Xsi_c
151 ForceParticleDecay( 4232,11,1); // Sigma_c
152 ForceParticleDecay( 4332,11,1); // Omega_c
153 ForceParticleDecay( 511,11,1); // B0
154 ForceParticleDecay( 521,11,1); // B+/-
155 ForceParticleDecay( 531,11,1); // B_s
156 ForceParticleDecay( 5122,11,1); // Lambda_b
157 ForceParticleDecay( 5132,11,1); // Xsi_b
158 ForceParticleDecay( 5232,11,1); // Sigma_b
159 ForceParticleDecay( 5332,11,1); // Omega_b
162 ForceParticleDecay( 113,11,2); // rho
163 ForceParticleDecay( 333,11,2); // phi
164 ForceParticleDecay( 221,11,2); // eta
165 ForceParticleDecay( 223,11,2); // omega
166 ForceParticleDecay( 443,11,2); // J/Psi
167 ForceParticleDecay(100443,11,2);// Psi'
168 ForceParticleDecay( 553,11,2); // Upsilon
169 ForceParticleDecay(100553,11,2);// Upsilon'
170 ForceParticleDecay(200553,11,2);// Upsilon''
175 products[1] = 100443;
179 ForceParticleDecay( 511, products, mult, 2); // B0 -> J/Psi (Psi') X
180 ForceParticleDecay( 521, products, mult, 2); // B+/- -> J/Psi (Psi') X
181 ForceParticleDecay( 531, products, mult, 2); // B_s -> J/Psi (Psi') X
182 ForceParticleDecay( 5122, products, mult, 2); // Lambda_b -> J/Psi (Psi') X
183 ForceParticleDecay( 100443, 443, 1); // Psi' -> J/Psi X
184 ForceParticleDecay( 443,13,2); // J/Psi -> mu+ mu-
186 case kBPsiPrimeDiMuon:
187 ForceParticleDecay( 511,100443,1); // B0
188 ForceParticleDecay( 521,100443,1); // B+/-
189 ForceParticleDecay( 531,100443,1); // B_s
190 ForceParticleDecay( 5122,100443,1); // Lambda_b
191 ForceParticleDecay(100443,13,2); // Psi'
193 case kBJpsiDiElectron:
194 ForceParticleDecay( 511,443,1); // B0
195 ForceParticleDecay( 521,443,1); // B+/-
196 ForceParticleDecay( 531,443,1); // B_s
197 ForceParticleDecay( 5122,443,1); // Lambda_b
198 ForceParticleDecay( 443,11,2); // J/Psi
201 ForceParticleDecay( 511,443,1); // B0
202 ForceParticleDecay( 521,443,1); // B+/-
203 ForceParticleDecay( 531,443,1); // B_s
204 ForceParticleDecay( 5122,443,1); // Lambda_b
206 case kBPsiPrimeDiElectron:
207 ForceParticleDecay( 511,100443,1); // B0
208 ForceParticleDecay( 521,100443,1); // B+/-
209 ForceParticleDecay( 531,100443,1); // B_s
210 ForceParticleDecay( 5122,100443,1); // Lambda_b
211 ForceParticleDecay(100443,11,2); // Psi'
214 ForceParticleDecay(211,13,1); // pi->mu
217 ForceParticleDecay(321,13,1); // K->mu
220 ForceParticleDecay(211,13,1); // pi->mu
221 ForceParticleDecay(321,13,1); // K->mu
224 ForceParticleDecay( 24, 13,1); // W -> mu
227 ForceParticleDecay( 24, 4,1); // W -> c
229 case kWToCharmToMuon:
230 ForceParticleDecay( 24, 4,1); // W -> c
231 ForceParticleDecay( 411,13,1); // D+/- -> mu
232 ForceParticleDecay( 421,13,1); // D0 -> mu
233 ForceParticleDecay( 431,13,1); // D_s -> mu
234 ForceParticleDecay( 4122,13,1); // Lambda_c
235 ForceParticleDecay( 4132,13,1); // Xsi_c
236 ForceParticleDecay( 4232,13,1); // Sigma_c
237 ForceParticleDecay( 4332,13,1); // Omega_c
240 ForceParticleDecay( 23, 13,2); // Z -> mu+ mu-
243 ForceParticleDecay( 23, 11,2); // Z -> e+ e-
248 case kHadronicDWithout4Bodies:
252 ForceParticleDecay(333,321,2); // Phi->K+K-
259 TPythia8::Instance()->ReadString("HadronLevel:Decay = off");
267 Float_t AliDecayerPythia8::GetPartialBranchingRatio(Int_t ipart)
269 // Get the partial branching ration for the forced decay channels
271 Pythia8::Pythia* thePythia = TPythia8::Instance()->Pythia8();
272 Pythia8::ParticleDataTable table = thePythia->particleData;
273 Pythia8::ParticleDataEntry* pd = table.particleDataPtr(ipart);
274 Pythia8::DecayTable decays = pd->decay;
277 Int_t nc = decays.size();
280 // Loop over decay channels
281 for (Int_t ic = 0; ic < nc; ic++) {
282 Pythia8::DecayChannel& decCh = decays[ic];
283 for (Int_t i = 1; i <= decCh.multiplicity(); i++) {
284 br += decCh.bRatio();
291 Int_t AliDecayerPythia8::CountProducts(Pythia8::DecayChannel& channel , Int_t particle)
293 // Count decay products of a given type
295 for (Int_t i = 1; i <= channel.multiplicity(); i++) {
296 if (TMath::Abs(channel.product(i)) == particle) np++;
303 void AliDecayerPythia8::ForceParticleDecay(Int_t particle, Int_t product, Int_t mult)
306 // Force decay of particle into products with multiplicity mult
308 Pythia8::Pythia* thePythia = TPythia8::Instance()->Pythia8();
309 Pythia8::ParticleDataTable table = thePythia->particleData;
310 Pythia8::ParticleDataEntry* pd = table.particleDataPtr(particle);
311 pd->setMayDecay(true);
312 Pythia8::DecayTable decays = pd->decay;
315 Int_t nc = decays.size();
317 // Loop over decay channels
318 for (Int_t ic = 0; ic < nc; ic++) {
319 Pythia8::DecayChannel& decCh = decays[ic];
320 if (CountProducts(decCh, product) >= mult) {
328 void AliDecayerPythia8::ForceParticleDecay(Int_t particle, Int_t* products, Int_t* mult, Int_t npart)
331 // Force decay of particle into products with multiplicity mult
333 Pythia8::Pythia* thePythia = TPythia8::Instance()->Pythia8();
334 Pythia8::ParticleDataTable table = thePythia->particleData;
335 Pythia8::ParticleDataEntry* pd = table.particleDataPtr(particle);
336 pd->setMayDecay(true);
337 Pythia8::DecayTable decays = pd->decay;
339 Int_t nc = decays.size();
341 // Loop over decay channels
342 for (Int_t ic = 0; ic < nc; ic++) {
344 Pythia8::DecayChannel& decCh = decays[ic];
346 for (Int_t i = 0; i < npart; i++) {
347 nprod += (CountProducts(decCh, products[i]) >= mult[i]);
359 Float_t AliDecayerPythia8::GetLifetime(Int_t kf)
361 // Return lifetime of particle
362 Pythia8::Pythia* thePythia = TPythia8::Instance()->Pythia8();
363 Pythia8::ParticleDataTable table = thePythia->particleData;
364 Float_t tau = table.tau0(kf);
368 void AliDecayerPythia8::SwitchOffHeavyFlavour()
370 // Switch off heavy flavour production
372 // Maximum number of quark flavours used in pdf
373 TPythia8::Instance()->ReadString("PDFinProcess:nQuarkIn = 3");
374 // Maximum number of flavors that can be used in showers
375 TPythia8::Instance()->ReadString("SpaceShower:nQuarkIn = 3");
376 TPythia8::Instance()->ReadString("TimeShower:nGammaToQuark = 3");
377 TPythia8::Instance()->ReadString("TimeShower:nGluonToQuark = 3");
381 void AliDecayerPythia8::ForceHadronicD(Int_t optUse4Bodies)
384 // Force golden D decay modes
386 const Int_t kNHadrons = 5;
387 Int_t hadron[kNHadrons] = {411, 421, 431, 4112, 4122};
389 // for D+ -> K0* (-> K- pi+) pi+
391 Int_t iKstarbar0 = -313;
392 Int_t products[2] = {kKPlus, kPiMinus}, mult[2] = {1, 1};
393 ForceParticleDecay(iKstar0, products, mult, 2);
396 ForceParticleDecay(iPhi, kKPlus, 2); // Phi->K+K-
397 // for D0 -> rho0 pi+ k-
399 ForceParticleDecay(iRho0, kPiPlus, 2); // Rho0->pi+pi-
400 // for Lambda_c -> Delta++ K-
401 Int_t iDeltaPP = 2224;
402 Int_t productsD[2] = {kProton, kPiPlus}, multD[2] = {1, 1};
403 ForceParticleDecay(iDeltaPP, productsD, multD, 2);
406 Int_t decayP1[kNHadrons][4] =
408 {kKMinus, kPiPlus, kPiPlus, 0},
409 {kKMinus, kPiPlus, 0 , 0},
410 {kKPlus , iKstarbar0, 0 , 0},
412 {kProton, iKstarbar0, 0 , 0}
414 Int_t decayP2[kNHadrons][4] =
416 {iKstarbar0, kPiPlus, 0 , 0},
417 {kKMinus , kPiPlus, kPiPlus, kPiMinus},
418 {iPhi , kPiPlus, 0 , 0},
420 {iDeltaPP , kKMinus, 0 , 0}
422 Int_t decayP3[kNHadrons][4] =
425 {kKMinus , kPiPlus, iRho0 , 0 },
428 {kProton , kKMinus, kPiPlus , 0}
430 if(optUse4Bodies==0){
431 for(Int_t iDau=0;iDau<4;iDau++){
438 Pythia8::Pythia* thePythia = TPythia8::Instance()->Pythia8();
439 Pythia8::ParticleDataTable table = thePythia->particleData;
441 for (Int_t ihadron = 0; ihadron < kNHadrons; ihadron++)
443 Pythia8::ParticleDataEntry* pd = table.particleDataPtr(hadron[ihadron]);
444 pd->setMayDecay(true);
445 Pythia8::DecayTable decays = pd->decay;
448 for (Int_t ic = 0; ic < decays.size(); ic++) {
449 Pythia8::DecayChannel& decCh = decays[ic];
451 decCh.product(0) == decayP1[ihadron][0] &&
452 decCh.product(1) == decayP1[ihadron][1] &&
453 decCh.product(2) == decayP1[ihadron][2] &&
454 decCh.product(3) == decayP1[ihadron][3] &&
455 decCh.product(4) == 0
458 decCh.product(0) == decayP2[ihadron][0] &&
459 decCh.product(1) == decayP2[ihadron][1] &&
460 decCh.product(2) == decayP2[ihadron][2] &&
461 decCh.product(3) == decayP2[ihadron][3] &&
462 decCh.product(4) == 0
465 decCh.product(0) == decayP3[ihadron][0] &&
466 decCh.product(1) == decayP3[ihadron][1] &&
467 decCh.product(2) == decayP3[ihadron][2] &&
468 decCh.product(3) == decayP3[ihadron][3] &&
469 decCh.product(4) == 0
475 } // selected channel ?