Falaise  4.0.1
SuperNEMO Software Toolkit
mock_calorimeter_s2c_module.h
Go to the documentation of this file.
1 // -*- mode: c++ ; -*-
2 /** \file falaise/snemo/processing/mock_calorimeter_s2c_module.h
3  * Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
4  * Creation date: 2011-01-12
5  * Last modified: 2014-02-27
6  *
7  * License:
8  *
9  * Description:
10  *
11  * Mock simulation data processor for calorimeter MC hits
12  *
13  * History:
14  *
15  */
16 
17 #ifndef FALAISE_SNEMO_PROCESSING_MOCK_CALORIMETER_S2C_MODULE_H
18 #define FALAISE_SNEMO_PROCESSING_MOCK_CALORIMETER_S2C_MODULE_H 1
19 
20 // Standard library:
21 #include <map>
22 #include <string>
23 #include <vector>
24 
25 // Third party:
26 // - Bayeux/mygsl:
27 #include <mygsl/rng.h>
28 // - Bayeux/dpp:
29 #include <dpp/base_module.h>
30 
31 // This project :
34 
35 namespace geomtools {
36 class manager;
37 }
38 
39 namespace mctools {
40 class simulated_data;
41 }
42 
43 namespace snemo {
44 
45 namespace processing {
46 
47 /// \brief A mock calibration for SuperNEMO calorimeter hits
49  public:
50  /// Dictionary of calorimeter regime objects associated to collection of calorimeter-like hits
51  typedef std::map<std::string, calorimeter_regime> calorimeter_regime_col_type;
52 
53  /// Setting geometry manager
54  void set_geom_manager(const geomtools::manager& gmgr_);
55 
56  /// Getting geometry manager
57  const geomtools::manager& get_geom_manager() const;
58 
59  /// Set the external PRNG
60  void set_external_random(mygsl::rng& rng_);
61 
62  /// Reset the external PRNG
63  void reset_external_random();
64 
65  /// Check if the module use an external PRNG
66  bool has_external_random() const;
67 
68  /// Constructor
70 
71  /// Destructor
73 
74  /// Initialization
75  virtual void initialize(const datatools::properties& setup_,
76  datatools::service_manager& service_manager_,
77  dpp::module_handle_dict_type& module_dict_);
78 
79  /// Reset
80  virtual void reset();
81 
82  /// Data record processing
84 
85  protected:
86  /// Set default attributes values
87  void _set_defaults();
88 
89  /// Getting random number generator
91 
92  /// Digitize calorimeter hits
94  const mctools::simulated_data& simulated_data_,
96  calibrated_calorimeter_hits_);
97 
98  /// Calibrate calorimeter hits (energy/time resolution spread)
101 
102  /// Apply basic trigger effect
105 
106  /// Main process function
107  void _process(const mctools::simulated_data& simulated_data_,
109  calibrated_calorimeter_hits_);
110 
111  private:
112  const geomtools::manager* _geom_manager_; //!< The geometry manager
113  mygsl::rng _random_; //!< PRN generator
114  mygsl::rng* _external_random_; //!< external PRN generator
115  std::vector<std::string> _hit_categories_; //!< Calorimeter hit categories
116  calorimeter_regime_col_type _calorimeter_regimes_; //!< Calorimeter regime tools
117  std::string _SD_label_; //!< The label of the simulated data bank
118  std::string _CD_label_; //!< The label of the calibrated data bank
119  std::string _Geo_label_; //!< The label of the geometry service
120  double _cluster_time_width_; //!< Time width of a calo cluster
121  bool _alpha_quenching_; //!< Flag to (dis)activate the alpha quenching
122  bool _store_mc_hit_id_; //!< The flag to reference MC true hit
123 
124  // Macro to automate the registration of the module :
126 };
127 
128 } // end of namespace processing
129 
130 } // end of namespace snemo
131 
132 /***************************
133  * OCD support : interface *
134  ***************************/
135 
136 #include <datatools/ocd_macros.h>
137 
138 // @arg snemo::processing::mock_calorimeter_s2c_module the name the registered class
140 
141 #endif // FALAISE_SNEMO_PROCESSING_MOCK_CALORIMETER_S2C_MODULE_H
142 
143 // end of falaise/snemo/processing/mock_calorimeter_s2c_module.h
bool has_external_random() const
Check if the module use an external PRNG.
void reset_external_random()
Reset the external PRNG.
A mock calibration for SuperNEMO calorimeter hits.
Definition: mock_calorimeter_s2c_module.h:48
void set_geom_manager(const geomtools::manager &gmgr_)
Setting geometry manager.
const geomtools::manager & get_geom_manager() const
Getting geometry manager.
void _process_calorimeter_digitization(const mctools::simulated_data &simulated_data_, snemo::datamodel::calibrated_data::calorimeter_hit_collection_type &calibrated_calorimeter_hits_)
Digitize calorimeter hits.
mygsl::rng & _get_random()
Getting random number generator.
void _process_calorimeter_calibration(snemo::datamodel::calibrated_data::calorimeter_hit_collection_type &calorimeter_hits_)
Calibrate calorimeter hits (energy/time resolution spread)
virtual process_status process(datatools::things &data_)
Data record processing.
std::map< std::string, calorimeter_regime > calorimeter_regime_col_type
Dictionary of calorimeter regime objects associated to collection of calorimeter-like hits.
Definition: mock_calorimeter_s2c_module.h:51
void set_external_random(mygsl::rng &rng_)
Set the external PRNG.
DOCD_CLASS_DECLARATION(my::algo)
std::vector< calorimeter_hit_handle_type > calorimeter_hit_collection_type
Collection of handles on calibrated calorimeter hits.
Definition: calibrated_data.h:58
std::map< std::string, module_entry_type > module_handle_dict_type
Definition: calo_tapered_scin_box_model.h:54
#define DPP_MODULE_REGISTRATION_INTERFACE(T)
void _process_calorimeter_trigger(snemo::datamodel::calibrated_data::calorimeter_hit_collection_type &calorimeter_hits_)
Apply basic trigger effect.
virtual void initialize(const datatools::properties &setup_, datatools::service_manager &service_manager_, dpp::module_handle_dict_type &module_dict_)
Initialization.
mock_calorimeter_s2c_module(datatools::logger::priority=datatools::logger::PRIO_FATAL)
Constructor.
void _set_defaults()
Set default attributes values.
void _process(const mctools::simulated_data &simulated_data_, snemo::datamodel::calibrated_data::calorimeter_hit_collection_type &calibrated_calorimeter_hits_)
Main process function.