Falaise  4.0.1
SuperNEMO Software Toolkit
locator_plugin.h
Go to the documentation of this file.
1 // falaise/snemo/geometry/locator_plugin.h
2 /* Author(s) : Xavier Garrido <garrido@lal.in2p3.fr>
3  * Creation date: 2013-07-15
4  * Last modified: 2014-01-28
5  *
6  * License:
7  *
8  * Description:
9  *
10  * A geometry manager plugin with embeded locators.
11  *
12  * History:
13  *
14  */
15 
16 #ifndef FALAISE_SNEMO_GEOMETRY_LOCATOR_PLUGIN_H
17 #define FALAISE_SNEMO_GEOMETRY_LOCATOR_PLUGIN_H 1
18 
19 // Third party:
20 // - Boost :
21 #include <boost/cstdint.hpp>
22 // - Bayeux/geomtools:
23 #include <geomtools/manager.h>
25 
26 namespace geomtools {
27 class i_base_locator;
28 }
29 
30 namespace snemo {
31 
32 namespace geometry {
33 
34 class gg_locator;
35 class calo_locator;
36 class xcalo_locator;
37 class gveto_locator;
38 
39 /// \brief A geometry manager plugin with embedded SuperNEMO locators.
41  public:
43 
45  std::string label;
46  std::string category_name;
48  uint32_t status;
50  };
51 
52  typedef std::map<std::string, locator_entry_type> locator_dict_type;
53 
54  /// Default constructor
56 
57  /// Destructor
58  virtual ~locator_plugin();
59 
60  /// Main plugin initialization method
61  virtual int initialize(const datatools::properties& config_,
63  const datatools::service_dict_type& services_);
64 
65  /// Plugin reset method
66  virtual int reset();
67 
68  /// Check if plugin is initialized
69  virtual bool is_initialized() const;
70 
71  /// Returns a non-mutable reference to the dictionary of locators
72  const locator_dict_type& get_locators() const;
73 
74  /// Returns a mutable reference to the dictionary of locators
76 
77  /// Check if geiger locator is available
78  bool has_gg_locator() const;
79 
80  /// Check if calo locator is available
81  bool has_calo_locator() const;
82 
83  /// Check if xcalo locator is available
84  bool has_xcalo_locator() const;
85 
86  /// Check if gveto locator is available
87  bool has_gveto_locator() const;
88 
89  /// Returns a non-mutable reference to the geiger locator
91 
92  /// Returns a non-mutable reference to the main wall locator
94 
95  /// Returns a non-mutable reference to the X wall locator
97 
98  /// Returns a non-mutable reference to the gamma veto locator
100 
101  protected:
102  /// Internal mapping build method
103  void _build_locators(const datatools::properties& config_);
104 
105  private:
106  bool _initialized_; //!< Initialization flag
107  locator_dict_type _locators_; //!< Locator dictionary
108  const snemo::geometry::gg_locator* _gg_locator_; //!< Geiger locator
109  const snemo::geometry::calo_locator* _calo_locator_; //!< Main wall locator
110  const snemo::geometry::xcalo_locator* _xcalo_locator_; //!< X-wall locator
111  const snemo::geometry::gveto_locator* _gveto_locator_; //!< gamma-veto locator
112 
114 };
115 
116 } // end of namespace geometry
117 
118 } // end of namespace snemo
119 
120 #endif // FALAISE_SNEMO_GEOMETRY_LOCATOR_PLUGIN_H
bool has_gg_locator() const
Check if geiger locator is available.
virtual ~locator_plugin()
Destructor.
locator_plugin()
Default constructor.
bool has_gveto_locator() const
Check if gveto locator is available.
bool has_xcalo_locator() const
Check if xcalo locator is available.
std::map< std::string, service_entry_ptr > service_dict_type
bool has_calo_locator() const
Check if calo locator is available.
const snemo::geometry::gg_locator & get_gg_locator() const
Returns a non-mutable reference to the geiger locator.
const snemo::geometry::xcalo_locator & get_xcalo_locator() const
Returns a non-mutable reference to the X wall locator.
Fast locator class for SuperNEMO X calorimeter scintillator block volumes.
Definition: xcalo_locator.h:61
std::map< std::string, locator_entry_type > locator_dict_type
Definition: locator_plugin.h:52
Definition: locator_plugin.h:44
virtual bool is_initialized() const
Check if plugin is initialized.
A geometry manager plugin with embedded SuperNEMO locators.
Definition: locator_plugin.h:40
locator_dict_type & grab_locators()
Returns a mutable reference to the dictionary of locators.
int category_type
Definition: locator_plugin.h:47
Definition: calo_tapered_scin_box_model.h:54
std::map< std::string, plugin_entry > plugins_dict_type
const snemo::geometry::calo_locator & get_calo_locator() const
Returns a non-mutable reference to the main wall locator.
void _build_locators(const datatools::properties &config_)
Internal mapping build method.
#define GEOMTOOLS_PLUGIN_REGISTRATION_INTERFACE(PLUGIN_CLASS_NAME)
datatools::handle< geomtools::base_locator > locator_handle_type
Definition: locator_plugin.h:42
Fast locator class for SuperNEMO gamma-veto scintillator block volumes.
Definition: gveto_locator.h:61
const snemo::geometry::gveto_locator & get_gveto_locator() const
Returns a non-mutable reference to the gamma veto locator.
locator_handle_type locator_handle
Definition: locator_plugin.h:49
const locator_dict_type & get_locators() const
Returns a non-mutable reference to the dictionary of locators.
uint32_t status
Definition: locator_plugin.h:48
virtual int initialize(const datatools::properties &config_, const geomtools::manager::plugins_dict_type &plugins_, const datatools::service_dict_type &services_)
Main plugin initialization method.
virtual int reset()
Plugin reset method.
std::string label
Definition: locator_plugin.h:45
Fast locator class for SuperNEMO drift chamber volumes.
Definition: gg_locator.h:62
std::string category_name
Definition: locator_plugin.h:46
Fast locator class for SuperNEMO main calorimeter scintillator block volumes.
Definition: calo_locator.h:63