Bayeux  3.4.1
Core Foundation library for SuperNEMO
geom_map.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2013-03-18
4  * Last modified: 2013-03-18
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Associative map of electro-magnetic fields and logical volumes
11  *
12  * History:
13  *
14  */
15 
16 #ifndef EMFIELD_GEOM_MAP_H
17 #define EMFIELD_GEOM_MAP_H
18 
19 // Standard library:
20 #include <iostream>
21 #include <string>
22 
23 // Third party:
24 // - Boost:
25 #include <boost/cstdint.hpp>
26 // - Bayeux/datatools:
27 #include <datatools/i_tree_dump.h>
29 
30 // This project:
32 
33 namespace datatools {
34  class properties;
35 }
36 
37 namespace geomtools {
38  class manager;
39  class logical_volume;
40 }
41 
42 namespace emfield {
43 
44  class electromagnetic_field_manager;
45 
47  class geom_map :
49  {
50 
51  public:
52 
54  {
55  public:
57  inline const std::string & get_label() const { return label; }
58  inline const std::string & get_logical_volume_name() const { return logical_volume_name; }
59  inline bool has_logvol() const { return logvol != 0;}
60  inline const geomtools::logical_volume & get_logvol() const { return *logvol; }
61  inline const std::string & get_field_name() const { return field_name; }
62  inline bool has_field() const { return field != 0; }
63  inline const emfield::base_electromagnetic_field & get_field() const { return *field; }
64  public:
65  std::string label;
66  std::string logical_volume_name;
68  std::string field_name;
71  };
72 
73  typedef std::map<std::string,association_entry> association_dict_type;
74 
75  geom_map();
76 
77  virtual ~geom_map();
78 
80 
82 
84 
86 
87  bool is_initialized() const;
88 
89  void initialize(const datatools::properties& config_);
90 
91  void reset();
92 
93  bool has_geometry_manager() const;
94 
95  void set_geometry_manager(const geomtools::manager & gmgr_);
96 
98 
99  bool has_fields_manager() const;
100 
102 
104 
105  virtual void tree_dump(std::ostream & out_ = std::clog,
106  const std::string & title = "",
107  const std::string & indent_= "",
108  bool inherit_ = false) const;
109 
110  protected :
111 
112  void _construct(const datatools::properties& config_);
113 
114  private:
115 
116  datatools::logger::priority _logging_priority_;
117  bool _initialized_;
118  const geomtools::manager * _geom_manager_;
119  const electromagnetic_field_manager * _fields_manager_;
120  association_dict_type _associations_map_;
121 
122  };
123 
124 } // end of namespace emfield
125 
126 #endif // EMFIELD_GEOM_MAP_H 1
127 
128 // Local Variables: --
129 // mode: c++ --
130 // c-file-style: "gnu" --
131 // tab-width: 2 --
132 // End: --
void set_geometry_manager(const geomtools::manager &gmgr_)
bool has_field() const
Definition: geom_map.h:62
datatools::logger::priority get_logging_priority() const
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
bool has_fields_manager() const
An interface with utilities for printable objects.
Definition: i_tree_dump.h:36
bool has_geometry_manager() const
void set_logging_priority(datatools::logger::priority priority_)
void initialize(const datatools::properties &config_)
bool has_logvol() const
Definition: geom_map.h:59
A logical geometry volume (ala GDML)
Definition: logical_volume.h:40
const emfield::base_electromagnetic_field & get_field() const
Definition: geom_map.h:63
const emfield::base_electromagnetic_field * field
Definition: geom_map.h:69
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title="", const std::string &indent_="", bool inherit_=false) const
Main old interface method for printing.
const std::string & get_label() const
Definition: geom_map.h:57
const geomtools::logical_volume & get_logvol() const
Definition: geom_map.h:60
Abstract base class for all electromagnetic field.
Definition: base_electromagnetic_field.h:43
const electromagnetic_field_manager & get_fields_manager() const
association_dict_type & grab_associations()
const std::string & get_field_name() const
Definition: geom_map.h:61
const std::string & get_logical_volume_name() const
Definition: geom_map.h:58
const geomtools::manager & get_geometry_manager() const
Electromagnetic field manager.
Definition: electromagnetic_field_manager.h:49
std::map< std::string, association_entry > association_dict_type
Definition: geom_map.h:73
std::string logical_volume_name
Definition: geom_map.h:66
Top-level namespace of the Bayeux/emfield module library.
Definition: base_electromagnetic_field.h:40
void _construct(const datatools::properties &config_)
std::string label
Definition: geom_map.h:65
datatools::properties auxiliaries
Definition: geom_map.h:70
std::string field_name
Definition: geom_map.h:68
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
Definition: geom_map.h:53
Geometry manager for virtual geometry modelling. Main geometry manager for the modelisation of variou...
Definition: manager.h:70
virtual ~geom_map()
association_entry()
void set_fields_manager(const electromagnetic_field_manager &emfmgr_)
Mapping of electromagnetic fields with geometry volume.
Definition: geom_map.h:47
const association_dict_type & get_associations() const
const geomtools::logical_volume * logvol
Definition: geom_map.h:67
bool is_initialized() const
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125