1 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
19 #include <g4detectors/DPDigitizer.h>
21 #include <phpythia8/PHPythia8.h>
24 #include <jobopts_svc/JobOptsSvc.h>
26 #include <module_example/TrkEval.h>
33 R__LOAD_LIBRARY(libfun4all)
34 R__LOAD_LIBRARY(libg4detectors)
35 R__LOAD_LIBRARY(libg4testbench)
36 R__LOAD_LIBRARY(libg4eval)
37 R__LOAD_LIBRARY(libktracker)
38 R__LOAD_LIBRARY(libPHPythia8)
45 const int nEvents = 1,
47 const double x0_shift = 0.0
50 const double target_coil_pos_z = -300;
51 int embedding_opt = 0;
53 const bool do_collimator =
false;
54 const bool do_target =
false;
55 const double target_l = 7.9;
56 const double target_z = (7.9-target_l)/2.;
57 const int use_g4steps = 1;
59 const bool gen_gun =
false;
60 const bool gen_pythia8 =
false;
61 const bool gen_test =
false;
62 const bool gen_particle =
true;
64 gSystem->Load(
"libfun4all");
65 gSystem->Load(
"libg4detectors");
66 gSystem->Load(
"libg4testbench");
67 gSystem->Load(
"libg4eval");
68 gSystem->Load(
"libktracker.so");
70 JobOptsSvc *jobopt_svc = JobOptsSvc::instance();
71 jobopt_svc->init(
"default.opts");
74 std::cout <<
"D2X::X0: " << geom_svc->
getDetectorX0(
"D2X") << std::endl;
76 std::cout <<
"D2X::X0: " << geom_svc->
getDetectorX0(
"D2X") << std::endl;
88 gun->
set_vtx(0, 0, target_coil_pos_z);
94 gSystem->Load(
"libPHPythia8.so");
129 gun_mup->
set_vtx(0., 0., target_coil_pos_z);
130 gun_mup->
set_mom(3., 0.2, 40.);
137 gun_mum->
set_vtx(0., 0., target_coil_pos_z);
138 gun_mum->
set_mom(-3., -0.2, 40.);
191 jobopt_svc->m_fMagFile+
" "+
192 jobopt_svc->m_kMagFile+
" "+
206 PHG4E1039InsensSubsystem* insens =
new PHG4E1039InsensSubsystem(
"Insens");
209 gROOT->LoadMacro(
"G4_Target.C");
210 SetupTarget(g4Reco, do_collimator, do_target, target_coil_pos_z, target_l, target_z, use_g4steps);
212 gROOT->LoadMacro(
"G4_SensitiveDetectors.C");
224 gSystem->Load(
"libembedding.so");
226 #if ROOT_VERSION_CODE < ROOT_VERSION(6,00,0)
227 if(embedding_opt == 1) {
237 }
else if(embedding_opt == 2) {
246 double noise_rate_1 = 0.12;
247 double noise_rate_2 = 0.10;
248 double noise_rate_3 = 0.08;
270 gSystem->Load(
"libktracker.so");
271 KalmanFastTrackingWrapper *ktracker =
new KalmanFastTrackingWrapper();
272 ktracker->Verbosity(10);
273 ktracker->set_DS_level(0);
282 string(
"DSTReader.root"));
312 std::cout <<
"All done" << std::endl;
int registerInputManager(Fun4AllInputManager *InManager)
void set_in_tree_name(const std::string &inTreeName)
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 print_noise_rate() const
void add_particles(const std::string &name, const unsigned int count)
interface for adding particles by name
void set_noise_rate(const std::string &name, const double &rate)
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.
double getDetectorX0(const std::string detectorName) const
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
int registerOutputManager(Fun4AllOutputManager *manager)
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_in_name(const std::string &inName)
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 setDetectorX0(const std::string detectorName, const double val)
TODO temp solution to overwrite the y0 of a plane.
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
virtual void set_name(const std::string &particle="proton")
virtual void set_mom(const double x, const double y, const double z)
void set_trigger_bit(int triggerBit)
int Fun4TrkDev(const int nEvents=1, const int nmu=1, const double x0_shift=0.0)
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 SetWorldSizeZ(const double sz)
void SetWorldSizeY(const double sy)