Bayeux  3.4.1
Core Foundation library for SuperNEMO
sphere_vg.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2013-10-10
4  * Last modified: 2014-04-09
5  *
6  * License:
7  *
8  * Description:
9  * Sphere vertex generator
10  * Generation of vertex in a 3D sphere
11  *
12  * History:
13  *
14  */
15 
16 #ifndef GENVTX_SPHERE_VG_H
17 #define GENVTX_SPHERE_VG_H 1
18 
19 // Standard library:
20 #include <iostream>
21 
22 // Third party:
23 // - Bayeux/geomtools
24 #include <geomtools/sphere.h>
25 
26 // This project:
28 
29 namespace geomtools {
30  // Forward declaration:
31  class logical_volume;
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  int get_mode () const;
47 
48  void set_mode (int mode_);
49 
50  void set_surface_mask (int surface_mask_);
51 
52  void set_skin_skip (double skin_skip_);
53 
54  void set_skin_thickness (double skin_thickness_);
55 
56  void set_bulk (double skin_thickness_);
57 
58  void set_surface (int surface_mask_);
59 
60  void set_sphere (const geomtools::sphere & sphere_);
61 
62  bool has_sphere_ref () const;
63 
64  void set_sphere_ref (const geomtools::sphere & sphere_);
65 
66  const geomtools::sphere & get_sphere () const;
67 
68  const geomtools::sphere & get_sphere_ref () const;
69 
70  bool has_sphere_safe () const;
71 
72  const geomtools::sphere & get_sphere_safe () const;
73 
75  bool has_logical() const;
76 
79 
81  void reset_logical();
82 
83  void tree_dump (std::ostream & out_ = std::clog,
84  const std::string & title_ = "",
85  const std::string & indent_ = "",
86  bool inherit_ = false) const;
87 
89  sphere_vg();
90 
92  virtual ~sphere_vg();
93 
95  virtual void initialize(const ::datatools::properties &,
98 
100  virtual void reset();
101 
103  virtual bool is_initialized() const;
104 
105  protected :
106 
108  virtual void _shoot_vertex(::mygsl::rng & random_, ::geomtools::vector_3d & vertex_);
109 
110  private:
111 
113  void _init_ ();
114 
116  void _reset_ ();
117 
119  void _set_defaults_ ();
120 
121  private:
122 
123  bool _initialized_;
124  const geomtools::logical_volume * _log_vol_;
125  geomtools::sphere _sphere_;
126  const geomtools::sphere * _sphere_ref_;
127 
128  int _mode_;
129  int _surface_mask_;
130  double _skin_skip_;
131  double _skin_thickness_;
132  double _sum_weight_[6];
133 
137 
138  };
139 
140  void randomize_sphere(mygsl::rng & random_,
141  double r1_, double r2_,
142  double theta1_, double theta2_,
143  double phi1_, double phi2_,
144  geomtools::vector_3d & vertex_);
145 
146 } // end of namespace genvtx
147 
148 #endif // GENVTX_SPHERE_VG_H
149 
150 /*
151 ** Local Variables: --
152 ** mode: c++ --
153 ** c-file-style: "gnu" --
154 ** tab-width: 2 --
155 ** End: --
156 */
void set_mode(int mode_)
void set_surface_mask(int surface_mask_)
A spherical volume (3D solid)
Definition: sphere.h:44
Top-level namespace of the Bayeux/genvtx module library.
Definition: box_model_vg.h:32
void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
sphere_vg()
Constructor.
void set_sphere_ref(const geomtools::sphere &sphere_)
void set_sphere(const geomtools::sphere &sphere_)
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.
virtual void _shoot_vertex(::mygsl::rng &random_, ::geomtools::vector_3d &vertex_)
Randomize vertex.
virtual ~sphere_vg()
Destructor.
virtual bool is_initialized() const
Check initialization status.
bool has_sphere_ref() const
int get_mode() const
void set_skin_skip(double skin_skip_)
void set_surface(int surface_mask_)
virtual void initialize(const ::datatools::properties &, ::datatools::service_manager &, ::genvtx::vg_dict_type &)
Initialization.
void reset_logical()
Reset the reference to an external logical.
void randomize_sphere(mygsl::rng &random_, double r1_, double r2_, double theta1_, double theta2_, double phi1_, double phi2_, geomtools::vector_3d &vertex_)
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
const geomtools::sphere & get_sphere_ref() const
void set_skin_thickness(double skin_thickness_)
The base interface class for all vertex generator classes.
Definition: i_vertex_generator.h:59
static const int MODE_DEFAULT
Definition: sphere_vg.h:44
bool has_logical() const
Check if a referenced logical is available.
#define GENVTX_VG_REGISTRATION_INTERFACE(GENVTX_CLASS_NAME)
Definition: vg_macros.h:46
static const int MODE_INVALID
Definition: sphere_vg.h:41
virtual void reset()
Reset.
static const int MODE_BULK
Definition: sphere_vg.h:42
bool has_sphere_safe() const
std::map< std::string, vg_entry_type > vg_dict_type
Definition: vg_tools.h:125
Vertex generator from a sphere.
Definition: sphere_vg.h:37
static const int MODE_SURFACE
Definition: sphere_vg.h:43
const geomtools::sphere & get_sphere_safe() const
const geomtools::sphere & get_sphere() const
Service management class.
Definition: service_manager.h:57
void set_bulk(double skin_thickness_)
Pseudo random number generator.
Definition: rng.h:53
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39