Bayeux  3.4.1
Core Foundation library for SuperNEMO
fluence_step_hit_processor.h
Go to the documentation of this file.
1 /* Author(s) : Arnaud Chapon <chapon@lpccaen.in2p3.fr>
3  * Creation date: 2014-10-09
4  * Last modified: 2014-10-20
5  *
6  * License:
7  *
8  * Description:
9  *
10  * A basic processor of simulated step hits through a detector surface.
11  *
12  * This algorithm clusterizes step fluence hits (from a
13  * simulation program) and save only boundary ones. It records the particle
14  * type, geometry ID, entrance momentum and energy, ...)
15  *
16  * CAUTION: this processor can manage only one geometry mapping category
17  * so care should be taken to attach only one geometry model (with the proper
18  * mapping category) to this processor.
19  *
20  */
21 
22 #ifndef MCTOOLS_FLUENCE_STEP_HIT_PROCESSOR_H
23 #define MCTOOLS_FLUENCE_STEP_HIT_PROCESSOR_H 1
24 
25 // Standard library:
26 #include <string>
27 
28 // Third party:
29 // - Boost:
30 #include <boost/cstdint.hpp>
31 // - Bayeux/datatools:
32 #include <datatools/ioutils.h>
33 // - Bayeux/geomtools:
34 #include <geomtools/i_shape_3d.h>
36 #include <geomtools/box.h>
37 #include <geomtools/sphere.h>
38 #include <geomtools/placement.h>
39 
40 // This project:
42 
43 namespace mctools {
44 
47  {
48  public:
49 
51  virtual bool locate_fluence_volume(const geomtools::vector_3d & position_,
52  geomtools::geom_id & gid_) const;
53 
55  const std::string & get_mapping_category() const;
56 
58  void set_mapping_category(const std::string & sc_);
59 
60  const std::vector<int> & get_mapping_category_any_addresses() const;
61 
64 
67 
69  virtual void initialize(const ::datatools::properties & config_,
70  ::datatools::service_manager & service_mgr_);
71 
73  virtual void process(const ::mctools::base_step_hit_processor::step_hit_ptr_collection_type & base_step_hits_,
75 
77  virtual void process(const ::mctools::base_step_hit_processor::step_hit_ptr_collection_type & base_step_hits_,
79 
81  void tree_dump(std::ostream & out_ = std::clog,
82  const std::string & title_ = "" ,
83  const std::string & indent_ = "",
84  bool inherit_ = false) const;
85 
88 
89  protected:
90 
91  void _init(const ::datatools::properties & config_,
92  ::datatools::service_manager & service_mgr_);
93 
97  simulated_data::hit_collection_type * plain_fluence_hits_);
98 
99  private:
100 
101  std::string _mapping_category_;
107  std::vector<int> _mapping_category_any_addresses_;
113  // internals:
114  const geomtools::mapping * _mapping_;
115 
117 
118  uint32_t _fluence_volume_type_;
119 
123  geomtools::smart_id_locator _fluence_volume_locator_;
124 
125  // Registration macro :
127 
128  };
129 
130 } // end of namespace mctools
131 
132 #include <datatools/ocd_macros.h>
134 
135 #endif // MCTOOLS_FLUENCE_STEP_HIT_PROCESSOR_H
136 
137 // Local Variables: --
138 // mode: c++ --
139 // c-file-style: "gnu" --
140 // tab-width: 2 --
141 // End: --
virtual bool locate_fluence_volume(const geomtools::vector_3d &position_, geomtools::geom_id &gid_) const
Find the Gid of the fluence volume at a given position.
virtual ~fluence_step_hit_processor()
Destructor.
The geometry ID mapping.
Definition: mapping.h:43
Definition: base_step_hit.h:32
An object that describes the way an object of a given class can be configured through properties.
Definition: object_configuration_description.h:234
Definition: fluence_step_hit_processor.h:45
std::vector< base_step_hit * > step_hit_ptr_collection_type
Definition: base_step_hit_processor.h:55
std::vector< base_step_hit > hit_collection_type
Alias for the collection of MC base step hits.
Definition: simulated_data.h:72
Definition: base_step_hit_processor.h:50
Locator of geometry volumes by thier geometry Id.
Definition: smart_id_locator.h:36
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
void _init(const ::datatools::properties &config_, ::datatools::service_manager &service_mgr_)
std::vector< hit_handle_type > hit_handle_collection_type
Alias for the collection of MC base step hit handles.
Definition: simulated_data.h:69
virtual void initialize(const ::datatools::properties &config_, ::datatools::service_manager &service_mgr_)
Main setup routine.
std::map< std::string, category_info > categories_by_name_col_type
Definition: id_mgr.h:201
void set_mapping_category(const std::string &sc_)
Set the geometry mapping category.
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
#define MCTOOLS_STEP_HIT_PROCESSOR_REGISTRATION_INTERFACE(SHP_CLASS_NAME)
Definition: step_hit_processor_macros.h:35
const std::string & get_mapping_category() const
Return the geometry mapping category.
void _process(const base_step_hit_processor::step_hit_ptr_collection_type &base_step_hits_, simulated_data::hit_handle_collection_type *fluence_hits_, simulated_data::hit_collection_type *plain_fluence_hits_)
Main non-public algorithm.
Definition: geom_id.h:41
const std::vector< int > & get_mapping_category_any_addresses() const
void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
virtual void process(const ::mctools::base_step_hit_processor::step_hit_ptr_collection_type &base_step_hits_, ::mctools::simulated_data::hit_handle_collection_type &handle_hits_)
Main processing routine :
static void init_ocd(datatools::object_configuration_description &)
OCD support.
Service management class.
Definition: service_manager.h:57