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.15 by dasu, Mon Feb 28 11:13:18 2011 UTC

# Line 14 | Line 14 | using namespace std;
14   using namespace Pythia8;
15  
16   #include "UltraFastSim.h"
17 < #include "Analysis.h"
17 > #include "UFSDataStore.h"
18  
19   int main(int argc, char **argv) {
20    // Generator. Process selection. LHC initialization. Histogram.
# Line 26 | Line 26 | int main(int argc, char **argv) {
26      {
27        cerr << "Command syntax: " << argv[0] << " ZHmmbb[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
28        cerr << "or              " << argv[0] << " ZHeebb[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
29 +      cerr << "or              " << argv[0] << " ZZmmbb[...]" << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
30        cerr << "or              " << argv[0] << " BBHmh[...] " << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
31        cerr << "or              " << argv[0] << " BBAmh[...] " << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
32        cerr << "or              " << argv[0] << " Zee[...]   " << " <nEvents> [RandomSeed] [meanPileupEventCount]" << endl;
# Line 154 | Line 155 | int main(int argc, char **argv) {
155            pythia.readString("15:onIfAny = 13");
156          }
157        }
158 +     else if(strncmp(argv[1], "ZZmmbb", 6) == 0)
159 +       {
160 +         pythia.readString("WeakDoubleBoson:ffbar2gmZgmZ = on");
161 +         pythia.readString("23:onMode = 0");
162 +         pythia.readString("23:onIfAny = 5 13");   // Let the Z decay to bQuarks or muons
163 +       }
164      else
165        {
166          cerr << "Unknown process type " << argv[1] << " - aborting" << endl;
# Line 177 | Line 184 | int main(int argc, char **argv) {
184  
185    // Ultra Fast Simulator
186  
187 <  UltraFastSim ufs(rndmPtr);
188 <  Analysis analysis(argv[1], &ufs);
187 >  UltraFastSim ufs;
188 >  char jobName[256];
189 >  sprintf(jobName, "%s-%4.4d", argv[1], runNumber);
190 >  UFSDataStore dataStore(jobName, &ufs);
191  
192    // Begin event loop
193    for (int iEvent = 0; iEvent < nEvents; ) {
# Line 194 | Line 203 | int main(int argc, char **argv) {
203      if(meanPileupEventCount > 0) pileupEventCount = meanPileupEventCount; // * rmdmPtr->pois(); (not available yet)
204      for (int puEvent = 0; puEvent < pileupEventCount; ) {
205        if(!pileupPythia.next()) continue;
206 +      double vx = rndmPtr->gauss()*2.; // Mean beam spread is 2 mm in x-y and 75 mm in z
207 +      double vy = rndmPtr->gauss()*2.;
208 +      double vz = rndmPtr->gauss()*75.;
209        for(int i = 0; i < pileupPythia.event.size(); i++) {
210          Particle& particle = pileupPythia.event[i];
211 +        particle.xProd(vx+particle.xProd());
212 +        particle.yProd(vy+particle.yProd());
213 +        particle.zProd(vz+particle.zProd());
214          if(particle.status() > 0) {
215            if(particle.isVisible()) {
216              if(particle.pT() > 0.5) {
# Line 209 | Line 224 | int main(int argc, char **argv) {
224  
225      // Ultra fast simulation
226  
227 <    if(!ufs.run(pythia.event))
227 >    if(!ufs.run(pythia.event, rndmPtr))
228        {
229          cerr << "Ultra fast simulation failed - aborting" << endl;
230          exit(1);
231        }
232  
233 <    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;
233 >    // Store data
234  
235 <    // Run analysis
232 <
233 <    if(!analysis.run())
235 >    if(!dataStore.run())
236        {
237 <        cerr << "Analysis failed - aborting" << endl;
238 <        exit(2);
237 >        cerr << "Failed to store data" << endl;
238 >        exit(3);
239        }
240  
241      // End of event loop. Statistics. Histogram. Done.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines