FairRoot/PandaRoot
macro/examples/kfparticle/D0Star/DecayConfig.C
Go to the documentation of this file.
1 int DecayConfig() {
2 
4 
5  int index[4] = {48, 49, 50, 63};
6 
7  for(Int_t iIndex = 0; iIndex<4; iIndex++)
8  {
9  iParticle = index[iIndex];
10  Double_t lifetime = eff.partLifeTime[iParticle]; // lifetime
11  Double_t mass = eff.partMass[iParticle];
12  Int_t PDG = eff.partPDG[iParticle];
13  Double_t charge = eff.partCharge[iParticle];
14 
15  std::cout << "Particle pdg: " << PDG << " mass " << mass << " charge " << charge << " lifetime "<< lifetime << std::endl;
16  TPythia6Decayer* decayer = TPythia6Decayer::Instance();
17 
18  decayer->SetDecayTableFile("/u/mzyzak/panda_06.2014/macro/kf/D0/PythiaDecayTable.txt");
19  decayer->ReadDecayTable();
20 
21  decayer->SetForceDecay(TPythia6Decayer::kAll);
22  Int_t products[4] = {0};
23  Int_t mult[4] = {0};
24  Int_t npart=eff.GetNDaughters(iParticle);
25 
26  for(int iD=0; iD<npart; iD++)
27  {
28  products[iD] = eff.GetDaughterPDG(iParticle, iD);
29  mult[iD] = 1;
30  }
31  decayer->ForceParticleDecay(PDG,products,mult,npart);
32 
33  gMC->SetExternalDecayer(decayer);
34 
35  TPythia6& pythia6 = *(TPythia6::Instance());
36 // pythia6.Pyupda(1,6);
37  gMC->SetUserDecay(PDG);
38  pythia6.SetMDCY(pythia6.Pycomp(PDG),1,1);
39  }
40  //make pi0 stable for pythia, Geant will decay it
41  pythia6.SetMDCY(pythia6.Pycomp(111),1,0);
42  return 0;
43 }
44 
45 
Double_t
void DecayConfig()
Double_t mult
int partPDG[nParticles]