Falaise  4.0.1
SuperNEMO Software Toolkit
gg_step_hit_processor.h
Go to the documentation of this file.
1 // -*- mode: c++ ; -*-
2 /// \file falaise/snemo/simulation/gg_step_hit_processor.h
3 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
4  * Creation date: 2010-07-04
5  * Last modified: 2014-01-30
6  *
7  * License:
8  *
9  * Description:
10  *
11  * A basic processor of simulated step hits in some drift cell
12  * in Geiger regime.
13  *
14  * This algorithm randomize first-ionization electrons along the step
15  * and compute the minimal drift distance to the anode wire as well
16  * the corresponding longitudinal position along the wire:
17  * the output step contains the geometry ID of the cell,
18  * the position and time of the fastest ion/electron ionization pair.
19  *
20  * CAUTION: this processor can manage only one geometry mapping category
21  * so care should be taken to attach only one geometry model (with the proper
22  * mapping category) to this processor.
23  *
24  *
25  * History:
26  *
27  */
28 
29 #ifndef FALAISE_SNEMO_SIMULATION_GG_STEP_HIT_PROCESSOR_H
30 #define FALAISE_SNEMO_SIMULATION_GG_STEP_HIT_PROCESSOR_H 1
31 
32 // Third party:
33 // - Bayeux/datatools :
34 #include <datatools/time_tools.h>
35 // - Bayeux/mygsl :
36 #include <mygsl/rng.h>
37 // - Bayeux/geomtools :
39 // - Bayeux/mctools :
41 
42 // This project:
44 
45 namespace snemo {
46 
47 namespace simulation {
48 
49 /// \brief A basic processor of simulated step hits in some drift cell in Geiger regime
51  public:
52  /// Return a non mutable reference to the PRNG
53  const mygsl::rng& get_rng() const;
54 
55  /// Return a mutable reference to the PRNG
57 
58  /// Check if processor uses an external PRNG
59  bool has_external_rng() const;
60 
61  /// Check if processor accepts an external PRNG
62  virtual bool accept_external_rng() const;
63 
64  /// Set an external PRNG
65  virtual void set_external_rng(mygsl::rng& rng_);
66 
67  /// Default constructor
69 
70  /// Destructor
71  virtual ~gg_step_hit_processor();
72 
73  /// Reset
74  virtual void reset();
75 
76  /// Main setup routine
77  virtual void initialize(const ::datatools::properties& config_,
78  ::datatools::service_manager& service_mgr_);
79 
80  /// Main processing routine :
81  virtual void process(
82  const ::mctools::base_step_hit_processor::step_hit_ptr_collection_type& the_base_step_hits,
84 
85  /// Main processing routine :
86  virtual void process(
87  const ::mctools::base_step_hit_processor::step_hit_ptr_collection_type& the_base_step_hits,
89 
90  /// Check if a step hit is a candidate for being part within a proposed Geiger hit
91  bool match_gg_hit(const mctools::base_step_hit& gg_hit_,
92  const mctools::base_step_hit& step_hit_) const;
93 
94  protected:
95  /// Set default values for attributes
96  void _set_defaults();
97 
98  /// Main process method
99  void _process(
103 
104  /// To be documented
107 
108  private:
109  std::string _module_category_; /* the name of the mapping
110  * category of module
111  */
112  std::string _mapping_category_; /* the name of the mapping
113  * category of volumes
114  * that should be considered
115  * as a sensitive volume
116  */
117 
118  double _time_resolution_; /* the time resolution of the
119  * Geiger regime (typically 15-25 ns)
120  */
121 
122  double _fiducial_drift_radius_; /* the radius of the effective
123  * drift region
124  */
125 
126  double _fiducial_drift_length_; /* the active length of the
127  * drift region
128  */
129 
130  double _mean_ionization_energy_; /* the mean ionization energy
131  * in the tracking gas:
132  *
133  * Default: ~50 eV
134  *
135  * From Georges Szkarlz
136  * Helium:
137  * ~6 e- / cm
138  * Helium+Alcohol+Argon:
139  * 10-15 e- / cm
140  */
141 
142  /*double _geiger_dead_time_;*/ /* Dead time before a Geiger cell
143  * is active again after a former hit
144  *
145  * From Georges Szkarlz:
146  * typically 1-2 ms
147  *
148  */
149  bool _use_continuous_ionization_;
150  bool _compute_minimum_approach_position_;
151  bool _store_track_infos_;
152 
153  // Pseudo-random numbers generator:
154  mygsl::rng _rng_; //!< Embedded PRNG
155  mygsl::rng* _external_rng_; //!< Handle to an external PRNG
156 
157  // Internals:
158  const geomtools::mapping* _mapping_; //!< The reference geometry ID mapping
160  uint32_t _module_type_; //!< The integral ID of the geometry category for module volume
161  uint32_t _gg_cell_type_; //!< The integral ID of the geometry category for gg drift volume
162  // Locators:
163  geomtools::smart_id_locator _module_locator_; /** A locator to compute the
164  * module number
165  * some hit lies in.
166  */
167  geomtools::smart_id_locator _gg_cell_locator_; /** A locator to compute the
168  * geometry ID of the detector
169  * block some hit lies in.
170  */
171  geometry::gg_locator _fast_gg_cell_locator_; //!< A fast locator for SuperNEMO Geiger cells
172  std::map<uint32_t, geometry::gg_locator> _fast_gg_cell_locators_per_module_;
173 
174  // Used only for performance test in debug mode:
177 
178  // Registration macro :
180 };
181 
182 } // end of namespace simulation
183 
184 } // end of namespace snemo
185 
186 #endif // FALAISE_SNEMO_SIMULATION_GG_STEP_HIT_PROCESSOR_H
void _process(const mctools::base_step_hit_processor::step_hit_ptr_collection_type &base_step_hits_, mctools::simulated_data::hit_handle_collection_type *gg_hits_, mctools::simulated_data::hit_collection_type *plain_gg_hits_)
Main process method.
virtual void process(const ::mctools::base_step_hit_processor::step_hit_ptr_collection_type &the_base_step_hits, ::mctools::simulated_data::hit_handle_collection_type &the_handle_hits)
Main processing routine :
virtual ~gg_step_hit_processor()
Destructor.
A basic processor of simulated step hits in some drift cell in Geiger regime.
Definition: gg_step_hit_processor.h:50
bool match_gg_hit(const mctools::base_step_hit &gg_hit_, const mctools::base_step_hit &step_hit_) const
Check if a step hit is a candidate for being part within a proposed Geiger hit.
const mygsl::rng & get_rng() const
Return a non mutable reference to the PRNG.
void _purge_gg_hits(mctools::simulated_data::hit_handle_collection_type *gg_hits_, mctools::simulated_data::hit_collection_type *plain_gg_hits_)
To be documented.
gg_step_hit_processor()
Default constructor.
virtual bool accept_external_rng() const
Check if processor accepts an external PRNG.
std::vector< base_step_hit * > step_hit_ptr_collection_type
std::vector< base_step_hit > hit_collection_type
std::vector< hit_handle_type > hit_handle_collection_type
virtual void set_external_rng(mygsl::rng &rng_)
Set an external PRNG.
bool has_external_rng() const
Check if processor uses an external PRNG.
Definition: calo_tapered_scin_box_model.h:54
std::map< std::string, category_info > categories_by_name_col_type
mygsl::rng & grab_rng()
Return a mutable reference to the PRNG.
void _set_defaults()
Set default values for attributes.
#define MCTOOLS_STEP_HIT_PROCESSOR_REGISTRATION_INTERFACE(SHP_CLASS_NAME)
virtual void initialize(const ::datatools::properties &config_, ::datatools::service_manager &service_mgr_)
Main setup routine.
Fast locator class for SuperNEMO drift chamber volumes.
Definition: gg_locator.h:62