]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PYTHIA8/AliDecayerPythia8.cxx
allow to set the number of events throub an env variable
[u/mrichter/AliRoot.git] / PYTHIA8 / AliDecayerPythia8.cxx
CommitLineData
948d10f4 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18// Implementation of AliDecayer using Pythia8
19// Author: andreas.morsch@cern.ch
20#include <TMath.h>
21#include <TPDGCode.h>
22#include <TPythia8.h>
23#include "AliDecayerPythia8.h"
24#include "ParticleData.h"
25
26ClassImp(AliDecayerPythia8)
27
ad720100 28Bool_t AliDecayerPythia8::fgInit = kFALSE;
29
948d10f4 30AliDecayerPythia8::AliDecayerPythia8():
31 TPythia8Decayer(),
32 fDecay(kAll),
33 fHeavyFlavour(kTRUE)
34{
35 // Constructor
36}
37
ad720100 38void AliDecayerPythia8::Init()
39{
40// Initialisation
41//
42 if (!fgInit) {
43 fgInit = kTRUE;
44 // fPythia->SetDecayTable();
45 }
46
47// Switch on heavy flavor decays
48
49 Int_t j;
50 Int_t heavy[14] = {411, 421, 431, 4122, 4132, 4232, 4332, 511, 521, 531, 5122, 5132, 5232, 5332};
51// fPythia->ResetDecayTable();
52 for (j=0; j < 14; j++) {
53 if (fDecay == kNoDecayHeavy) {
54 TPythia8::Instance()->ReadString(Form("%d:onMode = off", heavy[j]));
55 } else {
56 TPythia8::Instance()->ReadString(Form("%d:onMode = on", heavy[j]));
57 }
58 }
59
60
61//...Switch off decay of pi0, K0S, Lambda, Sigma+-, Xi0-, Omega-.
62
63 if (fDecay != kNeutralPion) {
64 TPythia8::Instance()->ReadString("111:onMode = off");
65 } else {
66 TPythia8::Instance()->ReadString("111:onMode = on");
67 }
68
69 TPythia8::Instance()->ReadString("310:onMode = off");
70 TPythia8::Instance()->ReadString("3122:onMode = off");
71 TPythia8::Instance()->ReadString("3112:onMode = off");
72 TPythia8::Instance()->ReadString("3212:onMode = off");
73 TPythia8::Instance()->ReadString("3222:onMode = off");
74 TPythia8::Instance()->ReadString("3312:onMode = off");
75 TPythia8::Instance()->ReadString("3322:onMode = off");
76 TPythia8::Instance()->ReadString("3334:onMode = off");
77// .. Force decay channels
78 ForceDecay();
79}
80
948d10f4 81void AliDecayerPythia8::ForceDecay()
82{
b7227478 83//
948d10f4 84// Force a particle decay mode
85// Switch heavy flavour production off if requested
86 if (!fHeavyFlavour) SwitchOffHeavyFlavour();
87//
88 Decay_t decay = fDecay;
89 TPythia8::Instance()->ReadString("HadronLevel:Decay = on");
90
91 if (decay == kNoDecayHeavy) return;
92
93//
94// select mode
948d10f4 95 switch (decay)
96 {
97 case kHardMuons:
ad720100 98// B0 -> mu X
b7227478 99 TPythia8::Instance()->ReadString("511:onMode = off");
100 TPythia8::Instance()->ReadString("511:onIfAny = 13 443 100443");
ad720100 101// B+/- -> mu X
b7227478 102 TPythia8::Instance()->ReadString("521:onMode = off");
103 TPythia8::Instance()->ReadString("521:onIfAny = 13 443 100443");
ad720100 104// Bs -> mu X
b7227478 105 TPythia8::Instance()->ReadString("531:onMode = off");
106 TPythia8::Instance()->ReadString("531:onIfAny = 13 443 100443");
ad720100 107// Lambda_b -> mu X
b7227478 108 TPythia8::Instance()->ReadString("5122:onMode = off");
109 TPythia8::Instance()->ReadString("5122:onIfAny = 13 443 100443");
ad720100 110// Sigma_b- -> mu X
b7227478 111 TPythia8::Instance()->ReadString("5132:onMode = off");
112 TPythia8::Instance()->ReadString("5132:onIfAny = 13 443 100443");
ad720100 113// Sigma_b0 -> mu X
b7227478 114 TPythia8::Instance()->ReadString("5232:onMode = off");
115 TPythia8::Instance()->ReadString("5232:onIfAny = 13 443 100443");
ad720100 116// Omega_b -> mu X
b7227478 117 TPythia8::Instance()->ReadString("5332:onMode = off");
118 TPythia8::Instance()->ReadString("5332:onIfAny = 13 443 100443");
ad720100 119// Psi' -> mu+ mu-
b7227478 120 TPythia8::Instance()->ReadString("100443:onMode = off");
121 TPythia8::Instance()->ReadString("100443:onIfAny = 443");
ad720100 122// Psi -> mu+ mu-
b7227478 123 TPythia8::Instance()->ReadString("443:onMode = off");
124 TPythia8::Instance()->ReadString("443:onIfAll = 13 13");
ad720100 125// D+/- -> mu X
b7227478 126 TPythia8::Instance()->ReadString("411:onMode = off");
127 TPythia8::Instance()->ReadString("411:onIfAll = 13");
ad720100 128// D0 -> mu X
b7227478 129 TPythia8::Instance()->ReadString("421:onMode = off");
130 TPythia8::Instance()->ReadString("421:onIfAll = 13");
ad720100 131// D_s -> mu X
b7227478 132 TPythia8::Instance()->ReadString("431:onMode = off");
133 TPythia8::Instance()->ReadString("431:onIfAll = 13");
ad720100 134// Lambda_c -> mu X
b7227478 135 TPythia8::Instance()->ReadString("4122:onMode = off");
136 TPythia8::Instance()->ReadString("4122:onIfAll = 13");
ad720100 137// Sigma_c -> mu X
b7227478 138 TPythia8::Instance()->ReadString("4132:onMode = off");
139 TPythia8::Instance()->ReadString("4132:onIfAll = 13");
ad720100 140// Sigma_c+ -> mu X
b7227478 141 TPythia8::Instance()->ReadString("4232:onMode = off");
142 TPythia8::Instance()->ReadString("4232:onIfAll = 13");
ad720100 143// Omega_c -> mu X
b7227478 144 TPythia8::Instance()->ReadString("4332:onMode = off");
145 TPythia8::Instance()->ReadString("4332:onIfAll = 13");
146
948d10f4 147 break;
148 case kChiToJpsiGammaToMuonMuon:
b7227478 149// Chi_1c -> J/Psi Gamma
150 TPythia8::Instance()->ReadString("20443:onMode = off");
151 TPythia8::Instance()->ReadString("20443:onIfAll = 443 22");
152// Chi_2c -> J/Psi Gamma
153 TPythia8::Instance()->ReadString("445:onMode = off");
154 TPythia8::Instance()->ReadString("445:onIfAll = 443 22");
155// J/Psi -> mu+ mu-
156 TPythia8::Instance()->ReadString("443:onMode = off");
157 TPythia8::Instance()->ReadString("443:onIfAll = 13 13");
948d10f4 158 break;
159 case kChiToJpsiGammaToElectronElectron:
b7227478 160// Chi_1c -> J/Psi Gamma
161 TPythia8::Instance()->ReadString("20443:onMode = off");
162 TPythia8::Instance()->ReadString("20443:onIfAll = 443 22");
163// Chi_2c -> J/Psi Gamma
164 TPythia8::Instance()->ReadString("445:onMode = off");
165 TPythia8::Instance()->ReadString("445:onIfAll = 443 22");
166// J/Psi -> e+ e-
167 TPythia8::Instance()->ReadString("443:onMode = off");
168 TPythia8::Instance()->ReadString("443:onIfAll = 11 11");
948d10f4 169 break;
170
171 case kBSemiMuonic:
ad720100 172// B0 -> mu X
b7227478 173 TPythia8::Instance()->ReadString("511:onMode = off");
174 TPythia8::Instance()->ReadString("511:onIfAny = 13");
ad720100 175// B+/- -> mu X
b7227478 176 TPythia8::Instance()->ReadString("521:onMode = off");
177 TPythia8::Instance()->ReadString("521:onIfAny = 13");
ad720100 178// B_s -> mu X
b7227478 179 TPythia8::Instance()->ReadString("531:onMode = off");
180 TPythia8::Instance()->ReadString("531:onIfAny = 13");
ad720100 181// Lambda_b -> mu X
b7227478 182 TPythia8::Instance()->ReadString("5122:onMode = off");
183 TPythia8::Instance()->ReadString("5122:onIfAny = 13");
ad720100 184// Sigma_b -> mu X
b7227478 185 TPythia8::Instance()->ReadString("5132:onMode = off");
186 TPythia8::Instance()->ReadString("5132:onIfAny = 13");
ad720100 187// Sigma_b0 -> mu X
b7227478 188 TPythia8::Instance()->ReadString("5232:onMode = off");
189 TPythia8::Instance()->ReadString("5232:onIfAny = 13");
ad720100 190// Omega_b -> mu X
b7227478 191 TPythia8::Instance()->ReadString("5332:onMode = off");
192 TPythia8::Instance()->ReadString("5332:onIfAny = 13");
948d10f4 193 break;
194 case kSemiMuonic:
ad720100 195// D+- -> mu X
b7227478 196 TPythia8::Instance()->ReadString("411:onMode = off");
197 TPythia8::Instance()->ReadString("411:onIfAll = 13");
ad720100 198// D0 -> mu X
b7227478 199 TPythia8::Instance()->ReadString("421:onMode = off");
200 TPythia8::Instance()->ReadString("421:onIfAll = 13");
ad720100 201// D_s -> mu X
b7227478 202 TPythia8::Instance()->ReadString("431:onMode = off");
203 TPythia8::Instance()->ReadString("431:onIfAll = 13");
ad720100 204// Lambda_c -> mu X
b7227478 205 TPythia8::Instance()->ReadString("4122:onMode = off");
206 TPythia8::Instance()->ReadString("4122:onIfAll = 13");
ad720100 207// Sigma_c -> mu X
b7227478 208 TPythia8::Instance()->ReadString("4132:onMode = off");
209 TPythia8::Instance()->ReadString("4132:onIfAll = 13");
ad720100 210// Sigma -> mu X
b7227478 211 TPythia8::Instance()->ReadString("4232:onMode = off");
212 TPythia8::Instance()->ReadString("4232:onIfAll = 13");
ad720100 213// Omega_c -> mu X
b7227478 214 TPythia8::Instance()->ReadString("4332:onMode = off");
215 TPythia8::Instance()->ReadString("4332:onIfAll = 13");
ad720100 216// B0 -> mu X
b7227478 217 TPythia8::Instance()->ReadString("511:onMode = off");
218 TPythia8::Instance()->ReadString("511:onIfAny = 13");
ad720100 219// B+/- -> mu X
b7227478 220 TPythia8::Instance()->ReadString("521:onMode = off");
221 TPythia8::Instance()->ReadString("521:onIfAny = 13");
ad720100 222// B_s -> mu X
b7227478 223 TPythia8::Instance()->ReadString("531:onMode = off");
224 TPythia8::Instance()->ReadString("531:onIfAny = 13");
ad720100 225// Lambda_c -> mu X
b7227478 226 TPythia8::Instance()->ReadString("5122:onMode = off");
227 TPythia8::Instance()->ReadString("5122:onIfAny = 13");
ad720100 228// Sigma_c -> mu X
b7227478 229 TPythia8::Instance()->ReadString("5132:onMode = off");
230 TPythia8::Instance()->ReadString("5132:onIfAny = 13");
ad720100 231// Sigma_c -> mu X
b7227478 232 TPythia8::Instance()->ReadString("5232:onMode = off");
233 TPythia8::Instance()->ReadString("5232:onIfAny = 13");
ad720100 234// Omega_c -> mu X
b7227478 235 TPythia8::Instance()->ReadString("5332:onMode = off");
236 TPythia8::Instance()->ReadString("5332:onIfAny = 13");
237
948d10f4 238 break;
239 case kDiMuon:
ad720100 240// Rho -> mu+ mu-
b7227478 241 TPythia8::Instance()->ReadString("113:onMode = off");
242 TPythia8::Instance()->ReadString("113:onIfAll = 13 13");
ad720100 243// Eta-> mu+ mu-
b7227478 244 TPythia8::Instance()->ReadString("221:onMode = off");
245 TPythia8::Instance()->ReadString("221:onIfAll = 13 13");
ad720100 246// omega-> mu+ mu-
b7227478 247 TPythia8::Instance()->ReadString("223:onMode = off");
248 TPythia8::Instance()->ReadString("223:onIfAll = 13 13");
ad720100 249// phi-> mu+ mu-
b7227478 250 TPythia8::Instance()->ReadString("333:onMode = off");
251 TPythia8::Instance()->ReadString("333:onIfAll = 13 13");
ad720100 252// J/Psi-> mu+ mu-
b7227478 253 TPythia8::Instance()->ReadString("443:onMode = off");
254 TPythia8::Instance()->ReadString("443:onIfAll = 13 13");
ad720100 255// Psi'-> mu+ mu-
b7227478 256 TPythia8::Instance()->ReadString("100443:onMode = off");
257 TPythia8::Instance()->ReadString("100443:onIfAll = 13 13");
ad720100 258// Ups-> mu+ mu-
b7227478 259 TPythia8::Instance()->ReadString("553:onMode = off");
260 TPythia8::Instance()->ReadString("553:onIfAll = 13 13");
ad720100 261// Ups'-> mu+ mu-
b7227478 262 TPythia8::Instance()->ReadString("100553:onMode = off");
ad720100 263 TPythia8::Instance()->ReadString("100553:onIfAll = 13 13");
264// Ups''-> mu+ mu-
b7227478 265 TPythia8::Instance()->ReadString("200553:onMode = off");
266 TPythia8::Instance()->ReadString("200553:onIfAll = 13 13");
948d10f4 267 break;
268 case kBSemiElectronic:
ad720100 269// B0 - > e+ e-
b7227478 270 TPythia8::Instance()->ReadString("511:onMode = off");
271 TPythia8::Instance()->ReadString("511:onIfAny = 11");
ad720100 272// B+- -> e+ e-
b7227478 273 TPythia8::Instance()->ReadString("521:onMode = off");
274 TPythia8::Instance()->ReadString("521:onIfAny = 11");
ad720100 275// B_s -> e+ e-
b7227478 276 TPythia8::Instance()->ReadString("531:onMode = off");
277 TPythia8::Instance()->ReadString("531:onIfAny = 11");
ad720100 278// Lambda_b -> e+ e-
b7227478 279 TPythia8::Instance()->ReadString("5122:onMode = off");
280 TPythia8::Instance()->ReadString("5122:onIfAny = 11");
ad720100 281// Sigma_b -> e+ e-
b7227478 282 TPythia8::Instance()->ReadString("5132:onMode = off");
283 TPythia8::Instance()->ReadString("5132:onIfAny = 11");
ad720100 284// Sigma_b -> e+ e-
b7227478 285 TPythia8::Instance()->ReadString("5232:onMode = off");
286 TPythia8::Instance()->ReadString("5232:onIfAny = 11");
ad720100 287// Omega_b ->e+ e-
b7227478 288 TPythia8::Instance()->ReadString("5332:onMode = off");
289 TPythia8::Instance()->ReadString("5332:onIfAny = 11");
948d10f4 290 break;
291 case kSemiElectronic:
ad720100 292// D+/- -> e X
b7227478 293 TPythia8::Instance()->ReadString("411:onMode = off");
294 TPythia8::Instance()->ReadString("411:onIfAll = 11");
ad720100 295// D0 -> e X
b7227478 296 TPythia8::Instance()->ReadString("421:onMode = off");
297 TPythia8::Instance()->ReadString("421:onIfAll = 11");
ad720100 298// D_s ->e X
b7227478 299 TPythia8::Instance()->ReadString("431:onMode = off");
300 TPythia8::Instance()->ReadString("431:onIfAll = 11");
ad720100 301// Lambda_c -> e X
b7227478 302 TPythia8::Instance()->ReadString("4122:onMode = off");
303 TPythia8::Instance()->ReadString("4122:onIfAll = 11");
ad720100 304// Sigma_c -> e X
b7227478 305 TPythia8::Instance()->ReadString("4132:onMode = off");
306 TPythia8::Instance()->ReadString("4132:onIfAll = 11");
ad720100 307// Sigma_c -> e X
b7227478 308 TPythia8::Instance()->ReadString("4232:onMode = off");
309 TPythia8::Instance()->ReadString("4232:onIfAll = 11");
ad720100 310// Omega_c -> e X
b7227478 311 TPythia8::Instance()->ReadString("4332:onMode = off");
312 TPythia8::Instance()->ReadString("4332:onIfAll = 11");
ad720100 313// B0 -> e X
b7227478 314 TPythia8::Instance()->ReadString("511:onMode = off");
315 TPythia8::Instance()->ReadString("511:onIfAny = 11");
ad720100 316// B+/- -> e X
b7227478 317 TPythia8::Instance()->ReadString("521:onMode = off");
318 TPythia8::Instance()->ReadString("521:onIfAny = 11");
ad720100 319// B_s -> e X
b7227478 320 TPythia8::Instance()->ReadString("531:onMode = off");
321 TPythia8::Instance()->ReadString("531:onIfAny = 11");
ad720100 322// Lambda_b -> e X
b7227478 323 TPythia8::Instance()->ReadString("5122:onMode = off");
324 TPythia8::Instance()->ReadString("5122:onIfAny = 11");
ad720100 325// Sigma_b -> e X
b7227478 326 TPythia8::Instance()->ReadString("5132:onMode = off");
327 TPythia8::Instance()->ReadString("5132:onIfAny = 11");
ad720100 328// Sigma_b -> e X
b7227478 329 TPythia8::Instance()->ReadString("5232:onMode = off");
330 TPythia8::Instance()->ReadString("5232:onIfAny = 11");
ad720100 331// Omega_b -> e X
b7227478 332 TPythia8::Instance()->ReadString("5332:onMode = off");
333 TPythia8::Instance()->ReadString("5332:onIfAny = 11");
948d10f4 334 break;
335 case kDiElectron:
ad720100 336// Rho -> e+e-
b7227478 337 TPythia8::Instance()->ReadString("113:onMode = off");
338 TPythia8::Instance()->ReadString("113:onIfAll = 11 11");
ad720100 339// Eta -> e+e-
b7227478 340 TPythia8::Instance()->ReadString("221:onMode = off");
341 TPythia8::Instance()->ReadString("221:onIfAll = 11 11");
ad720100 342// omega -> e+e-
b7227478 343 TPythia8::Instance()->ReadString("223:onMode = off");
344 TPythia8::Instance()->ReadString("223:onIfAll = 11 11");
ad720100 345// phi -> e+e-
b7227478 346 TPythia8::Instance()->ReadString("333:onMode = off");
347 TPythia8::Instance()->ReadString("333:onIfAll = 11 11");
ad720100 348// J/Psi -> e+e-
b7227478 349 TPythia8::Instance()->ReadString("443:onMode = off");
350 TPythia8::Instance()->ReadString("443:onIfAll = 11 11");
ad720100 351// Psi' -> e+e-
b7227478 352 TPythia8::Instance()->ReadString("100443:onMode = off");
353 TPythia8::Instance()->ReadString("100443:onIfAll = 11 11");
ad720100 354// Ups -> e+e-
b7227478 355 TPythia8::Instance()->ReadString("553:onMode = off");
356 TPythia8::Instance()->ReadString("553:onIfAll = 11 11");
ad720100 357// Ups' -> e+e-
b7227478 358 TPythia8::Instance()->ReadString("100553:onMode = off");
359 TPythia8::Instance()->ReadString("100553:onIfAll = 11 11");
ad720100 360// Ups'' -> e+e-
b7227478 361 TPythia8::Instance()->ReadString("200553:onMode = off");
362 TPythia8::Instance()->ReadString("200553:onIfAll = 11 11");
948d10f4 363 break;
364 case kBJpsiDiMuon:
ad720100 365// B0 -> J/Psi (Psi') X
b7227478 366 TPythia8::Instance()->ReadString("511:onMode = off");
367 TPythia8::Instance()->ReadString("511:onIfAny = 443 100443");
ad720100 368// B+/- -> J/Psi (Psi') X
b7227478 369 TPythia8::Instance()->ReadString("521:onMode = off");
370 TPythia8::Instance()->ReadString("521:onIfAny = 443 100443");
ad720100 371// B_s -> J/Psi (Psi') X
b7227478 372 TPythia8::Instance()->ReadString("531:onMode = off");
373 TPythia8::Instance()->ReadString("531:onIfAny = 443 100443");
ad720100 374// Lambda_b -> J/Psi (Psi') X
b7227478 375 TPythia8::Instance()->ReadString("5122:onMode = off");
376 TPythia8::Instance()->ReadString("5122:onIfAny = 443 100443");
377//
ad720100 378// J/Psi -> mu+ mu-
b7227478 379 TPythia8::Instance()->ReadString("443:onMode = off");
380 TPythia8::Instance()->ReadString("443:onIfAll = 13 13");
ad720100 381// Psi' -> mu+ mu-
b7227478 382 TPythia8::Instance()->ReadString("100443:onMode = off");
383 TPythia8::Instance()->ReadString("100443:onIfAll = 13 13");
948d10f4 384 break;
385 case kBPsiPrimeDiMuon:
ad720100 386// B0 -> Psi' X
b7227478 387 TPythia8::Instance()->ReadString("511:onMode = off");
388 TPythia8::Instance()->ReadString("511:onIfAny = 100443");
ad720100 389// B+/- -> Psi' X
b7227478 390 TPythia8::Instance()->ReadString("521:onMode = off");
391 TPythia8::Instance()->ReadString("521:onIfAny = 100443");
ad720100 392// B_s -> Psi' X
b7227478 393 TPythia8::Instance()->ReadString("531:onMode = off");
394 TPythia8::Instance()->ReadString("531:onIfAny = 100443");
ad720100 395// Lambda_b -> Psi' X
b7227478 396 TPythia8::Instance()->ReadString("5122:onMode = off");
397 TPythia8::Instance()->ReadString("5122:onIfAny = 100443");
398//
ad720100 399// Psi' -> mu+ mu-
b7227478 400 TPythia8::Instance()->ReadString("100443:onMode = off");
401 TPythia8::Instance()->ReadString("100443:onIfAll = 13 13");
948d10f4 402 break;
403 case kBJpsiDiElectron:
ad720100 404// B0 -> Psi X
b7227478 405 TPythia8::Instance()->ReadString("511:onMode = off");
406 TPythia8::Instance()->ReadString("511:onIfAny = 443");
ad720100 407// B+/- -> Psi X
b7227478 408 TPythia8::Instance()->ReadString("521:onMode = off");
409 TPythia8::Instance()->ReadString("521:onIfAny = 443");
ad720100 410// B_s -> Psi X
b7227478 411 TPythia8::Instance()->ReadString("531:onMode = off");
412 TPythia8::Instance()->ReadString("531:onIfAny = 443");
ad720100 413// Lambda_b -> Psi X
b7227478 414 TPythia8::Instance()->ReadString("5122:onMode = off");
415 TPythia8::Instance()->ReadString("5122:onIfAny = 443");
416//
ad720100 417// Psi -> mu+ mu-
b7227478 418 TPythia8::Instance()->ReadString("443:onMode = off");
419 TPythia8::Instance()->ReadString("443:onIfAll = 11 11");
420
948d10f4 421 break;
422 case kBJpsi:
ad720100 423// B0 -> Psi X
b7227478 424 TPythia8::Instance()->ReadString("511:onMode = off");
425 TPythia8::Instance()->ReadString("511:onIfAny = 443");
ad720100 426// B+/- -> Psi X
b7227478 427 TPythia8::Instance()->ReadString("521:onMode = off");
428 TPythia8::Instance()->ReadString("521:onIfAny = 443");
ad720100 429// B_s -> Psi X
b7227478 430 TPythia8::Instance()->ReadString("531:onMode = off");
431 TPythia8::Instance()->ReadString("531:onIfAny = 443");
ad720100 432// Lambda_b -> Psi X
b7227478 433 TPythia8::Instance()->ReadString("5122:onMode = off");
434 TPythia8::Instance()->ReadString("5122:onIfAny = 443");
948d10f4 435 break;
436 case kBPsiPrimeDiElectron:
ad720100 437// B0 -> Psi' X
b7227478 438 TPythia8::Instance()->ReadString("511:onMode = off");
439 TPythia8::Instance()->ReadString("511:onIfAny = 100443");
ad720100 440// B+/- -> Psi' X
b7227478 441 TPythia8::Instance()->ReadString("521:onMode = off");
442 TPythia8::Instance()->ReadString("521:onIfAny = 100443");
ad720100 443// B_s -> Psi' X
b7227478 444 TPythia8::Instance()->ReadString("531:onMode = off");
445 TPythia8::Instance()->ReadString("531:onIfAny = 100443");
ad720100 446// Lambda_b -> Psi' X
b7227478 447 TPythia8::Instance()->ReadString("5122:onMode = off");
448 TPythia8::Instance()->ReadString("5122:onIfAny = 100443");
449//
ad720100 450// Psi' -> mu+ mu-
b7227478 451 TPythia8::Instance()->ReadString("100443:onMode = off");
452 TPythia8::Instance()->ReadString("100443:onIfAll = 11 11");
948d10f4 453 break;
454 case kPiToMu:
ad720100 455// pi -> mu nu
b7227478 456 TPythia8::Instance()->ReadString("211:onMode = off");
457 TPythia8::Instance()->ReadString("211:onIfAny = 13");
948d10f4 458 break;
459 case kKaToMu:
ad720100 460// K -> mu nu
b7227478 461 TPythia8::Instance()->ReadString("321:onMode = off");
462 TPythia8::Instance()->ReadString("321:onIfAny = 13");
948d10f4 463 break;
464 case kAllMuonic:
ad720100 465// pi/K -> mu
b7227478 466 TPythia8::Instance()->ReadString("211:onMode = off");
467 TPythia8::Instance()->ReadString("211:onIfAny = 13");
468 TPythia8::Instance()->ReadString("321:onMode = off");
469 TPythia8::Instance()->ReadString("321:onIfAny = 13");
948d10f4 470 break;
471 case kWToMuon:
ad720100 472// W -> mu X
b7227478 473 TPythia8::Instance()->ReadString("24:onMode = off");
474 TPythia8::Instance()->ReadString("24:onIfAny = 13");
948d10f4 475 break;
476 case kWToCharm:
ad720100 477// W -> c X
b7227478 478 TPythia8::Instance()->ReadString("24:onMode = off");
479 TPythia8::Instance()->ReadString("24:onIfAny = 4");
948d10f4 480 break;
481 case kWToCharmToMuon:
ad720100 482// W -> c X
b7227478 483 TPythia8::Instance()->ReadString("24:onMode = off");
484 TPythia8::Instance()->ReadString("24:onIfAny = 4");
ad720100 485// D+- -> mu X
b7227478 486 TPythia8::Instance()->ReadString("411:onMode = off");
487 TPythia8::Instance()->ReadString("411:onIfAll = 13");
ad720100 488// D0 -> mu X
b7227478 489 TPythia8::Instance()->ReadString("421:onMode = off");
490 TPythia8::Instance()->ReadString("421:onIfAll = 13");
ad720100 491// D_s -> mu X
b7227478 492 TPythia8::Instance()->ReadString("431:onMode = off");
493 TPythia8::Instance()->ReadString("431:onIfAll = 13");
ad720100 494// Lambda_c -> mu X
b7227478 495 TPythia8::Instance()->ReadString("4122:onMode = off");
496 TPythia8::Instance()->ReadString("4122:onIfAll = 13");
ad720100 497// Sigma_c -> mu X
b7227478 498 TPythia8::Instance()->ReadString("4132:onMode = off");
499 TPythia8::Instance()->ReadString("4132:onIfAll = 13");
ad720100 500// Sigma_c -> mu X
b7227478 501 TPythia8::Instance()->ReadString("4232:onMode = off");
502 TPythia8::Instance()->ReadString("4232:onIfAll = 13");
ad720100 503// Omega_c -> mu X
b7227478 504 TPythia8::Instance()->ReadString("4332:onMode = off");
505 TPythia8::Instance()->ReadString("4332:onIfAll = 13");
948d10f4 506 break;
507 case kZDiMuon:
ad720100 508// Z -> mu+ mu-
b7227478 509 TPythia8::Instance()->ReadString("23:onMode = off");
510 TPythia8::Instance()->ReadString("23:onIfAll = 13 13");
948d10f4 511 break;
512 case kZDiElectron:
ad720100 513// Z -> e+ e-
b7227478 514 TPythia8::Instance()->ReadString("23:onMode = off");
515 TPythia8::Instance()->ReadString("23:onIfAll = 11 11");
948d10f4 516 break;
517 case kHadronicD:
518 ForceHadronicD(1);
519 break;
520 case kHadronicDWithout4Bodies:
521 ForceHadronicD(0);
522 break;
523 case kPhiKK:
ad720100 524 // Phi-> K+ K-
b7227478 525 TPythia8::Instance()->ReadString("333:onMode = off");
526 TPythia8::Instance()->ReadString("333:onIfAll = 321 321");
948d10f4 527 break;
528 case kOmega:
ad720100 529 // Omega -> Lambda K
b7227478 530 TPythia8::Instance()->ReadString("3334:onMode = off");
531 TPythia8::Instance()->ReadString("3334:onIfAll = 3122 321 ");
948d10f4 532 case kAll:
533 break;
534 case kNoDecay:
535 TPythia8::Instance()->ReadString("HadronLevel:Decay = off");
536 break;
537 case kNoDecayHeavy:
538 case kNeutralPion:
539 break;
540 }
541}
542
543Float_t AliDecayerPythia8::GetPartialBranchingRatio(Int_t ipart)
544{
545 // Get the partial branching ration for the forced decay channels
546
547 Pythia8::Pythia* thePythia = TPythia8::Instance()->Pythia8();
548 Pythia8::ParticleDataTable table = thePythia->particleData;
549 Pythia8::ParticleDataEntry* pd = table.particleDataPtr(ipart);
550 Pythia8::DecayTable decays = pd->decay;
551
552
553 Int_t nc = decays.size();
554 Float_t br = 0.;
555//
556// Loop over decay channels
557 for (Int_t ic = 0; ic < nc; ic++) {
558 Pythia8::DecayChannel& decCh = decays[ic];
b7227478 559 for (Int_t i = 0; i < decCh.multiplicity(); i++) {
948d10f4 560 br += decCh.bRatio();
561 }
562 }
563 return (br);
564}
565
566
948d10f4 567Float_t AliDecayerPythia8::GetLifetime(Int_t kf)
568{
569 // Return lifetime of particle
570 Pythia8::Pythia* thePythia = TPythia8::Instance()->Pythia8();
571 Pythia8::ParticleDataTable table = thePythia->particleData;
572 Float_t tau = table.tau0(kf);
573 return ( tau);
574}
575
576void AliDecayerPythia8::SwitchOffHeavyFlavour()
577{
578 // Switch off heavy flavour production
579 //
580// Maximum number of quark flavours used in pdf
581 TPythia8::Instance()->ReadString("PDFinProcess:nQuarkIn = 3");
582// Maximum number of flavors that can be used in showers
583 TPythia8::Instance()->ReadString("SpaceShower:nQuarkIn = 3");
584 TPythia8::Instance()->ReadString("TimeShower:nGammaToQuark = 3");
585 TPythia8::Instance()->ReadString("TimeShower:nGluonToQuark = 3");
586}
587
588
589void AliDecayerPythia8::ForceHadronicD(Int_t optUse4Bodies)
590{
591//
592// Force golden D decay modes
593//
ad720100 594 // K* -> K pi
b7227478 595 TPythia8::Instance()->ReadString("313:onMode = off");
596 TPythia8::Instance()->ReadString("313:onIfAll = 321 211");
948d10f4 597 // for Ds -> Phi pi+
b7227478 598 TPythia8::Instance()->ReadString("333:onMode = off");
599 TPythia8::Instance()->ReadString("333:onIfAll = 321 321");
948d10f4 600 // for D0 -> rho0 pi+ k-
b7227478 601 TPythia8::Instance()->ReadString("113:onMode = off");
602 TPythia8::Instance()->ReadString("113:onIfAll = 211 211");
948d10f4 603 // for Lambda_c -> Delta++ K-
b7227478 604 TPythia8::Instance()->ReadString("2224:onMode = off");
605 TPythia8::Instance()->ReadString("2224:onIfAll = 2212 211");
948d10f4 606
607
b7227478 608 TPythia8::Instance()->ReadString("411:onMode = off");
609 TPythia8::Instance()->ReadString("421:onMode = off");
610 TPythia8::Instance()->ReadString("431:onMode = off");
611 TPythia8::Instance()->ReadString("4112:onMode = off");
612 TPythia8::Instance()->ReadString("4122:onMode = off");
613
ad720100 614 // D+/- -> K pi pi
b7227478 615 TPythia8::Instance()->ReadString("411:onIfMatch = 321 211 211");
ad720100 616 // D+/- -> K K* pi
b7227478 617 TPythia8::Instance()->ReadString("411:onIfMatch = 313 211");
ad720100 618 // D+/- -> K pi
b7227478 619 TPythia8::Instance()->ReadString("421:onIfMatch = 321 211");
ad720100 620
b7227478 621 if (optUse4Bodies) {
ad720100 622 // D0 -> K pi pi pi
b7227478 623 TPythia8::Instance()->ReadString("421:onIfMatch = 321 211 211 211");
ad720100 624 // D0 -> K pi rho
b7227478 625 TPythia8::Instance()->ReadString("421:onIfMatch = 321 211 113");
626 }
948d10f4 627
ad720100 628 // D_s -> K K*
b7227478 629 TPythia8::Instance()->ReadString("431:onIfMatch = 321 313");
ad720100 630 // D_s -> Phi pi
b7227478 631 TPythia8::Instance()->ReadString("431:onIfMatch = 333 211");
b7227478 632
ad720100 633 // Lambda_c -> p K*
b7227478 634 TPythia8::Instance()->ReadString("4122:onIfMatch = 2212 313");
ad720100 635 // Lambda_c -> Delta K
b7227478 636 TPythia8::Instance()->ReadString("4122:onIfMatch = 2224 321");
ad720100 637 // Lambda_c -> p K pi
b7227478 638 TPythia8::Instance()->ReadString("4122:onIfMatch = 2212 321 211");
639
948d10f4 640}
641