Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:21:35

0001 #ifndef MACRO_FUN4ALLG4EICDETECTOR_C
0002 #define MACRO_FUN4ALLG4EICDETECTOR_C
0003 
0004 #include <anatutorial/AnaTutorial.h>
0005 
0006 #include <GlobalVariables.C>
0007 
0008 #include <DisplayOn.C>
0009 #include <G4Setup_EICDetector.C>
0010 #include <G4_Bbc.C>
0011 #include <G4_DSTReader_EICDetector.C>
0012 #include <G4_FwdJets.C>
0013 #include <G4_Global.C>
0014 #include <G4_Input.C>
0015 #include <G4_Jets.C>
0016 #include <G4_Production.C>
0017 #include <G4_User.C>
0018 
0019 #include <TROOT.h>
0020 #include <fun4all/Fun4AllDstOutputManager.h>
0021 #include <fun4all/Fun4AllOutputManager.h>
0022 #include <fun4all/Fun4AllServer.h>
0023 
0024 #include <phool/recoConsts.h>
0025 
0026 R__LOAD_LIBRARY(libfun4all.so)
0027 R__LOAD_LIBRARY(libanatutorial.so)
0028 
0029 int Fun4All_G4_EICDetector_AnaTutorial(
0030     const int nEvents = 1,
0031     const string &inputFile = "https://www.phenix.bnl.gov/WWW/publish/phnxbld/sPHENIX/files/sPHENIX_G4Hits_sHijing_9-11fm_00000_00010.root",
0032     const string &outputFile = "G4EICDetector.root",
0033     const string &embed_input_file = "https://www.phenix.bnl.gov/WWW/publish/phnxbld/sPHENIX/files/sPHENIX_G4Hits_sHijing_9-11fm_00000_00010.root",
0034     const int skip = 0,
0035     const string &outdir = ".")
0036 {
0037   //---------------
0038   // Fun4All server
0039   //---------------
0040   Fun4AllServer *se = Fun4AllServer::instance();
0041   se->Verbosity(0);
0042   //Opt to print all random seed used for debugging reproducibility. Comment out to reduce stdout prints.
0043   //PHRandomSeed::Verbosity(1);
0044 
0045   // just if we set some flags somewhere in this macro
0046   recoConsts *rc = recoConsts::instance();
0047   // By default every random number generator uses
0048   // PHRandomSeed() which reads /dev/urandom to get its seed
0049   // if the RANDOMSEED flag is set its value is taken as initial seed
0050   // which will produce identical results so you can debug your code
0051   // rc->set_IntFlag("RANDOMSEED", 12345);
0052 
0053   //===============
0054   // Input options
0055   //===============
0056 
0057   // Either:
0058   // read previously generated g4-hits files, in this case it opens a DST and skips
0059   // the simulations step completely. The G4Setup macro is only loaded to get information
0060   // about the number of layers used for the cell reco code
0061   //
0062   //Input::READHITS = true;
0063   INPUTREADHITS::filename[0] = inputFile;
0064   // if you use a filelist
0065   // INPUTREADHITS::listfile[0] = inputFile;
0066 
0067   // Or:
0068   // Use one or more particle generators
0069   // It is run if Input::<generator> is set to true
0070   // all other options only play a role if it is active
0071   // In case embedding into a production output, please double check your G4Setup_EICDetector.C and G4_*.C consistent with those in the production macro folder
0072   //  Input::EMBED = true;
0073   INPUTEMBED::filename[0] = embed_input_file;
0074   // if you use a filelist
0075   //INPUTEMBED::listfile[0] = embed_input_file;
0076 
0077   // Use Pythia 8
0078   //  Input::PYTHIA8 = true;
0079 
0080   // Use Pythia 6
0081   //   Input::PYTHIA6 = true;
0082 
0083   // Use Sartre
0084   //   Input::SARTRE = true;
0085 
0086   // Simple multi particle generator in eta/phi/pt ranges
0087   Input::SIMPLE = true;
0088   // Input::SIMPLE_NUMBER = 2; // if you need 2 of them
0089   // Input::SIMPLE_VERBOSITY = 1;
0090 
0091   // Particle gun (same particles in always the same direction)
0092   // Input::GUN = true;
0093   // Input::GUN_NUMBER = 3; // if you need 3 of them
0094   // Input::GUN_VERBOSITY = 0;
0095 
0096   // Upsilon generator
0097   // Input::UPSILON = true;
0098   // Input::UPSILON_NUMBER = 3; // if you need 3 of them
0099   // Input::UPSILON_VERBOSITY = 0;
0100 
0101   // And/Or read generated particles from file
0102 
0103   // eic-smear output
0104   //  Input::READEIC = true;
0105   INPUTREADEIC::filename = inputFile;
0106 
0107   // HepMC2 files
0108   //  Input::HEPMC = true;
0109   Input::VERBOSITY = 0;
0110   INPUTHEPMC::filename = inputFile;
0111 
0112   //-----------------
0113   // Initialize the selected Input/Event generation
0114   //-----------------
0115   InputInit();
0116   //--------------
0117   // Set generator specific options
0118   //--------------
0119   // can only be set after InputInit() is called
0120 
0121   // Simple Input generator:
0122   // if you run more than one of these Input::SIMPLE_NUMBER > 1
0123   // add the settings for other with [1], next with [2]...
0124   if (Input::SIMPLE)
0125   {
0126     INPUTGENERATOR::SimpleEventGenerator[0]->add_particles("pi-", 5);
0127     if (Input::HEPMC || Input::EMBED)
0128     {
0129       INPUTGENERATOR::SimpleEventGenerator[0]->set_reuse_existing_vertex(true);
0130       INPUTGENERATOR::SimpleEventGenerator[0]->set_existing_vertex_offset_vector(0.0, 0.0, 0.0);
0131     }
0132     else
0133     {
0134       INPUTGENERATOR::SimpleEventGenerator[0]->set_vertex_distribution_function(PHG4SimpleEventGenerator::Uniform,
0135                                                                                 PHG4SimpleEventGenerator::Uniform,
0136                                                                                 PHG4SimpleEventGenerator::Uniform);
0137       INPUTGENERATOR::SimpleEventGenerator[0]->set_vertex_distribution_mean(0., 0., 0.);
0138       INPUTGENERATOR::SimpleEventGenerator[0]->set_vertex_distribution_width(0., 0., 5.);
0139     }
0140     INPUTGENERATOR::SimpleEventGenerator[0]->set_eta_range(-3, 3);
0141     INPUTGENERATOR::SimpleEventGenerator[0]->set_phi_range(-M_PI, M_PI);
0142     INPUTGENERATOR::SimpleEventGenerator[0]->set_pt_range(0.1, 20.);
0143   }
0144   // Upsilons
0145   // if you run more than one of these Input::UPSILON_NUMBER > 1
0146   // add the settings for other with [1], next with [2]...
0147   if (Input::UPSILON)
0148   {
0149     INPUTGENERATOR::VectorMesonGenerator[0]->add_decay_particles("mu", 0);
0150     INPUTGENERATOR::VectorMesonGenerator[0]->set_rapidity_range(-1, 1);
0151     INPUTGENERATOR::VectorMesonGenerator[0]->set_pt_range(0., 10.);
0152     // Y species - select only one, last one wins
0153     INPUTGENERATOR::VectorMesonGenerator[0]->set_upsilon_1s();
0154     if (Input::HEPMC || Input::EMBED)
0155     {
0156       INPUTGENERATOR::VectorMesonGenerator[0]->set_reuse_existing_vertex(true);
0157       INPUTGENERATOR::VectorMesonGenerator[0]->set_existing_vertex_offset_vector(0.0, 0.0, 0.0);
0158     }
0159   }
0160   // particle gun
0161   // if you run more than one of these Input::GUN_NUMBER > 1
0162   // add the settings for other with [1], next with [2]...
0163   if (Input::GUN)
0164   {
0165     INPUTGENERATOR::Gun[0]->AddParticle("pi-", 0, 1, 0);
0166     INPUTGENERATOR::Gun[0]->set_vtx(0, 0, 0);
0167   }
0168   // pythia6
0169   if (Input::PYTHIA6)
0170   {
0171     INPUTGENERATOR::Pythia6->set_config_file(string(getenv("CALIBRATIONROOT")) + "/Generators/phpythia6_ep.cfg");
0172     //! apply EIC beam parameter following EIC CDR
0173     Input::ApplyEICBeamParameter(INPUTGENERATOR::Pythia6);
0174   }
0175   // pythia8
0176   if (Input::PYTHIA8)
0177   {
0178     //! apply EIC beam parameter following EIC CDR
0179     Input::ApplyEICBeamParameter(INPUTGENERATOR::Pythia8);
0180   }
0181   // Sartre
0182   if (Input::SARTRE)
0183   {
0184     //! apply EIC beam parameter following EIC CDR
0185     Input::ApplyEICBeamParameter(INPUTGENERATOR::Sartre);
0186   }
0187 
0188   //--------------
0189   // Set Input Manager specific options
0190   //--------------
0191   // can only be set after InputInit() is called
0192 
0193   if (Input::HEPMC)
0194   {
0195     //! apply EIC beam parameter following EIC CDR
0196     Input::ApplyEICBeamParameter(INPUTMANAGER::HepMCInputManager);
0197     // optional overriding beam parameters
0198     //INPUTMANAGER::HepMCInputManager->set_vertex_distribution_width(100e-4, 100e-4, 30, 0);  //optional collision smear in space, time
0199                                                                                             //    INPUTMANAGER::HepMCInputManager->set_vertex_distribution_mean(0,0,0,0);//optional collision central position shift in space, time
0200     // //optional choice of vertex distribution function in space, time
0201     // INPUTMANAGER::HepMCInputManager->set_vertex_distribution_function(PHHepMCGenHelper::Gaus, PHHepMCGenHelper::Gaus, PHHepMCGenHelper::Gaus, PHHepMCGenHelper::Gaus);
0202     //! embedding ID for the event
0203     //! positive ID is the embedded event of interest, e.g. jetty event from pythia
0204     //! negative IDs are backgrounds, .e.g out of time pile up collisions
0205     //! Usually, ID = 0 means the primary Au+Au collision background
0206     //INPUTMANAGER::HepMCInputManager->set_embedding_id(2);
0207   }
0208 
0209   // register all input generators with Fun4All
0210   InputRegister();
0211 
0212   // Reads event generators in EIC smear files, which is registered in InputRegister
0213   if (Input::READEIC)
0214   {
0215     //! apply EIC beam parameter following EIC CDR
0216     Input::ApplyEICBeamParameter(INPUTGENERATOR::EICFileReader);
0217   }
0218 
0219   // set up production relatedstuff
0220   //   Enable::PRODUCTION = true;
0221 
0222   //======================
0223   // Write the DST
0224   //======================
0225 
0226   Enable::DSTOUT = false;
0227   DstOut::OutputDir = outdir;
0228   DstOut::OutputFile = outputFile;
0229   Enable::DSTOUT_COMPRESS = false;  // Compress DST files
0230 
0231   //Option to convert DST to human command readable TTree for quick poke around the outputs
0232 //  Enable::DSTREADER = true;
0233 
0234   // turn the display on (default off)
0235   Enable::DISPLAY = false;
0236 
0237   //======================
0238   // What to run
0239   //======================
0240   // Global options (enabled for all subsystems - if implemented)
0241   //  Enable::ABSORBER = true;
0242   //  Enable::OVERLAPCHECK = true;
0243   //  Enable::VERBOSITY = 1;
0244 
0245   //  Enable::BBC = true;
0246   Enable::BBCFAKE = true; // Smeared vtx and t0, use if you don't want real BBC in simulation
0247 
0248   // whether to simulate the Be section of the beam pipe
0249   Enable::PIPE = true;
0250   // EIC beam pipe extension beyond the Be-section:
0251   G4PIPE::use_forward_pipes = false;
0252   //EIC hadron far forward magnets and detectors. IP6 and IP8 are incompatible (pick either or);
0253   Enable::HFARFWD_MAGNETS_IP6=true;
0254   Enable::HFARFWD_VIRTUAL_DETECTORS_IP6=true;
0255   Enable::HFARFWD_MAGNETS_IP8=false;
0256   Enable::HFARFWD_VIRTUAL_DETECTORS_IP8=false;
0257 
0258   // gems
0259   Enable::EGEM = true;
0260   Enable::FGEM = true;
0261   Enable::FGEM_ORIG = false; //5 forward gems; cannot be used with FST
0262   // barrel tracker
0263   Enable::BARREL = false;
0264   //G4BARREL::SETTING::BARRELV6=true;
0265   // fst
0266   Enable::FST = true;
0267   G4FST::SETTING::FST_TPC = true;
0268   // mvtx/tpc tracker
0269   Enable::MVTX = true;
0270   Enable::TPC = true;
0271   //  Enable::TPC_ENDCAP = true;
0272 
0273   Enable::TRACKING = true;
0274   Enable::TRACKING_EVAL = Enable::TRACKING && true;
0275   G4TRACKING::DISPLACED_VERTEX = false;  // this option exclude vertex in the track fitting and use RAVE to reconstruct primary and 2ndary vertexes
0276                                          // projections to calorimeters
0277   G4TRACKING::PROJECTION_EEMC = false;
0278   G4TRACKING::PROJECTION_CEMC = false;
0279   G4TRACKING::PROJECTION_FEMC = false;
0280   G4TRACKING::PROJECTION_FHCAL = false;
0281 
0282   Enable::CEMC = true;
0283   //  Enable::CEMC_ABSORBER = true;
0284   Enable::CEMC_CELL = Enable::CEMC && true;
0285   Enable::CEMC_TOWER = Enable::CEMC_CELL && true;
0286   Enable::CEMC_CLUSTER = Enable::CEMC_TOWER && true;
0287   Enable::CEMC_EVAL = Enable::CEMC_CLUSTER && true;
0288 
0289   Enable::HCALIN = true;
0290   //  Enable::HCALIN_ABSORBER = true;
0291   Enable::HCALIN_CELL = Enable::HCALIN && true;
0292   Enable::HCALIN_TOWER = Enable::HCALIN_CELL && true;
0293   Enable::HCALIN_CLUSTER = Enable::HCALIN_TOWER && true;
0294   Enable::HCALIN_EVAL = Enable::HCALIN_CLUSTER && true;
0295 
0296   Enable::MAGNET = true;
0297 
0298   Enable::HCALOUT = true;
0299   //  Enable::HCALOUT_ABSORBER = true;
0300   Enable::HCALOUT_CELL = Enable::HCALOUT && true;
0301   Enable::HCALOUT_TOWER = Enable::HCALOUT_CELL && true;
0302   Enable::HCALOUT_CLUSTER = Enable::HCALOUT_TOWER && true;
0303   Enable::HCALOUT_EVAL = Enable::HCALOUT_CLUSTER && true;
0304 
0305   // EICDetector geometry - barrel
0306   Enable::DIRC = true;
0307 
0308   // EICDetector geometry - 'hadron' direction
0309   Enable::RICH = true;
0310   Enable::AEROGEL = true;
0311 
0312   Enable::FEMC = true;
0313   //  Enable::FEMC_ABSORBER = true;
0314   Enable::FEMC_TOWER = Enable::FEMC && true;
0315   Enable::FEMC_CLUSTER = Enable::FEMC_TOWER && true;
0316   Enable::FEMC_EVAL = Enable::FEMC_CLUSTER && true;
0317 
0318   Enable::FHCAL = true;
0319   //  Enable::FHCAL_ABSORBER = true;
0320   Enable::FHCAL_TOWER = Enable::FHCAL && true;
0321   Enable::FHCAL_CLUSTER = Enable::FHCAL_TOWER && true;
0322   Enable::FHCAL_EVAL = Enable::FHCAL_CLUSTER && true;
0323 
0324   // EICDetector geometry - 'electron' direction
0325   Enable::EEMC = true;
0326   Enable::EEMC_TOWER = Enable::EEMC && true;
0327   Enable::EEMC_CLUSTER = Enable::EEMC_TOWER && true;
0328   Enable::EEMC_EVAL = Enable::EEMC_CLUSTER && true;
0329 
0330   Enable::PLUGDOOR = true;
0331 
0332   // Other options
0333   Enable::GLOBAL_RECO = true;
0334   Enable::GLOBAL_FASTSIM = true;
0335 
0336   // Select only one jet reconstruction- they currently use the same
0337   // output collections on the node tree!
0338   Enable::JETS = true;
0339   Enable::JETS_EVAL = Enable::JETS && true;
0340 
0341   Enable::FWDJETS = true;
0342   Enable::FWDJETS_EVAL = Enable::FWDJETS && true;
0343 
0344   // new settings using Enable namespace in GlobalVariables.C
0345   Enable::BLACKHOLE = true;
0346   //Enable::BLACKHOLE_SAVEHITS = false; // turn off saving of bh hits
0347   //BlackHoleGeometry::visible = true;
0348 
0349   //Enable::USER = true;
0350 
0351   //---------------
0352   // World Settings
0353   //---------------
0354   //  G4WORLD::PhysicsList = "FTFP_BERT"; //FTFP_BERT_HP best for calo
0355   //  G4WORLD::WorldMaterial = "G4_AIR"; // set to G4_GALACTIC for material scans
0356 
0357   //---------------
0358   // Magnet Settings
0359   //---------------
0360 
0361   //  const string magfield = "1.5"; // alternatively to specify a constant magnetic field, give a float number, which will be translated to solenoidal field in T, if string use as fieldmap name (including path)
0362   //  G4MAGNET::magfield = string(getenv("CALIBRATIONROOT")) + string("/Field/Map/sPHENIX.2d.root");  // default map from the calibration database
0363   G4MAGNET::magfield_rescale = -1.4 / 1.5;  // make consistent with expected Babar field strength of 1.4T
0364 
0365   //---------------
0366   // Pythia Decayer
0367   //---------------
0368   // list of decay types in
0369   // $OFFLINE_MAIN/include/g4decayer/EDecayType.hh
0370   // default is All:
0371   // G4P6DECAYER::decayType = EDecayType::kAll;
0372 
0373   // Initialize the selected subsystems
0374   G4Init();
0375 
0376   //---------------------
0377   // GEANT4 Detector description
0378   //---------------------
0379 
0380   // If "readhepMC" is also set, the Upsilons will be embedded in Hijing events, if 'particles" is set, the Upsilons will be embedded in whatever particles are thrown
0381   if (!Input::READHITS)
0382   {
0383     G4Setup();
0384   }
0385 
0386   //------------------
0387   // Detector Division
0388   //------------------
0389 
0390   if (Enable::BBC || Enable::BBCFAKE) Bbc_Reco();
0391 
0392   if (Enable::CEMC_CELL) CEMC_Cells();
0393 
0394   if (Enable::HCALIN_CELL) HCALInner_Cells();
0395 
0396   if (Enable::HCALOUT_CELL) HCALOuter_Cells();
0397 
0398   //-----------------------------
0399   // CEMC towering and clustering
0400   //-----------------------------
0401 
0402   if (Enable::CEMC_TOWER) CEMC_Towers();
0403   if (Enable::CEMC_CLUSTER) CEMC_Clusters();
0404 
0405   //-----------------------------
0406   // HCAL towering and clustering
0407   //-----------------------------
0408 
0409   if (Enable::HCALIN_TOWER) HCALInner_Towers();
0410   if (Enable::HCALIN_CLUSTER) HCALInner_Clusters();
0411 
0412   if (Enable::HCALOUT_TOWER) HCALOuter_Towers();
0413   if (Enable::HCALOUT_CLUSTER) HCALOuter_Clusters();
0414 
0415   //-----------------------------
0416   // e, h direction Calorimeter  towering and clustering
0417   //-----------------------------
0418 
0419   if (Enable::FEMC_TOWER) FEMC_Towers();
0420   if (Enable::FEMC_CLUSTER) FEMC_Clusters();
0421 
0422   if (Enable::FHCAL_TOWER) FHCAL_Towers();
0423   if (Enable::FHCAL_CLUSTER) FHCAL_Clusters();
0424 
0425   if (Enable::EEMC_TOWER) EEMC_Towers();
0426   if (Enable::EEMC_CLUSTER) EEMC_Clusters();
0427 
0428   if (Enable::DSTOUT_COMPRESS) ShowerCompress();
0429 
0430   //--------------
0431   // SVTX tracking
0432   //--------------
0433 
0434   if (Enable::TRACKING) Tracking_Reco();
0435 
0436   //-----------------
0437   // Global Vertexing
0438   //-----------------
0439 
0440   if (Enable::GLOBAL_RECO)
0441   {
0442     Global_Reco();
0443   }
0444   else if (Enable::GLOBAL_FASTSIM)
0445   {
0446     Global_FastSim();
0447   }
0448     
0449   //---------
0450   // Jet reco
0451   //---------
0452 
0453   if (Enable::JETS) Jet_Reco();
0454 
0455   if (Enable::FWDJETS) Jet_FwdReco();
0456 
0457   string outputroot = outputFile;
0458   string remove_this = ".root";
0459   size_t pos = outputroot.find(remove_this);
0460   if (pos != string::npos)
0461   {
0462     outputroot.erase(pos, remove_this.length());
0463   }
0464 
0465   if (Enable::DSTREADER) G4DSTreader_EICDetector(outputroot + "_DSTReader.root");
0466 
0467   //----------------------
0468   // Simulation evaluation
0469   //----------------------
0470   if (Enable::TRACKING_EVAL) Tracking_Eval(outputroot + "_g4tracking_eval.root");
0471 
0472   if (Enable::CEMC_EVAL) CEMC_Eval(outputroot + "_g4cemc_eval.root");
0473 
0474   if (Enable::HCALIN_EVAL) HCALInner_Eval(outputroot + "_g4hcalin_eval.root");
0475 
0476   if (Enable::HCALOUT_EVAL) HCALOuter_Eval(outputroot + "_g4hcalout_eval.root");
0477 
0478   if (Enable::FEMC_EVAL) FEMC_Eval(outputroot + "_g4femc_eval.root");
0479 
0480   if (Enable::FHCAL_EVAL) FHCAL_Eval(outputroot + "_g4fhcal_eval.root");
0481 
0482   if (Enable::EEMC_EVAL) EEMC_Eval(outputroot + "_g4eemc_eval.root");
0483 
0484   if (Enable::JETS_EVAL) Jet_Eval(outputroot + "_g4jet_eval.root");
0485 
0486   if (Enable::FWDJETS_EVAL) Jet_FwdEval(outputroot + "_g4fwdjet_eval.root");
0487 
0488   if (Enable::USER) UserAnalysisInit();
0489 
0490   AnaTutorial *anaTutorial = new AnaTutorial("anaTutorial", outputroot + "_anaTutorial.root");
0491   anaTutorial->setMinJetPt(3.);
0492   anaTutorial->Verbosity(0);
0493   anaTutorial->analyzeTracks(true);
0494   anaTutorial->analyzeClusters(true);
0495   anaTutorial->analyzeJets(true);
0496   anaTutorial->analyzeTruth(false);
0497   se->registerSubsystem(anaTutorial);
0498 
0499   //--------------
0500   // Set up Input Managers
0501   //--------------
0502 
0503   InputManagers();
0504 
0505   //--------------
0506   // Set up Output Manager
0507   //--------------
0508   if (Enable::PRODUCTION)
0509   {
0510     Production_CreateOutputDir();
0511   }
0512 
0513   if (Enable::DSTOUT)
0514   {
0515     string FullOutFile = DstOut::OutputDir + "/" + DstOut::OutputFile;
0516     Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", FullOutFile);
0517     if (Enable::DSTOUT_COMPRESS) DstCompress(out);
0518     se->registerOutputManager(out);
0519   }
0520 
0521   //-----------------
0522   // Event processing
0523   //-----------------
0524   if (Enable::DISPLAY)
0525   {
0526     DisplayOn();
0527 
0528     gROOT->ProcessLine("Fun4AllServer *se = Fun4AllServer::instance();");
0529     gROOT->ProcessLine("PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco(\"PHG4RECO\");");
0530 
0531     cout << "-------------------------------------------------" << endl;
0532     cout << "You are in event display mode. Run one event with" << endl;
0533     cout << "se->run(1)" << endl;
0534     cout << "Run Geant4 command with following examples" << endl;
0535     gROOT->ProcessLine("displaycmd()");
0536 
0537     return 0;
0538   }
0539   // if we use a negative number of events we go back to the command line here
0540   if (nEvents < 0)
0541   {
0542     return 0;
0543   }
0544   // if we run any of the particle generators and use 0 it'll run forever
0545   if (nEvents == 0 && !Input::READHITS && !Input::HEPMC && !Input::READEIC)
0546   {
0547     cout << "using 0 for number of events is a bad idea when using particle generators" << endl;
0548     cout << "it will run forever, so I just return without running anything" << endl;
0549     return 0;
0550   }
0551 
0552   se->skip(skip);
0553   se->run(nEvents);
0554 
0555   //-----
0556   // Exit
0557   //-----
0558 
0559   se->End();
0560   std::cout << "All done" << std::endl;
0561   delete se;
0562   if (Enable::PRODUCTION)
0563   {
0564     Production_MoveOutput();
0565   }
0566   gSystem->Exit(0);
0567   return 0;
0568 }
0569 #endif