Falaise  4.0.1
SuperNEMO Software Toolkit
tracker_clustering_data_cut.h
Go to the documentation of this file.
1 /// \file falaise/snemo/cuts/tracker_clustering_data_cut.h
2 /* Author(s) : Xavier Garrido <garrido@lal.in2p3.fr>
3  * Creation date : 2011-11-27
4  * Last modified : 2014-03-20
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  * Basic tracker clustering data cut.
28  *
29  * History:
30  *
31  */
32 
33 #ifndef FALAISE_SNEMO_CUT_TRACKER_CLUSTERING_DATA_CUT_H
34 #define FALAISE_SNEMO_CUT_TRACKER_CLUSTERING_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 snemo {
48 
49 namespace cut {
50 
51 /// \brief A cut performed on the event record's 'tracker clustering data' bank
53  public:
54  /// \brief Mode of the cut
55  enum mode_type {
62  };
63 
64  /// Set the 'Tracker clustering' bank label/name
65  void set_TCD_label(const std::string& TCD_label_);
66 
67  /// Return the 'Tracker clustering' bank label/name
68  const std::string& get_TCD_label() const;
69 
70  /// Return the cut mode
71  uint32_t get_mode() const;
72 
73  /// Check mode FLAG:
74  bool is_mode_flag() const;
75 
76  /// Check mode HAS_CLUSTER:
77  bool is_mode_has_cluster() const;
78 
79  /// Check mode RANGE_CLUSTER:
80  bool is_mode_range_cluster() const;
81 
82  /// Check mode HAS_UNCLUSTERED_HITS:
83  bool is_mode_has_unclustered_hits() const;
84 
85  /// Check mode RANGE_UNCLUSTERED_HITS:
86  bool is_mode_range_unclustered_hits() const;
87 
88  /// Set flag property name
89  void set_flag_name(const std::string& flag_name_);
90 
91  /// Return flag property name
92  const std::string& get_flag_name() const;
93 
94  /// Constructor
97 
98  /// Destructor
100 
101  /// Initilization
102  virtual void initialize(const datatools::properties& configuration_,
103  datatools::service_manager& service_manager_,
104  cuts::cut_handle_dict_type& cut_dict_);
105 
106  /// Reset
107  virtual void reset();
108 
109  protected:
110  /// Default values
111  void _set_defaults();
112 
113  /// Selection
114  virtual int _accept();
115 
116  private:
117  std::string _TCD_label_; //!< Name of the "tracker clustering data" bank
118  uint32_t _mode_; //!< Mode of the cut
119  std::string _flag_name_; //!< Name of the boolean property in the tracker clustering data
120  int _cluster_range_min_; //!< Minimal number of cluster
121  int _cluster_range_max_; //!< Maximal number of cluster
122  int _unclustered_range_min_; //!< Minimal number of unclustered hits
123  int _unclustered_range_max_; //!< Maximal number of unclustered hits
124 
125  // Macro to automate the registration of the cut :
127 };
128 
129 } // end of namespace cut
130 
131 } // end of namespace snemo
132 
133 // OCD support::
134 #include <datatools/ocd_macros.h>
135 
136 // @arg snemo::cut::tracker_clustering_data_cut the name the registered class in the OCD system
138 
139 #endif // FALAISE_SNEMO_CUT_TRACKER_CLUSTERING_DATA_CUT_H
140 
141 /*
142 ** Local Variables: --
143 ** mode: c++ --
144 ** c-file-style: "gnu" --
145 ** End: --
146 */
bool is_mode_has_cluster() const
Check mode HAS_CLUSTER:
bool is_mode_flag() const
Check mode FLAG:
bool is_mode_range_cluster() const
Check mode RANGE_CLUSTER:
Definition: tracker_clustering_data_cut.h:57
static const uint32_t bit01
static const uint32_t bit03
static const uint32_t bit04
const std::string & get_TCD_label() const
Return the 'Tracker clustering' bank label/name.
tracker_clustering_data_cut(datatools::logger::priority logging_priority_=datatools::logger::PRIO_FATAL)
Constructor.
virtual ~tracker_clustering_data_cut()
Destructor.
Definition: tracker_clustering_data_cut.h:58
Definition: tracker_clustering_data_cut.h:59
const std::string & get_flag_name() const
Return flag property name.
A cut performed on the event record's 'tracker clustering data' bank.
Definition: tracker_clustering_data_cut.h:52
DOCD_CLASS_DECLARATION(my::algo)
void set_TCD_label(const std::string &TCD_label_)
Set the 'Tracker clustering' bank label/name.
void set_flag_name(const std::string &flag_name_)
Set flag property name.
Definition: tracker_clustering_data_cut.h:60
#define CUT_REGISTRATION_INTERFACE(T)
static const uint32_t bit02
Definition: calo_tapered_scin_box_model.h:54
bool is_mode_has_unclustered_hits() const
Check mode HAS_UNCLUSTERED_HITS:
mode_type
Mode of the cut.
Definition: tracker_clustering_data_cut.h:55
uint32_t get_mode() const
Return the cut mode.
std::map< std::string, cut_entry_type > cut_handle_dict_type
static const uint32_t bit00
virtual void initialize(const datatools::properties &configuration_, datatools::service_manager &service_manager_, cuts::cut_handle_dict_type &cut_dict_)
Initilization.
Definition: tracker_clustering_data_cut.h:56
bool is_mode_range_unclustered_hits() const
Check mode RANGE_UNCLUSTERED_HITS: