Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 JMatch<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  * Clone object.
45  *
46  * \return match result
47  */
49  {
50  return new JMatch3D<JHit_t>(*this);
51  }
52 
53 
54  /**
55  * Match operator.
56  *
57  * \param first hit
58  * \param second hit
59  * \return match result
60  */
61  virtual bool operator()(const JHit_t& first, const JHit_t& second) const
62  {
63  x = first.getX() - second.getX();
64  y = first.getY() - second.getY();
65  z = first.getZ() - second.getZ();
66  d = sqrt(x*x + y*y + z*z);
67  t = fabs(first.getT() - second.getT());
68 
70  }
71 
72 
73  double TMaxExtra_ns;
74 
75  private:
76  mutable double x;
77  mutable double y;
78  mutable double z;
79  mutable double d;
80  mutable double t;
81  };
82 }
83 
84 #endif
double getIndexOfRefraction()
Get average index of refraction of water.
Definition: JConstants.hh:111
Function object interface for hit matching.
Definition: JMatch.hh:27
virtual bool operator()(const JHit_t &first, const JHit_t &second) const
Match operator.
Definition: JMatch3D.hh:61
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
Base class for match operations inside clusterize methods.
Constants.
JMatch< JHit_t > * clone() const
Clone object.
Definition: JMatch3D.hh:48
double TMaxExtra_ns
Definition: JMatch3D.hh:73
JMatch3D(const double Tmax_ns=0.0)
Constructor.
Definition: JMatch3D.hh:38
3D match criterion.
Definition: JMatch3D.hh:29