2 #include "G4_SensitiveDetectors.C"
5 R__LOAD_LIBRARY(libfun4all)
6 R__LOAD_LIBRARY(libPHPythia8)
7 R__LOAD_LIBRARY(libg4detectors)
8 R__LOAD_LIBRARY(libg4testbench)
9 R__LOAD_LIBRARY(libg4eval)
10 R__LOAD_LIBRARY(libg4dst)
11 R__LOAD_LIBRARY(libdptrigger)
12 R__LOAD_LIBRARY(libembedding)
13 R__LOAD_LIBRARY(libevt_filter)
14 R__LOAD_LIBRARY(libktracker)
15 R__LOAD_LIBRARY(libSQPrimaryGen)
16 R__LOAD_LIBRARY(libpheve_display)
17 R__LOAD_LIBRARY(libpheve_modules)
18 R__LOAD_LIBRARY(libpheve_interface)
32 printf(
"se->run(1)\n");
36 printf(
"ReqEvtID: %ld\n",ne_evt_id->GetNumberEntry()->GetIntNumber());
37 evt_filter->
set_event_id_req((
int)(ne_evt_id->GetNumberEntry()->GetIntNumber()));
40 printf(
"ReqTrig: %ld\n",ne_trig->GetNumberEntry()->GetIntNumber());
41 evt_filter->
set_trigger_req((
int)(ne_trig->GetNumberEntry()->GetIntNumber()));
46 view->ResetCurrentCamera();
47 view->CurrentCamera().RotateRad(-3.14/2.0, 0);
48 view->CurrentCamera().Zoom(400, 0, 0);
49 view->CurrentCamera().Truck(2800,0);
54 printf(
"Side View\n");
55 view->ResetCurrentCamera();
56 view->CurrentCamera().Zoom(400, 0, 0);
57 view->CurrentCamera().Truck(2800,0);
63 view->ResetCurrentCamera();
64 view->CurrentCamera().RotateRad(-3.14/4., -3.14/4.);
65 view->CurrentCamera().Zoom(350, 0, 0);
66 view->CurrentCamera().Truck(2000,-1500);
78 const double target_coil_pos_z = -300;
81 const bool do_collimator =
true;
82 const bool do_target =
true;
83 const bool do_e1039_shielding =
true;
84 const bool do_fmag =
true;
85 const bool do_kmag =
true;
86 const bool do_absorber =
true;
88 const double target_l = 7.9;
89 const double target_z = (7.9-target_l)/2.;
90 const int use_g4steps = 1;
92 const double FMAGSTR = -1.054;
93 const double KMAGSTR = -0.951;
95 const bool gen_pythia8 =
true;
96 const bool gen_gun =
false;
97 const bool gen_particle =
false;
98 const bool read_hepmc =
false;
99 const bool gen_e906legacy =
false;
106 JobOptsSvc *jobopt_svc = JobOptsSvc::instance();
107 jobopt_svc->init(
"run7_sim.opts");
140 if(gen_pythia8 || read_hepmc) {
209 const bool pythia_gen =
false;
210 const bool drellyan_gen =
true;
211 const bool JPsi_gen =
false;
212 const bool Psip_gen =
false;
236 jobopt_svc->m_fMagFile+
" "+
237 jobopt_svc->m_kMagFile+
" "+
238 Form(
"%f",FMAGSTR) +
" " +
239 Form(
"%f",KMAGSTR) +
" " +
257 SetupBeamline(g4Reco, do_collimator, target_coil_pos_z - 302.36);
260 SetupTarget(g4Reco, target_coil_pos_z, target_l, target_z, use_g4steps);
293 KalmanFastTrackingWrapper *ktracker =
new KalmanFastTrackingWrapper();
295 ktracker->set_enable_event_reducer(
true);
296 ktracker->set_DS_level(0);
297 ktracker->set_pattern_db_name(gSystem->ExpandPathName(
"$E1039_RESOURCE/dsearch/v1/pattern.root"));
329 view = gEve->GetDefaultGLViewer();
331 TEveBrowser* browser = gEve->GetBrowser();
332 browser->StartEmbedding(TRootBrowser::kLeft);
334 TGMainFrame* frmMain =
new TGMainFrame(gClient->GetRoot(), 1000, 600);
335 frmMain->SetWindowName(
"Event Display");
336 frmMain->SetCleanup(kDeepCleanup);
338 TGVerticalFrame* frmVert =
new TGVerticalFrame(frmMain);
342 EvNavHandler* handler =
new EvNavHandler;
343 TGHorizontalFrame* frm1 = 0;
347 frm1 =
new TGHorizontalFrame(frmVert);
348 lab =
new TGLabel(frm1,
"Event ID");
349 frm1->AddFrame(lab,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 5, 5, 3, 4));
350 ne_evt_id =
new TGNumberEntry(frm1, -1, 9, 999, TGNumberFormat::kNESInteger,
351 TGNumberFormat::kNEAAnyNumber,
352 TGNumberFormat::kNELLimitMinMax,
354 ne_evt_id->Connect(
"ValueSet(Long_t)",
"EvNavHandler", handler,
"ReqEvtID()");
355 frm1->AddFrame(
ne_evt_id,
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 5, 5, 5, 5));
356 frmVert->AddFrame(frm1);
359 frm1 =
new TGHorizontalFrame(frmVert);
360 lab =
new TGLabel(frm1,
"Trigger");
361 frm1->AddFrame(lab,
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 5, 5, 3, 4));
362 ne_trig =
new TGNumberEntry(frm1, -1, 9, 999, TGNumberFormat::kNESInteger,
363 TGNumberFormat::kNEAAnyNumber,
364 TGNumberFormat::kNELLimitMinMax,
366 ne_trig->Connect(
"ValueSet(Long_t)",
"EvNavHandler", handler,
"ReqTrig()");
367 frm1->AddFrame(
ne_trig,
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 5, 5, 5, 5));
368 frmVert->AddFrame(frm1);
371 b =
new TGTextButton(frmVert,
"Next Event");
372 frmVert->AddFrame(b,
new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
373 b->Connect(
"Clicked()",
"EvNavHandler", handler,
"NextEvent()");
375 b =
new TGTextButton(frmVert,
"Top View");
376 frmVert->AddFrame(b,
new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
377 b->Connect(
"Clicked()",
"EvNavHandler", handler,
"TopView()");
379 b =
new TGTextButton(frmVert,
"Side View");
380 frmVert->AddFrame(b,
new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
381 b->Connect(
"Clicked()",
"EvNavHandler", handler,
"SideView()");
383 b =
new TGTextButton(frmVert,
"3D View");
384 frmVert->AddFrame(b,
new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
385 b->Connect(
"Clicked()",
"EvNavHandler", handler,
"View3D()");
388 frmMain->AddFrame(frmVert);
390 frmMain->MapSubwindows();
392 frmMain->MapWindow();
394 browser->StopEmbedding();
395 browser->SetTabTitle(
"Event Control", 0);
int registerInputManager(Fun4AllInputManager *InManager)
virtual void set_DoubleFlag(const std::string &name, const double flag)
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 AddParticles(std::string particles)
int InitRun(PHCompositeNode *topNode)
Run initialization.
void SetWorldMaterial(const std::string &s)
void add_particles(const std::string &name, const unsigned int count)
interface for adding particles by name
void Print() const
print all the parameters
An SubsysReco module to create a set of SQ nodes for the simulation true info.
void SetWorldShape(const std::string &s)
void set_verbosity(int verb)
void set_particle_filter_on(const bool a)
static Fun4AllServer * instance()
int EventDisplay4Sim(const int nevent=10)
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_xfRange(const double xmin, const double xmax)
void set_config_file(const char *cfg_file)
void SetPzHighLow(double pzHigh, double pzLow)
void set_road_set_file_name(const std::string &roadSetFileName)
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 SetupInsensitiveVolumes(PHG4Reco *g4Reco, const bool toggle_shielding=true, const bool toggle_fmag=true, const bool toggle_kmag=true, const bool toggle_absorber=true, const int enable_fmag_filter=0, const double filter_max_slope=0.25, const double filter_min_energy=5.)
void set_massRange(const double mmin, const double mmax)
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 set_event_id_req(int eventIdReq)
PHCompositeNode * topNode() const
TGNumberEntry * ne_evt_id
void set_trigger_req(unsigned short triggerReq)
void SetWorldSizeX(const double sx)
int InitRun(PHCompositeNode *topNode)
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
virtual void Verbosity(const int ival)
Sets the verbosity of this module (0 by default=quiet).
static GeomSvc * instance()
singlton instance
void register_trigger(PHPy8GenTrigger *theTrigger)
set event selection criteria
void SetupBeamline(PHG4Reco *g4Reco, const bool toggle_collimator=true, const double collimator_pos_z=-300, const int register_hits=0)
virtual void set_name(const std::string &particle="proton")
virtual void set_mom(const double x, const double y, const double z)
void set_embedding_id(int id)
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)