16 #include "Pythia8/Pythia.h"
18 using namespace Pythia8;
32 virtual double sigmaHat() {
return 1.;}
35 virtual void setIdColAcol() {setId( -11, 11, 999999);
36 setColAcol( 0, 0, 0, 0, 0, 0);}
39 virtual string name()
const {
return "GenericResonance";}
40 virtual int code()
const {
return 9001;}
41 virtual string inFlux()
const {
return "ffbarSame";}
56 pythia.setSigmaPtr( sigma1GenRes);
59 pythia.readFile(
"main07.cmnd");
65 int nEvent = pythia.mode(
"Main:numberOfEvents");
66 int nAbort = pythia.mode(
"Main:timesAllowErrors");
69 Hist eGamma(
"energy spectrum of photons", 100, 0., 250.);
70 Hist eE(
"energy spectrum of e+ and e-", 100, 0., 250.);
71 Hist eP(
"energy spectrum of p and pbar", 100, 0., 250.);
72 Hist eNu(
"energy spectrum of neutrinos", 100, 0., 250.);
73 Hist eRest(
"energy spectrum of rest particles", 100, 0., 250.);
77 for (
int iEvent = 0; iEvent < nEvent; ++iEvent) {
81 if (++iAbort < nAbort)
continue;
82 cout <<
" Event generation aborted prematurely, owing to error!\n";
87 for (
int i = 0; i < pythia.event.size(); ++i)
88 if (pythia.event[i].isFinal()) {
89 int idAbs = pythia.event[i].idAbs();
90 double eI = pythia.event[i].e();
91 if (idAbs == 22) eGamma.fill(eI);
92 else if (idAbs == 11) eE.fill(eI);
93 else if (idAbs == 2212) eP.fill(eI);
94 else if (idAbs == 12 || idAbs == 14 || idAbs == 16) eNu.fill(eI);
97 cout <<
" Error: stable id = " << pythia.event[i].id() << endl;
106 cout << eGamma << eE << eP << eNu << eRest;