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.6 by dasu, Tue Feb 15 21:56:55 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 "Analysis.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 154 | Line 159 | int main(int argc, char **argv) {
159            pythia.readString("15:onIfAny = 13");
160          }
161        }
162 +     else if(strncmp(argv[1], "ZZmmbb", 6) == 0)
163 +       {
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        {
170          cerr << "Unknown process type " << argv[1] << " - aborting" << endl;
# Line 161 | 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 178 | Line 193 | int main(int argc, char **argv) {
193    // Ultra Fast Simulator
194  
195    UltraFastSim ufs(rndmPtr);
196 <  Analysis analysis(argv[1], &ufs);
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 215 | Line 231 | int main(int argc, char **argv) {
231          exit(1);
232        }
233  
234 <    cout << "Number of Gen Chrgd = " << ufs.chargedHadronList().size() << endl;
219 <    cout << "Number of Gen Neutr = " << ufs.neutralHadronList().size() << endl;
220 <    cout << "Number of Gen Phtns = " << ufs.photonList().size() << endl;
221 <    cout << "Number of Gen Elcns = " << ufs.electronList().size() << endl;
222 <    cout << "Number of Gen Muons = " << ufs.muonList().size() << endl;
223 <    cout << "Number of Gen Taus =  " << ufs.genTauList().size() << endl;
224 <    cout << "Number of taus =      " << ufs.tauList().size() << endl;
225 <    cout << "Number of c Quarks =  " << ufs.cQuarkList().size() << endl;
226 <    cout << "Number of b Quarks =  " << ufs.bQuarkList().size() << endl;
227 <    cout << "Number of Jets =      " << ufs.jetList().size() << endl;
228 <    cout << "Number of bJets =     " << ufs.bJetList().size() << endl;
229 <    cout << endl;
230 <
231 <    // 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 248 | 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