Jpp
JMatch3G.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JMATCH3G__
2 #define __JTRIGGER__JMATCH3G__
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 shower 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  * 3G match criterion.
26  * This match algorithm is intented for shower signals.
27  */
28  template<class JHit_t>
29  class JMatch3G :
30  public JClonable< JMatch<JHit_t>, JMatch3G<JHit_t> >
31  {
32  public:
33  /**
34  * Constructor.
35  *
36  * \param Dmax_m maximal distance traveled by photon [m]
37  * \param Tmax_ns maximal extra time [ns]
38  */
39  JMatch3G(const double Dmax_m,
40  const double Tmax_ns = 0.0) :
41  DMax_m (Dmax_m),
42  TMaxExtra_ns(Tmax_ns)
43  {
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
56  {
57  t = fabs(first.getT() - second.getT());
58 
59  if (t > TMax_ns) {
60  return false;
61  }
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 
68  if (d <= 0.5 * DMax_m)
70  else if (d <= DMax_m)
72 
73  return false;
74  }
75 
76 
77  double DMax_m;
78  double TMax_ns;
79  double TMaxExtra_ns;
80 
81  private:
82  mutable double x;
83  mutable double y;
84  mutable double z;
85  mutable double d;
86  mutable double t;
87  };
88 }
89 
90 #endif
JTRIGGER::JMatch3G::y
double y
Definition: JMatch3G.hh:83
JTRIGGER::JMatch3G::x
double x
Definition: JMatch3G.hh:82
JTRIGGER::JMatch3G::z
double z
Definition: JMatch3G.hh:84
JTRIGGER::JMatch3G::TMaxExtra_ns
double TMaxExtra_ns
Definition: JMatch3G.hh:79
JTRIGGER::JMatch3G::TMax_ns
double TMax_ns
Definition: JMatch3G.hh:78
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::JMatch3G::t
double t
Definition: JMatch3G.hh:86
JTRIGGER::JMatch3G
3G match criterion.
Definition: JMatch3G.hh:29
JTRIGGER::JMatch3G::d
double d
Definition: JMatch3G.hh:85
JMatch.hh
JTRIGGER::JMatch3G::JMatch3G
JMatch3G(const double Dmax_m, const double Tmax_ns=0.0)
Constructor.
Definition: JMatch3G.hh:39
JTRIGGER
Checksum.
Definition: JSupport/JSupport.hh:35
JTRIGGER::JMatch3G::operator()
virtual bool operator()(const JHit_t &first, const JHit_t &second) const
Match operator.
Definition: JMatch3G.hh:55
JLANG::JClonable
Template class for object cloning.
Definition: JClonable.hh:20
JTRIGGER::JMatch3G::DMax_m
double DMax_m
Definition: JMatch3G.hh:77