Bayeux  3.4.1
Core Foundation library for SuperNEMO
box_vg.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-02-13
4  * Last modified: 2014-04-09
5  *
6  * License:
7  *
8  * Description:
9  * Box vertex generator
10  * Generation of vertex in a 3D box
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GENVTX_BOX_VG_H
17 #define GENVTX_BOX_VG_H 1
18 
19 // Standard library:
20 #include <iostream>
21 
22 // Third party:
23 // - Bayeux/geomtools
24 #include <geomtools/box.h>
25 
26 // This project:
28 
29 namespace geomtools {
30  // Forward declaration:
31  class logical_volume;
32 }
33 
34 namespace genvtx {
35 
37  class box_vg : public i_vertex_generator
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  public:
47 
49  int get_mode () const;
50 
52  void set_mode (int mode_);
53 
55  void set_surface_mask (int surface_mask_);
56 
58  void set_skin_skip (double skin_skip_);
59 
61  void set_skin_thickness (double skin_thickness_);
62 
64  void set_bulk (double skin_thickness_);
65 
67  void set_surface (int surface_mask_);
68 
70  void set_box (const geomtools::box & box_);
71 
73  const geomtools::box & get_box () const;
74 
76  bool has_box_ref () const;
77 
79  void set_box_ref (const geomtools::box & box_);
80 
82  const geomtools::box & get_box_ref () const;
83 
85  bool has_box_safe() const;
86 
88  const geomtools::box & get_box_safe () const;
89 
91  bool has_logical() const;
92 
95 
97  void reset_logical();
98 
100  void tree_dump (std::ostream & out_ = std::clog,
101  const std::string & title_ = "",
102  const std::string & indent_ = "",
103  bool inherit_ = false) const;
104 
106  box_vg();
107 
109  virtual ~box_vg();
110 
112  virtual void initialize(const ::datatools::properties &,
115 
117  virtual void reset();
118 
120  virtual bool is_initialized() const;
121 
122  protected :
123 
125  virtual void _shoot_vertex(::mygsl::rng & random_, ::geomtools::vector_3d & vertex_);
126 
127  private:
128 
130  void _init_();
131 
133  void _reset_();
134 
136  void _set_defaults_();
137 
138  private:
139 
140  bool _initialized_;
141  const geomtools::logical_volume * _log_vol_;
142  geomtools::box _box_;
143  const geomtools::box * _box_ref_;
144 
145  int _mode_;
146  int _surface_mask_;
147  double _skin_skip_;
148  double _skin_thickness_;
149  double _sum_weight_[6];
150 
151  private:
152 
156 
157  };
158 
159 } // end of namespace genvtx
160 
161 #endif // GENVTX_BOX_VG_H
162 
163 /*
164 ** Local Variables: --
165 ** mode: c++ --
166 ** c-file-style: "gnu" --
167 ** tab-width: 2 --
168 ** End: --
169 */
static const int MODE_BULK
Definition: box_vg.h:42
static const int MODE_DEFAULT
Definition: box_vg.h:44
virtual void reset()
Reset.
Top-level namespace of the Bayeux/genvtx module library.
Definition: box_model_vg.h:32
void set_box(const geomtools::box &box_)
Set the embedded cylinder.
virtual void _shoot_vertex(::mygsl::rng &random_, ::geomtools::vector_3d &vertex_)
Randomize vertex.
void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
static const int MODE_SURFACE
Definition: box_vg.h:43
The 3D shape model for a box.
Definition: box.h:44
void set_mode(int mode_)
Set mode.
void set_bulk(double skin_thickness_)
Set bulk mode.
box_vg()
Constructor.
virtual ~box_vg()
Destructor.
A logical geometry volume (ala GDML)
Definition: logical_volume.h:40
void set_logical(const geomtools::logical_volume &)
Set the reference to an external logical.
void set_surface(int surface_mask_)
Set surface mode.
int get_mode() const
Return mode.
void set_box_ref(const geomtools::box &box_)
Set the reference to an external cylinder.
bool has_logical() const
Check if a referenced logical is available.
static const int MODE_INVALID
Definition: box_vg.h:41
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
const geomtools::box & get_box_safe() const
Return a safe const reference to the cylinder.
virtual void initialize(const ::datatools::properties &, ::datatools::service_manager &, ::genvtx::vg_dict_type &)
Initialization.
The base interface class for all vertex generator classes.
Definition: i_vertex_generator.h:59
A vertex generator based on the geometry of a 3D box.
Definition: box_vg.h:37
#define GENVTX_VG_REGISTRATION_INTERFACE(GENVTX_CLASS_NAME)
Definition: vg_macros.h:46
void set_skin_skip(double skin_skip_)
Set the skin skip distance.
virtual bool is_initialized() const
Check initialization status.
bool has_box_ref() const
Check if a referenced cylinder is available.
void set_surface_mask(int surface_mask_)
Set the surface mask.
const geomtools::box & get_box_ref() const
Return a const reference to the referenced external cylinder.
std::map< std::string, vg_entry_type > vg_dict_type
Definition: vg_tools.h:125
const geomtools::box & get_box() const
Return a const referece to the embedded cylinder.
void set_skin_thickness(double skin_thickness_)
Set the skin thickness.
Service management class.
Definition: service_manager.h:57
void reset_logical()
Reset the reference to an external logical.
bool has_box_safe() const
Check if a safe referenced cylinder is available.
Pseudo random number generator.
Definition: rng.h:53
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39