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