Falaise  4.0.1
SuperNEMO Software Toolkit
calibrated_tracker_hit.h
Go to the documentation of this file.
1 /// \file falaise/snemo/datamodels/calibrated_tracker_hit.h
2 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-03-15
4  * Last modified: 2014-01-27
5  *
6  * Description:
7  *
8  * Calibrated tracker hit
9  *
10  * History:
11  *
12  */
13 
14 #ifndef FALAISE_SNEMO_DATAMODELS_CALIBRATED_TRACKER_HIT_H
15 #define FALAISE_SNEMO_DATAMODELS_CALIBRATED_TRACKER_HIT_H 1
16 
17 // Standard library:
18 #include <string>
19 #include <vector>
20 
21 // Third party:
22 // - Boost:
23 #include <boost/cstdint.hpp>
24 // - Bayeux/datatools:
25 #include <datatools/bit_mask.h>
26 #include <datatools/handle.h>
27 // - Bayeux/geomtools:
28 #include <geomtools/base_hit.h>
29 
30 namespace snemo {
31 
32 namespace datamodel {
33 
34 /// \brief Model of a calibrated tracker hit (Geiger regime)
36  public:
37  /// \brief Special traits
38  enum traits_type {
39  none = 0x0,
48  };
49 
50  /// Alias for a handle on a calibrated tracker hit
52 
53  /// Alias for a collection of handles on calibrated tracker hits
54  typedef std::vector<handle_type> collection_type;
55 
56  /// Name of the property to store optional anode time
57  static const std::string& anode_time_key();
58 
59  /// Name of the property to store optional bottom cathode time
60  static const std::string& bottom_cathode_time_key();
61 
62  /// Name of the property to store optional top cathode time
63  static const std::string& top_cathode_time_key();
64 
65  /// Return the hit ID
66  int32_t get_id() const;
67 
68  /// Return the module number
69  int32_t get_module() const;
70 
71  /// Return the number of the tracker submodule
72  int32_t get_side() const;
73 
74  /// Return the layer
75  int32_t get_layer() const;
76 
77  /// Return the row
78  int32_t get_row() const;
79 
80  /// Return the longitudinal position of the Geiger hit along the anode wire
81  double get_z() const;
82 
83  /// Set the longitudinal position of the Geiger hit along the anode wire
84  void set_z(double);
85 
86  /// Return the error on the longitudinal position of the Geiger hit along the anode wire
87  double get_sigma_z() const;
88 
89  /// Set the error on the longitudinal position of the Geiger hit along the anode wire
90  void set_sigma_z(double);
91 
92  /// Return the drift radius of the Geiger hit
93  double get_r() const;
94 
95  /// Set the drift radius of the Geiger hit
96  void set_r(double);
97 
98  /// Return the error on the drift radius of the Geiger hit
99  double get_sigma_r() const;
100 
101  /// Set the error on the drift radius of the Geiger hit
102  void set_sigma_r(double);
103 
104  /// Return the X position of the center of the cell in the module coordinates system
105  double get_x() const;
106 
107  /// Return the Y position of the center of the cell in the module coordinates system
108  double get_y() const;
109 
110  /// Check if the X/Y position of the center of the cell is stored
111  bool has_xy() const;
112 
113  /// Set the X/Y position of the center of the cell in the module coordinates system
114  void set_xy(double x_, double y_);
115 
116  /// Invalidate X/Y position of the center of the cell
117  void invalidate_xy();
118 
119  /// Reset all calibration informations
120  void invalidate_positions();
121 
122  /// Check if the anode drift time is stored as an auxiliary property
123  bool has_anode_time() const;
124 
125  /// Store the anode drift time as an auxiliary property
126  void set_anode_time(double);
127 
128  /// Get the anode drift time from a stored auxiliary property
129  double get_anode_time() const;
130 
131  /// Interface to deal with trait bits
132  bool get_trait_bit(uint32_t mask_) const;
133 
134  /// Check if the hit is marked as noisy
135  bool is_noisy() const;
136 
137  /// Mark/unmark the hit as noisy
138  void set_noisy(bool);
139 
140  /// Check if the hit is marked as delayed
141  bool is_delayed() const;
142 
143  /// Mark/unmark the hit as delayed
144  void set_delayed(bool);
145 
146  /// Check if the delayed time is stored
147  bool has_delayed_time() const;
148 
149  /// Return the delayed reference time of the hit
150  double get_delayed_time() const;
151 
152  /// Check if the delayed time error is stored
153  bool has_delayed_time_error() const;
154 
155  /// Return the delayed reference time error of the hit
156  double get_delayed_time_error() const;
157 
158  /// Set the hit as delayed and store its referece delayed time and associated error
159  void set_delayed_time(double ref_delayed_time_, double ref_delayed_time_error_ = 0.0);
160 
161  /// Check if the hit is not marked as delayed
162  bool is_prompt() const;
163 
164  /// Check if the hit is marked as peripheral
165  bool is_peripheral() const;
166 
167  /// Mark/unmark the hit as peripheral
168  void set_peripheral(bool);
169 
170  /// Check if the hit lacks the measurement of the bottom cathode signal
171  bool is_bottom_cathode_missing() const;
172 
173  /// Mark/unmark the hit lacking the measurement of the bottom cathode signal
174  void set_bottom_cathode_missing(bool);
175 
176  /// Check if the hit lacks the measurement of the top cathode signal
177  bool is_top_cathode_missing() const;
178 
179  /// Mark/unmark the hit lacking the measurement of the bottom cathode signal
180  void set_top_cathode_missing(bool);
181 
182  /// Check if the hit lacks both measurements of the top and bottom cathode signals
183  bool are_both_cathodes_missing() const;
184 
185  /// Check if the hit is marked as sterile
186  bool is_sterile() const;
187 
188  /// Mark/unmark the hit as sterile
189  void set_sterile(bool);
190 
191  /// Check if the hit is marked as fake
192  bool is_fake() const;
193 
194  /// Mark/unmark the hit as fake
195  void set_fake(bool);
196 
197  /// Default constructor
199 
200  // Destructor
201  virtual ~calibrated_tracker_hit();
202 
203  /// Check if minimal calibration informations are present to consider the hit as valid and usable
204  bool is_valid() const;
205 
206  /// Invalidate calibration informations stored in the hit
207  void invalidate();
208 
209  /// Invalidate calibration informations stored in the hit
210  virtual void clear();
211 
212  /// Apply a measurement functor on the hit
214 
215  /// Smart print method
216  virtual void tree_dump(std::ostream& a_out = std::clog, const std::string& a_title = "",
217  const std::string& a_indent = "", bool a_inherit = false) const;
218 
219  /// Shortcut for the smart print method
220  void dump() const;
221 
222  protected:
223  /// Set the X position of the center of the cell in the module coordinates system
224  void _set_x(double);
225 
226  /// Set the Y position of the center of the cell in the module coordinates system
227  void _set_y(double);
228 
229  void _set_trait_bit(bool value_, uint32_t mask_);
230 
231  bool _get_trait_bit(uint32_t mask_) const;
232 
233  private:
234  uint32_t _traits_; //!< Bitset for special traits
235  double _r_; //!< Transverse drift distance within the cell coordinates system
236  double _sigma_r_; //!< Transverse drift distance error
237  double _z_; //!< Longitudinal position within the cell coordinates system
238  double _sigma_z_; //!< Longitudinal position error
239  double _x_; //!< X position of the anode wire within the module coordinates system
240  double _y_; //!< Y position of the anode wire within the module coordinates system
241  double _delayed_time_; //!< Delayed reference time
242  double _delayed_time_error_; //!< Delayed reference time error
243 
245 };
246 
247 /// Functor that compares hits by delayed time
249  bool operator()(const calibrated_tracker_hit& hit_i_, const calibrated_tracker_hit& hit_j_) const;
250 };
251 
252 } // end of namespace datamodel
253 
254 } // end of namespace snemo
255 
256 // Class version:
257 #include <boost/serialization/version.hpp>
258 BOOST_CLASS_VERSION(snemo::datamodel::calibrated_tracker_hit, 1)
259 
260 #endif // FALAISE_SNEMO_DATAMODELS_CALIBRATED_TRACKER_HIT_H
261 /*
262 ** Local Variables: --
263 ** mode: c++ --
264 ** c-file-style: "gnu" --
265 ** tab-width: 2 --
266 ** End: --
267 */
void set_r(double)
Set the drift radius of the Geiger hit.
void set_sigma_r(double)
Set the error on the drift radius of the Geiger hit.
bool are_both_cathodes_missing() const
Check if the hit lacks both measurements of the top and bottom cathode signals.
bool is_prompt() const
Check if the hit is not marked as delayed.
int32_t get_row() const
Return the row.
bool is_noisy() const
Check if the hit is marked as noisy.
Definition: calibrated_tracker_hit.h:39
static const uint32_t bit07
double get_x() const
Return the X position of the center of the cell in the module coordinates system.
void set_sterile(bool)
Mark/unmark the hit as sterile.
virtual void tree_dump(std::ostream &a_out=std::clog, const std::string &a_title="", const std::string &a_indent="", bool a_inherit=false) const
Smart print method.
void set_sigma_z(double)
Set the error on the longitudinal position of the Geiger hit along the anode wire.
void invalidate_positions()
Reset all calibration informations.
bool is_sterile() const
Check if the hit is marked as sterile.
void set_z(double)
Set the longitudinal position of the Geiger hit along the anode wire.
datatools::handle< calibrated_tracker_hit > handle_type
Alias for a handle on a calibrated tracker hit.
Definition: calibrated_tracker_hit.h:51
bool is_delayed() const
Check if the hit is marked as delayed.
void set_noisy(bool)
Mark/unmark the hit as noisy.
void set_fake(bool)
Mark/unmark the hit as fake.
void dump() const
Shortcut for the smart print method.
static const uint32_t bit01
bool is_top_cathode_missing() const
Check if the hit lacks the measurement of the top cathode signal.
double get_delayed_time() const
Return the delayed reference time of the hit.
static const uint32_t bit03
double get_sigma_z() const
Return the error on the longitudinal position of the Geiger hit along the anode wire.
void _set_x(double)
Set the X position of the center of the cell in the module coordinates system.
void invalidate_xy()
Invalidate X/Y position of the center of the cell.
static const uint32_t bit04
traits_type
Special traits.
Definition: calibrated_tracker_hit.h:38
static const uint32_t bit06
int32_t get_id() const
Return the hit ID.
Functor that compares hits by delayed time.
Definition: calibrated_tracker_hit.h:248
double get_sigma_r() const
Return the error on the drift radius of the Geiger hit.
bool is_bottom_cathode_missing() const
Check if the hit lacks the measurement of the bottom cathode signal.
#define DATATOOLS_SERIALIZATION_DECLARATION()
bool _get_trait_bit(uint32_t mask_) const
calibrated_tracker_hit & measure(i_measurement &)
Apply a measurement functor on the hit.
bool has_delayed_time() const
Check if the delayed time is stored.
double get_y() const
Return the Y position of the center of the cell in the module coordinates system.
void set_bottom_cathode_missing(bool)
Mark/unmark the hit lacking the measurement of the bottom cathode signal.
Definition: calibrated_tracker_hit.h:46
bool has_anode_time() const
Check if the anode drift time is stored as an auxiliary property.
Model of a calibrated tracker hit (Geiger regime)
Definition: calibrated_tracker_hit.h:35
int32_t get_module() const
Return the module number.
double get_r() const
Return the drift radius of the Geiger hit.
bool operator()(const calibrated_tracker_hit &hit_i_, const calibrated_tracker_hit &hit_j_) const
bool is_valid() const
Check if minimal calibration informations are present to consider the hit as valid and usable.
static const uint32_t bit02
Definition: calo_tapered_scin_box_model.h:54
void invalidate()
Invalidate calibration informations stored in the hit.
static const uint32_t bit05
virtual void clear()
Invalidate calibration informations stored in the hit.
static const std::string & top_cathode_time_key()
Name of the property to store optional top cathode time.
Definition: calibrated_tracker_hit.h:47
bool has_delayed_time_error() const
Check if the delayed time error is stored.
static const std::string & bottom_cathode_time_key()
Name of the property to store optional bottom cathode time.
double get_delayed_time_error() const
Return the delayed reference time error of the hit.
Definition: calibrated_tracker_hit.h:40
Definition: calibrated_tracker_hit.h:44
static const std::string & anode_time_key()
Name of the property to store optional anode time.
bool is_peripheral() const
Check if the hit is marked as peripheral.
double get_z() const
Return the longitudinal position of the Geiger hit along the anode wire.
int32_t get_side() const
Return the number of the tracker submodule.
void set_anode_time(double)
Store the anode drift time as an auxiliary property.
bool get_trait_bit(uint32_t mask_) const
Interface to deal with trait bits.
Definition: calibrated_tracker_hit.h:45
calibrated_tracker_hit()
Default constructor.
bool is_fake() const
Check if the hit is marked as fake.
void set_xy(double x_, double y_)
Set the X/Y position of the center of the cell in the module coordinates system.
void _set_y(double)
Set the Y position of the center of the cell in the module coordinates system.
static const uint32_t bit00
void set_peripheral(bool)
Mark/unmark the hit as peripheral.
std::vector< handle_type > collection_type
Alias for a collection of handles on calibrated tracker hits.
Definition: calibrated_tracker_hit.h:54
void _set_trait_bit(bool value_, uint32_t mask_)
Definition: calibrated_tracker_hit.h:41
void set_delayed_time(double ref_delayed_time_, double ref_delayed_time_error_=0.0)
Set the hit as delayed and store its referece delayed time and associated error.
double get_anode_time() const
Get the anode drift time from a stored auxiliary property.
bool has_xy() const
Check if the X/Y position of the center of the cell is stored.
void set_top_cathode_missing(bool)
Mark/unmark the hit lacking the measurement of the bottom cathode signal.
void set_delayed(bool)
Mark/unmark the hit as delayed.
int32_t get_layer() const
Return the layer.