4 const char * inputFile =
"/sphenix/sim//sim01/production/2016-07-21/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0_8GeV-0002.root",
5 const char * outputFile =
"G4sPHENIXCells.root",
6 const char * embed_input_file =
"/sphenix/sim/sim01/production/2016-07-12/sHijing/spacal2d/G4Hits_sPHENIX_sHijing-0-4.4fm.list"
21 const bool readhits =
false;
24 const bool readhepmc =
false;
27 const bool runpythia8 =
true;
28 const bool runpythia6 =
false;
33 const bool do_embedding =
false;
44 bool do_svtx_cell =
false;
45 bool do_svtx_track =
false;
46 bool do_svtx_eval =
false;
48 bool do_preshower =
false;
51 bool do_cemc_cell =
false;
52 bool do_cemc_twr =
false;
53 bool do_cemc_cluster =
false;
54 bool do_cemc_eval =
false;
56 bool do_hcalin =
false;
57 bool do_hcalin_cell =
false;
58 bool do_hcalin_twr =
false;
59 bool do_hcalin_cluster =
false;
60 bool do_hcalin_eval =
false;
62 bool do_magnet =
false;
64 bool do_hcalout =
false;
65 bool do_hcalout_cell =
false;
66 bool do_hcalout_twr =
false;
67 bool do_hcalout_cluster =
false;
68 bool do_hcalout_eval =
false;
70 bool do_global =
false;
71 bool do_global_fastsim =
false;
73 bool do_jet_reco =
true;
74 bool do_jet_eval =
false;
76 bool do_dst_compress =
false;
79 bool do_DSTReader =
true;
84 gSystem->Load(
"libfun4all.so");
85 gSystem->Load(
"libg4detectors.so");
86 gSystem->Load(
"libphhepmc.so");
87 gSystem->Load(
"libg4testbench.so");
88 gSystem->Load(
"libg4hough.so");
89 gSystem->Load(
"libg4calo.so");
90 gSystem->Load(
"libg4eval.so");
93 gROOT->LoadMacro(
"G4Setup_sPHENIX.C");
94 G4Init(do_svtx,do_preshower,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe);
96 int absorberactive = 1;
130 cout <<
"Do not support read hits and embed background at the same time."<<endl;
144 gSystem->Load(
"libPHPythia8.so");
170 gSystem->Load(
"libPHPythia6.so");
185 if (readhepmc || do_embedding) {
212 do_svtx, do_preshower, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe, magfield_rescale);
221 gROOT->LoadMacro(
"G4_Bbc.C");
268 gROOT->LoadMacro(
"G4_Global.C");
272 else if (do_global_fastsim)
274 gROOT->LoadMacro(
"G4_Global.C");
284 gROOT->LoadMacro(
"G4_Jets.C");
291 if (do_svtx_eval)
Svtx_Eval(
"g4svtx_eval.root");
293 if (do_cemc_eval)
CEMC_Eval(
"g4cemc_eval.root");
299 if (do_jet_eval)
Jet_Eval(
"g4jet_eval.root");
316 if (embed_input_file == NULL)
318 cout <<
"Missing embed_input_file! Exit";
344 gSystem->Load(
"libqa_modules");
363 assert (gSystem->Load(
"libHFJetTruthGeneration") == 0);
368 "HFJetTruthTrigger.root",5 ,
"AntiKt_Truth_r07");
373 "HFJetTruthTrigger.root",5 ,
"AntiKt_Truth_r04");
378 "HFJetTruthTrigger.root",5 ,
"AntiKt_Truth_r02");
385 if (gSystem->Load(
"libslt") == 0)
410 gROOT->LoadMacro(
"G4_DSTReader.C");
440 if (
nEvents == 0 && !readhits && !readhepmc)
442 cout <<
"using 0 for number of events is a bad idea when using particle generators" << endl;
443 cout <<
"it will run forever, so I just return without running anything" << endl;
451 gSystem->Load(
"libqa_modules");
454 if (gSystem->Load(
"libslt") == 0)
457 string(outputFile) +
"_slt.root");
464 gSystem->Exec(
"ps -o sid,ppid,pid,user,comm,vsize,rssize,time");
466 std::cout <<
"All done" << std::endl;