Bayeux  3.4.1
Core Foundation library for SuperNEMO
manager.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-05-04
4  * Last modified: 2016-06-28
5  *
6  * License:
7  *
8  * Copyright (C) 2011-2016 Francois Mauger <mauger@lpccaen.in2p3.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 3 of the License, or (at
13  * your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23  * 02110-1301, USA.
24  *
25  * Description:
26  *
27  * G4 simulation manager
28  *
29  * History:
30  *
31  */
32 
33 #ifndef MCTOOLS_G4_MANAGER_H
34 #define MCTOOLS_G4_MANAGER_H 1
35 
36 // Standard library:
37 #include <string>
38 #include <map>
39 #include <set>
40 
41 // Third party:
42 // - Boost:
43 #include <boost/cstdint.hpp>
44 // - Bayeux/datatools :
45 #include <datatools/time_tools.h>
46 #include <datatools/logger.h>
47 // - Bayeux/mygsl :
48 #include <mygsl/rng.h>
49 #include <mygsl/seed_manager.h>
51 // - Bayeux/geomtools :
52 #include <geomtools/manager.h>
53 // - Bayeux/genvtx :
54 #include <genvtx/manager.h>
55 // - Bayeux/genbb_help :
56 #include <genbb_help/manager.h>
57 
58 // This project:
59 #include <mctools/mctools_config.h>
60 #include <mctools/utils.h>
62 
63 namespace genvtx {
64  class manager;
65  class i_vertex_generator;
66 }
67 namespace genbb {
68  class manager;
69  class i_genbb;
70 }
71 
72 #include <mctools/g4/g4_prng.h>
74 
75 #ifdef G4VIS_USE
76 // #pragma message("NOTE: G4VIS_USE is set: declaring class 'G4VisManager'...")
77 class G4VisManager;
78 // #else
79 // #pragma message("NOTE: G4VIS_USE is NOT set.")
80 #endif // G4VIS_USE
81 
82 class G4VSteppingVerbose;
83 
84 #ifdef G4MULTITHREADED
85 class G4MTRunManager;
86 #else
87 class G4RunManager;
88 #endif
89 
90 class G4UImanager;
91 
92 namespace datatools {
93  class multi_properties;
94  class service_manager;
95 }
96 
97 namespace mctools {
98  namespace g4 {
99  // Forward declarations
100  class run_action;
101  class event_action;
102  class detector_construction;
103  class primary_generator;
104  class physics_list;
105  class tracking_action;
106  class stepping_action;
107  class stacking_action;
108  class simulation_ctrl;
109 
111  class manager : public loggable_support {
112  public:
114  typedef std::map<std::string, CT_type> CT_map;
115 
116  // 2012-04-24 : limit the maximum allowed number of events:
117  // http://hypernews.slac.stanford.edu/HyperNews/geant4/get/particles/528/1.html
118  static const uint32_t NUMBER_OF_EVENTS_UPPER_LIMIT = 1000000000;
119  static const uint32_t NUMBER_OF_EVENTS_LOWER_LIMIT = 1;
120  static const uint32_t NUMBER_OF_EVENTS_WARNING_LIMIT = 1000000;
122  static const uint32_t DEFAULT_PRNG_STATES_SAVE_MODULO = 100;
123 
124  static const std::string & g4_manager_label();
125  static const std::string & vertex_generator_label();
126  static const std::string & event_generator_label();
127  static const std::string & shpf_label();
128  static const std::string & default_prng_id();
129  static const std::string & default_prng_states_file();
130 
131  // struct dummy { int value = 0; };
132 
133  public:
135  manager();
136 
138  virtual ~manager();
139 
141  void initialize(const datatools::multi_properties& mp_);
142 
144  void reset();
145 
147  void run_simulation();
148 
150  bool is_initialized() const;
151 
153  bool is_automatic() const;
154 
155  //----------------------------------------------------------------------
156  // Simulation Initializations (Geometry/Physics, possibly via services)
157  //----------------------------------------------------------------------
159  bool has_service_manager() const;
160 
163 
166 
169 
171  bool has_external_geom_manager() const;
172 
175 
177  const geomtools::manager& get_geom_manager() const;
178 
179  //----------------------------------------------------------------------
180  // Simulation User Actions (EvtGen, Run, Event etc)
181  //----------------------------------------------------------------------
183  void set_event_generator_name(const std::string &);
184 
186  void set_event_generator_seed(int);
187 
189  const genbb::manager& get_eg_manager() const;
190 
193 
195  bool has_event_generator() const;
196 
198  const genbb::i_genbb& get_event_generator() const;
199 
201  void set_vertex_generator_name(const std::string&);
202 
204  void set_vertex_generator_seed(int);
205 
207  const genvtx::manager& get_vg_manager() const;
208 
211 
213  bool has_vertex_generator() const;
214 
217 
219  event_action& grab_user_event_action();
220 
221  // Run
223  uint32_t get_number_of_events() const;
224 
226  void set_number_of_events(uint32_t);
227 
229  bool has_number_of_events_modulo() const;
230 
232  int get_number_of_events_modulo() const;
233 
235  void set_number_of_events_modulo(int);
236 
237  void set_use_run_header_footer(bool a_use_run_header_footer);
238 
239  bool using_run_header_footer() const;
240 
242  bool is_batch() const;
243 
245  bool is_interactive() const;
246 
248  void set_interactive(bool);
249 
251  void set_g4_visualization(bool);
252 
254  bool has_g4_visualization() const;
255 
257  bool has_g4_macro() const;
258 
260  const std::string& get_g4_macro() const;
261 
263  void set_g4_macro(const std::string& macroFile);
264 
265  // Track history management:
267  void set_use_track_history(const bool);
268 
270  bool has_track_history() const;
271 
273  const track_history& get_track_history() const;
274 
277 
278  // Hit control ? Not clear yet where this belongs, but since it relates to
279  // sensitive detectors, probably part of User Actions
280  bool forbids_private_hits() const;
281  void set_forbid_private_hits(bool a_forbid);
282 
283  void set_dont_save_no_sensitive_hit_events(bool a_dont_save);
285 
286 
287  //----------------------------------------------------------------------
288  // Multithreaded Control
289  //----------------------------------------------------------------------
290  // NB: This is *not* Geant4 MT mode and is completely incompatible with it
291  // It simply allows the simulation to be run in a pipeline with polling to
292  // grab events as required.
293 
295  bool has_simulation_ctrl() const;
296 
298  void set_simulation_ctrl(simulation_ctrl & a_simulation_ctrl);
299 
301  void reset_simulation_ctrl();
302 
304  const simulation_ctrl& get_simulation_ctrl() const;
305 
307  simulation_ctrl& grab_simulation_ctrl();
308 
309 
310  //----------------------------------------------------------------------
311  // Random number (over)control
312  //----------------------------------------------------------------------
315 
318 
321 
323  const mygsl::rng& get_mgr_prng() const;
324 
327 
329  const g4_prng& get_g4_prng() const;
330 
333 
335  const mygsl::seed_manager& get_seed_manager() const;
336 
339 
342 
345 
348 
349  void set_prng_state_save_modulo(int a_modulo);
350 
351  int get_prng_state_save_modulo() const;
352 
353  bool has_prng_state_save_modulo() const;
354 
355  bool has_input_prng_seeds_file() const;
356 
358 
359  void set_input_prng_seeds_file(const std::string&);
360 
361  const std::string & get_input_prng_seeds_file() const;
362 
363  bool has_output_prng_seeds_file() const;
364 
366 
367  void set_output_prng_seeds_file(const std::string&);
368 
369  const std::string & get_output_prng_seeds_file() const;
370 
372 
373  bool has_output_prng_states_file() const;
374 
375  void set_output_prng_states_file(const std::string&);
376 
377  const std::string & get_output_prng_states_file() const;
378 
380 
381  bool has_input_prng_states_file() const;
382 
383  void set_input_prng_states_file(const std::string&);
384 
385  const std::string & get_input_prng_states_file() const;
386 
388  bool has_mgr_prng_seed() const;
389 
391  int get_mgr_prng_seed() const;
392 
394  void set_mgr_prng_seed(int seed);
395 
397  void set_shpf_prng_seed(int);
398 
400  bool has_init_seed_method() const;
401 
403  void set_init_seed_method(const std::string&);
404 
406  const std::string& get_init_seed_method() const;
407 
408  //----------------------------------------------------------------------
409  // I/O (over)control
410  //----------------------------------------------------------------------
412  void set_output_data_format_by_label(const std::string &);
413 
416 
419 
421  void set_output_data_bank_label(const std::string &);
422 
425 
427  void set_output_data_file(const std::string &);
428 
429  // CPU/Wall Time Statistics
430  bool using_time_stat() const;
431 
432  void set_using_time_stat(bool);
433 
434  const CT_map& get_CT_map() const;
435 
436  CT_map& grab_CT_map();
437 
438  //----------------------------------------------------------------------
439  // Output Profiles
440  //----------------------------------------------------------------------
442  bool has_supported_output_profile(const std::string & profile_id_) const;
443 
445  void add_supported_output_profile(const std::string & profile_id_,
446  const std::string & description_);
447 
449  const std::map<std::string, std::string>& get_supported_output_profiles() const;
450 
452  bool has_activated_output_profiles() const;
453 
455  bool has_activated_output_profile(const std::string & profile_id_) const;
456 
458  void activate_output_profile(const std::string & profile_id_);
459 
461  void deactivate_output_profile(const std::string & profile_id_);
462 
464  void set_output_profiles_activation_rule(const std::string & rule_);
465 
467  void apply_output_profiles_activation_rule(const std::string & output_profiles_activation_rule_);
468 
470  void fetch_activated_output_profile_ids(std::vector<std::string> & activated_output_profile_ids_) const;
471 
473  const std::set<std::string>& get_activated_output_profile_ids() const;
474 
475  //----------------------------------------------------------------------
476  // Dump-To-Stream
477  //----------------------------------------------------------------------
479  void dump(std::ostream & = std::clog) const;
480 
482  void dump_base(std::ostream & out_ = std::clog,
483  const std::string & title_ = "",
484  const std::string & indent_ = "") const;
485 
486  protected:
488  virtual void initialize_impl();
489 
491  virtual void reset_impl();
492 
494  virtual void run_simulation_impl();
495 
497  void _init_defaults();
498 
500  virtual void _init_core();
501 
503  virtual void _init_geometry();
504 
506  virtual void _init_vertex_generator();
507 
509  virtual void _init_event_generator();
510 
512  virtual void _init_detector_construction();
513 
515  virtual void _init_physics_list();
516 
518  virtual void _init_run_action();
519 
521  virtual void _init_event_action();
522 
524  virtual void _init_primary_generator_action();
525 
527  virtual void _init_tracking_action();
528 
530  virtual void _init_stepping_action();
531 
533  virtual void _init_stacking_action();
534 
536  void _init_seeds();
537 
539  void _init_prngs_states();
540 
542  virtual void _init_prngs();
543 
545  virtual void _init_time_stat();
546 
547  private:
548  // Controls:
549  bool _initialized_ = false;
550 
551  // Configuration:
552  const datatools::multi_properties* _multi_config_ = nullptr;
553 
554  // User interface mode:
555  bool _interactive_ = false;
556  bool _g4_visualization_ = false;
557 
558  std::string _simulation_ctrl_label_;
559  simulation_ctrl* _simulation_ctrl_ = nullptr;
560 
561  std::map<std::string,std::string> _supported_output_profile_ids_;
562  std::string _output_profiles_activation_rule_;
563  std::set<std::string> _activated_output_profile_ids_;
564 
565  // Service manager :
566  datatools::service_manager* _service_manager_ = nullptr;
567 
568  // Geometry manager :
569  const geomtools::manager* _external_geom_manager_ = nullptr;
570  geomtools::manager _geom_manager_;
571 
572  // Vertex generation manager :
573  int _vg_prng_seed_;
574  mygsl::rng _vg_prng_;
575  genvtx::manager _vg_manager_;
576  std::string _vg_name_;
577  genvtx::i_vertex_generator* _vertex_generator_ = nullptr;
578 
579  // Event generation manager :
580  int _eg_prng_seed_;
581  mygsl::rng _eg_prng_;
582  genbb::manager _eg_manager_;
583  std::string _eg_name_;
584  genbb::i_genbb* _event_generator_ = nullptr;
585 
586  // Step hit processor factory PRNG :
587  int _shpf_prng_seed_;
588  mygsl::rng _shpf_prng_;
589 
590  // Main Geant4 PRNG :
591  int _mgr_prng_seed_;
592  mygsl::rng _mgr_prng_;
593  g4_prng _g4_prng_;
594 
595  // G4 objects:
596  G4VSteppingVerbose* _g4_stepping_verbosity_ = nullptr;
597 #ifdef G4MULTITHREADED
598  G4MTRunManager* _g4_run_manager_ = nullptr;
599 #else
600  G4RunManager* _g4_run_manager_ = nullptr;
601 #endif
602  G4UImanager* _g4_UI_ = nullptr;
603 
604  // User specified G4 interfaces :
605  mctools::g4::detector_construction* _user_detector_construction_ = nullptr;
606  mctools::g4::physics_list* _user_physics_list_ = nullptr;
607  mctools::g4::primary_generator* _user_primary_generator_ = nullptr;
608  mctools::g4::run_action* _user_run_action_ = nullptr;
609  mctools::g4::event_action* _user_event_action_ = nullptr;
610  mctools::g4::tracking_action* _user_tracking_action_ = nullptr;
611  mctools::g4::stepping_action* _user_stepping_action_ = nullptr;
612  mctools::g4::stacking_action* _user_stacking_action_ = nullptr;
613 
614 #ifdef G4VIS_USE
615  // G4 visualization, if you choose to have it!
616  G4VisManager * _g4_vis_manager_ = nullptr;
617 #endif // G4VIS_USE
618 
619 
620  // A PRNG seed manager :
621  std::string _init_seed_method_;
622  mygsl::prng_seed_manager _seed_manager_;
623 
624  // A PRNG state manager :
625  mygsl::prng_state_manager _prng_state_manager_;
626  int _prng_state_save_modulo_;
627 
628  // Track historical infos :
629  bool _use_track_history_;
630  track_history _track_history_;
631 
632  // User:
633  std::string _input_prng_seeds_file_;
634  std::string _output_prng_seeds_file_;
635  std::string _input_prng_states_file_;
636  std::string _output_prng_states_file_;
637  io_utils::data_format_type _output_data_format_;
638  std::string _output_data_bank_label_;
639  std::string _output_data_file_;
640  uint32_t _number_of_events_;
641  int _number_of_events_modulo_;
642  std::string _g4_macro_;
643  int _g4_tracking_verbosity_;
644  bool _forbid_private_hits_;
645  bool _dont_save_no_sensitive_hit_events_;
646  bool _use_run_header_footer_;
647  bool _use_time_stat_;
648  CT_map _CTs_;
649  };
650 
651  } // end of namespace g4
652 } // end of namespace mctools
653 
654 /***************************
655  * OCD support : interface *
656  ***************************/
657 
658 #include <datatools/ocd_macros.h>
660 
661 #endif // MCTOOLS_G4_MANAGER_H
662 
663 // Local Variables: --
664 // mode: c++ --
665 // c-file-style: "gnu" --
666 // tab-width: 2 --
667 // End: --
virtual void _init_time_stat()
Initialize the time statistics.
void apply_output_profiles_activation_rule(const std::string &output_profiles_activation_rule_)
Apply activation rule for output profile.
void set_output_data_file(const std::string &)
Set the output data file name.
datatools::service_manager & grab_service_manager()
Return a mutable service manager reference.
void _init_defaults()
Initialize attirbutes' default values.
void set_forbid_private_hits(bool a_forbid)
void set_input_prng_states_file(const std::string &)
void set_use_run_header_footer(bool a_use_run_header_footer)
bool has_vertex_generator() const
Check if a vertex generator is available.
event_action & grab_user_event_action()
Return a mutable event_action reference.
void set_prng_state_save_modulo(int a_modulo)
bool has_output_prng_states_file() const
const mygsl::prng_state_manager & get_state_manager() const
Return a non mutable reference to the manager of PRNG's states.
bool has_activated_output_profiles() const
Check if some output profiles are activated.
A container of mapped properties objects.
Definition: multi_properties.h:99
virtual void _init_tracking_action()
Initialize the tracking action.
void initialize(const datatools::multi_properties &mp_)
Initialize the Geant4 manager.
bool has_mgr_prng_seed() const
Check the seed of the G4 simulation engine.
void set_init_seed_method(const std::string &)
Set the method used to set the initialization seed for the generation of seeds.
Definition: base_step_hit.h:32
bool is_interactive() const
Return true if the simulation is interactive via a CLI/GUI.
void _init_prngs_states()
Initialize the internal states of embedded PRNGs.
void set_output_profiles_activation_rule(const std::string &rule_)
Set the activation rule for output profiles.
Top-level namespace of the Bayeux/genvtx module library.
Definition: box_model_vg.h:32
const g4_prng & get_g4_prng() const
Return a non mutable reference to the Geant4 engine's PRNG.
void set_output_data_format(io_utils::data_format_type)
Set the output data file format.
const std::string & get_init_seed_method() const
Return the method for seed initialization.
const mygsl::rng & get_mgr_prng() const
Return a non mutable reference to the Geant4 engine's PRNG.
bool has_g4_macro() const
Check if the manager has a Geant4 macro.
void set_service_manager(datatools::service_manager &sm)
Plug an external service manager.
void dump_base(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="") const
Basic print.
void record_current_prng_states()
Record the current states of all PRNGs.
mygsl::rng & grab_eg_prng()
Return a mutable reference to the event generator's PRNG.
void set_number_of_events_modulo(int)
Set the number of events modulo.
GENBB particle generator abstract base class.
Definition: i_genbb.h:59
void set_interactive(bool)
Set the simulation to be interactive.
void run_simulation()
Run the simulation session.
const std::string & get_input_prng_seeds_file() const
void set_g4_visualization(bool)
Set the Geant4 visualization flag.
static const uint32_t NO_LIMIT
Definition: manager.h:121
const std::string & get_input_prng_states_file() const
const genbb::i_genbb & get_event_generator() const
Return a non-mutable reference to a embedded event generator.
const std::string & get_g4_macro() const
Return the filename of the Geant4 macro.
Base class with logging support.
Definition: loggable_support.h:23
const track_history & get_track_history() const
Get a non-mutable reference to the track history object.
data_format_type
Definition: utils.h:92
int get_prng_state_save_modulo() const
void set_g4_macro(const std::string &macroFile)
Set the Geant4 macro.
void reset_output_data_format()
Reset the output data file format.
static const uint32_t NUMBER_OF_EVENTS_WARNING_LIMIT
Number of events that triggers an alarm.
Definition: manager.h:120
CT_map & grab_CT_map()
Vertex generator manager.
Definition: manager.h:81
bool has_input_prng_seeds_file() const
mygsl::rng & grab_shpf_prng()
Return a mutable reference to the Step Hit Processor Factory's PRNG.
int get_number_of_events_modulo() const
Return the number of events modulo.
void set_external_geom_manager(const geomtools::manager &gm)
Plug an external geometry manager.
genbb::manager & grab_eg_manager()
Get a mutable reference to the embedded event generator.
const std::set< std::string > & get_activated_output_profile_ids() const
Return the set of activated output profiles' Ids.
void set_dont_save_no_sensitive_hit_events(bool a_dont_save)
void fetch_activated_output_profile_ids(std::vector< std::string > &activated_output_profile_ids_) const
Build the list of output profiles' Ids.
virtual void _init_run_action()
Initialize the run action.
virtual void _init_detector_construction()
Initialize the detector construction.
Definition: g4_prng.h:49
bool has_activated_output_profile(const std::string &profile_id_) const
Check if a given output profile is activated.
A manager that can store the internal states associated to a set of PRNGs addressed with some labels.
Definition: prng_state_manager.h:50
bool using_run_header_footer() const
genvtx::manager & grab_vg_manager()
Get a mutable reference to the vertex generator manager.
bool forbids_private_hits() const
datatools::computing_time CT_type
Definition: manager.h:113
virtual void _init_physics_list()
Initialize the physics list.
static const uint32_t DEFAULT_PRNG_STATES_SAVE_MODULO
Definition: manager.h:122
bool has_external_geom_manager() const
Check if an external service manager is plugged.
manager()
Default constructor:
bool has_number_of_events_modulo() const
Check if a modulo on number of events is defined.
bool is_batch() const
Return true if the simulation will run in batch mode.
void set_output_data_bank_label(const std::string &)
Set the output data bank label(for "bank" output format only)
virtual void _init_core()
Initialize the manager's core functionalities.
const geomtools::manager & get_geom_manager() const
Get a non-mutable reference to the geometry manager.
std::map< std::string, CT_type > CT_map
Definition: manager.h:114
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
virtual void run_simulation_impl()
Simulation actions.
bool dont_save_no_sensitive_hit_events() const
bool has_g4_visualization() const
Check the Geant4 visualization flag.
bool has_service_manager() const
Check is an external service manager plugged.
void reset_output_prng_seeds_file()
void reset()
Reset the Geant4 manager.
virtual void reset_impl()
Termination actions.
g4_prng & grab_g4_prng()
Return a mutable reference to the Geant4 engine's PRNG.
bool has_output_prng_seeds_file() const
bool has_input_prng_states_file() const
uint32_t get_number_of_events() const
Return the number of events to be generated.
const CT_map & get_CT_map() const
void reset_input_prng_states_file()
bool is_automatic() const
Return true if simulation will run in batch mode sans macro file.
track_history & grab_track_history()
Get a mutable reference to the track history object.
mygsl::rng & grab_vg_prng()
Return a mutable reference to the vertex generator's PRNG.
void reset_output_prng_states_file()
static const uint32_t NUMBER_OF_EVENTS_UPPER_LIMIT
Maximum number of events to be processed.
Definition: manager.h:118
Top-level namespace of the Bayeux/genbb_help module library.
Definition: alpha_decay.h:51
void set_simulation_ctrl(simulation_ctrl &a_simulation_ctrl)
Plug an external thread simulation control.
void set_output_prng_seeds_file(const std::string &)
mygsl::seed_manager & grab_seed_manager()
Return a mutable reference to the manager of PRNG's seeds.
void set_input_prng_seeds_file(const std::string &)
bool has_event_generator() const
Check if an event generator is available.
bool has_simulation_ctrl() const
Check if an external thread simulation control is plugged.
virtual void initialize_impl()
Initialization actions.
const genbb::manager & get_eg_manager() const
Get a non-mutable reference to the embedded event generator.
virtual void _init_event_generator()
Initialize the event generator.
void activate_output_profile(const std::string &profile_id_)
Activate a given output profile.
void set_output_data_format_by_label(const std::string &)
Set the output data file format.
void _init_seeds()
Initialize the seeds for embedded PRNGs.
void add_supported_output_profile(const std::string &profile_id_, const std::string &description_)
Add an output profile officially supported by the manager.
static const std::string & vertex_generator_label()
static const std::string & shpf_label()
bool has_supported_output_profile(const std::string &profile_id_) const
Check if some output profile is officially supported by the manager.
void reset_input_prng_seeds_file()
bool is_initialized() const
Return true if the simulation is fully initialized.
Definition: seed_manager.h:60
The Geant4 simulation manager.
Definition: manager.h:111
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
bool has_prng_state_save_modulo() const
Utilities for logging information.
Geometry manager for virtual geometry modelling. Main geometry manager for the modelisation of variou...
Definition: manager.h:70
The base interface class for all vertex generator classes.
Definition: i_vertex_generator.h:59
void set_vertex_generator_name(const std::string &)
Set the name of the active vertex generator.
int get_mgr_prng_seed() const
Get the seed of the G4 simulation engine.
bool has_track_history() const
Check if a track history object is available.
void dump(std::ostream &=std::clog) const
Basic default print.
void set_number_of_events(uint32_t)
Set the number of events to be generated.
virtual void _init_primary_generator_action()
Initialize the primary generator action.
void deactivate_output_profile(const std::string &profile_id_)
Deactivate a given output profile.
void set_using_time_stat(bool)
void set_event_generator_seed(int)
Set the seed for the event generator's PRNG.
const std::string & get_output_prng_states_file() const
mygsl::prng_state_manager & grab_state_manager()
Return a mutable reference to the manager of PRNG's states.
static const std::string & default_prng_id()
virtual void _init_vertex_generator()
Initialize the vertex generator.
const std::map< std::string, std::string > & get_supported_output_profiles() const
Return the dictionary of supported output profiles.
io_utils::data_format_type get_output_data_format() const
Return the output data file format.
void set_shpf_prng_seed(int)
Set the seed for the Step Hit Processor Factory's PRNG.
bool using_time_stat() const
virtual void _init_stacking_action()
Initialize the stacking action.
static const std::string & default_prng_states_file()
const std::string & get_output_prng_seeds_file() const
bool has_init_seed_method() const
Check if the method for seed initialization is set.
const genvtx::i_vertex_generator & get_vertex_generator() const
Return a non-mutable reference to a embedded vertex generator.
void set_mgr_prng_seed(int seed)
Set the seed of the G4 simulation engine.
const datatools::service_manager & get_service_manager() const
Return a non-mutable service manager reference.
simulation_ctrl & grab_simulation_ctrl()
Return a mutable thread simulation control reference.
virtual void _init_event_action()
Initialize the event action.
const genvtx::manager & get_vg_manager() const
Get a non-mutable reference to the vertex generator manager.
void set_output_prng_states_file(const std::string &)
static const std::string & g4_manager_label()
static const uint32_t NUMBER_OF_EVENTS_LOWER_LIMIT
Minimum number of events to be processed.
Definition: manager.h:119
A class that compute time statistics.
Definition: time_tools.h:18
void set_vertex_generator_seed(int)
Set the seed for the vertex generator's PRNG.
const mygsl::seed_manager & get_seed_manager() const
Return a non mutable reference to the manager of PRNG's seeds.
virtual void _init_prngs()
Initialize the embedded PRNGs.
const simulation_ctrl & get_simulation_ctrl() const
Return a non-mutable thread simulation control reference.
void reset_simulation_ctrl()
Unplug an external thread simulation control.
static const std::string & event_generator_label()
GENBB particle manager management class.
Definition: manager.h:69
virtual void _init_geometry()
Initialize the geometry.
Service management class.
Definition: service_manager.h:57
Recording of tracks history.
Definition: track_history.h:45
Pseudo random number generator.
Definition: rng.h:53
virtual void _init_stepping_action()
Initialize the stepping action.
void set_event_generator_name(const std::string &)
Set the name of the active event generator.
virtual ~manager()
Destructor.
mygsl::rng & grab_mgr_prng()
Return a mutable reference to the Geant4 engine's PRNG.
void set_use_track_history(const bool)
(De)Activate the track history object