00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __N3AnaBase__energy_cut_h
00031 #define __N3AnaBase__energy_cut_h 1
00032
00033 #include <cstdlib>
00034 #include <iostream>
00035 #include <string>
00036 #include <sstream>
00037 #include <stdexcept>
00038
00039 #include <boost/numeric/interval.hpp>
00040
00041 #include <N3AnaBase/cuts/i_ana_event_cut.h>
00042 #include <N3AnaBase/measurements/tof_tools.h>
00043
00044 namespace nemo3 {
00045
00046 class tof_cut : public nemo3::i_ana_event_cut
00047 {
00048 public:
00049 enum mode_t
00050 {
00051 MODE_INVALID = -1,
00052 MODE_INCLUSIVE = 0,
00053 MODE_EXCLUSIVE = 1,
00054 };
00055
00056
00057 static const std::string INTERNAL_ELECTRON_CANDIDATE;
00058 static const std::string INTERNAL_GAMMA_CANDIDATE;
00059
00060 static int get_mode_from_label (const std::string & label_);
00061
00062 static std::string get_label_from_mode (int mode_);
00063
00064 static bool is_mode_valid (int mode_);
00065
00066 static std::ostream & print_NENG (std::ostream & out_,
00067 int NE_, int NG_,
00068 double proba_int_ee_, double proba_ext_ee_,
00069 double proba_int_eg_, double proba_ext_eg_);
00070
00071 private:
00072
00073 double __NE;
00074 double __NG;
00075 double __NGT;
00076 double __proba_int_ee;
00077 double __proba_ext_ee;
00078 double __proba_int_eg;
00079 double __proba_ext_eg;
00080 double __proba_int_gg;
00081 bool __debug;
00082 int __mode;
00083 std::string __tracking_name;
00084 tof_tools * __tof_tools;
00085
00086 public:
00087
00088 bool is_mode_inclusive () const;
00089
00090 bool is_mode_exclusive () const;
00091
00092 tof_cut (bool debug_ = false);
00093
00094 virtual ~tof_cut ();
00095
00096 void set (int mode_, int ne_, int ng_, int ngt,
00097 double proba_int_ee_, double proba_ext_ee_,
00098 double proba_int_eg_, double proba_ext_eg_,
00099 double proba_int_gg_);
00100
00101 public:
00102
00103 bool is_debug () const;
00104
00105 void set_debug (bool);
00106
00107 void dump (std::ostream & out_ = std::clog) const;
00108
00109 public:
00110 bool accept ();
00111
00112 protected:
00113 virtual void __prepare_cut ();
00114
00115
00116 private:
00117 static creator_registration<tof_cut> __CR;
00118
00119 public:
00120
00121 static const std::string CUT_ID;
00122
00123 virtual std::string cut_id () const;
00124
00125 virtual cut_creator_t cut_creator () const;
00126
00127 static nemo3::i_ana_event_cut * create (const nemocuts::ICutFactory::cut_properties_t & cut_properties_);
00128
00129 };
00130
00131 }
00132
00133 #endif
00134
00135