Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_G4_sPHENIX.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_G4_sPHENIX.C
1 #ifndef MACRO_FUN4ALLG4SPHENIX_C
2 #define MACRO_FUN4ALLG4SPHENIX_C
3 
4 #include <GlobalVariables.C>
5 
6 #include <DisplayOn.C>
7 #include <G4Setup_sPHENIX.C>
8 #include <G4_Mbd.C>
9 #include <G4_CaloTrigger.C>
10 #include <G4_Centrality.C>
11 #include <G4_DSTReader.C>
12 #include <G4_Global.C>
13 #include <G4_HIJetReco.C>
14 #include <G4_Input.C>
15 #include <G4_Jets.C>
16 #include <G4_KFParticle.C>
17 #include <G4_ParticleFlow.C>
18 #include <G4_Production.C>
19 #include <G4_TopoClusterReco.C>
20 
21 #include <Trkr_RecoInit.C>
22 #include <Trkr_Clustering.C>
23 #include <Trkr_LaserClustering.C>
24 #include <Trkr_Reco.C>
25 #include <Trkr_Eval.C>
26 #include <Trkr_QA.C>
27 
28 #include <Trkr_Diagnostics.C>
29 #include <G4_User.C>
30 #include <QA.C>
31 
32 #include <ffamodules/FlagHandler.h>
33 #include <ffamodules/HeadReco.h>
34 #include <ffamodules/SyncReco.h>
36 
39 #include <fun4all/Fun4AllServer.h>
40 
41 #include <phool/PHRandomSeed.h>
42 #include <phool/recoConsts.h>
43 
44 R__LOAD_LIBRARY(libfun4all.so)
45 R__LOAD_LIBRARY(libffamodules.so)
46 
47 // For HepMC Hijing
48 // try inputFile = /sphenix/sim/sim01/sphnxpro/sHijing_HepMC/sHijing_0-12fm.dat
49 
51  const int nEvents = 1,
52  const string &inputFile = "https://www.phenix.bnl.gov/WWW/publish/phnxbld/sPHENIX/files/sPHENIX_G4Hits_sHijing_9-11fm_00000_00010.root",
53  const string &outputFile = "G4sPHENIX.root",
54  const string &embed_input_file = "https://www.phenix.bnl.gov/WWW/publish/phnxbld/sPHENIX/files/sPHENIX_G4Hits_sHijing_9-11fm_00000_00010.root",
55  const int skip = 0,
56  const string &outdir = ".")
57 {
59  se->Verbosity(0);
60 
61  //Opt to print all random seed used for debugging reproducibility. Comment out to reduce stdout prints.
63 
64  // just if we set some flags somewhere in this macro
66  // By default every random number generator uses
67  // PHRandomSeed() which reads /dev/urandom to get its seed
68  // if the RANDOMSEED flag is set its value is taken as seed
69  // You can either set this to a random value using PHRandomSeed()
70  // which will make all seeds identical (not sure what the point of
71  // this would be:
72  // rc->set_IntFlag("RANDOMSEED",PHRandomSeed());
73  // or set it to a fixed value so you can debug your code
74  // rc->set_IntFlag("RANDOMSEED", 12345);
75 
76 
77  //===============
78  // Input options
79  //===============
80  // verbosity setting (applies to all input managers)
81  Input::VERBOSITY = 0;
82  // First enable the input generators
83  // Either:
84  // read previously generated g4-hits files, in this case it opens a DST and skips
85  // the simulations step completely. The G4Setup macro is only loaded to get information
86  // about the number of layers used for the cell reco code
87  // Input::READHITS = true;
88  INPUTREADHITS::filename[0] = inputFile;
89  // if you use a filelist
90  // INPUTREADHITS::listfile[0] = inputFile;
91  // Or:
92  // Use particle generator
93  // And
94  // Further choose to embed newly simulated events to a previous simulation. Not compatible with `readhits = true`
95  // In case embedding into a production output, please double check your G4Setup_sPHENIX.C and G4_*.C consistent with those in the production macro folder
96  // E.g. /sphenix/sim//sim01/production/2016-07-21/single_particle/spacal2d/
97  // Input::EMBED = true;
98  INPUTEMBED::filename[0] = embed_input_file;
99  // if you use a filelist
100  //INPUTEMBED::listfile[0] = embed_input_file;
101 
102  Input::SIMPLE = true;
103  // Input::SIMPLE_NUMBER = 2; // if you need 2 of them
104  // Input::SIMPLE_VERBOSITY = 1;
105 
106  // Enable this is emulating the nominal pp/pA/AA collision vertex distribution
107  // Input::BEAM_CONFIGURATION = Input::AA_COLLISION; // Input::AA_COLLISION (default), Input::pA_COLLISION, Input::pp_COLLISION
108 
109  // Input::PYTHIA6 = true;
110 
111  // Input::PYTHIA8 = true;
112 
113  // Input::GUN = true;
114  // Input::GUN_NUMBER = 3; // if you need 3 of them
115  // Input::GUN_VERBOSITY = 1;
116 
117  // Input::COSMIC = true;
118 
119  //D0 generator
120  //Input::DZERO = false;
121  //Input::DZERO_VERBOSITY = 0;
122  //Lambda_c generator //Not ready yet
123  //Input::LAMBDAC = false;
124  //Input::LAMBDAC_VERBOSITY = 0;
125  // Upsilon generator
126  //Input::UPSILON = true;
127  //Input::UPSILON_NUMBER = 3; // if you need 3 of them
128  //Input::UPSILON_VERBOSITY = 0;
129 
130  // Input::HEPMC = true;
131  INPUTHEPMC::filename = inputFile;
132  //-----------------
133  // Hijing options (symmetrize hijing, add flow, add fermi motion)
134  //-----------------
135  // INPUTHEPMC::HIJINGFLIP = true;
136  // INPUTHEPMC::FLOW = true;
137  // INPUTHEPMC::FLOW_VERBOSITY = 3;
138  // INPUTHEPMC::FERMIMOTION = true;
139 
140 
141  // Event pile up simulation with collision rate in Hz MB collisions.
142  //Input::PILEUPRATE = 50e3; // 50 kHz for AuAu
143  //Input::PILEUPRATE = 3e6; // 3MHz for pp
144 
145  // Enable this is emulating the nominal pp/pA/AA collision vertex distribution
146  // for HepMC records (hijing, pythia8)
147  // Input::BEAM_CONFIGURATION = Input::AA_COLLISION; // for 2023 sims we want the AA geometry for no pileup sims
148  // Input::BEAM_CONFIGURATION = Input::pp_COLLISION; // for 2024 sims we want the pp geometry for no pileup sims
149  // Input::BEAM_CONFIGURATION = Input::pA_COLLISION; // for pAu sims we want the pA geometry for no pileup sims
150 
151  //-----------------
152  // Initialize the selected Input/Event generation
153  //-----------------
154  // This creates the input generator(s)
155  InputInit();
156 
157  //--------------
158  // Set generator specific options
159  //--------------
160  // can only be set after InputInit() is called
161 
162  // Simple Input generator:
163  // if you run more than one of these Input::SIMPLE_NUMBER > 1
164  // add the settings for other with [1], next with [2]...
165  if (Input::SIMPLE)
166  {
167  INPUTGENERATOR::SimpleEventGenerator[0]->add_particles("pi-", 5);
168  if (Input::HEPMC || Input::EMBED)
169  {
170  INPUTGENERATOR::SimpleEventGenerator[0]->set_reuse_existing_vertex(true);
171  INPUTGENERATOR::SimpleEventGenerator[0]->set_existing_vertex_offset_vector(0.0, 0.0, 0.0);
172  }
173  else
174  {
175  INPUTGENERATOR::SimpleEventGenerator[0]->set_vertex_distribution_function(PHG4SimpleEventGenerator::Gaus,
178  INPUTGENERATOR::SimpleEventGenerator[0]->set_vertex_distribution_mean(0., 0., 0.);
179  INPUTGENERATOR::SimpleEventGenerator[0]->set_vertex_distribution_width(0.01, 0.01, 5.);
180  }
181  INPUTGENERATOR::SimpleEventGenerator[0]->set_eta_range(-1, 1);
182  INPUTGENERATOR::SimpleEventGenerator[0]->set_phi_range(-M_PI, M_PI);
183  INPUTGENERATOR::SimpleEventGenerator[0]->set_pt_range(0.1, 20.);
184  }
185  // Upsilons
186  // if you run more than one of these Input::UPSILON_NUMBER > 1
187  // add the settings for other with [1], next with [2]...
188  if (Input::UPSILON)
189  {
190  INPUTGENERATOR::VectorMesonGenerator[0]->add_decay_particles("e", 0);
191  INPUTGENERATOR::VectorMesonGenerator[0]->set_rapidity_range(-1, 1);
192  INPUTGENERATOR::VectorMesonGenerator[0]->set_pt_range(0., 10.);
193  // Y species - select only one, last one wins
194  INPUTGENERATOR::VectorMesonGenerator[0]->set_upsilon_1s();
195  if (Input::HEPMC || Input::EMBED)
196  {
197  INPUTGENERATOR::VectorMesonGenerator[0]->set_reuse_existing_vertex(true);
198  INPUTGENERATOR::VectorMesonGenerator[0]->set_existing_vertex_offset_vector(0.0, 0.0, 0.0);
199  }
200  }
201  // particle gun
202  // if you run more than one of these Input::GUN_NUMBER > 1
203  // add the settings for other with [1], next with [2]...
204  if (Input::GUN)
205  {
206  INPUTGENERATOR::Gun[0]->AddParticle("pi-", 0, 1, 0);
207  INPUTGENERATOR::Gun[0]->set_vtx(0, 0, 0);
208  }
209 
210  // pythia6
211  if (Input::PYTHIA6)
212  {
215  }
216  // pythia8
217  if (Input::PYTHIA8)
218  {
221  }
222 
223  //--------------
224  // Set Input Manager specific options
225  //--------------
226  // can only be set after InputInit() is called
227 
228  if (Input::HEPMC)
229  {
232 
233  // optional overriding beam parameters
234  //INPUTMANAGER::HepMCInputManager->set_vertex_distribution_width(100e-4, 100e-4, 8, 0); //optional collision smear in space, time
235  // INPUTMANAGER::HepMCInputManager->set_vertex_distribution_mean(0,0,0,0);//optional collision central position shift in space, time
236  // //optional choice of vertex distribution function in space, time
237  //INPUTMANAGER::HepMCInputManager->set_vertex_distribution_function(PHHepMCGenHelper::Gaus, PHHepMCGenHelper::Gaus, PHHepMCGenHelper::Gaus, PHHepMCGenHelper::Gaus);
242  //INPUTMANAGER::HepMCInputManager->set_embedding_id(Input::EmbedID);
243  if (Input::PILEUPRATE > 0)
244  {
245  // Copy vertex settings from foreground hepmc input
247  // and then modify the ones you want to be different
248  // INPUTMANAGER::HepMCPileupInputManager->set_vertex_distribution_width(100e-4,100e-4,8,0);
249  }
250  }
251  if (Input::PILEUPRATE > 0)
252  {
255  }
256  // register all input generators with Fun4All
257  InputRegister();
258 
259  if (! Input::READHITS)
260  {
261  rc->set_IntFlag("RUNNUMBER",1);
262 
263  SyncReco *sync = new SyncReco();
264  se->registerSubsystem(sync);
265 
266  HeadReco *head = new HeadReco();
267  se->registerSubsystem(head);
268  }
269 // Flag Handler is always needed to read flags from input (if used)
270 // and update our rc flags with them. At the end it saves all flags
271 // again on the DST in the Flags node under the RUN node
272  FlagHandler *flag = new FlagHandler();
273  se->registerSubsystem(flag);
274 
275  // set up production relatedstuff
276  // Enable::PRODUCTION = true;
277 
278  //======================
279  // Write the DST
280  //======================
281 
282  //Enable::DSTOUT = true;
283  Enable::DSTOUT_COMPRESS = false;
284  DstOut::OutputDir = outdir;
285  DstOut::OutputFile = outputFile;
286 
287  //Option to convert DST to human command readable TTree for quick poke around the outputs
288  // Enable::DSTREADER = true;
289 
290  // turn the display on (default off)
291  //Enable::DISPLAY = true;
292 
293  //======================
294  // What to run
295  //======================
296 
297  // QA, main switch
298  Enable::QA = true;
299 
300  // Global options (enabled for all enables subsystems - if implemented)
301  // Enable::ABSORBER = true;
302  // Enable::OVERLAPCHECK = true;
303  // Enable::VERBOSITY = 1;
304 
305  // Enable::MBD = true;
306  // Enable::MBD_SUPPORT = true; // save hist in MBD/BBC support structure
307  // Enable::MBDRECO = Enable::MBD && true;
308  Enable::MBDFAKE = true; // Smeared vtx and t0, use if you don't want real MBD/BBC in simulation
309 
310  Enable::PIPE = true;
311  Enable::PIPE_ABSORBER = true;
312 
313  // central tracking
314  Enable::MVTX = true;
318 
319  Enable::INTT = true;
320 // Enable::INTT_ABSORBER = true; // enables layerwise support structure readout
321 // Enable::INTT_SUPPORT = true; // enable global support structure readout
324  Enable::INTT_QA = Enable::INTT_CLUSTER && Enable::QA && true;
325 
326  Enable::TPC = true;
327  Enable::TPC_ABSORBER = true;
328  Enable::TPC_CELL = Enable::TPC && true;
330  Enable::TPC_QA = Enable::TPC_CLUSTER && Enable::QA && true;
331 
332  Enable::MICROMEGAS = true;
335  Enable::MICROMEGAS_QA = Enable::MICROMEGAS_CLUSTER && Enable::QA && true;
336 
340  Enable::TRACKING_QA = Enable::TRACKING_TRACK && Enable::QA && true;
341 
342  // only do track matching if TRACKINGTRACK is also used
346 
347  //Additional tracking tools
348  //Enable::TRACKING_DIAGNOSTICS = Enable::TRACKING_TRACK && true;
349  //G4TRACKING::filter_conversion_electrons = true;
350 
351 
352  // cemc electronics + thin layer of W-epoxy to get albedo from cemc
353  // into the tracking, cannot run together with CEMC
354  // Enable::CEMCALBEDO = true;
355 
356  Enable::CEMC = true;
357  Enable::CEMC_ABSORBER = true;
362  Enable::CEMC_QA = Enable::CEMC_CLUSTER && Enable::QA && true;
363 
364  Enable::HCALIN = true;
370  Enable::HCALIN_QA = Enable::HCALIN_CLUSTER && Enable::QA && true;
371 
372  Enable::MAGNET = true;
374 
375  Enable::HCALOUT = true;
381  Enable::HCALOUT_QA = Enable::HCALOUT_CLUSTER && Enable::QA && true;
382 
383  Enable::EPD = true;
384  Enable::EPD_TILE = Enable::EPD && true;
385 
386  Enable::BEAMLINE = true;
387 // Enable::BEAMLINE_ABSORBER = true; // makes the beam line magnets sensitive volumes
388 // Enable::BEAMLINE_BLACKHOLE = true; // turns the beamline magnets into black holes
389  Enable::ZDC = true;
390 // Enable::ZDC_ABSORBER = true;
391 // Enable::ZDC_SUPPORT = true;
392  Enable::ZDC_TOWER = Enable::ZDC && true;
394 
396  //Enable::PLUGDOOR = true;
398 
399  //Enable::GLOBAL_FASTSIM = true;
400 
401  //Enable::KFPARTICLE = true;
402  //Enable::KFPARTICLE_VERBOSITY = 1;
403  //Enable::KFPARTICLE_TRUTH_MATCH = true;
404  //Enable::KFPARTICLE_SAVE_NTUPLE = true;
405 
407 
408  Enable::JETS = (Enable::GLOBAL_RECO || Enable::GLOBAL_FASTSIM) && true;
410  Enable::JETS_QA = Enable::JETS && Enable::QA && true;
411 
412  // HI Jet Reco for p+Au / Au+Au collisions (default is false for
413  // single particle / p+p-only simulations, or for p+Au / Au+Au
414  // simulations which don't particularly care about jets)
415  Enable::HIJETS = Enable::JETS && Enable::CEMC_TOWER && Enable::HCALIN_TOWER && Enable::HCALOUT_TOWER && false;
416 
417  // 3-D topoCluster reconstruction, potentially in all calorimeter layers
418  Enable::TOPOCLUSTER = Enable::CEMC_TOWER && Enable::HCALIN_TOWER && Enable::HCALOUT_TOWER && false;
419  // particle flow jet reconstruction - needs topoClusters!
421  // centrality reconstruction
422  Enable::CENTRALITY = true;
423 
424  // new settings using Enable namespace in GlobalVariables.C
425  Enable::BLACKHOLE = true;
426  //Enable::BLACKHOLE_SAVEHITS = false; // turn off saving of bh hits
427  //Enable::BLACKHOLE_FORWARD_SAVEHITS = false; // disable forward/backward hits
428  //BlackHoleGeometry::visible = true;
429 
430  // run user provided code (from local G4_User.C)
431  //Enable::USER = true;
432 
433  //===============
434  // conditions DB flags
435  //===============
436  Enable::CDB = true;
437  // global tag
438  rc->set_StringFlag("CDB_GLOBALTAG",CDB::global_tag);
439  // 64 bit timestamp
440  rc->set_uint64Flag("TIMESTAMP",CDB::timestamp);
441  //---------------
442  // World Settings
443  //---------------
444  // G4WORLD::PhysicsList = "FTFP_BERT"; //FTFP_BERT_HP best for calo
445  // G4WORLD::WorldMaterial = "G4_AIR"; // set to G4_GALACTIC for material scans
446 
447  //---------------
448  // Magnet Settings
449  //---------------
450 
451  // G4MAGNET::magfield = string(getenv("CALIBRATIONROOT"))+ string("/Field/Map/sphenix3dbigmapxyz.root"); // default map from the calibration database
452  // G4MAGNET::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)
453 // G4MAGNET::magfield_rescale = 1.; // make consistent with expected Babar field strength of 1.4T
454 
455  //---------------
456  // Pythia Decayer
457  //---------------
458  // list of decay types in
459  // $OFFLINE_MAIN/include/g4decayer/EDecayType.hh
460  // default is All:
461  // G4P6DECAYER::decayType = EDecayType::kAll;
462 
463  // Initialize the selected subsystems
464  G4Init();
465 
466  //---------------------
467  // GEANT4 Detector description
468  //---------------------
469  if (!Input::READHITS)
470  {
471  G4Setup();
472  }
473 
474  //------------------
475  // Detector Division
476  //------------------
477 
479 
484 
486 
488 
490 
491  //-----------------------------
492  // CEMC towering and clustering
493  //-----------------------------
494 
496  if (Enable::CEMC_CLUSTER) CEMC_Clusters();
497 
498  //--------------
499  // EPD tile reconstruction
500  //--------------
501 
503 
504  //-----------------------------
505  // HCAL towering and clustering
506  //-----------------------------
507 
509  if (Enable::HCALIN_CLUSTER) HCALInner_Clusters();
510 
511  if (Enable::HCALOUT_TOWER) HCALOuter_Towers();
512  if (Enable::HCALOUT_CLUSTER) HCALOuter_Clusters();
513 
514  // if enabled, do topoClustering early, upstream of any possible jet reconstruction
516 
517  //--------------
518  // SVTX tracking
519  //--------------
521  {
522  TrackingInit();
523  }
527  {
529  {
531  }
532  else
533  {
534  TPC_Clustering();
535  }
536  }
538 
540  {
541  Tracking_Reco();
542  }
543 
544 
545 
547  {
548  const std::string kshortFile = "./kshort_" + outputFile;
549  const std::string residualsFile = "./residuals_" + outputFile;
550 
551  G4KshortReconstruction(kshortFile);
552  seedResiduals(residualsFile);
553  }
554 
555 
556  //-----------------
557  // Global Vertexing
558  //-----------------
559 
560  if (Enable::GLOBAL_RECO && Enable::GLOBAL_FASTSIM)
561  {
562  cout << "You can only enable Enable::GLOBAL_RECO or Enable::GLOBAL_FASTSIM, not both" << endl;
563  gSystem->Exit(1);
564  }
565  if (Enable::GLOBAL_RECO)
566  {
567  Global_Reco();
568  }
569  else if (Enable::GLOBAL_FASTSIM)
570  {
571  Global_FastSim();
572  }
573 
574  //-----------------
575  // Centrality Determination
576  //-----------------
577 
578  if (Enable::CENTRALITY)
579  {
580  Centrality();
581  }
582 
583  //-----------------
584  // Calo Trigger Simulation
585  //-----------------
586 
588  {
589  CaloTrigger_Sim();
590  }
591 
592  //---------
593  // Jet reco
594  //---------
595 
596  if (Enable::JETS) Jet_Reco();
597  if (Enable::HIJETS) HIJetReco();
598 
600 
601  //----------------------
602  // Simulation evaluation
603  //----------------------
604  string outputroot = outputFile;
605  string remove_this = ".root";
606  size_t pos = outputroot.find(remove_this);
607  if (pos != string::npos)
608  {
609  outputroot.erase(pos, remove_this.length());
610  }
611 
612  if (Enable::TRACKING_EVAL) Tracking_Eval(outputroot + "_g4svtx_eval.root");
613 
614  if (Enable::CEMC_EVAL) CEMC_Eval(outputroot + "_g4cemc_eval.root");
615 
616  if (Enable::HCALIN_EVAL) HCALInner_Eval(outputroot + "_g4hcalin_eval.root");
617 
618  if (Enable::HCALOUT_EVAL) HCALOuter_Eval(outputroot + "_g4hcalout_eval.root");
619 
620  if (Enable::JETS_EVAL) Jet_Eval(outputroot + "_g4jet_eval.root");
621 
622  if (Enable::DSTREADER) G4DSTreader(outputroot + "_DSTReader.root");
623 
624 
625 
627 
628  // Writes electrons from conversions to a new track map on the node tree
629  // the ntuple file is for diagnostics, it is produced only if the flag is set in G4_Tracking.C
630  if(G4TRACKING::filter_conversion_electrons) Filter_Conversion_Electrons(outputroot + "_secvert_ntuple.root");
631 
632 
633  //======================
634  // Run KFParticle on evt
635  //======================
638 
639  //----------------------
640  // Standard QAs
641  //----------------------
642 
643  if (Enable::CEMC_QA) CEMC_QA();
646 
647  if (Enable::JETS_QA) Jet_QA();
648 
649  if (Enable::MVTX_QA) Mvtx_QA();
650  if (Enable::INTT_QA) Intt_QA();
651  if (Enable::TPC_QA) TPC_QA();
654 
656 
657  if (Enable::TRACK_MATCHING) Track_Matching(outputroot + "_g4trackmatching.root");
658 
659  //--------------
660  // Set up Input Managers
661  //--------------
662 
663  InputManagers();
664 
665  if (Enable::PRODUCTION)
666  {
668  }
669 
670  if (Enable::DSTOUT)
671  {
672  string FullOutFile = DstOut::OutputDir + "/" + DstOut::OutputFile;
673  Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", FullOutFile);
675  {
676  ShowerCompress();
677  DstCompress(out);
678  }
679  se->registerOutputManager(out);
680  }
681  //-----------------
682  // Event processing
683  //-----------------
684  if (Enable::DISPLAY)
685  {
686  DisplayOn();
687 
688  gROOT->ProcessLine("Fun4AllServer *se = Fun4AllServer::instance();");
689  gROOT->ProcessLine("PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco(\"PHG4RECO\");");
690 
691  cout << "-------------------------------------------------" << endl;
692  cout << "You are in event display mode. Run one event with" << endl;
693  cout << "se->run(1)" << endl;
694  cout << "Run Geant4 command with following examples" << endl;
695  gROOT->ProcessLine("displaycmd()");
696 
697  return 0;
698  }
699 
700  // if we use a negative number of events we go back to the command line here
701  if (nEvents < 0)
702  {
703  return 0;
704  }
705  // if we run the particle generator and use 0 it'll run forever
706  // for embedding it runs forever if the repeat flag is set
707  if (nEvents == 0 && !Input::HEPMC && !Input::READHITS && INPUTEMBED::REPEAT)
708  {
709  cout << "using 0 for number of events is a bad idea when using particle generators" << endl;
710  cout << "it will run forever, so I just return without running anything" << endl;
711  return 0;
712  }
713 
714  se->skip(skip);
715  se->run(nEvents);
716 
717  //-----
718  // QA output
719  //-----
720 
721  if (Enable::QA) QA_Output(outputroot + "_qa.root");
722 
723  //-----
724  // Exit
725  //-----
726 
727 // CDBInterface::instance()->Print(); // print used DB files
728  se->End();
729  std::cout << "All done" << std::endl;
730  delete se;
731  if (Enable::PRODUCTION)
732  {
734  }
735 
736  gSystem->Exit(0);
737  return 0;
738 }
739 #endif