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