FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DecayConfig.C
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 void DecayConfig()
10 {
11 
12  // This script uses the external decayer TPythia6Decayer in place of the
13  // concrete Monte Carlo native decay mechanisms only for the
14  // specific types of decays defined below.
15 
16  // Access the external decayer singleton and initialize it
17  TPythia6Decayer* decayer = TPythia6Decayer::Instance();
18  // The following just tells pythia6 to not decay particles only to
19  // certain channels.
20 
21  decayer->SetForceDecay(TPythia6Decayer::kAll);
22  // example: Force the J/PSI decay channel e+e-
23  // Int_t products[2];
24  // Int_t mult[2];
25  // Int_t npart=2;
26 
27  // decay products
28  // products[0]=11;
29  // products[1]=-11;
30  // multiplicity
31  // mult[0]=1;
32  // mult[1]=1;
33  // force the decay channel
34  // decayer->ForceParticleDecay(443,products,mult,npart);
35 
36  decayer->Init();
37 
38  // Tell the concrete monte carlo to use the external decayer. The
39  // external decayer will be used for:
40  // i)particle decays not defined in concrete monte carlo, or
41  // ii)particles for which the concrete monte carlo is told
42  // to use the external decayer for its type via:
43  // gMC->SetUserDecay(pdgId);
44  // If this is invoked, the external decayer will be used for particles
45  // of type pdgId even if the concrete monte carlo has a decay mode
46  // already defined for that particle type.
47  gMC->SetExternalDecayer(decayer);
48 
49  TPythia6& pythia6 = *(TPythia6::Instance());
50 
51  // The pythia6 decayer is used in place of the concrete Monte Carlo
52  // decay for the particles type mu+/-,pi+/-, K+/-, K0L in order to preserve
53  // the decay product neutrino flavor, which is otherwise not preserved in
54  // Geant3 decays.
55  const Int_t npartnf = 9;
56  // mu-,mu+,pi+,pi-,K+,K-,K0L, Xi-
57  Int_t pdgnf[npartnf] = {13, -13, 211, -211, 321, -321, 130, 3312, 443};
58  for (Int_t ipartnf = 0; ipartnf < npartnf; ipartnf++) {
59  Int_t ipdg = pdgnf[ipartnf];
60 
61  if (TString(gMC->GetName()) == "TGeant3")
62  gMC->SetUserDecay(ipdg); // Force the decay to be done w/external decayer
63 
64  pythia6.SetMDCY(pythia6.Pycomp(ipdg), 1, 1); // Activate decay in pythia
65  }
66 
67  // The following will print the decay modes
68  pythia6.Pyupda(1, 6);
69 
70  // rho0 (113), rho+ (213), rho- (-213) and
71  // D+(411) ,D-(-411),D0(421),D0bar(-421) have decay modes defined in
72  // TGeant3::DefineParticles, but for these particles
73  // those decay modes are overridden to make use of pythia6.
74  const Int_t nparthq = 3;
75  // rho0,rho+,rho-,D+,D-,D0,D0bar
76  // Int_t pdghq[nparthq] = {113,213,-213,411,-411,421,-421};
77  Int_t pdghq[nparthq] = {421, 3122, -3122};
78  for (Int_t iparthq = 0; iparthq < nparthq; iparthq++) {
79  Int_t ipdg = pdghq[iparthq];
80  if (TString(gMC->GetName()) == "TGeant3")
81  gMC->SetUserDecay(ipdg); // Force the decay to be done w/external decayer
82  pythia6.SetMDCY(pythia6.Pycomp(ipdg), 1, 1); // Activate decay in pythia
83  }
84  // Set pi0 to be stable in pythia6 so that Geant3 can handle decay.
85  // In general, TGeant3 is set up through TGeant3gu::gudcay to pass
86  // all pythia6 decay products back to the G3 transport mechanism if they
87  // have a lifetime > 1.E-15 sec for further transport.
88  // Since the pi0 lifetime is less than this, if pi0 is produced as a decay
89  // product in pythia6, e.g. KL0 -> pi0 pi+ pi-, the pi0 will be immediately
90  // decayed by pythia6 to 2 gammas, and the KL0 decay product list passed
91  // back to the transport mechanism will be "gamma gamma pi+ pi-", i.e.
92  // the pi0 will not be visible in the list of secondaries passed back to
93  // the transport mechanism and will not be pushed to the stack for possible
94  // storage to the stdhep output array.
95  // To avoid this, the pi0 is set to stable in pythia6, and its decay
96  // will be handled by Geant3.
97  // pythia6.SetMDCY(pythia6.Pycomp(111),1,0);
98  //}
99 }
void DecayConfig()
Definition: DecayConfig.C:8