Falaise  4.0.1
SuperNEMO Software Toolkit
particle_track_data_cut.h
Go to the documentation of this file.
1 /// \file falaise/snemo/cuts/particle_track_data_cut.h
2 /* Author(s) : Steven Calvez <calvez@lal.in2p3.fr>
3  * Creation date : 2012-06-15
4  * Last modified : 2014-06-04
5  *
6  * Copyright (C) 2012-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  * Description:
24  *
25  * Particle track data cut.
26  *
27  * History:
28  *
29  */
30 
31 #ifndef FALAISE_SNEMO_CUT_PARTICLE_TRACK_DATA_CUT_H
32 #define FALAISE_SNEMO_CUT_PARTICLE_TRACK_DATA_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 the event record's 'particle track data' bank
51  public:
52  /// Mode of the cut
53  enum mode_type {
60  };
61 
62  /// Set the 'Particle Track Data' bank label/name
63  void set_PTD_label(const std::string& PTD_label_);
64 
65  /// Return the 'Particle Track Data' bank label/name
66  const std::string& get_PTD_label() const;
67 
68  /// Return the cut mode
69  uint32_t get_mode() const;
70 
71  /// Check mode FLAG:
72  bool is_mode_flag() const;
73 
74  /// Check mode HAS_NON_ASSOCIATED_CALORIMETER_HITS
76 
77  /// Check mode RANGE_NON_ASSOCIATED_CALORIMETER_HITS
79 
80  /// Check mode HAS_PARTICLES
81  bool is_mode_has_particles() const;
82 
83  /// Check mode RANGE_PARTICLES
84  bool is_mode_range_particles() const;
85 
86  /// Set flag property name
87  void set_flag_name(const std::string& flag_name_);
88 
89  /// Return flag property name
90  const std::string& get_flag_name() const;
91 
92  /// Constructor
95 
96  /// Destructor
97  virtual ~particle_track_data_cut();
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 _PTD_label_; //!< Name of the "Particle track data" bank
116  uint32_t _mode_; //!< Mode of the cut
117  std::string _flag_name_; //!< Name of the boolean property in the particle track data
118  int _particles_range_min_; //!< Minimal number of particles for range_particles mode
119  int _particles_range_max_; //!< Maximal number of particles for range_particles mode
120  int _non_associated_calorimeter_hits_range_min_; //!< Minimal number of ass. calo for
121  //!< range_non_associated_calorimeter_hits mode
122  int _non_associated_calorimeter_hits_range_max_; //!< Maximal number of ass. calo for
123  //!< range_non_associated_calorimeter_hits mode
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::particle_track_data_cut the name the registered class in the OCD system
138 
139 #endif // FALAISE_SNEMO_CUT_PARTICLE_TRACK_DATA_CUT_H
140 
141 /*
142 ** Local Variables: --
143 ** mode: c++ --
144 ** c-file-style: "gnu" --
145 ** End: --
146 */
const std::string & get_PTD_label() const
Return the 'Particle Track Data' bank label/name.
uint32_t get_mode() const
Return the cut mode.
bool is_mode_range_particles() const
Check mode RANGE_PARTICLES.
virtual int _accept()
Selection.
static const uint32_t bit01
static const uint32_t bit03
Definition: particle_track_data_cut.h:54
Definition: particle_track_data_cut.h:55
virtual ~particle_track_data_cut()
Destructor.
bool is_mode_has_particles() const
Check mode HAS_PARTICLES.
void set_flag_name(const std::string &flag_name_)
Set flag property name.
static const uint32_t bit04
bool is_mode_range_non_associated_calorimeter_hits() const
Check mode RANGE_NON_ASSOCIATED_CALORIMETER_HITS.
bool is_mode_has_non_associated_calorimeter_hits() const
Check mode HAS_NON_ASSOCIATED_CALORIMETER_HITS.
A cut performed on the event record's 'particle track data' bank.
Definition: particle_track_data_cut.h:50
DOCD_CLASS_DECLARATION(my::algo)
mode_type
Mode of the cut.
Definition: particle_track_data_cut.h:53
Definition: particle_track_data_cut.h:58
#define CUT_REGISTRATION_INTERFACE(T)
static const uint32_t bit02
Definition: calo_tapered_scin_box_model.h:54
bool is_mode_flag() const
Check mode FLAG:
void set_PTD_label(const std::string &PTD_label_)
Set the 'Particle Track Data' bank label/name.
void _set_defaults()
Default values.
virtual void initialize(const datatools::properties &configuration_, datatools::service_manager &service_manager_, cuts::cut_handle_dict_type &cut_dict_)
Initilization.
std::map< std::string, cut_entry_type > cut_handle_dict_type
particle_track_data_cut(datatools::logger::priority logging_priority_=datatools::logger::PRIO_FATAL)
Constructor.
const std::string & get_flag_name() const
Return flag property name.
static const uint32_t bit00
Definition: particle_track_data_cut.h:59