Jpp  15.0.1-rc.2-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JMatchL0.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JMATCHL0__
2 #define __JTRIGGER__JMATCHL0__
3 
4 #include "JTrigger/JMatch.hh"
5 
6 
7 /**
8  * \file
9  *
10  * Match operator for consecutive hits.
11  * \author mdejong
12  */
13 namespace JTRIGGER {}
14 namespace JPP { using namespace JTRIGGER; }
15 
16 namespace JTRIGGER {
17 
18  /**
19  * L0 match criterion.
20  *
21  * The maximal time difference between trailing and leading edge of two consecutive hits
22  * can be interpreted as the effective two-hit resolution of a PMT/TDC.
23  *
24  * Note that the hits should be time ordered.
25  */
26  template<class JHit_t>
27  class JMatchL0 :
28  public JClonable< JMatch<JHit_t>, JMatchL0<JHit_t> >
29  {
30  public:
31  /**
32  * Constructor.
33  *
34  * \param Tmax_ns maximal time difference between trailing and leading edge [ns]
35  */
36  JMatchL0(const double Tmax_ns) :
37  Tmax_ns(Tmax_ns)
38  {}
39 
40 
41  /**
42  * Match function.
43  *
44  * The template should provide for the following member methods:
45  * <pre>
46  * double getT1() const; // time of leading edge
47  * double getT2() const; // time of traling edge
48  * </pre>
49  *
50  * \param first first hit
51  * \param second second hit
52  * \return true if time difference between trailing edge and leading edge less than specified time; else false
53  */
54  bool operator()(const JHit_t& first, const JHit_t& second) const
55  {
56  return (second.getT1() > first.getT1() &&
57  second.getT1() < first.getT2() + Tmax_ns);
58  }
59 
60  double Tmax_ns;
61  };
62 }
63 
64 #endif
L0 match criterion.
Definition: JMatchL0.hh:27
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Base class for match operations for cluster and hit-preprocessing methods.
Template class for object cloning.
Definition: JClonable.hh:20
bool operator()(const JHit_t &first, const JHit_t &second) const
Match function.
Definition: JMatchL0.hh:54
JMatchL0(const double Tmax_ns)
Constructor.
Definition: JMatchL0.hh:36