Falaise  4.0.1
SuperNEMO Software Toolkit
particle_track_cut.h
Go to the documentation of this file.
1 /// \file falaise/snemo/cuts/particle_track_cut.h
2 /* Author(s) : Xavier Garrido <garrido@lal.in2p3.fr>
3  * Creation date : 2015-03-05
4  * Last modified : 2015-03-05
5  *
6  * Copyright (C) 2015 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  * Description:
24  *
25  * Particle track cut.
26  *
27  * History:
28  *
29  */
30 
31 #ifndef FALAISE_SNEMO_CUT_PARTICLE_TRACK_CUT_H
32 #define FALAISE_SNEMO_CUT_PARTICLE_TRACK_CUT_H 1
33 
34 // Standard library:
35 #include <string>
36 
37 // Third party:
38 // - Boost:
39 #include <boost/cstdint.hpp>
40 // - Bayeux/datatools:
41 #include <datatools/bit_mask.h>
42 // - Bayeux/cuts:
43 #include <cuts/i_cut.h>
44 
45 namespace snemo {
46 
47 namespace cut {
48 
49 /// \brief A cut performed on individual 'particle track' record
51  public:
52  /// Mode of the cut
53  enum mode_type {
61  };
62 
63  /// Return the cut mode
64  uint32_t get_mode() const;
65 
66  /// Check mode FLAG
67  bool is_mode_flag() const;
68 
69  /// Check mode HAS_ASSOCIATED_CALORIMETER_HITS
71 
72  /// Check mode RANGE_ASSOCIATED_CALORIMETER_HITS
74 
75  /// Check mode HAS_VERTEX
76  bool is_mode_has_vertex() const;
77 
78  /// Check mode HAS_CHARGE
79  bool is_mode_has_charge() const;
80 
81  /// Check mode HAS_DELAYED_CLUSTER
82  bool is_mode_has_delayed_cluster() const;
83 
84  /// Constructor
86 
87  /// Destructor
88  virtual ~particle_track_cut();
89 
90  /// Initilization
91  virtual void initialize(const datatools::properties& configuration_,
92  datatools::service_manager& service_manager_,
93  cuts::cut_handle_dict_type& cut_dict_);
94 
95  /// Reset
96  virtual void reset();
97 
98  protected:
99  /// Default values
100  void _set_defaults();
101 
102  /// Selection
103  virtual int _accept();
104 
105  private:
106  uint32_t _mode_; //!< Mode of the cut
107  std::string _flag_name_; //!< Name of the boolean property in the particle track
108  std::string _charge_type_; //!< Name of the charge type
109  std::string _vertex_type_; //!< Name of the vertex type
110 
111  std::string _calorimeter_hits_range_category_; //!< Calorimeter category
112  int _calorimeter_hits_range_min_; //!< Minimal number of associated calorimeter
113  int _calorimeter_hits_range_max_; //!< Maximal number of associated calorimeter
114 
115  // Macro to automate the registration of the cut :
117 };
118 
119 } // end of namespace cut
120 
121 } // end of namespace snemo
122 
123 // OCD support::
124 #include <datatools/ocd_macros.h>
125 
126 // @arg snemo::cut::particle_track_cut the name the registered class in the OCD system
128 
129 #endif // FALAISE_SNEMO_CUT_PARTICLE_TRACK_CUT_H
130 
131 /*
132 ** Local Variables: --
133 ** mode: c++ --
134 ** c-file-style: "gnu" --
135 ** End: --
136 */
bool is_mode_has_vertex() const
Check mode HAS_VERTEX.
particle_track_cut(datatools::logger::priority logging_priority_=datatools::logger::PRIO_FATAL)
Constructor.
static const uint32_t bit01
virtual ~particle_track_cut()
Destructor.
static const uint32_t bit03
void _set_defaults()
Default values.
static const uint32_t bit04
mode_type
Mode of the cut.
Definition: particle_track_cut.h:53
virtual void reset()
Reset.
bool is_mode_has_delayed_cluster() const
Check mode HAS_DELAYED_CLUSTER.
DOCD_CLASS_DECLARATION(my::algo)
#define CUT_REGISTRATION_INTERFACE(T)
static const uint32_t bit02
Definition: calo_tapered_scin_box_model.h:54
static const uint32_t bit05
Definition: particle_track_cut.h:54
uint32_t get_mode() const
Return the cut mode.
bool is_mode_has_charge() const
Check mode HAS_CHARGE.
bool is_mode_range_associated_calorimeter_hits() const
Check mode RANGE_ASSOCIATED_CALORIMETER_HITS.
A cut performed on individual 'particle track' record.
Definition: particle_track_cut.h:50
Definition: particle_track_cut.h:59
Definition: particle_track_cut.h:55
std::map< std::string, cut_entry_type > cut_handle_dict_type
Definition: particle_track_cut.h:56
virtual int _accept()
Selection.
bool is_mode_has_associated_calorimeter_hits() const
Check mode HAS_ASSOCIATED_CALORIMETER_HITS.
static const uint32_t bit00
bool is_mode_flag() const
Check mode FLAG.
virtual void initialize(const datatools::properties &configuration_, datatools::service_manager &service_manager_, cuts::cut_handle_dict_type &cut_dict_)
Initilization.