All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MaxNPEWindow.h
Go to the documentation of this file.
1 /**
2  * \file MaxNPEWindow.h
3  *
4  * \ingroup Algorithms
5  *
6  * \brief Class def header for a class MaxNPEWindow
7  *
8  * @author kazuhiro
9  */
10 
11 /** \addtogroup Algorithms
12 
13  @{*/
14 #ifndef OPT0FINDER_MAXNPEWINDOW_H
15 #define OPT0FINDER_MAXNPEWINDOW_H
16 
17 #ifndef USING_LARSOFT
18 #define USING_LARSOFT 1
19 #endif
20 
21 #if USING_LARSOFT == 0
24 #else
27 #endif
28 
29 namespace flashmatch {
30  /**
31  \class MaxNPEWindow
32  Type flashmatch::BaseFlashFilter algorithm class. It applies a very simple \n
33  filter based on time window to eliminate multiple flashes coming from the \n
34  same interaction. The algorithm works in the following steps: \n
35 
36  0) Order a list of provided flash using the amount photoelectrons \n
37  (the bigger, the higher priority). \n
38 
39  1) Loop over the list of flashes in high=>low priority order. \n
40 
41  1.1) For each flash, attempt to open a time window T1 => T2 w.r.t. \n
42  flash time where T1 & T2 are configured via user \n
43 
44  1.2) If a flash falls within any of previously-opened time window, \n
45  ignore this flash. \n
46 
47  1.3) Terminate the loop when the number of photoelectrons drops below \n
48  the threshold set by a user.
49  */
50  class MaxNPEWindow : public BaseFlashFilter{
51 
52  public:
53 
54  /// Default constructor
55  MaxNPEWindow(const std::string name="MaxNPEWindow");
56 
57  /// Default destructor
59 
60  /// Implementation of a virtual function
62 
63  protected:
64 
65  void _Configure_(const Config_t &pset);
66 
67  private:
68 
69  double _time_lower_bound; ///< T1 [us]: the lower edge of the opened time window
70  double _time_upper_bound; ///< T2 [us]: the upper edge of the opened time window
71  double _npe_threshold; ///< threshold [p.e.]: to ignore any flash below this value
72 
73  };
74 
75  /**
76  \class flashmatch::MaxNPEWindowFactory
77  */
79  public:
80  /// ctor
82  /// dtor
84  /// creation method
85  BaseFlashFilter* create(const std::string instance_name) { return new MaxNPEWindow(instance_name); }
86  };
87 
88 }
89 
90 #endif
91 /** @} */ // end of doxygen group
92 
BaseFlashFilter * create(const std::string instance_name)
creation method
Definition: MaxNPEWindow.h:85
fhicl::ParameterSet Config_t
Configuration object.
Definition: FMWKInterface.h:31
double _time_upper_bound
T2 [us]: the upper edge of the opened time window.
Definition: MaxNPEWindow.h:70
~MaxNPEWindow()
Default destructor.
Definition: MaxNPEWindow.h:58
Abstract base class for factory (to be implemented per flash)
double _npe_threshold
threshold [p.e.]: to ignore any flash below this value
Definition: MaxNPEWindow.h:71
void add_factory(const std::string name, flashmatch::FlashFilterFactoryBase *factory)
Factory registration method (should be called by global factory instance in algorithm header) ...
IDArray_t Filter(const FlashArray_t &)
Implementation of a virtual function.
Class def header for a class BaseFlashFilter.
double _time_lower_bound
T1 [us]: the lower edge of the opened time window.
Definition: MaxNPEWindow.h:69
MaxNPEWindow(const std::string name="MaxNPEWindow")
Default constructor.
static FlashFilterFactory & get()
Static sharable instance getter.
std::vector< flashmatch::ID_t > IDArray_t
Index collection.
void _Configure_(const Config_t &pset)
std::vector< flashmatch::Flash_t > FlashArray_t
Collection of Flash objects.
Class def header for a class FlashFilterFactory.
const std::string & name() const
Name getter, defined in a logger instance attribute.
Definition: LoggerFeature.h:51