Bayeux  3.4.1
Core Foundation library for SuperNEMO
calorimeter_step_hit_processor.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-05-26
4  * Last modified: 2014-04-23
5  *
6  * License:
7  *
8  * Description:
9  *
10  * A basic processor of simulated step hits in some plastic scintillator
11  * volume.
12  *
13  * This algorithm clusterizes step calorimeter hits (from a
14  * simulation program) and build new hits that cumulate the
15  * physics of original MC step hits (particle type, geometry ID,
16  * energy deposit, timing...)
17  *
18  * CAUTION: this processor can manage only one geometry mapping category
19  * so care should be taken to attach only one geometry model (with the proper
20  * mapping category) to this processor.
21  *
22  * QUESTION:
23  * Should delta rays energy deposit along the track of an alpha particle
24  * be clusterized within the parent alpha clusterized hit (quenching effect) ?
25  *
26  */
27 
28 #ifndef MCTOOLS_CALORIMETER_STEP_HIT_PROCESSOR_H
29 #define MCTOOLS_CALORIMETER_STEP_HIT_PROCESSOR_H 1
30 
31 // Standard library:
32 #include <string>
33 
34 // Third party:
35 // - Boost:
36 #include <boost/cstdint.hpp>
37 // - Bayeux/datatools:
38 #include <datatools/ioutils.h>
39 // - Bayeux/geomtools:
40 #include <geomtools/i_shape_3d.h>
42 #include <geomtools/box.h>
43 #include <geomtools/sphere.h>
44 #include <geomtools/placement.h>
45 
46 // This project:
48 
49 namespace mctools {
50 
53  {
54  public:
55 
57  virtual bool locate_calorimeter_block(const geomtools::vector_3d & position_,
58  geomtools::geom_id & gid_) const;
59 
61  const std::string & get_mapping_category() const;
62 
64  void set_mapping_category(const std::string & sc_);
65 
66  const std::vector<int> & get_mapping_category_any_addresses() const;
67 
70 
73 
75  virtual void initialize(const ::datatools::properties & config_,
76  ::datatools::service_manager & service_mgr_);
77 
79  virtual void process(const ::mctools::base_step_hit_processor::step_hit_ptr_collection_type & base_step_hits_,
81 
83  virtual void process(const ::mctools::base_step_hit_processor::step_hit_ptr_collection_type & base_step_hits_,
85 
89  bool match_scintillation_hit(const base_step_hit & scintillation_hit_,
90  const base_step_hit & step_hit_) const;
91 
94 
96  void tree_dump(std::ostream & out_ = std::clog,
97  const std::string & title_ = "" ,
98  const std::string & indent_ = "",
99  bool inherit_ = false) const;
100 
103 
104  protected:
105 
106  void _init(const ::datatools::properties & config_,
107  ::datatools::service_manager & service_mgr_);
108 
112  simulated_data::hit_collection_type * plain_calo_hits_);
113 
114  private:
115 
120  double _scintillation_cluster_time_range_;
121 
125  double _scintillation_cluster_space_range_;
126 
132  std::string _mapping_category_;
133 
140  std::vector<int> _mapping_category_any_addresses_;
141 
142  // internals:
143  const geomtools::mapping * _mapping_;
144 
146 
147  uint32_t _calo_block_type_;
148 
155  geomtools::smart_id_locator _calo_block_locator_;
156 
157  bool _alpha_quenching_;
158 
159  // Registration macro :
161 
162  };
163 
164 } // end of namespace mctools
165 
166 #include <datatools/ocd_macros.h>
168 
169 #endif // MCTOOLS_CALORIMETER_STEP_HIT_PROCESSOR_H
170 
171 // Local Variables: --
172 // mode: c++ --
173 // c-file-style: "gnu" --
174 // tab-width: 2 --
175 // End: --
The base class for all Monte-Carlo (MC) hit objects.
Definition: base_step_hit.h:47
The geometry ID mapping.
Definition: mapping.h:43
Definition: base_step_hit.h:32
bool match_scintillation_hit(const base_step_hit &scintillation_hit_, const base_step_hit &step_hit_) const
void set_mapping_category(const std::string &sc_)
Set the geometry mapping category.
An object that describes the way an object of a given class can be configured through properties.
Definition: object_configuration_description.h:234
void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
std::vector< base_step_hit * > step_hit_ptr_collection_type
Definition: base_step_hit_processor.h:55
virtual bool locate_calorimeter_block(const geomtools::vector_3d &position_, geomtools::geom_id &gid_) const
Find the Gid of the calorimeter block at a given position.
std::vector< base_step_hit > hit_collection_type
Alias for the collection of MC base step hits.
Definition: simulated_data.h:72
const std::vector< int > & get_mapping_category_any_addresses() const
Definition: base_step_hit_processor.h:50
virtual ~calorimeter_step_hit_processor()
Destructor.
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.
std::vector< hit_handle_type > hit_handle_collection_type
Alias for the collection of MC base step hit handles.
Definition: simulated_data.h:69
void _process(const base_step_hit_processor::step_hit_ptr_collection_type &base_step_hits_, simulated_data::hit_handle_collection_type *calo_hits_, simulated_data::hit_collection_type *plain_calo_hits_)
Main non-public algorithm.
void _init(const ::datatools::properties &config_, ::datatools::service_manager &service_mgr_)
const std::string & get_mapping_category() const
Return the geometry mapping category.
std::map< std::string, category_info > categories_by_name_col_type
Definition: id_mgr.h:201
static void init_ocd(datatools::object_configuration_description &)
OCD support.
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 :
CLHEP::Hep3Vector vector_3d
Alias for the CLHEP 3D-vector class.
Definition: clhep.h:63
virtual void initialize(const ::datatools::properties &config_, ::datatools::service_manager &service_mgr_)
Main setup routine.
#define MCTOOLS_STEP_HIT_PROCESSOR_REGISTRATION_INTERFACE(SHP_CLASS_NAME)
Definition: step_hit_processor_macros.h:35
Definition: geom_id.h:41
Definition: calorimeter_step_hit_processor.h:51
void merge_scintillation_hits(simulated_data::hit_handle_collection_type &scintillation_hits_)
Merge 'compatible' scintillator hit clusters.
Service management class.
Definition: service_manager.h:57