Bayeux  3.4.1
Core Foundation library for SuperNEMO
tube_vg.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2012-04-04
4  * Last modified: 2014-04-09
5  *
6  * License:
7  *
8  * Description:
9  * Tube vertex generator
10  * Generation of vertex in a 3D tube
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GENVTX_TUBE_VG_H
17 #define GENVTX_TUBE_VG_H 1
18 
19 // Standard library:
20 #include <iostream>
21 
22 // Third party:
23 // - Bayeux/geomtools
24 #include <geomtools/tube.h>
25 #include <geomtools/cylinder.h>
26 
27 // This project:
29 
30 namespace datatools {
31  class properties;
32 }
33 
34 namespace geomtools {
35  // Forward declaration:
36  class logical_volume;
37 }
38 
39 namespace genvtx {
40 
42  class tube_vg : public i_vertex_generator
43  {
44  public:
45 
46  static const int MODE_INVALID = -1;
47  static const int MODE_BULK = 0;
48  static const int MODE_SURFACE = 1;
49  static const int MODE_DEFAULT = MODE_BULK;
50 
51  int get_mode () const;
52 
53  void set_mode (int mode_);
54 
55  void set_surface_mask (int surface_mask_);
56 
57  void set_skin_skip (double skin_skip_);
58 
59  void set_skin_thickness (double skin_thickness_);
60 
61  void set_bulk (double skin_thickness_);
62 
63  void set_surface (int surface_mask_);
64 
65  void set_tube (const geomtools::tube & tube_);
66 
67  const geomtools::tube & get_tube () const;
68 
69  bool has_tube_ref () const;
70 
71  void set_tube_ref (const geomtools::tube & tube_);
72 
73  const geomtools::tube & get_tube_ref () const;
74 
75  bool has_tube_safe() const;
76 
77  const geomtools::tube & get_tube_safe () const;
78 
80  bool has_logical() const;
81 
84 
86  void reset_logical();
87 
89  void tree_dump (std::ostream & out_ = std::clog,
90  const std::string & title_ = "",
91  const std::string & indent_ = "",
92  bool inherit_ = false) const;
93 
95  tube_vg();
96 
98  virtual ~tube_vg();
99 
101  virtual void initialize(const ::datatools::properties &,
104 
106  virtual void reset();
107 
109  virtual bool is_initialized() const;
110 
111  protected :
112 
114  virtual void _shoot_vertex(::mygsl::rng & random_, ::geomtools::vector_3d & vertex_);
115 
116  private:
117 
118  void _init_ ();
119 
120  void _reset_ ();
121 
122  void _set_defaults_ ();
123 
124  private:
125 
126  bool _initialized_;
127  const geomtools::logical_volume * _log_vol_;
128  const geomtools::tube * _tube_ref_;
129  geomtools::tube _tube_;
130  int _mode_;
131  int _surface_mask_;
132  double _skin_skip_;
133  double _skin_thickness_;
134  double _sum_weight_[4];
135 
139 
140  };
141 
142 } // end of namespace genvtx
143 
144 #endif // GENVTX_TUBE_VG_H
145 
146 /*
147 ** Local Variables: --
148 ** mode: c++ --
149 ** c-file-style: "gnu" --
150 ** tab-width: 2 --
151 ** End: --
152 */
const geomtools::tube & get_tube() const
bool has_logical() const
Check logical.
void set_mode(int mode_)
Top-level namespace of the Bayeux/genvtx module library.
Definition: box_model_vg.h:32
void set_surface(int surface_mask_)
bool has_tube_safe() const
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(double skin_thickness_)
virtual bool is_initialized() const
Check initialization status.
void set_surface_mask(int surface_mask_)
void reset_logical()
Reset logical.
A logical geometry volume (ala GDML)
Definition: logical_volume.h:40
virtual void reset()
Reset.
int get_mode() const
void set_skin_thickness(double skin_thickness_)
static const int MODE_BULK
Definition: tube_vg.h:47
void set_skin_skip(double skin_skip_)
The 3D shape model for a tube.
Definition: tube.h:45
virtual ~tube_vg()
Destructor.
void set_logical(const geomtools::logical_volume &)
Set logical.
bool has_tube_ref() const
const geomtools::tube & get_tube_ref() const
const geomtools::tube & get_tube_safe() const
void set_tube_ref(const geomtools::tube &tube_)
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
virtual void initialize(const ::datatools::properties &, ::datatools::service_manager &, ::genvtx::vg_dict_type &)
Initialization.
virtual void _shoot_vertex(::mygsl::rng &random_, ::geomtools::vector_3d &vertex_)
Randomize vertex.
static const int MODE_SURFACE
Definition: tube_vg.h:48
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
#define GENVTX_VG_REGISTRATION_INTERFACE(GENVTX_CLASS_NAME)
Definition: vg_macros.h:46
static const int MODE_DEFAULT
Definition: tube_vg.h:49
std::map< std::string, vg_entry_type > vg_dict_type
Definition: vg_tools.h:125
A vertex generator based on the geometry of a 3D tube.
Definition: tube_vg.h:42
static const int MODE_INVALID
Definition: tube_vg.h:46
tube_vg()
Constructor.
void set_tube(const geomtools::tube &tube_)
Service management class.
Definition: service_manager.h:57
Pseudo random number generator.
Definition: rng.h:53
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39