Bayeux  3.4.1
Core Foundation library for SuperNEMO
cylinder_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: 2010-02-13
5  *
6  * License:
7  *
8  * Description:
9  * Cylinder vertex generator
10  * Generation of vertex in a 3D cylinder
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GENVTX_CYLINDER_VG_H
17 #define GENVTX_CYLINDER_VG_H 1
18 
19 // Standard library:
20 #include <iostream>
21 
22 // Third party:
23 // - Bayeux/geomtools
24 #include <geomtools/cylinder.h>
25 
26 // This project:
28 
29 namespace datatools {
30  class properties;
31 }
32 
33 namespace geomtools {
34  // Forward declaration:
35  class logical_volume;
36 }
37 
38 namespace genvtx {
39 
42  {
43  public:
44 
45  static const int MODE_INVALID = -1;
46  static const int MODE_BULK = 0;
47  static const int MODE_SURFACE = 1;
48  static const int MODE_DEFAULT = MODE_BULK;
49 
51  int get_mode () const;
52 
54  void set_mode (int mode_);
55 
57  void set_surface_mask (int surface_mask_);
58 
60  void set_skin_skip (double skin_skip_);
61 
63  void set_skin_thickness (double skin_thickness_);
64 
66  void set_bulk (double skin_thickness_);
67 
69  void set_surface (int surface_mask_);
70 
72  void set_cylinder (const geomtools::cylinder & cylinder_);
73 
75  const geomtools::cylinder & get_cylinder () const;
76 
78  bool has_cylinder_ref () const;
79 
81  void set_cylinder_ref (const geomtools::cylinder & cylinder_);
82 
84  const geomtools::cylinder & get_cylinder_ref () const;
85 
87  bool has_cylinder_safe() const;
88 
90  const geomtools::cylinder & get_cylinder_safe () const;
91 
93  bool has_logical() const;
94 
97 
99  void reset_logical();
100 
102  void tree_dump (std::ostream & out_ = std::clog,
103  const std::string & title_ = "",
104  const std::string & indent_ = "",
105  bool inherit_ = false) const;
106 
108  cylinder_vg();
109 
111  virtual ~cylinder_vg();
112 
114  virtual void initialize(const ::datatools::properties &,
117 
119  virtual void reset();
120 
122  virtual bool is_initialized() const;
123 
124  protected :
125 
127  virtual void _shoot_vertex(::mygsl::rng & random_, ::geomtools::vector_3d & vertex_);
128 
129  private:
130 
132  void _init_ ();
133 
135  void _reset_ ();
136 
138  void _set_defaults_ ();
139 
140  private:
141 
142  bool _initialized_;
143  const geomtools::logical_volume * _log_vol_;
144  const geomtools::cylinder * _cylinder_ref_;
145  geomtools::cylinder _cylinder_;
146  int _mode_;
147  int _surface_mask_;
148  double _skin_skip_;
149  double _skin_thickness_;
150  double _sum_weight_[3];
151 
155 
156  };
157 
158 } // end of namespace genvtx
159 
160 #endif // GENVTX_CYLINDER_VG_H
161 
162 /*
163 ** Local Variables: --
164 ** mode: c++ --
165 ** c-file-style: "gnu" --
166 ** tab-width: 2 --
167 ** End: --
168 */
int get_mode() const
Return mode.
static const int MODE_BULK
Definition: cylinder_vg.h:46
const geomtools::cylinder & get_cylinder() const
Return a const referece to the embedded cylinder.
virtual void reset()
Reset.
virtual ~cylinder_vg()
Destructor.
Top-level namespace of the Bayeux/genvtx module library.
Definition: box_model_vg.h:32
const geomtools::cylinder & get_cylinder_ref() const
Return a const reference to the referenced external cylinder.
bool has_cylinder_ref() const
Check if a referenced cylinder is available.
A logical geometry volume (ala GDML)
Definition: logical_volume.h:40
void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
void set_cylinder_ref(const geomtools::cylinder &cylinder_)
Set the reference to an external cylinder.
static const int MODE_SURFACE
Definition: cylinder_vg.h:47
static const int MODE_DEFAULT
Definition: cylinder_vg.h:48
void set_surface_mask(int surface_mask_)
Set the surface mask.
void set_skin_skip(double skin_skip_)
Set the skin skip distance.
const geomtools::cylinder & get_cylinder_safe() const
Return a safe const reference to the cylinder.
virtual void _shoot_vertex(::mygsl::rng &random_, ::geomtools::vector_3d &vertex_)
Randomize vertex.
void set_skin_thickness(double skin_thickness_)
Set the skin thickness.
bool has_cylinder_safe() const
Check if a safe referenced cylinder is available.
static const int MODE_INVALID
Definition: cylinder_vg.h:45
cylinder_vg()
Constructor.
virtual void initialize(const ::datatools::properties &, ::datatools::service_manager &, ::genvtx::vg_dict_type &)
Initialization.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
void set_surface(int surface_mask_)
Set surface mode.
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
void set_logical(const geomtools::logical_volume &)
Set the reference to an external logical.
The base interface class for all vertex generator classes.
Definition: i_vertex_generator.h:59
The 3D shape model for a cylinder.
Definition: cylinder.h:41
virtual bool is_initialized() const
Check initialization status.
#define GENVTX_VG_REGISTRATION_INTERFACE(GENVTX_CLASS_NAME)
Definition: vg_macros.h:46
bool has_logical() const
Check if a referenced logical is available.
A vertex generator based on the geometry of a 3D cylinder.
Definition: cylinder_vg.h:41
std::map< std::string, vg_entry_type > vg_dict_type
Definition: vg_tools.h:125
void reset_logical()
Reset the reference to an external logical.
void set_cylinder(const geomtools::cylinder &cylinder_)
Set the embedded cylinder.
Service management class.
Definition: service_manager.h:57
void set_bulk(double skin_thickness_)
Set bulk mode.
Pseudo random number generator.
Definition: rng.h:53
void set_mode(int mode_)
Set mode.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39