24 cout <<
" --- New Particle --- "<<endl;
25 cout <<
"status: "<<status<<
" pdg_id: "<<pdg_id<<
" parent: "
26 <<parent<<
" fChild: "<<firstChild<<
" lChild: "<<lastChild<<endl;
27 cout <<
"px: "<<momentum[0]<<
" py: "<<momentum[1]<<
" pz: "<<momentum[2]<<
" e: "
28 <<momentum[3]<<
" mass: "<<mass<<endl;
30 <<
vertex[3]<<
" tau: "<<lifetime<<endl;
35 void PythiaTest(
int nEvents=1)
37 gSystem->Load(
"$PYTHIA/libPythia6.so");
38 gSystem->Load(
"libEG");
39 gSystem->Load(
"libEGPythia6.so");
41 TPythia6* p6 =
new TPythia6();
47 p6->SetPARJ(50+4, -0.07);
48 p6->SetPARJ(50+5, -0.006);
49 p6->SetPARJ(50+5, -0.000001);
50 p6->SetPMAS(6, 1, 174.3);
51 p6->SetPMAS(25, 1, 120.0);
57 p6->SetPARP(82, 2.41);
58 p6->SetMRPY(1, 88158204);
61 p6->SetMDCY(24, 1, 1);
62 p6->SetMDCY(25, 1, 1);
65 int startdecay = p6->GetMDCY(24, 2);
66 int enddecay = p6->GetMDCY(24, 2) + p6->GetMDCY(24, 3);
67 for ( i=startdecay; i<enddecay; i++ ) p6->SetMDME(i, 1, 0);
71 startdecay = p6->GetMDCY(25, 2);
72 enddecay = p6->GetMDCY(25, 2) + p6->GetMDCY(25, 3);
73 for ( i=startdecay; i<enddecay; i++ ) p6->SetMDME(i, 1, 0);
77 p6->SetMDME(206, 1, 1);
78 p6->SetMDME(207, 1, 1);
79 p6->SetMDME(208, 1, 1);
83 p6->SetMDME(214, 1, 1);
87 p6->Initialize(
"CMS",
"p",
"pbar", 2000.0);
89 for ( i=0; i<nEvents; i++ ) {
91 if ( i%10 == 0 ) cout <<
"Event No.: " << i << endl;
95 Pyjets_t* pythiaParticle = p6->GetPyjets();
97 Int_t nParticle = p6->GetN();
99 for (
int i=0;i<nParticle;i++) {
101 memset(&particle,0,
sizeof(particle));
103 particle.momentum[0] = pythiaParticle->P[0][i];
104 particle.momentum[1] = pythiaParticle->P[1][i];
105 particle.momentum[2] = pythiaParticle->P[2][i];
106 particle.momentum[3] = pythiaParticle->P[3][i];
107 particle.mass = pythiaParticle->P[4][i];
109 particle.status = pythiaParticle->K[0][i];
110 particle.pdg_id = pythiaParticle->K[1][i];
111 particle.parent = pythiaParticle->K[2][i];
112 particle.firstChild = pythiaParticle->K[3][i];
113 particle.lastChild = pythiaParticle->K[4][i];
115 particle.vertex[0] = pythiaParticle->V[0][i];
116 particle.vertex[1] = pythiaParticle->V[1][i];
117 particle.vertex[2] = pythiaParticle->V[2][i];
118 particle.vertex[3] = pythiaParticle->V[3][i];
120 particle.lifetime = pythiaParticle->V[4][i];