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