Falaise  4.0.1
SuperNEMO Software Toolkit
calibrated_data_cut.h
Go to the documentation of this file.
1 /// \file falaise/snemo/cuts/calibrated_data_cut.h
2 /* Author(s) : Xavier Garrido <garrido@lal.in2p3.fr>
3  * Creation date : 2011-11-24
4  * Last modified : 2014-01-30
5  *
6  * Copyright (C) 2011-2014 Xavier Garrido <garrido@lal.in2p3.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or (at
11  * your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  *
23  *
24  *
25  * Description:
26  *
27  * Calibrated data cut.
28  *
29  * History:
30  *
31  */
32 
33 #ifndef FALAISE_SNEMO_CUT_CALIBRATED_DATA_CUT_H
34 #define FALAISE_SNEMO_CUT_CALIBRATED_DATA_CUT_H 1
35 
36 // Standard library:
37 #include <string>
38 
39 // Third party:
40 // - Boost:
41 #include <boost/cstdint.hpp>
42 // - Bayeux/datatools:
43 #include <datatools/bit_mask.h>
44 // - Bayeux/cuts:
45 #include <cuts/i_cut.h>
46 
47 namespace datatools {
48 class service_manager;
49 class properties;
50 } // namespace datatools
51 
52 namespace snemo {
53 
54 namespace cut {
55 
56 /// \brief A cut performed on the event record's 'calibrated data' bank
58  public:
59  /// \brief Type of cut on calibrated data model
60  enum mode_type {
67  };
68 
69  /// Set the calibrated data bank label/name
70  void set_CD_label(const std::string& CD_label_);
71 
72  /// Return the calibrated data bank label/name
73  const std::string& get_CD_label() const;
74 
75  /// Return the cut mode
76  uint32_t get_mode() const;
77 
78  /// Check cut mode MODE_FLAG :
79  bool is_mode_flag() const;
80 
81  /// Check cut mode MODE_HAS_HIT_CATEGORY:
82  bool is_mode_has_hit_category() const;
83 
84  /// Check cut mode MODE_RANGE_HIT_CATEGORY:
85  bool is_mode_range_hit_category() const;
86 
87  /// Check cut mode MODE_TRACKER_HIT_HAS_TRAITS:
88  bool is_mode_tracker_hit_has_traits() const;
89 
90  /// Check cut mode MODE_TRACKER_HIT_IS_DELAYED:
91  bool is_mode_tracker_hit_is_delayed() const;
92 
93  /// Set the name of cut mode MODE_FLAG
94  void set_flag_name(const std::string& flag_name_);
95 
96  /// Return the name of cut mode MODE_FLAG
97  const std::string& get_flag_name() const;
98 
99  /// Constructor
102 
103  /// Destructor
104  virtual ~calibrated_data_cut();
105 
106  /// Initilization
107  virtual void initialize(const datatools::properties& configuration_,
108  datatools::service_manager& service_manager_,
109  cuts::cut_handle_dict_type& cut_dict_);
110 
111  /// Reset
112  virtual void reset();
113 
114  protected:
115  /// Default values
116  void _set_defaults();
117 
118  /// Selection
119  virtual int _accept();
120 
121  private:
122  std::string _CD_label_; //!< Name of the "Calibrated data" bank
123  uint32_t _mode_; //!< Mode of the cut
124  std::string _flag_name_; //!< Name of the boolean property in the calibrated data
125  std::string _hit_category_; //!< Name of the hit category to be checked
126  int _hit_category_range_min_; //!< Minimal number of hits in a category
127  int _hit_category_range_max_; //!< Maximal number of hits in a category
128  int _tracker_hit_trait_bits_; //!< Tracker hit traits bits
129  double _tracker_hit_delay_time_; //!< Tracker hit delayed time
130  // Macro to automate the registration of the cut :
132 };
133 
134 } // end of namespace cut
135 
136 } // end of namespace snemo
137 
138 // OCD support::
139 #include <datatools/ocd_macros.h>
140 
141 // @arg snemo::cut::calibrated_data_cut the name the registered class in the OCD system
143 
144 #endif // FALAISE_SNEMO_CUT_CALIBRATED_DATA_CUT_H
145 
146 /*
147 ** Local Variables: --
148 ** mode: c++ --
149 ** c-file-style: "gnu" --
150 ** End: --
151 */
A cut performed on the event record's 'calibrated data' bank.
Definition: calibrated_data_cut.h:57
virtual void initialize(const datatools::properties &configuration_, datatools::service_manager &service_manager_, cuts::cut_handle_dict_type &cut_dict_)
Initilization.
virtual void reset()
Reset.
bool is_mode_flag() const
Check cut mode MODE_FLAG :
Definition: calibrated_data_cut.h:62
static const uint32_t bit01
static const uint32_t bit03
Definition: calibrated_data_cut.h:63
virtual int _accept()
Selection.
static const uint32_t bit04
virtual ~calibrated_data_cut()
Destructor.
mode_type
Type of cut on calibrated data model.
Definition: calibrated_data_cut.h:60
void set_CD_label(const std::string &CD_label_)
Set the calibrated data bank label/name.
const std::string & get_CD_label() const
Return the calibrated data bank label/name.
bool is_mode_range_hit_category() const
Check cut mode MODE_RANGE_HIT_CATEGORY:
const std::string & get_flag_name() const
Return the name of cut mode MODE_FLAG.
bool is_mode_tracker_hit_has_traits() const
Check cut mode MODE_TRACKER_HIT_HAS_TRAITS:
DOCD_CLASS_DECLARATION(my::algo)
#define CUT_REGISTRATION_INTERFACE(T)
static const uint32_t bit02
Definition: calo_tapered_scin_box_model.h:54
void set_flag_name(const std::string &flag_name_)
Set the name of cut mode MODE_FLAG.
Definition: calibrated_data_cut.h:61
calibrated_data_cut(datatools::logger::priority logging_priority_=datatools::logger::PRIO_FATAL)
Constructor.
bool is_mode_tracker_hit_is_delayed() const
Check cut mode MODE_TRACKER_HIT_IS_DELAYED:
bool is_mode_has_hit_category() const
Check cut mode MODE_HAS_HIT_CATEGORY:
std::map< std::string, cut_entry_type > cut_handle_dict_type
uint32_t get_mode() const
Return the cut mode.
static const uint32_t bit00
void _set_defaults()
Default values.