Bayeux  3.4.1
Core Foundation library for SuperNEMO
utils.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  */
4 
5 #ifndef GENVTX_UTILS_H
6 #define GENVTX_UTILS_H 1
7 
8 // Standard library:
9 #include <string>
10 #include <iostream>
11 
12 // Third party:
13 // - Boost:
14 #include <boost/type_traits/integral_constant.hpp>
15 // - Bayeux/datatools:
16 #include <datatools/properties.h>
17 
18 namespace geomtools {
19  class geom_info;
20 }
21 
22 namespace genvtx {
23 
25  struct utils
26  {
27  public :
28 
29  static const int MODE_INVALID = -1;
30  static const int MODE_BULK = 0;
31  static const int MODE_SURFACE = 1;
32  static const int MODE_DEFAULT = MODE_BULK;
33 
34  static void origin_invalidate(std::string &);
35  static bool origin_is_invalid(const std::string &);
36 
37  };
38 
41  void load(const datatools::properties & config_);
42  void reset();
43  bool is_defined() const;
44  };
45 
48  {
49  public:
50 
53 
55  bool is_valid() const;
56 
58  void reset();
59 
61  void invalidate();
62 
64  double get_weight() const;
65 
67  double get_cumulated_weight() const;
68 
70  const geomtools::geom_info & get_ginfo() const;
71 
73  bool has_ginfo() const;
74 
75  public:
76 
77  double weight;
80 
81  };
82 
84  struct weight_info
85  {
86 
94  };
95 
97  void invalidate();
98 
100  bool has_type() const;
101 
103  bool has_surface() const;
104 
106  bool has_volume() const;
107 
109  bool has_mass() const;
110 
112  bool is_valid() const;
113 
115  double get_surface() const;
116 
118  double get_volume() const;
119 
121  double get_mass() const;
122 
124  void set_mass(double);
125 
127  void set_value(double);
128 
130  void set_type(int);
131 
133  int get_type() const;
134 
136  double get_value() const;
137 
139  weight_info();
140 
142  void dump(std::ostream & = std::clog, const std::string & title_ = "") const;
143 
144  private:
145  double value; //<! Surface or volume (in CLHEP units)
146  double mass; //<! Mass (in CLHEP units)
147  int type; //<! Type of generator: SURFACE, VOLUME (BULK)
148 
149  };
150 
151 } // end of namespace genvtx
152 
153 #endif // GENVTX_UTILS_H
154 
155 /*
156 ** Local Variables: --
157 ** mode: c++ --
158 ** c-file-style: "gnu" --
159 ** tab-width: 2 --
160 ** End: --
161 */
weight_info()
Default constructor.
Definition: utils.h:39
weighting by volume
Definition: utils.h:91
const geomtools::geom_info & get_ginfo() const
Return a reference to the non mutable geometry info.
Top-level namespace of the Bayeux/genvtx module library.
Definition: box_model_vg.h:32
bool has_mass() const
Check for mass weigthing.
No weighting.
Definition: utils.h:89
void dump(std::ostream &=std::clog, const std::string &title_="") const
Print.
void invalidate()
Invalidate the weight parameters.
weighting by surface
Definition: utils.h:90
double get_weight() const
Return the weight.
double get_value() const
Return the reference weighting value.
double get_cumulated_weight() const
Return the cumulated weight.
double get_volume() const
Return the associated volume.
A record for geometry information about a physical volume in a virtual geometry.
Definition: geom_info.h:38
weight_entry_type()
Default constructor.
bool has_surface() const
Check for surface weigthing.
static const int MODE_DEFAULT
Definition: utils.h:32
static const int MODE_SURFACE
Definition: utils.h:31
datatools::properties config
Definition: utils.h:40
weighting by volume
Definition: utils.h:92
const geomtools::geom_info * ginfo
Handle to associated geometry data.
Definition: utils.h:79
Utilities for vertex generators.
Definition: utils.h:25
bool has_type() const
Check if a weighting type is present.
weighting by mass
Definition: utils.h:93
void set_value(double)
Set the reference weighting value.
void invalidate()
Invalidate the weighting informations.
bool is_valid() const
Check the validity of weight parameters.
weighting_type
Weighting type for combined vertex generators.
Definition: utils.h:88
static bool origin_is_invalid(const std::string &)
bool has_ginfo() const
Check if geometry info is available.
void set_mass(double)
Set the associated mass.
double get_surface() const
Return the associated surface.
static void origin_invalidate(std::string &)
bool has_volume() const
Check for volume weigthing.
int get_type() const
Return the weighting type.
Information about the weighting of combined vertex generators.
Definition: utils.h:84
double get_mass() const
Return the associated mass.
void reset()
Reset the weight parameters.
Weight data for combined vertex generators.
Definition: utils.h:47
double cumulated_weight
Cumulated weight.
Definition: utils.h:78
void set_type(int)
Set the weighting type.
double weight
Weight.
Definition: utils.h:77
void load(const datatools::properties &config_)
static const int MODE_INVALID
Definition: utils.h:29
static const int MODE_BULK
Definition: utils.h:30
bool is_valid() const
Check the validity of weighting informations.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125