ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/dasu/UltraFastSim/generateData.cc
(Generate patch)

Comparing UserCode/dasu/UltraFastSim/generateData.cc (file contents):
Revision 1.9 by dasu, Thu Feb 17 14:57:43 2011 UTC vs.
Revision 1.10 by dasu, Fri Feb 18 05:06:02 2011 UTC

# Line 13 | Line 13 | using namespace std;
13   #include "Pythia.h"
14   using namespace Pythia8;
15  
16 + #include "TROOT.h"
17 + #include "TFile.h"
18 +
19   #include "UltraFastSim.h"
20   #include "bbHAnalysis.h"
21 + #include "ZHAnalysis.h"
22  
23   int main(int argc, char **argv) {
24    // Generator. Process selection. LHC initialization. Histogram.
# Line 26 | Line 30 | int main(int argc, char **argv) {
30      {
31        cerr << "Command syntax: " << argv[0] << " ZHmmbb[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
32        cerr << "or              " << argv[0] << " ZHeebb[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
33 +      cerr << "or              " << argv[0] << " ZZmmbb[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
34        cerr << "or              " << argv[0] << " BBHmh[...] " << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
35        cerr << "or              " << argv[0] << " BBAmh[...] " << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
36        cerr << "or              " << argv[0] << " Zee[...]   " << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
# Line 156 | Line 161 | int main(int argc, char **argv) {
161        }
162       else if(strncmp(argv[1], "ZZmmbb", 6) == 0)
163         {
164 <        pythia.readString("WeakDoubleBoson:ffbar2gmZgmZ = on");
165 <        pythia.readString("23:onMode = 2");      
166 <        pythia.readString("23:onIfAny = 13");
162 <        pythia.readString("23:onMode = 3");
163 <        pythia.readString("23:onIfAny = 5");
164 >         pythia.readString("WeakDoubleBoson:ffbar2gmZgmZ = on");
165 >         pythia.readString("23:onMode = 0");
166 >         pythia.readString("23:onIfAny = 5 13");   // Let the Z decay to bQuarks or muons
167         }
168      else
169        {
# Line 169 | Line 172 | int main(int argc, char **argv) {
172        }
173    }
174  
175 +  string name(argv[1]);
176 +  name += ".root";
177 +  TFile *outFile = TFile::Open(name.c_str(), "recreate");
178 +
179    // Initialize pythia
180  
181    pythia.init( 2212, 2212, 14000.);
# Line 186 | Line 193 | int main(int argc, char **argv) {
193    // Ultra Fast Simulator
194  
195    UltraFastSim ufs(rndmPtr);
196 <  bbHAnalysis analysis(argv[1], &pythia, &ufs, true);
196 >  bbHAnalysis bbH(outFile, &pythia, &ufs, true);
197 >  ZHAnalysis ZH(outFile, &pythia, &ufs, true);
198  
199    // Begin event loop
200    for (int iEvent = 0; iEvent < nEvents; ) {
# Line 223 | Line 231 | int main(int argc, char **argv) {
231          exit(1);
232        }
233  
234 <    // Run analysis
234 >    // Run bbHAnalysis
235  
236 <    if(!analysis.run())
236 >    if(!bbH.run())
237        {
238 <        cerr << "Analysis failed - aborting" << endl;
238 >        cerr << "bbH Analysis failed - aborting" << endl;
239          exit(2);
240        }
241  
242 +    // Run ZHAnalysis
243 +
244 +    if(!ZH.run())
245 +      {
246 +        cerr << "ZH Analysis failed - aborting" << endl;
247 +        exit(3);
248 +      }
249 +
250      // End of event loop. Statistics. Histogram. Done.
251  
252      if(!(iEvent % 100)) cout << "Processed event " << iEvent << endl;
# Line 243 | Line 259 | int main(int argc, char **argv) {
259    pythia.statistics();
260    pileupPythia.statistics();
261  
262 +  bbH.end();
263 +  ZH.end();
264 +
265 +  outFile->cd();
266 +  outFile->Write();
267 +  outFile->Close();
268 +
269    return 0;
270  
271   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines