16 using namespace Pythia8;
30 virtual double sigmaHat() {
return 1.;}
33 virtual void setIdColAcol() {setId( -11, 11, 999999);
34 setColAcol( 0, 0, 0, 0, 0, 0);}
37 virtual string name()
const {
return "GenericResonance";}
38 virtual int code()
const {
return 9001;}
39 virtual string inFlux()
const {
return "ffbarSame";}
54 pythia.setSigmaPtr( sigma1GenRes);
57 pythia.readFile(
"main07.cmnd");
63 int nEvent = pythia.mode(
"Main:numberOfEvents");
64 int nAbort = pythia.mode(
"Main:timesAllowErrors");
67 Hist eGamma(
"energy spectrum of photons", 100, 0., 250.);
68 Hist eE(
"energy spectrum of e+ and e-", 100, 0., 250.);
69 Hist eP(
"energy spectrum of p and pbar", 100, 0., 250.);
70 Hist eNu(
"energy spectrum of neutrinos", 100, 0., 250.);
71 Hist eRest(
"energy spectrum of rest particles", 100, 0., 250.);
75 for (
int iEvent = 0; iEvent < nEvent; ++iEvent) {
79 if (++iAbort < nAbort)
continue;
80 cout <<
" Event generation aborted prematurely, owing to error!\n";
85 for (
int i = 0; i < pythia.event.size(); ++i)
86 if (pythia.event[i].isFinal()) {
87 int idAbs = pythia.event[i].idAbs();
88 double eI = pythia.event[i].e();
89 if (idAbs == 22) eGamma.fill(eI);
90 else if (idAbs == 11) eE.fill(eI);
91 else if (idAbs == 2212) eP.fill(eI);
92 else if (idAbs == 12 || idAbs == 14 || idAbs == 16) eNu.fill(eI);
95 cout <<
" Error: stable id = " << pythia.event[i].id() << endl;
104 cout << eGamma << eE << eP << eNu << eRest;