All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TimeCompatMatch.h
Go to the documentation of this file.
1 /**
2  * \file TimeCompatMatch.h
3  *
4  * \ingroup Algorithms
5  *
6  * \brief Class def header for a class TimeCompatMatch
7  *
8  * @author david caratelli
9  */
10 
11 /** \addtogroup Algorithms
12 
13  @{*/
14 #ifndef OPT0FINDER_TIMECOMPATMATCH_H
15 #define OPT0FINDER_TIMECOMPATMATCH_H
16 
17 #ifndef USING_LARSOFT
18 #define USING_LARSOFT 1
19 #endif
20 
21 #if USING_LARSOFT == 0
26 #else
31 #endif
32 
33 #include <cmath>
34 #include <sstream>
35 
36 namespace flashmatch {
37 
38  /**
39  \class TimeCompatMatch
40  Simple flash matching algorithm. Based on absolute time of flash and track
41  w.r.t. trigger time, if the two objects are incompatible (because the time-difference
42  is larger than a full drift window) the match is not allowed
43  */
45 
46  public:
47 
48  /// Default constructor
49  TimeCompatMatch(const std::string name="TimeCompatMatch");
50 
51  /// Default destructor
53 
54  bool MatchCompatible(const QCluster_t& clus, const Flash_t& flash);
55 
56  protected:
57 
58  void _Configure_(const Config_t &pset);
59 
60  private:
61 
62  /// Buffer time to allow some uncertainty [us]
63  double _time_buffer;
64 
65  };
66 
67  /**
68  \class flashmatch::TimeCompatMatchFactory
69  */
71  public:
72  /// ctor
74  /// dtor
76  /// creation method
77  BaseProhibitAlgo* create(const std::string instance_name) { return new TimeCompatMatch(instance_name); }
78  };
79 
80 }
81 #endif
82 /** @} */ // end of doxygen group
83 
double _time_buffer
Buffer time to allow some uncertainty [us].
fhicl::ParameterSet Config_t
Configuration object.
Definition: FMWKInterface.h:31
Struct to represent an optical flash.
Class def header for a class BaseProhibitAlgo.
TimeCompatMatch(const std::string name="TimeCompatMatch")
Default constructor.
Class def header for a class FlashProhibitFactory.
Collection of charge deposition 3D point (cluster)
static FlashProhibitFactory & get()
Static sharable instance getter.
Class def header for exception classes in OpT0Finder package.
BaseProhibitAlgo * create(const std::string instance_name)
creation method
~TimeCompatMatch()
Default destructor.
bool MatchCompatible(const QCluster_t &clus, const Flash_t &flash)
CORE FUNCTION: determines if a flash and cluster are at all compatible (bool return) ...
void add_factory(const std::string name, flashmatch::FlashProhibitFactoryBase *factory)
Factory registration method (should be called by global factory instance in algorithm header) ...
const std::string & name() const
Name getter, defined in a logger instance attribute.
Definition: LoggerFeature.h:51
Abstract base class for factory (to be implemented per flash)
void _Configure_(const Config_t &pset)