8 const double hodo_gap = 0.,
9 const double target_coil_pos_z = -130
12 const bool do_collimator =
true;
13 const bool do_target =
true;
14 const double target_l = 7.9;
15 const double target_z = (7.9-target_l)/2.;
16 const int use_g4steps = 1;
18 const bool gen_gun =
false;
19 const bool gen_pythia8 =
true;
20 const bool gen_test =
false;
21 const bool gen_particle =
false;
23 gSystem->Load(
"libfun4all");
24 gSystem->Load(
"libg4detectors");
25 gSystem->Load(
"libg4testbench");
26 gSystem->Load(
"libg4eval");
27 gSystem->Load(
"libtruth_eval.so");
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.);
139 jobopt_svc->m_fMagFile+
" "+
140 jobopt_svc->m_kMagFile,
153 PHG4E1039InsensSubsystem* insens =
new PHG4E1039InsensSubsystem(
"Insens");
156 gROOT->LoadMacro(
"G4_Target.C");
157 SetupTarget(g4Reco, do_collimator, do_target, target_coil_pos_z, target_l, target_z, use_g4steps);
159 gROOT->LoadMacro(
"G4_SensitiveDetectors.C");
170 gSystem->Load(
"libktracker.so");
171 KalmanFastTrackingWrapper *ktracker =
new KalmanFastTrackingWrapper();
172 ktracker->set_geom_file_name(
"geom.root");
173 ktracker->Verbosity(0);
182 string(
"DSTReader.root"));
212 std::cout <<
"All done" << std::endl;
int registerInputManager(Fun4AllInputManager *InManager)
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_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)
void AddNode(const std::string &name)
PHCompositeNode * topNode() const
void set_save_particle(bool b)
Switch for saving any particles at all.
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)
int Fun4HodoAccGap(const int nEvents=1, const double hodo_gap=0., const double target_coil_pos_z=-130)
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)