14 |
|
using namespace Pythia8; |
15 |
|
|
16 |
|
#include "UltraFastSim.h" |
17 |
+ |
#include "UFSDataStore.h" |
18 |
+ |
|
19 |
+ |
int poisson(double mean, Rndm *rndmPtr) { |
20 |
+ |
static double oldMean = -1; |
21 |
+ |
static double g; |
22 |
+ |
if(mean != oldMean) { |
23 |
+ |
oldMean = mean; |
24 |
+ |
if(mean == 0) { |
25 |
+ |
g = 0; |
26 |
+ |
} |
27 |
+ |
else { |
28 |
+ |
g = exp(-mean); |
29 |
+ |
} |
30 |
+ |
} |
31 |
+ |
double em = -1; |
32 |
+ |
double t = 1; |
33 |
+ |
do { |
34 |
+ |
em++; |
35 |
+ |
t *= rndmPtr->flat(); |
36 |
+ |
} while(t > g); |
37 |
+ |
return em; |
38 |
+ |
} |
39 |
|
|
40 |
|
int main(int argc, char **argv) { |
41 |
|
// Generator. Process selection. LHC initialization. Histogram. |
43 |
|
int nEvents = 0; |
44 |
|
int runNumber = 0; |
45 |
|
int meanPileupEventCount = 0; |
46 |
< |
if(argc < 3 || argc > 5) |
46 |
> |
float cmEnergy = 14000.; |
47 |
> |
bool cutOnMET = false; |
48 |
> |
if(argc < 3 || argc > 6) |
49 |
|
{ |
50 |
< |
cerr << "Command syntax: " << argv[0] << " BBA[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl; |
51 |
< |
cerr << "or " << argv[0] << " ZLL[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl; |
52 |
< |
cerr << "or " << argv[0] << " TLN[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl; |
53 |
< |
cerr << "or " << argv[0] << " WLN[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl; |
50 |
> |
cerr << "Command syntax: " << argv[0] << " ZHmmbb[...]" << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
51 |
> |
cerr << "or " << argv[0] << " ZHeebb[...]" << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
52 |
> |
cerr << "or " << argv[0] << " ZHmmXX[...]" << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
53 |
> |
cerr << "or " << argv[0] << " ZHeeXX[...]" << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
54 |
> |
cerr << "or " << argv[0] << " ZZmmbb[...]" << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
55 |
> |
cerr << "or " << argv[0] << " ZZmmnn[...]" << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
56 |
> |
cerr << "or " << argv[0] << " ZZeebb[...]" << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
57 |
> |
cerr << "or " << argv[0] << " ZZeenn[...]" << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
58 |
> |
cerr << "or " << argv[0] << " BBHmh[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
59 |
> |
cerr << "or " << argv[0] << " BBAmh[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
60 |
> |
cerr << "or " << argv[0] << " VBFHXX[..] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
61 |
> |
cerr << "or " << argv[0] << " Zee[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
62 |
> |
cerr << "or " << argv[0] << " Zmm[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
63 |
> |
cerr << "or " << argv[0] << " Zeh[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
64 |
> |
cerr << "or " << argv[0] << " Zmh[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
65 |
> |
cerr << "or " << argv[0] << " Zhh[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
66 |
> |
cerr << "or " << argv[0] << " Znn[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
67 |
> |
cerr << "or " << argv[0] << " Wen[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
68 |
> |
cerr << "or " << argv[0] << " Wmn[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
69 |
> |
cerr << "or " << argv[0] << " Ten[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
70 |
> |
cerr << "or " << argv[0] << " Tmn[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
71 |
> |
cerr << "or " << argv[0] << " QCD[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
72 |
> |
cerr << "or " << argv[0] << " QED[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
73 |
> |
cerr << "or " << argv[0] << " EWK[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
74 |
> |
cerr << "or " << argv[0] << " Top[...] " << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
75 |
> |
cerr << "or " << argv[0] << " QCDMET[...]" << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
76 |
> |
cerr << "or " << argv[0] << " ZnnMET[...]" << " <nEvents> [RandomSeed] [meanPileupEventcount] [cmEnergy]" << endl; |
77 |
> |
cerr << "In above e-electron, m-muon, h-hadronic tau. n-neutrino" << endl; |
78 |
> |
cerr << "QCD, QED, EWK and Top do not specify the decays -- they are useful for generic BG production" << endl; |
79 |
> |
cerr << "QCDMET has MET > 50 GeV to make efficient to study QCD MET BG" << endl; |
80 |
> |
cerr << "ZnnMET has MET > 50 GeV to make efficient to study Znn MET BG" << endl; |
81 |
|
exit(1); |
82 |
|
} |
83 |
|
else { |
84 |
|
nEvents = atoi(argv[2]); |
85 |
|
if(argc >= 4) runNumber = atoi(argv[3]); |
86 |
|
if(argc >= 5) meanPileupEventCount = atoi(argv[4]); |
87 |
< |
if(strncmp(argv[1], "ZLL", 3) == 0) |
87 |
> |
if(argc >= 6) cmEnergy = atof(argv[5]); |
88 |
> |
if(strncmp(argv[1], "Zee", 3) == 0) |
89 |
> |
{ |
90 |
> |
pythia.readString("WeakSingleBoson:ffbar2gmZ = on"); |
91 |
> |
pythia.readString("PhaseSpace:mHatMin = 60."); |
92 |
> |
pythia.readString("PhaseSpace:mHatMax = -1"); |
93 |
> |
pythia.readString("23:onMode = 0"); // Z decays to electrons only |
94 |
> |
pythia.readString("23:onIfAny = 11"); |
95 |
> |
} |
96 |
> |
else if(strncmp(argv[1], "Zmm", 3) == 0) |
97 |
|
{ |
98 |
|
pythia.readString("WeakSingleBoson:ffbar2gmZ = on"); |
99 |
|
pythia.readString("PhaseSpace:mHatMin = 60."); |
100 |
|
pythia.readString("PhaseSpace:mHatMax = -1"); |
101 |
< |
pythia.readString("23:onMode = 0"); // Z decays to leptons only |
102 |
< |
pythia.readString("23:onIfAny = 11 13 15"); |
103 |
< |
pythia.readString("15:onMode = 2"); // tau- decays to electrons and muons - second tau decays in all modes |
104 |
< |
pythia.readString("15:onIfAny = 11 13"); |
101 |
> |
pythia.readString("23:onMode = 0"); // Z decays to muons only |
102 |
> |
pythia.readString("23:onIfAny = 13"); |
103 |
> |
} |
104 |
> |
else if(strncmp(argv[1], "Znn", 3) == 0) |
105 |
> |
{ |
106 |
> |
pythia.readString("WeakSingleBoson:ffbar2gmZ = on"); |
107 |
> |
pythia.readString("PhaseSpace:mHatMin = 60."); |
108 |
> |
pythia.readString("PhaseSpace:mHatMax = -1"); |
109 |
> |
pythia.readString("23:onMode = 0"); // Z decays to neutrinos only |
110 |
> |
pythia.readString("23:onIfAny = 12, 14, 16"); |
111 |
> |
if(strncmp(argv[1], "ZnnMET", 6) == 0) { |
112 |
> |
cutOnMET = true; |
113 |
> |
} |
114 |
|
} |
115 |
< |
else if(strncmp(argv[1], "WLN", 3) == 0) |
115 |
> |
else if(strncmp(argv[1], "Zeh", 3) == 0) |
116 |
> |
{ |
117 |
> |
pythia.readString("WeakSingleBoson:ffbar2gmZ = on"); |
118 |
> |
pythia.readString("PhaseSpace:mHatMin = 60."); |
119 |
> |
pythia.readString("PhaseSpace:mHatMax = -1"); |
120 |
> |
pythia.readString("23:onMode = 0"); // Z decays to taus only |
121 |
> |
pythia.readString("23:onIfAny = 15"); |
122 |
> |
pythia.readString("15:onMode = 2"); // tau- decays to electrons - second tau decays in all modes |
123 |
> |
pythia.readString("15:onIfAny = 11"); |
124 |
> |
} |
125 |
> |
else if(strncmp(argv[1], "Zmh", 3) == 0) |
126 |
> |
{ |
127 |
> |
pythia.readString("WeakSingleBoson:ffbar2gmZ = on"); |
128 |
> |
pythia.readString("PhaseSpace:mHatMin = 60."); |
129 |
> |
pythia.readString("PhaseSpace:mHatMax = -1"); |
130 |
> |
pythia.readString("23:onMode = 0"); // Z decays to taus only |
131 |
> |
pythia.readString("23:onIfAny = 15"); |
132 |
> |
pythia.readString("15:onMode = 2"); // tau- decays to muons - second tau decays in all modes |
133 |
> |
pythia.readString("15:onIfAny = 13"); |
134 |
> |
} |
135 |
> |
else if(strncmp(argv[1], "Zhh", 3) == 0) |
136 |
> |
{ |
137 |
> |
pythia.readString("WeakSingleBoson:ffbar2gmZ = on"); |
138 |
> |
pythia.readString("PhaseSpace:mHatMin = 60."); |
139 |
> |
pythia.readString("PhaseSpace:mHatMax = -1"); |
140 |
> |
pythia.readString("23:onMode = 0"); // Z decays to taus only |
141 |
> |
pythia.readString("23:onIfAny = 15"); |
142 |
> |
} |
143 |
> |
else if(strncmp(argv[1], "Wen", 3) == 0) |
144 |
|
{ |
145 |
|
pythia.readString("WeakSingleBoson:ffbar2W = on"); |
146 |
< |
pythia.readString("24:onMode = 0"); // W decays to light leptons only |
147 |
< |
pythia.readString("24:onIfAny = 11 13"); |
146 |
> |
pythia.readString("24:onMode = 0"); // W decays to electron |
147 |
> |
pythia.readString("24:onIfAny = 11"); |
148 |
|
} |
149 |
< |
else if(strncmp(argv[1], "TLN", 3) == 0) |
149 |
> |
else if(strncmp(argv[1], "Wmn", 3) == 0) |
150 |
> |
{ |
151 |
> |
pythia.readString("WeakSingleBoson:ffbar2W = on"); |
152 |
> |
pythia.readString("24:onMode = 0"); // W decays to muon |
153 |
> |
pythia.readString("24:onIfAny = 13"); |
154 |
> |
} |
155 |
> |
else if(strncmp(argv[1], "Ten", 3) == 0) |
156 |
|
{ |
157 |
|
pythia.readString("Top:all = on"); |
158 |
< |
pythia.readString("24:onMode = 2"); // W+ decays to light leptons only |
159 |
< |
pythia.readString("24:onIfAny = 11 13"); |
158 |
> |
pythia.readString("24:onMode = 2"); // W+ decays to electron |
159 |
> |
pythia.readString("24:onIfAny = 11"); |
160 |
|
} |
161 |
< |
else if(strncmp(argv[1], "BBA", 3) == 0) |
161 |
> |
else if(strncmp(argv[1], "Tmn", 3) == 0) |
162 |
|
{ |
163 |
< |
pythia.readString("Higgs:useBSM = on"); |
164 |
< |
pythia.readString("HiggsBSM:gg2A3bbbar = on"); |
165 |
< |
pythia.readString("36:onMode = 0"); // A0(H_3) decays only to tau-pairs |
63 |
< |
pythia.readString("36:onIfAny = 15"); |
163 |
> |
pythia.readString("Top:all = on"); |
164 |
> |
pythia.readString("24:onMode = 2"); // W+ decays to muon |
165 |
> |
pythia.readString("24:onIfAny = 13"); |
166 |
|
} |
167 |
< |
else |
167 |
> |
else if(strncmp(argv[1], "HZGamma", 7) == 0) |
168 |
|
{ |
169 |
< |
cerr << "Unknown process type " << argv[1] << " - aborting" << endl; |
170 |
< |
exit(1); |
169 |
> |
pythia.readString("HiggsSM:all = on"); |
170 |
> |
pythia.readString("25:m0 = 125"); |
171 |
> |
pythia.readString("25:onMode = 0"); // Higgs decays to Zgamma only |
172 |
> |
pythia.readString("25:onIfMatch = 22 23"); |
173 |
> |
pythia.readString("23:onMode = 0"); // Z decays to light leptons |
174 |
> |
pythia.readString("23:onIfAny = 11 13"); |
175 |
> |
} |
176 |
> |
else if(strncmp(argv[1], "ZHmmbb", 6) == 0) |
177 |
> |
{ |
178 |
> |
pythia.readString("HiggsSM:ffbar2HZ = on"); |
179 |
> |
pythia.readString("25:m0 = 125"); |
180 |
> |
pythia.readString("25:onMode = 0"); // Higgs decays to bbBar only |
181 |
> |
pythia.readString("25:onIfAny = 5"); |
182 |
> |
pythia.readString("23:onMode = 0"); // Z decays to mu+,mu- only (for trigger) |
183 |
> |
pythia.readString("23:onIfAny = 13"); |
184 |
> |
} |
185 |
> |
else if(strncmp(argv[1], "ZHmmXX", 6) == 0) |
186 |
> |
{ |
187 |
> |
pythia.readString("HiggsSM:ffbar2HZ = on"); |
188 |
> |
pythia.readString("25:m0 = 125"); |
189 |
> |
pythia.readString("25:mayDecay = false"); // Higgs does not decay -- becomes invisible |
190 |
> |
pythia.readString("25:isVisible = false"); |
191 |
> |
pythia.readString("23:onMode = 0"); // Z decays to mu+,mu- only (for trigger) |
192 |
> |
pythia.readString("23:onIfAny = 13"); |
193 |
> |
} |
194 |
> |
else if(strncmp(argv[1], "ZHeebb", 6) == 0) |
195 |
> |
{ |
196 |
> |
pythia.readString("HiggsSM:ffbar2HZ = on"); |
197 |
> |
pythia.readString("25:m0 = 125"); |
198 |
> |
pythia.readString("25:onMode = 0"); // Higgs decays to bbBar only |
199 |
> |
pythia.readString("25:onIfAny = 5"); |
200 |
> |
pythia.readString("23:onMode = 0"); // Z decays to e+,e- only (for trigger) |
201 |
> |
pythia.readString("23:onIfAny = 11"); |
202 |
> |
} |
203 |
> |
else if(strncmp(argv[1], "ZHeeXX", 6) == 0) |
204 |
> |
{ |
205 |
> |
pythia.readString("HiggsSM:ffbar2HZ = on"); |
206 |
> |
pythia.readString("25:m0 = 125"); |
207 |
> |
pythia.readString("25:mayDecay = false"); // Higgs does not decay -- becomes invisible |
208 |
> |
pythia.readString("25:isVisible = false"); |
209 |
> |
pythia.readString("23:onMode = 0"); // Z decays to mu+,mu- only (for trigger) |
210 |
> |
pythia.readString("23:onIfAny = 11"); |
211 |
> |
} |
212 |
> |
else if(strncmp(argv[1], "BB", 2) == 0) |
213 |
> |
{ |
214 |
> |
pythia.readString("Higgs:useBSM = on"); |
215 |
> |
pythia.readString("25:m0 = 129"); |
216 |
> |
pythia.readString("35:m0 = 499.7"); |
217 |
> |
pythia.readString("36:m0 = 500"); |
218 |
> |
pythia.readString("37:m0 = 506"); |
219 |
> |
pythia.readString("HiggsHchg:tanBeta = 30"); |
220 |
> |
if(strncmp(argv[1], "BBH", 3) == 0) { |
221 |
> |
pythia.readString("HiggsBSM:gg2H2bbbar = on"); |
222 |
> |
pythia.readString("35:onMode = 0"); // H2(H_2) decays only to tau-pairs |
223 |
> |
pythia.readString("35:onIfAny = 15"); |
224 |
> |
} |
225 |
> |
else { |
226 |
> |
pythia.readString("HiggsBSM:gg2A3bbbar = on"); |
227 |
> |
pythia.readString("36:onMode = 0"); // A0(H_3) decays only to tau-pairs |
228 |
> |
pythia.readString("36:onIfAny = 15"); |
229 |
> |
} |
230 |
> |
if(strncmp(argv[1], "BBHmh", 5) == 0 || |
231 |
> |
strncmp(argv[1], "BBAmh", 5) == 0) { |
232 |
> |
pythia.readString("15:onMode = 2"); // tau- decays to muons - second tau decays in all modes |
233 |
> |
pythia.readString("15:onIfAny = 13"); |
234 |
> |
} |
235 |
|
} |
236 |
+ |
else if(strncmp(argv[1], "ZZmmbb", 6) == 0) |
237 |
+ |
{ |
238 |
+ |
pythia.readString("WeakDoubleBoson:ffbar2gmZgmZ = on"); |
239 |
+ |
pythia.readString("23:onMode = 0"); |
240 |
+ |
pythia.readString("23:onIfAny = 5 13"); // Let the Z decay to bQuarks or muons |
241 |
+ |
} |
242 |
+ |
else if(strncmp(argv[1], "ZZmmnn", 6) == 0) |
243 |
+ |
{ |
244 |
+ |
pythia.readString("WeakDoubleBoson:ffbar2gmZgmZ = on"); |
245 |
+ |
pythia.readString("23:onMode = 0"); |
246 |
+ |
pythia.readString("23:onIfAny = 13 12 14 16"); // Let the Z decay to muons or neutrinos |
247 |
+ |
} |
248 |
+ |
else if(strncmp(argv[1], "ZZeebb", 6) == 0) |
249 |
+ |
{ |
250 |
+ |
pythia.readString("WeakDoubleBoson:ffbar2gmZgmZ = on"); |
251 |
+ |
pythia.readString("23:onMode = 0"); |
252 |
+ |
pythia.readString("23:onIfAny = 5 11"); // Let the Z decay to bQuarks or electrons |
253 |
+ |
} |
254 |
+ |
else if(strncmp(argv[1], "ZZeenn", 6) == 0) |
255 |
+ |
{ |
256 |
+ |
pythia.readString("WeakDoubleBoson:ffbar2gmZgmZ = on"); |
257 |
+ |
pythia.readString("23:onMode = 0"); |
258 |
+ |
pythia.readString("23:onIfAny = 11 12 14 16"); // Let the Z decay to electrons or neutrinos |
259 |
+ |
} |
260 |
+ |
else if(strncmp(argv[1], "QCD", 3) == 0) |
261 |
+ |
{ |
262 |
+ |
pythia.readString("HardQCD:all = on"); |
263 |
+ |
pythia.readString("PhaseSpace:pTHatMin = 50."); |
264 |
+ |
if(strncmp(argv[1], "QCDMET", 6) == 0) { |
265 |
+ |
cutOnMET = true; |
266 |
+ |
} |
267 |
+ |
} |
268 |
+ |
else if(strcmp(argv[1], "QED") == 0) |
269 |
+ |
{ |
270 |
+ |
pythia.readString("PromptPhoton:all = on"); |
271 |
+ |
pythia.readString("PhaseSpace:mHatMin = 60."); |
272 |
+ |
pythia.readString("PhaseSpace:mHatMax = -1"); |
273 |
+ |
} |
274 |
+ |
else if(strncmp(argv[1], "EWK", 3) == 0) |
275 |
+ |
{ |
276 |
+ |
pythia.readString("WeakSingleBoson:all = on"); |
277 |
+ |
pythia.readString("PhaseSpace:mHatMin = 60."); |
278 |
+ |
pythia.readString("PhaseSpace:mHatMax = -1"); |
279 |
+ |
pythia.readString("WeakDoubleBoson:all = on"); |
280 |
+ |
} |
281 |
+ |
else if(strncmp(argv[1], "Top", 3) == 0) |
282 |
+ |
{ |
283 |
+ |
pythia.readString("Top:all = on"); |
284 |
+ |
} |
285 |
+ |
else if(strncmp(argv[1], "VBFHXX", 6) == 0) |
286 |
+ |
{ |
287 |
+ |
pythia.readString("HiggsSM:ff2Hff(t:ZZ) = on"); |
288 |
+ |
pythia.readString("HiggsSM:ff2Hff(t:WW) = on"); |
289 |
+ |
pythia.readString("25:m0 = 125"); |
290 |
+ |
pythia.readString("25:mayDecay = false"); // Higgs does not decay -- becomes invisible |
291 |
+ |
pythia.readString("25:isVisible = false"); |
292 |
+ |
} |
293 |
+ |
else |
294 |
+ |
{ |
295 |
+ |
cerr << "Unknown process type " << argv[1] << " - aborting" << endl; |
296 |
+ |
exit(1); |
297 |
+ |
} |
298 |
|
} |
299 |
|
|
300 |
|
// Initialize pythia |
301 |
|
|
302 |
< |
pythia.init( 2212, 2212, 14000.); |
302 |
> |
pythia.init(2212, 2212, cmEnergy); |
303 |
|
pythia.particleData.listAll(); |
304 |
|
Rndm * rndmPtr = &pythia.rndm; |
305 |
|
rndmPtr->init(runNumber); |
313 |
|
|
314 |
|
// Ultra Fast Simulator |
315 |
|
|
316 |
< |
UltraFastSim ufs(rndmPtr); |
316 |
> |
UltraFastSim ufs; |
317 |
> |
char jobName[256]; |
318 |
> |
sprintf(jobName, "%s-PU%3.3d-%4.4d", argv[1], meanPileupEventCount, runNumber); |
319 |
> |
UFSDataStore dataStore(jobName, &ufs); |
320 |
|
|
321 |
|
// Begin event loop |
322 |
|
for (int iEvent = 0; iEvent < nEvents; ) { |
324 |
|
// Generate event. Skip if error. List first one. |
325 |
|
if (!pythia.next()) continue; |
326 |
|
|
327 |
+ |
if(iEvent < 10) pythia.event.list(); |
328 |
+ |
|
329 |
|
// Add pileup |
330 |
|
|
331 |
|
int pileupEventCount = 0; |
332 |
< |
if(meanPileupEventCount > 0) pileupEventCount = meanPileupEventCount; // * rmdmPtr->pois(); (not available yet) |
332 |
> |
if(meanPileupEventCount > 0) pileupEventCount = poisson(meanPileupEventCount, rndmPtr); |
333 |
|
for (int puEvent = 0; puEvent < pileupEventCount; ) { |
334 |
|
if(!pileupPythia.next()) continue; |
335 |
+ |
double vx = rndmPtr->gauss()*2.; // Mean beam spread is 2 mm in x-y and 75 mm in z |
336 |
+ |
double vy = rndmPtr->gauss()*2.; |
337 |
+ |
double vz = rndmPtr->gauss()*75.; |
338 |
|
for(int i = 0; i < pileupPythia.event.size(); i++) { |
339 |
|
Particle& particle = pileupPythia.event[i]; |
340 |
+ |
particle.xProd(vx+particle.xProd()); |
341 |
+ |
particle.yProd(vy+particle.yProd()); |
342 |
+ |
particle.zProd(vz+particle.zProd()); |
343 |
|
if(particle.status() > 0) { |
344 |
|
if(particle.isVisible()) { |
345 |
|
if(particle.pT() > 0.5) { |
353 |
|
|
354 |
|
// Ultra fast simulation |
355 |
|
|
356 |
< |
if(!ufs.run(pythia.event)) |
356 |
> |
if(!ufs.run(pythia.event, rndmPtr)) |
357 |
|
{ |
358 |
|
cerr << "Ultra fast simulation failed - aborting" << endl; |
359 |
|
exit(1); |
360 |
|
} |
361 |
|
|
362 |
< |
cout << "Number of Particles = " << ufs.particleList().size() << endl; |
363 |
< |
cout << "Number of Gen Elecs = " << ufs.electronList().size() << endl; |
364 |
< |
cout << "Number of Gen Muons = " << ufs.muonList().size() << endl; |
365 |
< |
cout << "Number of Gen Taus = " << ufs.genTauList().size() << endl; |
366 |
< |
cout << "Number of b Quarks = " << ufs.bQuarkList().size() << endl; |
367 |
< |
cout << "Number of Jets = " << ufs.sortedJetList().size() << endl; |
368 |
< |
cout << "Number of bJets = " << ufs.bJetList().size() << endl; |
369 |
< |
cout << "Number of taus = " << ufs.tauList().size() << endl; |
370 |
< |
cout << endl; |
371 |
< |
|
362 |
> |
// If necessary, check MET and decide to store or not |
363 |
> |
|
364 |
> |
bool doStore = true; |
365 |
> |
if(cutOnMET) { |
366 |
> |
double MET = ufs.getMET().Pt(); |
367 |
> |
if(MET < 50.) { |
368 |
> |
doStore = false; |
369 |
> |
} |
370 |
> |
} |
371 |
> |
// Store data |
372 |
> |
|
373 |
> |
if(doStore && !dataStore.run()) |
374 |
> |
{ |
375 |
> |
cerr << "Failed to store data" << endl; |
376 |
> |
exit(3); |
377 |
> |
} |
378 |
> |
|
379 |
|
// End of event loop. Statistics. Histogram. Done. |
380 |
|
|
381 |
|
if(!(iEvent % 100)) cout << "Processed event " << iEvent << endl; |