Jpp  18.2.0
the software that should make you happy
 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 "JPhysics/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  x(0.0),
41  y(0.0),
42  z(0.0),
43  d(0.0),
44  t(0.0)
45  {}
46 
47 
48  /**
49  * Match operator.
50  *
51  * \param first hit
52  * \param second hit
53  * \return match result
54  */
55  virtual bool operator()(const JHit_t& first, const JHit_t& second) const override
56  {
57  x = first.getX() - second.getX();
58  y = first.getY() - second.getY();
59  z = first.getZ() - second.getZ();
60  d = sqrt(x*x + y*y + z*z);
61  t = fabs(first.getT() - second.getT());
62 
64  }
65 
66 
67  double TMaxExtra_ns;
68 
69  private:
70  mutable double x;
71  mutable double y;
72  mutable double z;
73  mutable double d;
74  mutable double t;
75  };
76 }
77 
78 #endif
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
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.
virtual bool operator()(const JHit_t &first, const JHit_t &second) const override
Match operator.
Definition: JMatch3D.hh:55
Template class for object cloning.
Definition: JClonable.hh:20
Physics constants.
double TMaxExtra_ns
Definition: JMatch3D.hh:67
const double getInverseSpeedOfLight()
Get inverse speed of light.
JMatch3D(const double Tmax_ns=0.0)
Constructor.
Definition: JMatch3D.hh:38
3D match criterion.
Definition: JMatch3D.hh:29