14 char *embed_input_file;
17 bool do_svtx_cell =
true;
18 bool do_svtx_track =
true;
19 bool do_svtx_eval =
true;
22 bool do_global =
false;
24 bool do_jet_reco =
true;
26 embed_input_file = NULL;
34 const bool readhits =
false;
37 const bool readhepmc =
true;
40 const bool runpythia =
false;
49 bool do_preshower =
false;
52 bool do_cemc_cell =
false;
53 bool do_cemc_twr =
false;
54 bool do_cemc_cluster =
false;
55 bool do_cemc_eval =
false;
57 bool do_hcalin =
false;
58 bool do_hcalin_cell =
false;
59 bool do_hcalin_twr =
false;
60 bool do_hcalin_cluster =
false;
61 bool do_hcalin_eval =
false;
63 bool do_magnet =
true;
65 bool do_hcalout =
false;
66 bool do_hcalout_cell =
false;
67 bool do_hcalout_twr =
false;
68 bool do_hcalout_cluster =
false;
69 bool do_hcalout_eval =
false;
71 bool do_global_fastsim =
false;
73 bool do_jet_eval =
false;
75 bool do_dst_compress =
false;
78 bool do_DSTReader =
false;
83 gSystem->Load(
"libfun4all.so");
84 gSystem->Load(
"libg4detectors.so");
85 gSystem->Load(
"libphhepmc.so");
86 gSystem->Load(
"libg4testbench.so");
87 gSystem->Load(
"libg4hough.so");
88 gSystem->Load(
"libg4calo.so");
89 gSystem->Load(
"libg4eval.so");
90 gSystem->Load(
"libg4vertex.so");
93 gROOT->LoadMacro(
"G4Setup_sPHENIX.C");
94 G4Init(do_svtx,do_preshower,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,which_tracking);
96 int absorberactive = 1;
98 const string magfield =
"/phenix/upgrades/decadal/fieldmaps/sPHENIX.2d.root";
128 if (embed_input_file)
130 cout <<
"Do not support read hits and embed background"<<endl;
149 gSystem->Load(
"libPHPythia8.so");
165 if (readhepmc || embed_input_file) {
194 do_svtx, do_preshower, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe, magfield_rescale);
203 gROOT->LoadMacro(
"G4_Bbc.C");
250 gROOT->LoadMacro(
"G4_Global.C");
254 else if (do_global_fastsim)
256 gROOT->LoadMacro(
"G4_Global.C");
267 gROOT->LoadMacro(
"G4_Jets.C");
277 if (do_svtx_eval)
Svtx_Eval(
"g4svtx_eval.root");
279 if (do_cemc_eval)
CEMC_Eval(
"g4cemc_eval.root");
285 if (do_jet_eval)
Jet_Eval(
"g4jet_eval.root");
298 if (embed_input_file)
302 in1->
AddFile(embed_input_file);
322 assert (gSystem->Load(
"libHFJetTruthGeneration") == 0);
327 "HFJetTruthTrigger.root",5 ,
"AntiKt_Truth_r07");
332 "HFJetTruthTrigger.root",5 ,
"AntiKt_Truth_r04");
338 "HFJetTruthTrigger.root",5 ,
"AntiKt_Truth_r02");
347 gROOT->LoadMacro(
"G4_DSTReader.C");
377 if (
nEvents == 0 && !readhits && !readhepmc)
379 cout <<
"using 0 for number of events is a bad idea when using particle generators" << endl;
380 cout <<
"it will run forever, so I just return without running anything" << endl;
390 std::cout <<
"All done" << std::endl;