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.10 by dasu, Fri Feb 18 05:06:02 2011 UTC vs.
Revision 1.13 by dasu, Fri Feb 25 15:37:18 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
16   #include "UltraFastSim.h"
17 < #include "bbHAnalysis.h"
21 < #include "ZHAnalysis.h"
17 > #include "UFSDataStore.h"
18  
19   int main(int argc, char **argv) {
20    // Generator. Process selection. LHC initialization. Histogram.
# Line 172 | Line 168 | int main(int argc, char **argv) {
168        }
169    }
170  
175  string name(argv[1]);
176  name += ".root";
177  TFile *outFile = TFile::Open(name.c_str(), "recreate");
178
171    // Initialize pythia
172  
173    pythia.init( 2212, 2212, 14000.);
# Line 193 | Line 185 | int main(int argc, char **argv) {
185    // Ultra Fast Simulator
186  
187    UltraFastSim ufs(rndmPtr);
188 <  bbHAnalysis bbH(outFile, &pythia, &ufs, true);
197 <  ZHAnalysis ZH(outFile, &pythia, &ufs, true);
188 >  UFSDataStore dataStore(argv[1], &ufs);
189  
190    // Begin event loop
191    for (int iEvent = 0; iEvent < nEvents; ) {
# Line 210 | Line 201 | int main(int argc, char **argv) {
201      if(meanPileupEventCount > 0) pileupEventCount = meanPileupEventCount; // * rmdmPtr->pois(); (not available yet)
202      for (int puEvent = 0; puEvent < pileupEventCount; ) {
203        if(!pileupPythia.next()) continue;
204 +      double vx = rndmPtr->gauss()*2.; // Mean beam spread is 2 mm in x-y and 75 mm in z
205 +      double vy = rndmPtr->gauss()*2.;
206 +      double vz = rndmPtr->gauss()*75.;
207        for(int i = 0; i < pileupPythia.event.size(); i++) {
208          Particle& particle = pileupPythia.event[i];
209 +        particle.xProd(vx+particle.xProd());
210 +        particle.yProd(vy+particle.yProd());
211 +        particle.zProd(vz+particle.zProd());
212          if(particle.status() > 0) {
213            if(particle.isVisible()) {
214              if(particle.pT() > 0.5) {
# Line 231 | Line 228 | int main(int argc, char **argv) {
228          exit(1);
229        }
230  
231 <    // Run bbHAnalysis
235 <
236 <    if(!bbH.run())
237 <      {
238 <        cerr << "bbH Analysis failed - aborting" << endl;
239 <        exit(2);
240 <      }
241 <
242 <    // Run ZHAnalysis
231 >    // Store data
232  
233 <    if(!ZH.run())
233 >    if(!dataStore.run())
234        {
235 <        cerr << "ZH Analysis failed - aborting" << endl;
235 >        cerr << "Failed to store data" << endl;
236          exit(3);
237        }
238  
# Line 259 | Line 248 | int main(int argc, char **argv) {
248    pythia.statistics();
249    pileupPythia.statistics();
250  
262  bbH.end();
263  ZH.end();
264
265  outFile->cd();
266  outFile->Write();
267  outFile->Close();
268
251    return 0;
252  
253   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines