Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
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 */
13namespace JTRIGGER {}
14namespace JPP { using namespace JTRIGGER; }
15
16namespace 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) :
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
Base class for match operations for cluster and hit-preprocessing methods.
L0 match criterion.
Definition JMatchL0.hh:29
JMatchL0(const double Tmax_ns)
Constructor.
Definition JMatchL0.hh:36
bool operator()(const JHit_t &first, const JHit_t &second) const
Match function.
Definition JMatchL0.hh:54
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
Template class for object cloning.
Definition JClonable.hh:59