Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JMatch1D.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JMATCH1D__
2 #define __JTRIGGER__JMATCH1D__
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 with given direction.
13  * \author mdejong
14  */
15 namespace JTRIGGER {}
16 namespace JPP { using namespace JTRIGGER; }
17 
18 namespace JTRIGGER {
19 
23 
24 
25  /**
26  * 1D match criterion.
27  * This match algorithm is intented for muon signals.
28  * It is assumed that the muon direction is along the z-axis.
29  */
30  template<class JHit_t>
31  class JMatch1D :
32  public JClonable< JMatch<JHit_t>, JMatch1D<JHit_t> >
33  {
34  public:
35  /**
36  * Constructor.
37  *
38  * \param roadWidth_m maximal road width [m]
39  * \param Tmax_ns maximal extra time [ns]
40  */
41  JMatch1D(const double roadWidth_m,
42  const double Tmax_ns = 0.0) :
43  RMax_m (roadWidth_m),
44  TMaxExtra_ns(Tmax_ns)
45  {
47  }
48 
49 
50  /**
51  * Match operator.
52  *
53  * \param first hit
54  * \param second hit
55  * \return match result
56  */
57  virtual bool operator()(const JHit_t& first, const JHit_t& second) const
58  {
59  z = first.getZ() - second.getZ();
60  t = fabs(first.getT() - second.getT() - z * getInverseSpeedOfLight());
61 
62  if (t > TMax_ns) {
63  return false;
64  }
65 
66  x = first.getX() - second.getX();
67  y = first.getY() - second.getY();
68  d = sqrt(x*x + y*y);
69 
70  if (d <= 0.5 * RMax_m)
72  else if (d <= RMax_m)
73  return t <= (RMax_m - d) * getTanThetaC() * getInverseSpeedOfLight() + TMaxExtra_ns;
74 
75  return false;
76  }
77 
78 
79  double RMax_m;
80  double TMax_ns;
81  double TMaxExtra_ns;
82 
83  private:
84  mutable double x;
85  mutable double y;
86  mutable double z;
87  mutable double d;
88  mutable double t;
89  };
90 }
91 
92 #endif
1D match criterion.
Definition: JMatch1D.hh:31
double getIndexOfRefraction()
Get average index of refraction of water.
Definition: JConstants.hh:111
double TMaxExtra_ns
Definition: JMatch1D.hh:81
JMatch1D(const double roadWidth_m, const double Tmax_ns=0.0)
Constructor.
Definition: JMatch1D.hh:41
virtual bool operator()(const JHit_t &first, const JHit_t &second) const
Match operator.
Definition: JMatch1D.hh:57
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
Base class for match operations for cluster and hit-preprocessing methods.
Constants.
Template class for object cloning.
Definition: JClonable.hh:20
double getTanThetaC()
Get average tangent of Cherenkov angle of water.
Definition: JConstants.hh:133