23 using namespace Pythia8;
29 int poisson(
double nAvg,
Rndm& rndm) {
35 double rPoisson = rndm.flat() * exp(nAvg);
42 for (
int i = 0; i < NMAX; ) {
44 if (rSum > rPoisson)
return i;
66 double nPileupAvg = 2.5;
69 double nBeamAGasAvg = 0.5;
70 double nBeamBGasAvg = 0.5;
82 pythiaSignal.readString(
"Next:numberShowInfo = 0");
83 pythiaSignal.readString(
"Next:numberShowProcess = 0");
84 pythiaSignal.readString(
"Next:numberShowEvent = 0");
85 pythiaPileup.readString(
"Next:numberShowInfo = 0");
86 pythiaPileup.readString(
"Next:numberShowProcess = 0");
87 pythiaPileup.readString(
"Next:numberShowEvent = 0");
88 pythiaBeamAGas.readString(
"Next:numberShowInfo = 0");
89 pythiaBeamAGas.readString(
"Next:numberShowProcess = 0");
90 pythiaBeamAGas.readString(
"Next:numberShowEvent = 0");
91 pythiaBeamBGas.readString(
"Next:numberShowInfo = 0");
92 pythiaBeamBGas.readString(
"Next:numberShowProcess = 0");
93 pythiaBeamBGas.readString(
"Next:numberShowEvent = 0");
96 pythiaSignal.readString(
"HardQCD:all = on");
97 pythiaSignal.readString(
"PhaseSpace:pTHatMin = 50.");
98 pythiaSignal.settings.parm(
"Beams:eCM", 2. * eBeam);
102 pythiaPileup.readString(
"Random:setSeed = on");
103 pythiaPileup.readString(
"Random:seed = 10000002");
104 pythiaPileup.readString(
"SoftQCD:all = on");
105 pythiaPileup.settings.parm(
"Beams:eCM", 2. * eBeam);
109 pythiaBeamAGas.readString(
"Random:setSeed = on");
110 pythiaBeamAGas.readString(
"Random:seed = 10000003");
111 pythiaBeamAGas.readString(
"SoftQCD:all = on");
112 pythiaBeamAGas.readString(
"Beams:frameType = 2");
113 pythiaBeamAGas.settings.parm(
"Beams:eA", eBeam);
114 pythiaBeamAGas.settings.parm(
"Beams:eB", 0.);
115 pythiaBeamAGas.init();
118 pythiaBeamBGas.readString(
"Random:setSeed = on");
119 pythiaBeamBGas.readString(
"Random:seed = 10000004");
120 pythiaBeamBGas.readString(
"SoftQCD:all = on");
121 pythiaBeamBGas.readString(
"Beams:frameType = 2");
122 pythiaBeamBGas.settings.parm(
"Beams:eA", 0.);
123 pythiaBeamBGas.settings.parm(
"Beams:eB", eBeam);
124 pythiaBeamBGas.init();
127 Hist nPileH(
"number of pileup events per signal event", 100, -0.5, 99.5);
128 Hist nAGH(
"number of beam A + gas events per signal event", 100, -0.5, 99.5);
129 Hist nBGH(
"number of beam B + gas events per signal event", 100, -0.5, 99.5);
130 Hist nChgH(
"number of charged multiplicity",100, -0.5, 1999.5);
131 Hist sumPZH(
"total pZ of system",100, -100000., 100000.);
134 for (
int iEvent = 0; iEvent < nEvent; ++iEvent) {
137 if (!pythiaSignal.next())
continue;
138 sumEvent = pythiaSignal.event;
141 int nPileup = poisson(nPileupAvg, pythiaPileup.rndm);
142 nPileH.fill( nPileup );
145 for (
int iPileup = 0; iPileup < nPileup; ++iPileup) {
147 sumEvent += pythiaPileup.event;
151 int nBeamAGas = poisson(nBeamAGasAvg, pythiaBeamAGas.rndm);
152 nAGH.fill( nBeamAGas );
155 for (
int iAG = 0; iAG < nBeamAGas; ++iAG) {
156 pythiaBeamAGas.next();
157 sumEvent += pythiaBeamAGas.event;
161 int nBeamBGas = poisson(nBeamBGasAvg, pythiaBeamBGas.rndm);
162 nBGH.fill( nBeamBGas );
165 for (
int iBG = 0; iBG < nBeamBGas; ++iBG) {
166 pythiaBeamBGas.next();
167 sumEvent += pythiaBeamBGas.event;
172 pythiaSignal.info.list();
173 pythiaSignal.process.list();
179 for (
int i = 0; i < sumEvent.size(); ++i)
180 if (sumEvent[i].isFinal() && sumEvent[i].isCharged()) ++nChg;
184 sumPZH.fill( sumEvent[0].pz() );
192 pythiaBeamAGas.stat();
193 pythiaBeamBGas.stat();
194 cout << nPileH << nAGH << nBGH << nChgH << sumPZH;