6 const char *inputFile =
"hepmc_pythia.dat",
7 const char *outputFile =
"G4sPHENIX.root",
8 const char *embed_input_file =
"/sphenix/data/data02/review_2017-08-02/sHijing/fm_0-4.list")
11 const int n_TPC_layers = 40;
24 const bool readhits =
false;
27 const bool readhepmc =
true;
30 const bool runpythia8 =
false;
31 const bool runpythia6 =
false;
37 const bool do_embedding =
false;
41 const bool particles =
false && !readhits;
43 const bool usegun =
false && !readhits;
45 const bool upsilons =
false && !readhits;
48 const double pileup_collision_rate = 0;
59 bool do_svtx_cell = do_svtx &&
true;
60 bool do_svtx_track = do_svtx_cell &&
true;
61 bool do_svtx_eval = do_svtx_track &&
false;
63 bool do_pstof =
false;
66 bool do_cemc_cell = do_cemc &&
true;
67 bool do_cemc_twr = do_cemc_cell &&
true;
68 bool do_cemc_cluster = do_cemc_twr &&
true;
69 bool do_cemc_eval = do_cemc_cluster &&
false;
71 bool do_hcalin =
true;
72 bool do_hcalin_cell = do_hcalin &&
true;
73 bool do_hcalin_twr = do_hcalin_cell &&
true;
74 bool do_hcalin_cluster = do_hcalin_twr &&
true;
75 bool do_hcalin_eval = do_hcalin_cluster &&
false;
77 bool do_magnet =
true;
79 bool do_hcalout =
true;
80 bool do_hcalout_cell = do_hcalout &&
true;
81 bool do_hcalout_twr = do_hcalout_cell &&
true;
82 bool do_hcalout_cluster = do_hcalout_twr &&
true;
83 bool do_hcalout_eval = do_hcalout_cluster &&
false;
86 bool do_plugdoor =
false;
88 bool do_global =
true;
89 bool do_global_fastsim =
true;
91 bool do_calotrigger =
true && do_cemc_twr && do_hcalin_twr && do_hcalout_twr;
93 bool do_jet_reco =
true;
94 bool do_jet_eval = do_jet_reco &&
true;
99 bool do_HIjetreco =
false && do_cemc_twr && do_hcalin_twr && do_hcalout_twr;
101 bool do_dst_compress =
false;
104 bool do_DSTReader =
false;
109 gSystem->Load(
"libfun4all.so");
110 gSystem->Load(
"libg4detectors.so");
111 gSystem->Load(
"libphhepmc.so");
112 gSystem->Load(
"libg4testbench.so");
113 gSystem->Load(
"libg4hough.so");
114 gSystem->Load(
"libg4eval.so");
117 gROOT->LoadMacro(
"G4Setup_sPHENIX.C");
118 G4Init(do_svtx, do_pstof, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe, do_plugdoor, n_TPC_layers);
120 int absorberactive = 1;
122 const string magfield =
"/phenix/upgrades/decadal/fieldmaps/sPHENIX.2d.root";
154 cout <<
"Do not support read hits and embed background at the same time." << endl;
171 gSystem->Load(
"libPHPythia8.so");
200 gSystem->Load(
"libPHPythia6.so");
217 if (readhepmc || do_embedding || runpythia8 || runpythia6)
259 pgen->
set_phi_range(5.3 / 180. * TMath::Pi(), 5.7 / 180. * TMath::Pi());
271 if (readhepmc || do_embedding || particles || runpythia8 || runpythia6)
277 vgen->set_vtx_zrange(-10.0, +10.0);
292 else if (istate == 2)
309 cout <<
"Upsilon generator for istate = " << istate <<
" created and registered " << endl;
320 do_svtx, do_pstof, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe,do_plugdoor, magfield_rescale);
329 gROOT->LoadMacro(
"G4_Bbc.C");
376 gROOT->LoadMacro(
"G4_Global.C");
380 else if (do_global_fastsim)
382 gROOT->LoadMacro(
"G4_Global.C");
392 gROOT->LoadMacro(
"G4_CaloTrigger.C");
402 gROOT->LoadMacro(
"G4_Jets.C");
408 gROOT->LoadMacro(
"G4_HIJetReco.C");
416 if (do_svtx_eval)
Svtx_Eval(
string(outputFile) +
"_g4svtx_eval.root");
418 if (do_cemc_eval)
CEMC_Eval(
string(outputFile) +
"_g4cemc_eval.root");
420 if (do_hcalin_eval)
HCALInner_Eval(
string(outputFile) +
"_g4hcalin_eval.root");
422 if (do_hcalout_eval)
HCALOuter_Eval(
string(outputFile) +
"_g4hcalout_eval.root");
424 if (do_jet_eval)
Jet_Eval(
string(outputFile) +
"_g4jet_eval.root");
429 gSystem->Load(
"libPhotonJet.so");
456 gSystem->Load(
"libg4dst.so");
466 if (embed_input_file == NULL)
468 cout <<
"Missing embed_input_file! Exit";
473 gSystem->Load(
"libg4dst.so");
484 gSystem->Load(
"libg4dst.so");
507 if (pileup_collision_rate > 0)
514 const string pileupfile(
"/sphenix/sim/sim01/sHijing/sHijing_0-12fm.dat");
520 double time_window_minus = -35000;
521 double time_window_plus = 35000;
530 cout <<
"Collision pileup enabled using file " << pileupfile <<
" with collision rate " << pileup_collision_rate
531 <<
" and time window " << time_window_minus <<
" to " << time_window_plus << endl;
537 gROOT->LoadMacro(
"G4_DSTReader.C");
565 if (
nEvents == 0 && !readhits && !readhepmc)
567 cout <<
"using 0 for number of events is a bad idea when using particle generators" << endl;
568 cout <<
"it will run forever, so I just return without running anything" << endl;
579 std::cout <<
"All done" << std::endl;