DecayConfig.C 3.7 KB

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