FairRoot/PandaRoot
Functions
gconfig/DecayConfig.C File Reference

Go to the source code of this file.

Functions

void DecayConfig ()
 

Function Documentation

void DecayConfig ( )

Definition at line 1 of file gconfig/DecayConfig.C.

References TString.

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