Bayeux  3.4.1
Core Foundation library for SuperNEMO
genvtx_driver.h
Go to the documentation of this file.
1 
4 #ifndef GENVTX_GENVTX_DRIVER_H
5 #define GENVTX_GENVTX_DRIVER_H 1
6 
7 // Standard libraries:
8 #include <cstdlib>
9 #include <iostream>
10 #include <string>
11 #include <vector>
12 #include <memory>
13 
14 // Third party
15 // - Boost:
16 #include <boost/cstdint.hpp>
17 // - Bayeux/datatools:
18 #include <datatools/logger.h>
19 
20 namespace geomtools {
21  class manager;
22 }
23 
24 namespace mygsl {
25  class rng;
26 }
27 
29 namespace genvtx {
30 
31  class manager;
32 
35  {
38 
40  void reset();
41 
43  void dump(std::ostream & = std::clog) const;
44 
46  void check() const;
47 
48  protected:
49 
51  void _set_defaults();
52 
53  public:
54  std::string logging_label;
55  std::vector<std::string> LL_dlls;
56  std::string LL_config;
57  std::string GeoMgrConfigFile;
58  std::string VGMgrConfigFile;
59 
60  bool action_list = false;
61  std::string generator_name;
62  bool action_show = false;
63 
64  bool action_shoot = false;
65  std::string prng_type;
66  int prng_seed;
67  int nshoots;
69  std::string VtxOutputFile;
70  std::string VtxInputFile;
71 
72  bool action_visu = false;
73  std::string visu_object;
75  double visu_spot_zoom;
76  double visu_spot_size;
77  std::string visu_spot_color;
78  std::string visu_view;
79 
80  bool action_visu_store_dd = false;
81  std::string visu_store_dd_out;
82 
83  };
84 
86  class genvtx_driver {
87  public:
88 
93  ACTION_LIST = 0x1,
94  ACTION_SHOW = 0x2,
95  ACTION_SHOOT = 0x4,
96  ACTION_VISU = 0x8,
98  };
99 
101  genvtx_driver();
102 
105 
107  ~genvtx_driver();
108 
110  bool is_initialized() const;
111 
113  void setup(const genvtx_driver_params &);
114 
116  void initialize();
117 
119  void initialize(const genvtx_driver_params &);
120 
122  void reset();
123 
125  void run();
126 
129 
131  const genvtx_driver_params & get_params() const;
132 
133  private:
134 
135  bool _initialized_ = false;
136  genvtx_driver_params _params_;
137  datatools::logger::priority _logging_;
138  uint32_t _action_ = 0;
139  std::unique_ptr<geomtools::manager> _geo_mgr_;
140  std::unique_ptr<mygsl::rng> _prng_;
141  std::unique_ptr<genvtx::manager> _vtx_mgr_;
142 
143  };
144 
145 } // end of namespace genvtx
146 
147 #endif // GENVTX_GENVTX_DRIVER_H
148 
149 // Local Variables: --
150 // mode: c++ --
151 // c-file-style: "gnu" --
152 // tab-width: 2 --
153 // End: --
double visu_spot_size
Display splot size.
Definition: genvtx_driver.h:76
double visu_spot_zoom
Display zoom factor.
Definition: genvtx_driver.h:75
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
Top-level namespace of the Bayeux/genvtx module library.
Definition: box_model_vg.h:32
Definition: genvtx_driver.h:97
genvtx_driver()
Default constructor.
void setup(const genvtx_driver_params &)
Load the configuration parameters:
std::vector< std::string > LL_dlls
List of DLL to be loaded (library loader)
Definition: genvtx_driver.h:55
Definition: genvtx_driver.h:94
std::string LL_config
Configuration file for the library loader.
Definition: genvtx_driver.h:56
std::string prng_type
Type of the PRNG.
Definition: genvtx_driver.h:65
std::string visu_object
Name of the 3D object to focus on.
Definition: genvtx_driver.h:73
bool action_list
Flag to list available vertex generators.
Definition: genvtx_driver.h:60
int nshoots
Number of shoots.
Definition: genvtx_driver.h:67
int shoot_modulo
Modulo on vertex number (progress bar)
Definition: genvtx_driver.h:68
void _set_defaults()
Set default values.
bool action_visu_store_dd
Flag to store generated vertexes as a display data objects.
Definition: genvtx_driver.h:80
std::string generator_name
Selected vertex generator name.
Definition: genvtx_driver.h:61
Definition: genvtx_driver.h:93
datatools::logger::priority get_logging() const
Return the logging priority threshold.
void initialize()
Initialize.
Definition: genvtx_driver.h:95
std::string VtxOutputFile
Output file where to store generated vertexes.
Definition: genvtx_driver.h:69
Definition: genvtx_driver.h:92
bool action_shoot
Flag to shoot vertexes from the selected vertex generator.
Definition: genvtx_driver.h:64
std::string visu_store_dd_out
Output file where to store generated vertexes as display data object.
Definition: genvtx_driver.h:81
void run()
Run the driver.
genvtx_driver_params()
Default constructor.
bool action_show
Flag to print informations about the selected vertex generator.
Definition: genvtx_driver.h:62
bool action_visu
Flag to activate visualization.
Definition: genvtx_driver.h:72
int prng_seed
Seed used to initialize the PRNG.
Definition: genvtx_driver.h:66
Definition: genvtx_driver.h:96
std::string logging_label
Logging priority level.
Definition: genvtx_driver.h:54
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
Definition: genvtx_driver.h:91
std::string VGMgrConfigFile
Vertex generator manager main configuration file.
Definition: genvtx_driver.h:58
The genvtx driver.
Definition: genvtx_driver.h:86
Utilities for logging information.
action_flag_type
Action activation bits.
Definition: genvtx_driver.h:90
std::string VtxInputFile
Input file from which to load generated vertexes.
Definition: genvtx_driver.h:70
bool is_initialized() const
Check initialization status.
void dump(std::ostream &=std::clog) const
Rough print.
void check() const
Check.
std::string visu_view
Display view (default: "3d")
Definition: genvtx_driver.h:78
std::string GeoMgrConfigFile
Geometry manager main configuration file.
Definition: genvtx_driver.h:57
std::string visu_spot_color
Display splot color.
Definition: genvtx_driver.h:77
int visu_max_counts
Max number of displayed vertexes.
Definition: genvtx_driver.h:74
~genvtx_driver()
Destructor.
Genvtx driver configuration parameters.
Definition: genvtx_driver.h:34
const genvtx_driver_params & get_params() const
Return the configuration parameter.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39