13 |
|
#include "Pythia.h" |
14 |
|
using namespace Pythia8; |
15 |
|
|
16 |
+ |
#include "TROOT.h" |
17 |
+ |
#include "TFile.h" |
18 |
+ |
|
19 |
|
#include "UltraFastSim.h" |
20 |
< |
#include "Analysis.h" |
20 |
> |
#include "bbHAnalysis.h" |
21 |
> |
//#include "ZHAnalysis.h" |
22 |
> |
#include "bbHAnalysis.cc" |
23 |
> |
//#include "ZHAnalysis.cc" |
24 |
|
|
25 |
|
int main(int argc, char **argv) { |
26 |
|
// Generator. Process selection. LHC initialization. Histogram. |
32 |
|
{ |
33 |
|
cerr << "Command syntax: " << argv[0] << " ZHmmbb[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl; |
34 |
|
cerr << "or " << argv[0] << " ZHeebb[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl; |
35 |
+ |
cerr << "or " << argv[0] << " ZZmmbb[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl; |
36 |
|
cerr << "or " << argv[0] << " BBHmh[...] " << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl; |
37 |
|
cerr << "or " << argv[0] << " BBAmh[...] " << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl; |
38 |
|
cerr << "or " << argv[0] << " Zee[...] " << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl; |
161 |
|
pythia.readString("15:onIfAny = 13"); |
162 |
|
} |
163 |
|
} |
164 |
+ |
else if(strncmp(argv[1], "ZZmmbb", 6) == 0) |
165 |
+ |
{ |
166 |
+ |
pythia.readString("WeakDoubleBoson:ffbar2gmZgmZ = on"); |
167 |
+ |
pythia.readString("23:onMode = 0"); |
168 |
+ |
pythia.readString("23:onIfAny = 5 13"); // Let the Z decay to bQuarks or muons |
169 |
+ |
} |
170 |
|
else |
171 |
|
{ |
172 |
|
cerr << "Unknown process type " << argv[1] << " - aborting" << endl; |
174 |
|
} |
175 |
|
} |
176 |
|
|
177 |
+ |
string name(argv[1]); |
178 |
+ |
name += ".root"; |
179 |
+ |
TFile *outFile = TFile::Open(name.c_str(), "recreate"); |
180 |
+ |
|
181 |
|
// Initialize pythia |
182 |
|
|
183 |
|
pythia.init( 2212, 2212, 14000.); |
195 |
|
// Ultra Fast Simulator |
196 |
|
|
197 |
|
UltraFastSim ufs(rndmPtr); |
198 |
< |
Analysis analysis(argv[1], &pythia, &ufs, true); |
198 |
> |
bbHAnalysis bbH(outFile, &pythia, &ufs, true); |
199 |
> |
//ZHAnalysis ZH; // outFile, &pythia, &ufs, true); |
200 |
> |
//ZH.BookTree(); |
201 |
|
|
202 |
|
// Begin event loop |
203 |
|
for (int iEvent = 0; iEvent < nEvents; ) { |
213 |
|
if(meanPileupEventCount > 0) pileupEventCount = meanPileupEventCount; // * rmdmPtr->pois(); (not available yet) |
214 |
|
for (int puEvent = 0; puEvent < pileupEventCount; ) { |
215 |
|
if(!pileupPythia.next()) continue; |
216 |
+ |
double vx = rndmPtr->gauss()*2.; // Mean beam spread is 2 mm in x-y and 75 mm in z |
217 |
+ |
double vy = rndmPtr->gauss()*2.; |
218 |
+ |
double vz = rndmPtr->gauss()*75.; |
219 |
|
for(int i = 0; i < pileupPythia.event.size(); i++) { |
220 |
|
Particle& particle = pileupPythia.event[i]; |
221 |
+ |
particle.xProd(vx+particle.xProd()); |
222 |
+ |
particle.yProd(vy+particle.yProd()); |
223 |
+ |
particle.zProd(vz+particle.zProd()); |
224 |
|
if(particle.status() > 0) { |
225 |
|
if(particle.isVisible()) { |
226 |
|
if(particle.pT() > 0.5) { |
240 |
|
exit(1); |
241 |
|
} |
242 |
|
|
243 |
< |
// Run analysis |
243 |
> |
// Run bbHAnalysis |
244 |
|
|
245 |
< |
if(!analysis.run()) |
245 |
> |
if(!bbH.run()) |
246 |
|
{ |
247 |
< |
cerr << "Analysis failed - aborting" << endl; |
247 |
> |
cerr << "bbH Analysis failed - aborting" << endl; |
248 |
|
exit(2); |
249 |
|
} |
250 |
|
|
251 |
+ |
// Run ZHAnalysis |
252 |
+ |
|
253 |
+ |
/* if(!ZH.Run(&ufs)) |
254 |
+ |
{ |
255 |
+ |
cerr << "ZH Analysis failed - aborting" << endl; |
256 |
+ |
exit(3); |
257 |
+ |
} |
258 |
+ |
*/ |
259 |
|
// End of event loop. Statistics. Histogram. Done. |
260 |
|
|
261 |
|
if(!(iEvent % 100)) cout << "Processed event " << iEvent << endl; |
268 |
|
pythia.statistics(); |
269 |
|
pileupPythia.statistics(); |
270 |
|
|
271 |
+ |
bbH.end(); |
272 |
+ |
|
273 |
+ |
outFile->cd(); |
274 |
+ |
outFile->Write(); |
275 |
+ |
outFile->Close(); |
276 |
+ |
|
277 |
|
return 0; |
278 |
|
|
279 |
|
} |