Bayeux  3.4.1
Core Foundation library for SuperNEMO
polycone_vg.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2013-10-11
4  * Last modified: 2014-04-09
5  *
6  * License:
7  *
8  * Description:
9  * Polycone vertex generator
10  * Generation of vertex in a 3D polycone
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GENVTX_POLYCONE_VG_H
17 #define GENVTX_POLYCONE_VG_H 1
18 
19 // Standard library
20 #include <iostream>
21 #include <vector>
22 
23 // Third party
24 // - geomtools
25 #include <geomtools/polycone.h>
26 
27 // This project
29 
30 namespace datatools {
31  class properties;
32 }
33 
34 namespace genvtx {
35 
38  {
39  public:
40 
41  static const int MODE_INVALID = -1;
42  static const int MODE_BULK = 0;
43  static const int MODE_SURFACE = 1;
44  static const int MODE_DEFAULT = MODE_BULK;
45 
46  enum bulk_bits {
47  BULK_NONE = 0,
51  };
52 
53  int get_mode() const;
54 
55  void set_mode(int mode_);
56 
57  void set_surface_mask(int surface_mask_);
58 
59  void set_bulk_mask(int bulk_mask_);
60 
61  void set_angles(double theta_min_, double theta_max_);
62 
63  void set_skin_skip(double skin_skip_);
64 
65  void set_skin_thickness(double skin_thickness_);
66 
67  void set_bulk(int bulk_mask_, double skin_thickness_);
68 
69  void set_surface(int surface_mask_);
70 
71  void set_active_frustrum(size_t index_, bool active_);
72 
74 
75  void set_polycone(const geomtools::polycone & polycone_);
76 
77  const geomtools::polycone & get_polycone() const;
78 
79  void tree_dump(std::ostream & out_ = std::clog,
80  const std::string & title_ = "",
81  const std::string & indent_ = "",
82  bool inherit_ = false) const;
83 
84 
86  polycone_vg();
87 
89  virtual ~polycone_vg();
90 
92  virtual bool is_initialized() const;
93 
95  virtual void initialize(const ::datatools::properties &,
98 
100  virtual void reset();
101 
102  protected :
103 
105  virtual void _shoot_vertex(::mygsl::rng & random_, ::geomtools::vector_3d & vertex_);
106 
107  private:
108 
109  void _init_();
110 
111  void _reset_();
112 
113  void _set_defaults_();
114 
115  private:
116 
117  bool _initialized_;
118  geomtools::polycone _polycone_;
119  int _mode_;
120  int _surface_mask_;
121  int _bulk_mask_;
122  double _skin_skip_;
123  double _skin_thickness_;
124  double _theta_min_;
125  double _theta_max_;
126  double _sum_surface_weight_[4];
127  double _sum_bulk_weight_[2];
128  std::vector<bool> _active_frustra_;
129  std::vector<double> _volume_inner_frustra_;
130  std::vector<double> _volume_frustra_;
131  std::vector<double> _surface_inner_frustra_;
132  std::vector<double> _surface_outer_frustra_;
133  double _surface_bottom_;
134  double _surface_top_;
135 
139 
140  };
141 
142 } // end of namespace genvtx
143 
144 #endif // GENVTX_POLYCONE_VG_H
145 
146 /*
147 ** Local Variables: --
148 ** mode: c++ --
149 ** c-file-style: "gnu" --
150 ** tab-width: 2 --
151 ** End: --
152 */
void set_skin_thickness(double skin_thickness_)
Top-level namespace of the Bayeux/genvtx module library.
Definition: box_model_vg.h:32
void set_polycone(const geomtools::polycone &polycone_)
virtual ~polycone_vg()
Destructor.
void set_angles(double theta_min_, double theta_max_)
Polycone 3D solid shape.
Definition: polycone.h:39
static const int MODE_INVALID
Definition: polycone_vg.h:41
bulk_bits
Definition: polycone_vg.h:46
static const uint32_t bit01
Definition: bit_mask.h:28
static const int MODE_SURFACE
Definition: polycone_vg.h:43
Definition: polycone_vg.h:50
void set_active_all_frustrum()
void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
void set_bulk(int bulk_mask_, double skin_thickness_)
polycone_vg()
Constructor.
Definition: polycone_vg.h:49
void set_mode(int mode_)
virtual void initialize(const ::datatools::properties &, ::datatools::service_manager &, ::genvtx::vg_dict_type &)
Initialization.
static const int MODE_DEFAULT
Definition: polycone_vg.h:44
void set_skin_skip(double skin_skip_)
Definition: polycone_vg.h:47
const geomtools::polycone & get_polycone() const
virtual bool is_initialized() const
Check initialization status.
void set_surface_mask(int surface_mask_)
A vertex generator based on the geometry of a 3D polycone.
Definition: polycone_vg.h:37
void set_surface(int surface_mask_)
static const int MODE_BULK
Definition: polycone_vg.h:42
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
The base interface class for all vertex generator classes.
Definition: i_vertex_generator.h:59
void set_bulk_mask(int bulk_mask_)
int get_mode() const
#define GENVTX_VG_REGISTRATION_INTERFACE(GENVTX_CLASS_NAME)
Definition: vg_macros.h:46
Definition: polycone_vg.h:48
static const uint32_t bit00
Definition: bit_mask.h:27
std::map< std::string, vg_entry_type > vg_dict_type
Definition: vg_tools.h:125
void set_active_frustrum(size_t index_, bool active_)
virtual void reset()
Reset.
Service management class.
Definition: service_manager.h:57
virtual void _shoot_vertex(::mygsl::rng &random_, ::geomtools::vector_3d &vertex_)
Randomize vertex.
Pseudo random number generator.
Definition: rng.h:53