Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_G4_sPHENIX_ForTrackCutStudy_WithPileup_EmbedScanOn.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_G4_sPHENIX_ForTrackCutStudy_WithPileup_EmbedScanOn.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_Bbc.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  //D0 generator
118  //Input::DZERO = false;
119  //Input::DZERO_VERBOSITY = 0;
120  //Lambda_c generator //Not ready yet
121  //Input::LAMBDAC = false;
122  //Input::LAMBDAC_VERBOSITY = 0;
123  // Upsilon generator
124  //Input::UPSILON = true;
125  //Input::UPSILON_NUMBER = 3; // if you need 3 of them
126  //Input::UPSILON_VERBOSITY = 0;
127 
128  // Input::HEPMC = true;
129  INPUTHEPMC::filename = inputFile;
130 
131  // Event pile up simulation with collision rate in Hz MB collisions.
132  //Input::PILEUPRATE = 100e3;
133 
134  //-----------------
135  // Initialize the selected Input/Event generation
136  //-----------------
137  // This creates the input generator(s)
138  InputInit();
139 
140  //--------------
141  // Set generator specific options
142  //--------------
143  // can only be set after InputInit() is called
144 
145  // Simple Input generator:
146  // if you run more than one of these Input::SIMPLE_NUMBER > 1
147  // add the settings for other with [1], next with [2]...
148  if (Input::SIMPLE)
149  {
150  INPUTGENERATOR::SimpleEventGenerator[0]->add_particles("pi-", 5);
151  if (Input::HEPMC || Input::EMBED)
152  {
153  INPUTGENERATOR::SimpleEventGenerator[0]->set_reuse_existing_vertex(true);
154  INPUTGENERATOR::SimpleEventGenerator[0]->set_existing_vertex_offset_vector(0.0, 0.0, 0.0);
155  }
156  else
157  {
158  INPUTGENERATOR::SimpleEventGenerator[0]->set_vertex_distribution_function(PHG4SimpleEventGenerator::Gaus,
161  INPUTGENERATOR::SimpleEventGenerator[0]->set_vertex_distribution_mean(0., 0., 0.);
162  INPUTGENERATOR::SimpleEventGenerator[0]->set_vertex_distribution_width(0.01, 0.01, 5.);
163  }
164  INPUTGENERATOR::SimpleEventGenerator[0]->set_eta_range(-1, 1);
165  INPUTGENERATOR::SimpleEventGenerator[0]->set_phi_range(-M_PI, M_PI);
166  INPUTGENERATOR::SimpleEventGenerator[0]->set_pt_range(0.1, 20.);
167  }
168  // Upsilons
169  // if you run more than one of these Input::UPSILON_NUMBER > 1
170  // add the settings for other with [1], next with [2]...
171  if (Input::UPSILON)
172  {
173  INPUTGENERATOR::VectorMesonGenerator[0]->add_decay_particles("e", 0);
174  INPUTGENERATOR::VectorMesonGenerator[0]->set_rapidity_range(-1, 1);
175  INPUTGENERATOR::VectorMesonGenerator[0]->set_pt_range(0., 10.);
176  // Y species - select only one, last one wins
177  INPUTGENERATOR::VectorMesonGenerator[0]->set_upsilon_1s();
178  if (Input::HEPMC || Input::EMBED)
179  {
180  INPUTGENERATOR::VectorMesonGenerator[0]->set_reuse_existing_vertex(true);
181  INPUTGENERATOR::VectorMesonGenerator[0]->set_existing_vertex_offset_vector(0.0, 0.0, 0.0);
182  }
183  }
184  // particle gun
185  // if you run more than one of these Input::GUN_NUMBER > 1
186  // add the settings for other with [1], next with [2]...
187  if (Input::GUN)
188  {
189  INPUTGENERATOR::Gun[0]->AddParticle("pi-", 0, 1, 0);
190  INPUTGENERATOR::Gun[0]->set_vtx(0, 0, 0);
191  }
192 
193  // pythia6
194  if (Input::PYTHIA6)
195  {
198  }
199  // pythia8
200  if (Input::PYTHIA8)
201  {
204  }
205 
206  //--------------
207  // Set Input Manager specific options
208  //--------------
209  // can only be set after InputInit() is called
210 
211  if (Input::HEPMC)
212  {
215 
216  // optional overriding beam parameters
217  //INPUTMANAGER::HepMCInputManager->set_vertex_distribution_width(100e-4, 100e-4, 8, 0); //optional collision smear in space, time
218  // INPUTMANAGER::HepMCInputManager->set_vertex_distribution_mean(0,0,0,0);//optional collision central position shift in space, time
219  // //optional choice of vertex distribution function in space, time
220  //INPUTMANAGER::HepMCInputManager->set_vertex_distribution_function(PHHepMCGenHelper::Gaus, PHHepMCGenHelper::Gaus, PHHepMCGenHelper::Gaus, PHHepMCGenHelper::Gaus);
225  //INPUTMANAGER::HepMCInputManager->set_embedding_id(Input::EmbedID);
226  if (Input::PILEUPRATE > 0)
227  {
228  // Copy vertex settings from foreground hepmc input
230  // and then modify the ones you want to be different
231  // INPUTMANAGER::HepMCPileupInputManager->set_vertex_distribution_width(100e-4,100e-4,8,0);
232  }
233  }
234  if (Input::PILEUPRATE > 0)
235  {
238  }
239  // register all input generators with Fun4All
240  InputRegister();
241 
242  if (! Input::READHITS)
243  {
244  rc->set_IntFlag("RUNNUMBER",1);
245 
246  SyncReco *sync = new SyncReco();
247  se->registerSubsystem(sync);
248 
249  HeadReco *head = new HeadReco();
250  se->registerSubsystem(head);
251  }
252 // Flag Handler is always needed to read flags from input (if used)
253 // and update our rc flags with them. At the end it saves all flags
254 // again on the DST in the Flags node under the RUN node
255  FlagHandler *flag = new FlagHandler();
256  se->registerSubsystem(flag);
257 
258  // set up production relatedstuff
259  // Enable::PRODUCTION = true;
260 
261  //======================
262  // Write the DST
263  //======================
264 
265  //Enable::DSTOUT = true;
266  Enable::DSTOUT_COMPRESS = false;
267  DstOut::OutputDir = outdir;
268  DstOut::OutputFile = outputFile;
269 
270  //Option to convert DST to human command readable TTree for quick poke around the outputs
271  // Enable::DSTREADER = true;
272 
273  // turn the display on (default off)
274  //Enable::DISPLAY = true;
275 
276  //======================
277  // What to run
278  //======================
279 
280  // QA, main switch
281  Enable::QA = true;
282 
283  // Global options (enabled for all enables subsystems - if implemented)
284  // Enable::ABSORBER = true;
285  // Enable::OVERLAPCHECK = true;
286  // Enable::VERBOSITY = 1;
287 
288  // Enable::BBC = true;
289  // Enable::BBC_SUPPORT = true; // save hist in bbc support structure
290  // Enable::BBCRECO = Enable::BBC && true
291  Enable::BBCFAKE = true; // Smeared vtx and t0, use if you don't want real BBC in simulation
292 
293  Enable::PIPE = true;
294  Enable::PIPE_ABSORBER = true;
295 
296  // central tracking
297  Enable::MVTX = true;
301 
302  Enable::INTT = true;
303 // Enable::INTT_ABSORBER = true; // enables layerwise support structure readout
304 // Enable::INTT_SUPPORT = true; // enable global support structure readout
307  Enable::INTT_QA = Enable::INTT_CLUSTER && Enable::QA && true;
308 
309  Enable::TPC = true;
310  Enable::TPC_ABSORBER = true;
311  Enable::TPC_CELL = Enable::TPC && true;
313  Enable::TPC_QA = Enable::TPC_CLUSTER && Enable::QA && true;
314 
315  Enable::MICROMEGAS = true;
318  Enable::MICROMEGAS_QA = Enable::MICROMEGAS_CLUSTER && Enable::QA && true;
319 
322  Enable::TRACKING_QA = Enable::TRACKING_TRACK && Enable::QA && true;
323 
324  //Additional tracking tools
325  //Enable::TRACKING_DIAGNOSTICS = Enable::TRACKING_TRACK && true;
326  //G4TRACKING::filter_conversion_electrons = true;
327 
328 
329  // cemc electronics + thin layer of W-epoxy to get albedo from cemc
330  // into the tracking, cannot run together with CEMC
331  // Enable::CEMCALBEDO = true;
332 
333  Enable::CEMC = true;
334  Enable::CEMC_ABSORBER = true;
339  Enable::CEMC_QA = Enable::CEMC_CLUSTER && Enable::QA && true;
340 
341  Enable::HCALIN = true;
347  Enable::HCALIN_QA = Enable::HCALIN_CLUSTER && Enable::QA && true;
348 
349  Enable::MAGNET = true;
351 
352  Enable::HCALOUT = true;
358  Enable::HCALOUT_QA = Enable::HCALOUT_CLUSTER && Enable::QA && true;
359 
360  Enable::EPD = true;
361  Enable::EPD_TILE = Enable::EPD && true;
362 
363  Enable::BEAMLINE = true;
364 // Enable::BEAMLINE_ABSORBER = true; // makes the beam line magnets sensitive volumes
365 // Enable::BEAMLINE_BLACKHOLE = true; // turns the beamline magnets into black holes
366  Enable::ZDC = true;
367 // Enable::ZDC_ABSORBER = true;
368 // Enable::ZDC_SUPPORT = true;
369  Enable::ZDC_TOWER = Enable::ZDC && true;
371 
373  //Enable::PLUGDOOR = true;
375 
376  Enable::GLOBAL_RECO = (Enable::BBCFAKE || Enable::TRACKING_TRACK) && true;
377  //Enable::GLOBAL_FASTSIM = true;
378 
379  //Enable::KFPARTICLE = true;
380  //Enable::KFPARTICLE_VERBOSITY = 1;
381  //Enable::KFPARTICLE_TRUTH_MATCH = true;
382  //Enable::KFPARTICLE_SAVE_NTUPLE = true;
383 
385 
388  Enable::JETS_QA = Enable::JETS && Enable::QA && true;
389 
390  // HI Jet Reco for p+Au / Au+Au collisions (default is false for
391  // single particle / p+p-only simulations, or for p+Au / Au+Au
392  // simulations which don't particularly care about jets)
393  Enable::HIJETS = Enable::JETS && Enable::CEMC_TOWER && Enable::HCALIN_TOWER && Enable::HCALOUT_TOWER && false;
394 
395  // 3-D topoCluster reconstruction, potentially in all calorimeter layers
396  Enable::TOPOCLUSTER = Enable::CEMC_TOWER && Enable::HCALIN_TOWER && Enable::HCALOUT_TOWER && false;
397  // particle flow jet reconstruction - needs topoClusters!
399  // centrality reconstruction
400  Enable::CENTRALITY = true;
401 
402  // new settings using Enable namespace in GlobalVariables.C
403  Enable::BLACKHOLE = true;
404  //Enable::BLACKHOLE_SAVEHITS = false; // turn off saving of bh hits
405  //Enable::BLACKHOLE_FORWARD_SAVEHITS = false; // disable forward/backward hits
406  //BlackHoleGeometry::visible = true;
407 
408  // run user provided code (from local G4_User.C)
409  //Enable::USER = true;
410 
411  //===============
412  // conditions DB flags
413  //===============
414  Enable::CDB = true;
415  // global tag
416  rc->set_StringFlag("CDB_GLOBALTAG",CDB::global_tag);
417  // 64 bit timestamp
418  rc->set_uint64Flag("TIMESTAMP",CDB::timestamp);
419  //---------------
420  // World Settings
421  //---------------
422  // G4WORLD::PhysicsList = "FTFP_BERT"; //FTFP_BERT_HP best for calo
423  // G4WORLD::WorldMaterial = "G4_AIR"; // set to G4_GALACTIC for material scans
424 
425  //---------------
426  // Magnet Settings
427  //---------------
428 
429  // G4MAGNET::magfield = string(getenv("CALIBRATIONROOT"))+ string("/Field/Map/sphenix3dbigmapxyz.root"); // default map from the calibration database
430  // 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)
431 // G4MAGNET::magfield_rescale = 1.; // make consistent with expected Babar field strength of 1.4T
432 
433  //---------------
434  // Pythia Decayer
435  //---------------
436  // list of decay types in
437  // $OFFLINE_MAIN/include/g4decayer/EDecayType.hh
438  // default is All:
439  // G4P6DECAYER::decayType = EDecayType::kAll;
440 
441  // Initialize the selected subsystems
442  G4Init();
443 
444  //---------------------
445  // GEANT4 Detector description
446  //---------------------
447  if (!Input::READHITS)
448  {
449  G4Setup();
450  }
451 
452  //------------------
453  // Detector Division
454  //------------------
455 
456  if ((Enable::BBC && Enable::BBCRECO) || Enable::BBCFAKE) Bbc_Reco();
457 
462 
464 
466 
468 
469  //-----------------------------
470  // CEMC towering and clustering
471  //-----------------------------
472 
475 
476  //--------------
477  // EPD tile reconstruction
478  //--------------
479 
481 
482  //-----------------------------
483  // HCAL towering and clustering
484  //-----------------------------
485 
488 
489  if (Enable::HCALOUT_TOWER) HCALOuter_Towers();
491 
492  // if enabled, do topoClustering early, upstream of any possible jet reconstruction
494 
495  //--------------
496  // SVTX tracking
497  //--------------
499  {
500  TrackingInit();
501  }
505  {
507  {
509  }
510  else
511  {
512  TPC_Clustering();
513  }
514  }
516 
518  {
519  Tracking_Reco();
520  }
521 
523  {
524  const std::string kshortFile = "./kshort_" + outputFile;
525  const std::string residualsFile = "./residuals_" + outputFile;
526 
527  G4KshortReconstruction(kshortFile);
528  seedResiduals(residualsFile);
529  }
530 
531  //-----------------
532  // Global Vertexing
533  //-----------------
534 
536  {
537  cout << "You can only enable Enable::GLOBAL_RECO or Enable::GLOBAL_FASTSIM, not both" << endl;
538  gSystem->Exit(1);
539  }
541  {
542  Global_Reco();
543  }
544  else if (Enable::GLOBAL_FASTSIM)
545  {
546  Global_FastSim();
547  }
548 
549  //-----------------
550  // Centrality Determination
551  //-----------------
552 
553  if (Enable::CENTRALITY)
554  {
555  Centrality();
556  }
557 
558  //-----------------
559  // Calo Trigger Simulation
560  //-----------------
561 
563  {
564  CaloTrigger_Sim();
565  }
566 
567  //---------
568  // Jet reco
569  //---------
570 
571  if (Enable::JETS) Jet_Reco();
572  if (Enable::HIJETS) HIJetReco();
573 
575 
576  //----------------------
577  // Simulation evaluation
578  //----------------------
579  string outputroot = outputFile;
580  string remove_this = ".root";
581  size_t pos = outputroot.find(remove_this);
582  if (pos != string::npos)
583  {
584  outputroot.erase(pos, remove_this.length());
585  }
586 
587  if (Enable::TRACKING_EVAL) {
588 
589  // create output name
590  const std::string svtxOutput = outputroot + "_g4svtx_eval.root";
591 
592  // instantiate tracking evaluator
593  SvtxEvaluator* eval;
594  eval = new SvtxEvaluator("SVTXEVALUATOR", svtxOutput, "SvtxTrackMap",
599 
600  // turn on evaluations
601  eval -> do_cluster_eval(false);
602  eval -> do_g4hit_eval(false);
603  eval -> do_hit_eval(false); // enable to see the hits that includes the chamber physics...
604  eval -> do_gpoint_eval(false);
605  eval -> do_vtx_eval_light(true);
606  eval -> do_eval_light(true);
607  eval -> set_use_initial_vertex(G4TRACKING::g4eval_use_initial_vertex);
608 
609  // turn off embed scan
610  bool embed_scan = true;
611  if (TRACKING::pp_mode) {
612  embed_scan = false;
613  }
614  eval -> scan_for_embedded(embed_scan); // take all tracks if false - take only embedded tracks if true
615  eval -> scan_for_primaries(embed_scan); // defaults to only thrown particles for ntp_gtrack
616 
617  // announce pp mode selection
618  std::cout << "SvtxEvaluator: pp_mode set to " << TRACKING::pp_mode << " and scan_for_embedded set to " << embed_scan << std::endl;
619  eval -> Verbosity(1);
620  eval -> set_cluster_version(G4TRACKING::cluster_version);
621 
622  // register evaluator
623  se -> registerSubsystem(eval);
624  }
625 
626  if (Enable::CEMC_EVAL) CEMC_Eval(outputroot + "_g4cemc_eval.root");
627 
628  if (Enable::HCALIN_EVAL) HCALInner_Eval(outputroot + "_g4hcalin_eval.root");
629 
630  if (Enable::HCALOUT_EVAL) HCALOuter_Eval(outputroot + "_g4hcalout_eval.root");
631 
632  if (Enable::JETS_EVAL) Jet_Eval(outputroot + "_g4jet_eval.root");
633 
634  if (Enable::DSTREADER) G4DSTreader(outputroot + "_DSTReader.root");
635 
637 
638  // Writes electrons from conversions to a new track map on the node tree
639  // the ntuple file is for diagnostics, it is produced only if the flag is set in G4_Tracking.C
640  if(G4TRACKING::filter_conversion_electrons) Filter_Conversion_Electrons(outputroot + "_secvert_ntuple.root");
641 
642  //======================
643  // Run KFParticle on evt
644  //======================
647 
648  //----------------------
649  // Standard QAs
650  //----------------------
651 
652  if (Enable::CEMC_QA) CEMC_QA();
655 
656  if (Enable::JETS_QA) Jet_QA();
657 
658  if (Enable::MVTX_QA) Mvtx_QA();
659  if (Enable::INTT_QA) Intt_QA();
660  if (Enable::TPC_QA) TPC_QA();
663 
665 
666  //--------------
667  // Set up Input Managers
668  //--------------
669 
670  InputManagers();
671 
672  if (Enable::PRODUCTION)
673  {
675  }
676 
677  if (Enable::DSTOUT)
678  {
679  string FullOutFile = DstOut::OutputDir + "/" + DstOut::OutputFile;
680  Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", FullOutFile);
682  {
683  ShowerCompress();
684  DstCompress(out);
685  }
686  se->registerOutputManager(out);
687  }
688  //-----------------
689  // Event processing
690  //-----------------
691  if (Enable::DISPLAY)
692  {
693  DisplayOn();
694 
695  gROOT->ProcessLine("Fun4AllServer *se = Fun4AllServer::instance();");
696  gROOT->ProcessLine("PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco(\"PHG4RECO\");");
697 
698  cout << "-------------------------------------------------" << endl;
699  cout << "You are in event display mode. Run one event with" << endl;
700  cout << "se->run(1)" << endl;
701  cout << "Run Geant4 command with following examples" << endl;
702  gROOT->ProcessLine("displaycmd()");
703 
704  return 0;
705  }
706 
707  // if we use a negative number of events we go back to the command line here
708  if (nEvents < 0)
709  {
710  return 0;
711  }
712  // if we run the particle generator and use 0 it'll run forever
713  // for embedding it runs forever if the repeat flag is set
714  if (nEvents == 0 && !Input::HEPMC && !Input::READHITS && INPUTEMBED::REPEAT)
715  {
716  cout << "using 0 for number of events is a bad idea when using particle generators" << endl;
717  cout << "it will run forever, so I just return without running anything" << endl;
718  return 0;
719  }
720 
721  se->skip(skip);
722  se->run(nEvents);
723 
724  //-----
725  // QA output
726  //-----
727 
728  if (Enable::QA) QA_Output(outputroot + "_qa.root");
729 
730  //-----
731  // Exit
732  //-----
733 
734 // CDBInterface::instance()->Print(); // print used DB files
735  se->End();
736  std::cout << "All done" << std::endl;
737  delete se;
738  if (Enable::PRODUCTION)
739  {
741  }
742 
743  gSystem->Exit(0);
744  return 0;
745 }
746 #endif