Falaise  4.0.1
SuperNEMO Software Toolkit
tracker_trajectory_data_cut.h
Go to the documentation of this file.
1 /// \file falaise/snemo/cuts/tracker_trajectory_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 trajectory data cut.
28  *
29  * History:
30  *
31  */
32 
33 #ifndef FALAISE_SNEMO_CUT_TRACKER_TRAJECTORY_DATA_CUT_H
34 #define FALAISE_SNEMO_CUT_TRACKER_TRAJECTORY_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 trajectory data' bank
53  public:
54  /// \brief Mode of the cut
55  enum mode_type {
62  };
63 
64  /// Set the 'Tracker trajectory' bank label/name
65  void set_TTD_label(const std::string& TTD_label_);
66 
67  /// Return the 'Tracker trajectory' bank label/name
68  const std::string& get_TTD_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_SOLUTION:
77  bool is_mode_has_solution() const;
78 
79  /// Check mode RANGE_SOLUTION:
80  bool is_mode_range_solution() const;
81 
82  /// Check mode RANGE_CHI2NDF:
83  bool is_mode_range_chi2ndf() const;
84 
85  /// Check mode RANGE_PVALUE:
86  bool is_mode_range_pvalue() const;
87 
88  void set_flag_name(const std::string& flag_name_);
89 
90  const std::string& get_flag_name() const;
91 
92  /// Constructor
95 
96  /// Destructor
98 
99  /// Initilization
100  virtual void initialize(const datatools::properties& configuration_,
101  datatools::service_manager& service_manager_,
102  cuts::cut_handle_dict_type& cut_dict_);
103 
104  /// Reset
105  virtual void reset();
106 
107  protected:
108  /// Default values
109  void _set_defaults();
110 
111  /// Selection
112  virtual int _accept();
113 
114  private:
115  std::string _TTD_label_; //!< Name of the "tracker trajectory data" bank
116  uint32_t _mode_; //!< Mode of the cut
117  std::string _flag_name_; //!< Name of the boolean property in the tracker trajectory data
118  int _solution_range_min_; //!< Minimal number of cluster
119  int _solution_range_max_; //!< Maximal number of cluster
120  double _chi2ndf_range_min_; //!< Minimal value of chi2/ndf
121  double _chi2ndf_range_max_; //!< Maximal value of chi2/ndf
122  double _pvalue_range_min_; //!< Minimal value of p-value
123  double _pvalue_range_max_; //!< Maximal value of p-value
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_trajectory_data_cut the name the registered class in the OCD system
138 
139 #endif // FALAISE_SNEMO_CUT_TRACKER_TRAJECTORY_DATA_CUT_H
140 
141 /*
142 ** Local Variables: --
143 ** mode: c++ --
144 ** c-file-style: "gnu" --
145 ** End: --
146 */
Definition: tracker_trajectory_data_cut.h:57
bool is_mode_flag() const
Check mode FLAG:
Definition: tracker_trajectory_data_cut.h:56
bool is_mode_range_pvalue() const
Check mode RANGE_PVALUE:
bool is_mode_range_chi2ndf() const
Check mode RANGE_CHI2NDF:
void set_TTD_label(const std::string &TTD_label_)
Set the 'Tracker trajectory' bank label/name.
virtual void initialize(const datatools::properties &configuration_, datatools::service_manager &service_manager_, cuts::cut_handle_dict_type &cut_dict_)
Initilization.
virtual ~tracker_trajectory_data_cut()
Destructor.
static const uint32_t bit01
static const uint32_t bit04
A cut performed on the event record's 'tracker trajectory data' bank.
Definition: tracker_trajectory_data_cut.h:52
const std::string & get_flag_name() const
mode_type
Mode of the cut.
Definition: tracker_trajectory_data_cut.h:55
Definition: tracker_trajectory_data_cut.h:58
DOCD_CLASS_DECLARATION(my::algo)
#define CUT_REGISTRATION_INTERFACE(T)
static const uint32_t bit02
Definition: calo_tapered_scin_box_model.h:54
Definition: tracker_trajectory_data_cut.h:61
static const uint32_t bit05
void set_flag_name(const std::string &flag_name_)
bool is_mode_range_solution() const
Check mode RANGE_SOLUTION:
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
const std::string & get_TTD_label() const
Return the 'Tracker trajectory' bank label/name.
tracker_trajectory_data_cut(datatools::logger::priority logging_priority_=datatools::logger::PRIO_FATAL)
Constructor.
Definition: tracker_trajectory_data_cut.h:60
Definition: tracker_trajectory_data_cut.h:59
bool is_mode_has_solution() const
Check mode HAS_SOLUTION: