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.8 by dasu, Wed Feb 16 01:46:58 2011 UTC vs.
Revision 1.14 by dasu, Fri Feb 25 17:10:39 2011 UTC

# Line 14 | Line 14 | using namespace std;
14   using namespace Pythia8;
15  
16   #include "UltraFastSim.h"
17 < #include "bbHAnalysis.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 <  bbHAnalysis analysis(argv[1], &pythia, &ufs, true);
187 >  UltraFastSim ufs;
188 >  UFSDataStore dataStore(argv[1], &ufs);
189  
190    // Begin event loop
191    for (int iEvent = 0; iEvent < nEvents; ) {
# Line 194 | 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 209 | Line 222 | int main(int argc, char **argv) {
222  
223      // Ultra fast simulation
224  
225 <    if(!ufs.run(pythia.event))
225 >    if(!ufs.run(pythia.event, rndmPtr))
226        {
227          cerr << "Ultra fast simulation failed - aborting" << endl;
228          exit(1);
229        }
230  
231 <    // Run analysis
231 >    // Store data
232  
233 <    if(!analysis.run())
233 >    if(!dataStore.run())
234        {
235 <        cerr << "Analysis failed - aborting" << endl;
236 <        exit(2);
235 >        cerr << "Failed to store data" << endl;
236 >        exit(3);
237        }
238  
239      // End of event loop. Statistics. Histogram. Done.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines