Falaise  4.0.1
SuperNEMO Software Toolkit
mock_tracker_s2c_module.h
Go to the documentation of this file.
1 // -*- mode: c++ ; -*-
2 /** \file falaise/snemo/processing/mock_tracker_s2c_module.h
3  * Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
4  * Creation date: 2011-01-09
5  * Last modified: 2014-02-27
6  *
7  * License:
8  *
9  * Description:
10  *
11  * Mock simulation data processor for tracker MC hits
12  *
13  * History:
14  *
15  */
16 
17 #ifndef FALAISE_SNEMO_PROCESSING_MOCK_TRACKER_S2C_MODULE_H
18 #define FALAISE_SNEMO_PROCESSING_MOCK_TRACKER_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 :
35 
36 namespace geomtools {
37 class manager;
38 }
39 
40 namespace mctools {
41 class simulated_data;
42 }
43 
44 namespace snemo {
45 
46 namespace processing {
47 
48 /// \brief Simple modelling of the time and space measurement with the SuperNEMO drift cells in
49 /// Geiger mode
51  public:
52  /// Collection of raw tracker hit Intermediate :
53  typedef std::list<snemo::datamodel::mock_raw_tracker_hit> raw_tracker_hit_col_type;
54 
55  /// Set the geometry manager
56  void set_geom_manager(const geomtools::manager& gmgr_);
57 
58  /// Getting geometry manager
59  const geomtools::manager& get_geom_manager() const;
60 
61  /// Set the external PRNG
62  void set_external_random(mygsl::rng& rng_);
63 
64  /// Reset the external PRNG
65  void reset_external_random();
66 
67  /// Check if the module use an external PRNG
68  bool has_external_random() const;
69 
70  /// Return the drift time threshold for peripheral Geiger hits (far from the anode wire)
72 
73  /// Return the drift time threshold for delayed Geiger hits
74  double get_delayed_drift_time_threshold() const;
75 
76  /// Constructor
78 
79  /// Destructor
80  virtual ~mock_tracker_s2c_module();
81 
82  /// Initialization
83  virtual void initialize(const datatools::properties& setup_,
84  datatools::service_manager& service_manager_,
85  dpp::module_handle_dict_type& module_dict_);
86 
87  /// Reset
88  virtual void reset();
89 
90  /// Data record processing
92 
93  protected:
94  /// Set default attributes values
95  void _set_defaults();
96 
97  /// Getting random number generator
99 
100  /// Digitize tracker hits
101  void _process_tracker_digitization(const mctools::simulated_data& simulated_data_,
102  raw_tracker_hit_col_type& raw_tracker_hits_);
103 
104  /// Calibrate tracker hits (longitudinal and transverse spread)
106  const raw_tracker_hit_col_type& raw_tracker_hits_,
108 
109  /// Main process function
110  void _process(
111  const mctools::simulated_data& simulated_data_,
113 
114  private:
115  const geomtools::manager* _geom_manager_; //!< The geometry manager
116  std::string _module_category_; //!< The geometry category of the SuperNEMO module
117  std::string _hit_category_; //!< The category of the input Geiger hits
118  geiger_regime _geiger_; //!< Geiger regime tools
119  mygsl::rng _random_; //!< internal PRN generator
120  mygsl::rng* _external_random_; //!< external PRN generator
121  double _peripheral_drift_time_threshold_; //!< Peripheral drift time threshold
122  double _delayed_drift_time_threshold_; //!< Delayed drift time threshold
123  std::string _SD_label_; //!< The label of the simulated data bank
124  std::string _CD_label_; //!< The label of the calibrated data bank
125  std::string _Geo_label_; //!< The label of the geometry service
126  bool _store_mc_hit_id_; //!< Flag to store the MC true hit ID
127  bool _store_mc_truth_track_ids_; //!< The flag to reference the MC engine track and parent track
128  //!< IDs associated to this calibrated Geiger hit
129 
130  // Macro to automate the registration of the module :
132 };
133 
134 } // end of namespace processing
135 
136 } // end of namespace snemo
137 
138 /***************************
139  * OCD support : interface *
140  ***************************/
141 
142 #include <datatools/ocd_macros.h>
143 
144 // @arg snemo::processing::mock_tracker_s2c_module the name the registered class
146 
147 #endif // FALAISE_SNEMO_PROCESSING_MOCK_TRACKER_S2C_MODULE_H
148 
149 // end of falaise/snemo/processing/mock_tracker_s2c_module.h
void _set_defaults()
Set default attributes values.
virtual process_status process(datatools::things &data_)
Data record processing.
Modelling of the Geiger regime of the SuperNEMO drift cell.
Definition: geiger_regime.h:43
mygsl::rng & _get_random()
Getting random number generator.
void reset_external_random()
Reset the external PRNG.
void _process_tracker_calibration(const raw_tracker_hit_col_type &raw_tracker_hits_, snemo::datamodel::calibrated_data::tracker_hit_collection_type &calibrated_tracker_hits_)
Calibrate tracker hits (longitudinal and transverse spread)
DOCD_CLASS_DECLARATION(my::algo)
double get_peripheral_drift_time_threshold() const
Return the drift time threshold for peripheral Geiger hits (far from the anode wire)
bool has_external_random() const
Check if the module use an external PRNG.
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)
std::list< snemo::datamodel::mock_raw_tracker_hit > raw_tracker_hit_col_type
Collection of raw tracker hit Intermediate :
Definition: mock_tracker_s2c_module.h:53
void set_external_random(mygsl::rng &rng_)
Set the external PRNG.
std::vector< tracker_hit_handle_type > tracker_hit_collection_type
Collection of handles on calibrated tracker hits.
Definition: calibrated_data.h:55
mock_tracker_s2c_module(datatools::logger::priority=datatools::logger::PRIO_FATAL)
Constructor.
virtual void initialize(const datatools::properties &setup_, datatools::service_manager &service_manager_, dpp::module_handle_dict_type &module_dict_)
Initialization.
double get_delayed_drift_time_threshold() const
Return the drift time threshold for delayed Geiger hits.
void _process(const mctools::simulated_data &simulated_data_, snemo::datamodel::calibrated_data::tracker_hit_collection_type &calibrated_tracker_hits_)
Main process function.
void _process_tracker_digitization(const mctools::simulated_data &simulated_data_, raw_tracker_hit_col_type &raw_tracker_hits_)
Digitize tracker hits.
void set_geom_manager(const geomtools::manager &gmgr_)
Set the geometry manager.
const geomtools::manager & get_geom_manager() const
Getting geometry manager.
Simple modelling of the time and space measurement with the SuperNEMO drift cells in Geiger mode.
Definition: mock_tracker_s2c_module.h:50