12 using namespace Pythia8;
18 Event&
event = pythia.event;
21 pythia.readFile(
"main24.cmnd");
24 int nEvent = pythia.mode(
"Main:numberOfEvents");
25 int nAbort = pythia.mode(
"Main:timesAllowErrors");
26 double eCM = pythia.parm(
"Beams:eCM");
32 double epTol = 1e-6 * eCM;
33 Hist epCons(
"deviation from energy-momentum conservation",100,0.,epTol);
34 Hist nFinal(
"final particle multiplicity",100,-0.5,799.5);
35 Hist dnparticledy(
"dn/dy for particles",100,-10.,10.);
39 for (
int iEvent = 0; iEvent < nEvent; ++iEvent) {
43 if (++iAbort < nAbort)
continue;
44 cout <<
" Event generation aborted prematurely, owing to error!\n";
51 for (
int i = 0; i <
event.size(); ++i)
if (event[i].isFinal()) {
54 dnparticledy.fill(event[i].y());
59 double epDev = abs(pSum.e() - eCM) + abs(pSum.px()) + abs(pSum.py())
63 cout <<
" Warning! Event with epDev = " << scientific
64 << setprecision(4) << epDev <<
" now listed:";
73 cout << epCons << nFinal << dnparticledy;