8 const double hodo_gap = 0.,
9 const int do_e1039_shielding = 1,
10 const double target_coil_pos_z = -300
13 const bool do_collimator =
true;
14 const bool do_target =
true;
15 const double target_l = 7.9;
16 const double target_z = (7.9-target_l)/2.;
17 const int use_g4steps = 1;
19 const bool gen_gun =
false;
20 const bool gen_pythia8 =
true;
21 const bool gen_test =
false;
22 const bool gen_particle =
false;
24 gSystem->Load(
"libfun4all");
25 gSystem->Load(
"libg4detectors");
26 gSystem->Load(
"libg4testbench");
27 gSystem->Load(
"libg4eval");
29 JobOptsSvc *jobopt_svc = JobOptsSvc::instance();
30 jobopt_svc->init(
"default.opts");
48 TF2 *beam_profile =
new TF2(
"beam_profile",
50 "(((x**2+y**2)<=0.81)*exp(-(x**2+y**2)/0.18))+(((x**2+y**2)>0.81&&(x**2+y**2)<=25)*0.9*exp(-4.5)/(sqrt(x**2+y**2)))",
57 gSystem->Load(
"libPHPythia8.so");
92 gun_mup->
set_vtx(0., 0., target_coil_pos_z);
100 gun_mum->
set_vtx(0., 0., target_coil_pos_z);
101 gun_mum->
set_mom(-3., -0.2, 40.);
140 jobopt_svc->m_fMagFile+
" "+
141 jobopt_svc->m_kMagFile+
" "+
157 if(do_e1039_shielding == 1) {
158 const double inch = 2.54;
166 shielding->
set_double_param(
"place_z", (-18*inch/2.-(2.15+11.38+ 36)*inch));
199 PHG4E1039InsensSubsystem* insens =
new PHG4E1039InsensSubsystem(
"Insens");
202 gROOT->LoadMacro(
"G4_Target.C");
203 SetupTarget(g4Reco, do_collimator, do_target, target_coil_pos_z, target_l, target_z, use_g4steps);
205 gROOT->LoadMacro(
"G4_SensitiveDetectors.C");
214 gSystem->Load(
"libktracker.so");
215 KalmanFastTrackingWrapper *ktracker =
new KalmanFastTrackingWrapper();
216 ktracker->set_geom_file_name(
"geom.root");
217 ktracker->Verbosity(10);
226 string(
"DSTReader.root"));
256 std::cout <<
"All done" << std::endl;
int registerInputManager(Fun4AllInputManager *InManager)
int Fun4E1039Shielding(const int nEvents=1, const double hodo_gap=0., const int do_e1039_shielding=1, const double target_coil_pos_z=-300)
void insert_particle_filter_pid(const int a)
void SetupSensitiveDetectors(PHG4Reco *g4Reco, bool toggle_dphodo=true, bool toggle_dc1=false, std::string chamberGas="SQ_ArCO2", std::string hodoMat="SQ_Scintillator", const int verbosity=0)
void set_load_all_particle(bool b)
void AddParticles(std::string particles)
PHG4DSTReader save information from DST to an evaluator, which could include hit. particle...
void SetWorldMaterial(const std::string &s)
void add_particles(const std::string &name, const unsigned int count)
interface for adding particles by name
void SetWorldShape(const std::string &s)
void set_particle_filter_on(const bool a)
static Fun4AllServer * instance()
void PrintTimer(const std::string &name="")
static void ExportGeomtry(PHCompositeNode *topNode, const std::string &geometry_file)
DST node -> TGeoManager -> export files, like gdml, .root or .C formats.
void set_double_param(const std::string &name, const double dval)
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)
void SetPzHighLow(double pzHigh, double pzLow)
int run(const int nevnts=0, const bool require_nevents=false)
run n events (0 means up to end of file)
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_field_map(const std::string &fmap, const PHFieldConfig::FieldConfigTypes dim)
void set_vertex_distribution_mean(const double x, const double y, const double z, const double t)
set the mean value of the vertex distribution, use PHENIX units of cm, ns
void set_save_vertex(bool b)
Switch for vertex.
void SetupTarget(PHG4Reco *g4Reco, const double target_coil_pos_z=-300, const double target_l=7.9, const double target_z=0., const int use_g4steps=1, const int register_hits=0)
PHCompositeNode * topNode() const
void set_save_particle(bool b)
Switch for saving any particles at all.
void set_string_param(const std::string &name, const std::string &sval)
void SetWorldSizeX(const double sx)
void SetPhysicsList(const std::string &s)
void set_vertex_size_parameters(const double mean, const double width)
set the dimensions of the distribution of particles about the vertex
virtual void set_vtx(const double x, const double y, const double z)
void set_vertex_size_function(FUNCTION r)
set the distribution function of particles about the vertex
SubsysReco * getSubsysReco(const std::string &name)
virtual void Verbosity(const int ival)
Sets the verbosity of this module (0 by default=quiet).
static GeomSvc * instance()
singlton instance
void set_load_active_particle(bool b)
load all particle that produced a saved hit
void register_trigger(PHPy8GenTrigger *theTrigger)
set event selection criteria
void set_eta_range(const double eta_min, const double eta_max)
range of randomized eta values
virtual void set_name(const std::string &particle="proton")
virtual void set_mom(const double x, const double y, const double z)
void setDetectorY0(const std::string detectorName, const double val)
PHG4ParticleGun * get_gun(const char *name="PGUN")
void registerSubsystem(PHG4Subsystem *subsystem)
register subsystem
void set_pxpypz_range(const double x_min, const double x_max, const double y_min, const double y_max, const double z_min, const double z_max)
void set_phi_range(const double phi_min, const double phi_max)
range of randomized phi values
void SetWorldSizeZ(const double sz)
void SetWorldSizeY(const double sy)