10 #include "Pythia8/Pythia.h"
12 using namespace Pythia8;
26 Event&
event = pythia.event;
29 pythia.settings.parm(
"Beams:eCM", eCM);
33 pythia.readString(
"SUSY:gg2squarkantisquark = on");
34 pythia.readString(
"SUSY:idA = 1000006");
35 pythia.readString(
"SUSY:idB = 1000006");
39 }
else if (nGluino == 1) {
40 pythia.readString(
"SUSY:qg2squarkgluino = on");
41 pythia.readString(
"SUSY:idA = 1000002");
42 pythia.readString(
"RHadrons:idStop = 1000002");
43 pythia.readString(
"SUSY:idB = 1000021");
46 pythia.readString(
"SUSY:gg2gluinogluino = on");
51 pythia.readString(
"SLHA:file = sps1aNarrowStopGluino.spc");
56 pythia.readString(
"Rhadrons:allow = on");
60 pythia.readString(
"RHadrons:allowDecay = off");
63 pythia.readString(
"RHadrons:probGluinoball = 0.1");
74 pythia.readString(
"1000002:tau0 = 200.");
75 pythia.readString(
"1000006:tau0 = 250.");
76 pythia.readString(
"1000021:tau0 = 300.");
79 pythia.readString(
"Check:nErrList = 2");
84 pythia.readString(
"Init:showChangedSettings = on");
85 pythia.readString(
"Init:showChangedParticleData = off");
86 pythia.readString(
"Next:numberShowInfo = 1");
87 pythia.readString(
"Next:numberShowProcess = 1");
88 pythia.readString(
"Next:numberShowEvent = 0");
89 pythia.readString(
"Next:showScaleAndVertex = on");
95 Hist nChargedH(
"charged multiplicity", 100, -0.5, 799.5);
96 Hist dndyChargedH(
"dn/dy charged", 100, -10., 10.);
97 Hist dndyRH(
"dn/dy R-hadrons", 100, -5., 5.);
98 Hist pTRH(
"pT R-hadrons", 100, 0., 1000.);
99 Hist xRH(
"p_RHadron / p_sparticle", 100, 0.9, 1.1);
100 Hist mDiff(
"m(Rhadron) - m(sparticle)", 100, 0., 5.);
101 Hist decVtx(
"R-hadron decay vertex (mm from origin)", 100, 0., 1000.);
104 map<int, int> flavours;
108 for (
int iEvent = 0; iEvent < nEvent; ++iEvent) {
111 if (!pythia.next()) {
112 if (++iAbort < nAbort)
continue;
113 cout <<
" Event generation aborted prematurely, owing to error!\n";
121 for (
int i = 0; i <
event.size(); ++i) {
122 if (event[i].isFinal()) {
123 pSum +=
event[i].p();
124 if (event[i].isCharged()) {
126 dndyChargedH.fill( event[i].y() );
130 nChargedH.fill( nCharged );
133 for (
int i = 0; i <
event.size(); ++i) {
134 int idAbs =
event[i].idAbs();
135 if (idAbs > 1000100 && idAbs < 2000000 && idAbs != 1009002) {
136 ++flavours[
event[i].id() ];
137 dndyRH.fill( event[i].y() );
138 pTRH.fill( event[i].pT() );
141 while( event[iMother].statusAbs() > 100)
142 iMother =
event[iMother].mother1();
143 double xFrac =
event[i].pAbs() /
event[iMother].pAbs();
145 double mShift =
event[i].m() -
event[iMother].m();
146 mDiff.fill( mShift );
150 double dist =
event[i].vDec().pAbs();
159 double eLossAvg = 1.;
161 do { eLoss = eLossAvg * pythia.rndm.exp(); }
162 while (eLoss > 0.5 * (event[i].e() - event[i].m()));
163 double eNew =
event[i].e() - eLoss;
164 Vec4 pNew =
event[i].p() * sqrt( pow2(eNew) - pow2(event[i].m()) )
183 pythia.forceRHadronDecays();
184 if (iEvent < nList) pythia.event.list(
true);
191 cout <<
"\n Composition of produced R-hadrons \n code "
192 <<
"name times " << endl;
193 for (map<int, int>::iterator flavNow = flavours.begin();
194 flavNow != flavours.end(); ++flavNow) cout << setw(8)
195 << flavNow->first << setw(16) << pythia.particleData.name(flavNow->first)
196 << setw(8) << flavNow->second << endl;
197 cout << nChargedH << dndyChargedH << dndyRH << pTRH << xRH << mDiff