Jpp
JMatch3D.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JMATCH3D__
2 #define __JTRIGGER__JMATCH3D__
3 
4 #include "JTools/JConstants.hh"
5 
6 #include "JTrigger/JMatch.hh"
7 
8 
9 /**
10  * \file
11  *
12  * Match operator for Cherenkov light from muon in any direction.
13  * \author mdejong
14  */
15 namespace JTRIGGER {}
16 namespace JPP { using namespace JTRIGGER; }
17 
18 namespace JTRIGGER {
19 
22 
23 
24  /**
25  * 3D match criterion.
26  * This match algorithm is intented for muon or shower signals.
27  */
28  template<class JHit_t>
29  class JMatch3D :
30  public JClonable< JMatch<JHit_t>, JMatch3D<JHit_t> >
31  {
32  public:
33  /**
34  * Constructor.
35  *
36  * \param Tmax_ns maximal extra time [ns]
37  */
38  JMatch3D(const double Tmax_ns = 0.0) :
39  TMaxExtra_ns(Tmax_ns)
40  {}
41 
42 
43  /**
44  * Match operator.
45  *
46  * \param first hit
47  * \param second hit
48  * \return match result
49  */
50  virtual bool operator()(const JHit_t& first, const JHit_t& second) const
51  {
52  x = first.getX() - second.getX();
53  y = first.getY() - second.getY();
54  z = first.getZ() - second.getZ();
55  d = sqrt(x*x + y*y + z*z);
56  t = fabs(first.getT() - second.getT());
57 
59  }
60 
61 
62  double TMaxExtra_ns;
63 
64  private:
65  mutable double x;
66  mutable double y;
67  mutable double z;
68  mutable double d;
69  mutable double t;
70  };
71 }
72 
73 #endif
JTRIGGER::JMatch3D::operator()
virtual bool operator()(const JHit_t &first, const JHit_t &second) const
Match operator.
Definition: JMatch3D.hh:50
JTRIGGER::JMatch3D::t
double t
Definition: JMatch3D.hh:69
JTRIGGER::JMatch3D::TMaxExtra_ns
double TMaxExtra_ns
Definition: JMatch3D.hh:62
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JTOOLS::getInverseSpeedOfLight
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
JConstants.hh
JTOOLS::getIndexOfRefraction
double getIndexOfRefraction()
Get average index of refraction of water.
Definition: JConstants.hh:111
JTRIGGER::JMatch3D
3D match criterion.
Definition: JMatch3D.hh:29
JTRIGGER::JMatch3D::d
double d
Definition: JMatch3D.hh:68
JMatch.hh
JTRIGGER::JMatch3D::JMatch3D
JMatch3D(const double Tmax_ns=0.0)
Constructor.
Definition: JMatch3D.hh:38
JTRIGGER::JMatch3D::y
double y
Definition: JMatch3D.hh:66
JTRIGGER::JMatch3D::x
double x
Definition: JMatch3D.hh:65
JTRIGGER
Checksum.
Definition: JSupport/JSupport.hh:35
JTRIGGER::JMatch3D::z
double z
Definition: JMatch3D.hh:67
JLANG::JClonable
Template class for object cloning.
Definition: JClonable.hh:20