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 =
"G4fsPHENIX.root",
6 const char * embed_input_file =
"/sphenix/sim/sim01/production/2016-07-12/sHijing/spacal2d/G4Hits_sPHENIX_sHijing-0-4.4fm.list"
10 const int n_TPC_layers = 40;
20 const bool readhits =
false;
23 const bool readhepmc =
false;
26 const bool runpythia8 =
false;
27 const bool runpythia6 =
false;
32 const bool do_embedding =
false;
43 bool do_svtx_cell = do_svtx &&
true;
44 bool do_svtx_track = do_svtx_cell &&
true;
45 bool do_svtx_eval = do_svtx_track &&
false;
48 bool do_cemc_cell = do_cemc &&
true;
49 bool do_cemc_twr = do_cemc_cell &&
true;
50 bool do_cemc_cluster = do_cemc_twr &&
true;
51 bool do_cemc_eval = do_cemc_cluster &&
false;
53 bool do_hcalin =
true;
54 bool do_hcalin_cell = do_hcalin &&
true;
55 bool do_hcalin_twr = do_hcalin_cell &&
true;
56 bool do_hcalin_cluster = do_hcalin_twr &&
true;
57 bool do_hcalin_eval = do_hcalin_cluster &&
false;
59 bool do_magnet =
true;
61 bool do_hcalout =
true;
62 bool do_hcalout_cell = do_hcalout &&
true;
63 bool do_hcalout_twr = do_hcalout_cell &&
true;
64 bool do_hcalout_cluster = do_hcalout_twr &&
true;
65 bool do_hcalout_eval = do_hcalout_cluster &&
false;
67 bool do_global =
true;
68 bool do_global_fastsim =
false;
70 bool do_jet_reco =
false;
71 bool do_jet_eval = do_jet_reco &&
true;
73 bool do_fwd_jet_reco =
false;
74 bool do_fwd_jet_eval = do_fwd_jet_reco &&
false;
79 bool do_FGEM_track = do_FGEM &&
false;
82 bool do_FEMC_cell = do_FEMC &&
true;
83 bool do_FEMC_twr = do_FEMC_cell &&
true;
84 bool do_FEMC_cluster = do_FEMC_twr &&
true;
87 bool do_FHCAL_cell = do_FHCAL &&
true;
88 bool do_FHCAL_twr = do_FHCAL_cell &&
true;
89 bool do_FHCAL_cluster = do_FHCAL_twr &&
true;
91 bool do_dst_compress =
false;
94 bool do_DSTReader =
true;
99 gSystem->Load(
"libfun4all.so");
100 gSystem->Load(
"libg4detectors.so");
101 gSystem->Load(
"libphhepmc.so");
102 gSystem->Load(
"libg4testbench.so");
103 gSystem->Load(
"libg4hough.so");
104 gSystem->Load(
"libg4eval.so");
107 gROOT->LoadMacro(
"G4Setup_fsPHENIX.C");
108 G4Init(do_svtx,do_cemc,do_hcalin,do_magnet,do_hcalout,do_pipe,do_FGEM,do_FEMC,do_FHCAL,n_TPC_layers);
110 int absorberactive = 0;
112 const string magfield =
"/phenix/upgrades/decadal/fieldmaps/fsPHENIX.2d.root";
144 cout <<
"Do not support read hits and embed background at the same time."<<endl;
154 gSystem->Load(
"libPHPythia8.so");
163 gSystem->Load(
"libPHPythia6.so");
178 if (readhepmc || do_embedding) {
207 do_svtx, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe,
208 do_FGEM, do_FEMC, do_FHCAL,
219 gROOT->LoadMacro(
"G4_Bbc.C");
282 gROOT->LoadMacro(
"G4_Global.C");
286 else if (do_global_fastsim)
288 gROOT->LoadMacro(
"G4_Global.C");
298 gROOT->LoadMacro(
"G4_Jets.C");
304 gROOT->LoadMacro(
"G4_FwdJets.C");
311 if (do_svtx_eval)
Svtx_Eval(
"g4svtx_eval.root");
313 if (do_cemc_eval)
CEMC_Eval(
"g4cemc_eval.root");
319 if (do_jet_eval)
Jet_Eval(
"g4jet_eval.root");
321 if (do_fwd_jet_eval)
Jet_FwdEval(
"g4fwdjet_eval.root");
324 gSystem->Load(
"libPhotons.so");
348 if (embed_input_file == NULL)
350 cout <<
"Missing embed_input_file! Exit";
376 gROOT->LoadMacro(
"G4_DSTReader_fsPHENIX.C");
401 if (
nEvents == 0 && !readhits && !readhepmc)
403 cout <<
"using 0 for number of events is a bad idea when using particle generators" << endl;
404 cout <<
"it will run forever, so I just return without running anything" << endl;
416 std::cout <<
"All done" << std::endl;
419 std::cout <<
"==== Useful display commands ==" << std::endl;
420 cout <<
"draw axis: " << endl;
421 cout <<
" G4Cmd(\"/vis/scene/add/axes 0 0 0 50 cm\")" << endl;
422 cout <<
"zoom" << endl;
423 cout <<
" G4Cmd(\"/vis/viewer/zoom 1\")" << endl;
424 cout <<
"viewpoint:" << endl;
425 cout <<
" G4Cmd(\"/vis/viewer/set/viewpointThetaPhi 0 0\")" << endl;
426 cout <<
"panTo:" << endl;
427 cout <<
" G4Cmd(\"/vis/viewer/panTo 0 0 cm\")" << endl;
428 cout <<
"print to eps:" << endl;
429 cout <<
" G4Cmd(\"/vis/ogl/printEPS\")" << endl;
430 cout <<
"set background color:" << endl;
431 cout <<
" G4Cmd(\"/vis/viewer/set/background white\")" << endl;
432 std::cout <<
"===============================" << std::endl;
440 std::cout <<
"All done" << std::endl;