3 const int nEvents = 10,
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"
20 const bool readhits =
false;
23 const bool readhepmc =
false;
26 const bool runpythia8 =
true;
27 const bool runpythia6 =
false;
32 const bool do_embedding =
false;
42 bool do_svtx_cell =
true;
43 bool do_svtx_track =
true;
44 bool do_svtx_eval =
true;
46 bool do_preshower =
false;
49 bool do_cemc_cell =
true;
50 bool do_cemc_twr =
true;
51 bool do_cemc_cluster =
true;
52 bool do_cemc_eval =
false;
54 bool do_hcalin =
true;
55 bool do_hcalin_cell =
true;
56 bool do_hcalin_twr =
true;
57 bool do_hcalin_cluster =
true;
58 bool do_hcalin_eval =
false;
60 bool do_magnet =
true;
62 bool do_hcalout =
true;
63 bool do_hcalout_cell =
true;
64 bool do_hcalout_twr =
true;
65 bool do_hcalout_cluster =
true;
66 bool do_hcalout_eval =
false;
68 bool do_global =
true;
69 bool do_global_fastsim =
false;
71 bool do_jet_reco =
true;
72 bool do_jet_eval =
false;
74 bool do_dst_compress =
false;
77 bool do_DSTReader =
false;
82 gSystem->Load(
"libfun4all.so");
83 gSystem->Load(
"libphgeom.so");
84 gSystem->Load(
"libg4detectors.so");
85 gSystem->Load(
"libphhepmc.so");
86 gSystem->Load(
"libg4testbench.so");
87 gSystem->Load(
"libg4hough.so");
88 gSystem->Load(
"libcemc.so");
89 gSystem->Load(
"libg4eval.so");
91 gSystem->ListLibraries();
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;
98 const string magfield =
"/phenix/upgrades/decadal/fieldmaps/sPHENIX.2d.root";
99 const float magfield_rescale = 1.4/1.5;
130 cout <<
"Do not support read hits and embed background at the same time."<<endl;
144 gSystem->Load(
"/afs/rhic.bnl.gov/sphenix/sys/x8664_sl6/new.2/lib/libPHPythia8.so");
156 gSystem->Load(
"libPHPythia6.so");
158 PHPythia6 *pythia6 =
new PHPythia6();
159 pythia6->set_config_file(
"phpythia6.cfg");
171 if (readhepmc || do_embedding) {
198 do_svtx, do_preshower, do_cemc, do_hcalin, do_magnet, do_hcalout, do_pipe, magfield_rescale);
207 gROOT->LoadMacro(
"G4_Bbc.C");
215 if (do_svtx_cell) Svtx_Cells();
217 if (do_cemc_cell) CEMC_Cells();
219 if (do_hcalin_cell) HCALInner_Cells();
221 if (do_hcalout_cell) HCALOuter_Cells();
227 if (do_cemc_twr) CEMC_Towers();
228 if (do_cemc_cluster) CEMC_Clusters();
234 if (do_hcalin_twr) HCALInner_Towers();
235 if (do_hcalin_cluster) HCALInner_Clusters();
237 if (do_hcalout_twr) HCALOuter_Towers();
238 if (do_hcalout_cluster) HCALOuter_Clusters();
240 if (do_dst_compress) ShowerCompress();
246 if (do_svtx_track) Svtx_Reco();
254 gROOT->LoadMacro(
"G4_Global.C");
258 else if (do_global_fastsim)
260 gROOT->LoadMacro(
"G4_Global.C");
270 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");
281 if (do_hcalin_eval) HCALInner_Eval(
"g4hcalin_eval.root");
283 if (do_hcalout_eval) HCALOuter_Eval(
"g4hcalout_eval.root");
285 if (do_jet_eval) Jet_Eval(
"g4jet_eval.root");
302 if (embed_input_file ==
NULL)
304 cout <<
"Missing embed_input_file! Exit";
330 gROOT->LoadMacro(
"G4_DSTReader.C");
332 G4DSTreader( outputFile,
360 if (nEvents == 0 && !readhits && !readhepmc)
362 cout <<
"using 0 for number of events is a bad idea when using particle generators" << endl;
363 cout <<
"it will run forever, so I just return without running anything" << endl;
371 gSystem->Exec(
"/bin/env");
372 gSystem->Load(
"libpheve.so");
373 gSystem->Load(
"libPHBFieldMap.so");
376 =
new PHEventDisplay(1920,860,
true,
false,
"sPHENIX.2d.root",
"sphenix_maps+tpc_geo.root");
381 event_display->set_svtx_on(
true);
382 event_display->set_cemc_on(
true);
383 event_display->set_hcalin_on(
false);
384 event_display->set_hcalout_on(
false);
385 event_display->set_jet_on(
false);
391 timer =
new TTimer();
392 timer->Connect(
"Timeout()",
"PHEventDisplay", event_display,
"run_evt_in_thread()");
393 timer->Start(100000,kFALSE);
int registerInputManager(Fun4AllInputManager *InManager)
void set_jet_e_scale(float e_scale)
void set_reuse_existing_vertex(const int i=1)
void add_particles(const std::string &name, const unsigned int count)
interface for adding particles by name
void set_verbosity(int verb)
int fileopen(const char *managername="NONE", const char *filename="NONE")
static Fun4AllServer * instance()
void set_jet_pt_threshold(float pt)
static recoConsts * instance()
void set_vertex_distribution_function(FUNCTION x, FUNCTION y, FUNCTION z)
toss a new vertex according to a Uniform or Gaus distribution
int registerSubsystem(SubsysReco *subsystem, const std::string &topnodename="TOP")
void set_config_file(const char *cfg_file)
virtual const std::string Name() const
Returns the name of this module.
void set_vertex_distribution_mean(const double x, const double y, const double z)
set the mean value of the vertex distribution
void set_vertex_distribution_width(const double x, const double y, const double z)
set the width of the vertex distribution function about the mean
void set_truth_on(bool truth_on)
int Fun4All_EventDisplay(const int nEvents=10, const char *inputFile="/sphenix/sim//sim01/production/2016-07-21/single_particle/spacal2d/fieldmap/G4Hits_sPHENIX_e-_eta0_8GeV-0002.root", const char *outputFile="G4sPHENIXCells.root", const char *embed_input_file="/sphenix/sim/sim01/production/2016-07-12/sHijing/spacal2d/G4Hits_sPHENIX_sHijing-0-4.4fm.list")
void set_vertex_size_parameters(const double mean, const double width)
set the dimensions of the distribution of particles about the vertex
void set_calo_e_threshold(float e)
void set_vertex_size_function(FUNCTION r)
set the distribution function of particles about the vertex
virtual void Verbosity(const int ival)
Sets the verbosity of this module (0 by default=quiet).
void set_existing_vertex_offset_vector(const double x, const double y, const double z)
set an offset vector from the existing vertex
virtual void Embed(const int i=1)
void set_eta_range(const double eta_min, const double eta_max)
range of randomized eta values
void set_pt_range(const double pt_min, const double pt_max, const double pt_gaus_width=0)
void set_phi_range(const double phi_min, const double phi_max)
range of randomized phi values