Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JMatch3B.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JMATCH3B__
2 #define __JTRIGGER__JMATCH3B__
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 
24 
25 
26  /**
27  * 3D match criterion with road width.
28  * This match algorithm is intented for muon signals.
29  *
30  * B. Bakker, "Trigger studies for the Antares and KM3NeT detector.",
31  * Master thesis, University of Amsterdam.
32  */
33  template<class JHit_t>
34  class JMatch3B :
35  public JMatch<JHit_t>
36  {
37  public:
38  /**
39  * Constructor.
40  *
41  * \param road_width_m maximal road width [m]
42  * \param Tmax_ns maximal extra time [ns]
43  */
44  JMatch3B(const double road_width_m,
45  const double Tmax_ns = 0.0) :
46  roadWidth_m (road_width_m),
47  TMaxExtra_ns(Tmax_ns)
48  {
49  //
50  // calculation D2 in thesis is wrong, here correct
51  //
52  const double tt2 = getTanThetaC() * getTanThetaC();
53 
54  D0 = roadWidth_m;
55  D1 = roadWidth_m * 2.0;
56  D2 = roadWidth_m * 0.5 * sqrt(tt2 + 10.0 + 9.0/tt2);
57 
58  D02 = D0 * D0;
59  D12 = D1 * D1;
60  D22 = D2 * D2;
61 
62  const double R = roadWidth_m;
63  const double Rs = R * getSinThetaC();
64 
65  R2 = R * R;
66  Rs2 = Rs * Rs;
67  Rst = Rs * getTanThetaC();
68  Rt = R * getTanThetaC();
69  }
70 
71 
72  /**
73  * Clone object.
74  *
75  * \return match result
76  */
78  {
79  return new JMatch3B<JHit_t>(*this);
80  }
81 
82 
83  /**
84  * Match operator.
85  *
86  * \param first hit
87  * \param second hit
88  * \return match result
89  */
90  virtual bool operator()(const JHit_t& first, const JHit_t& second) const
91  {
92  x = first.getX() - second.getX();
93  y = first.getY() - second.getY();
94  z = first.getZ() - second.getZ();
95  d2 = x*x + y*y + z*z;
96  t = fabs(first.getT() - second.getT());
97 
98  if (d2 < D02)
99  dmax = sqrt(d2) * getIndexOfRefraction();
100  else
101  dmax = sqrt(d2 - Rs2) + Rst;
102 
104  return false;
105  }
106 
107  if (d2 > D22)
108  dmin = sqrt(d2 - R2) - Rt;
109  else if (d2 > D12)
110  dmin = sqrt(d2 - D12);
111  else
112  return true;
113 
114  return t >= dmin * getInverseSpeedOfLight() - TMaxExtra_ns;
115  }
116 
117 
118  double roadWidth_m;
119  double TMaxExtra_ns;
120 
121  private:
122  double D0;
123  double D1;
124  double D2;
125  mutable double x;
126  mutable double y;
127  mutable double z;
128  mutable double d;
129  mutable double t;
130  mutable double dmin;
131  mutable double dmax;
132 
133  double D02;
134  double D12;
135  double D22;
136  double Rs2;
137  double Rst;
138  double Rt;
139  double R2;
140  mutable double d2;
141  };
142 }
143 
144 #endif
double getIndexOfRefraction()
Get average index of refraction of water.
Definition: JConstants.hh:111
virtual bool operator()(const JHit_t &first, const JHit_t &second) const
Match operator.
Definition: JMatch3B.hh:90
Function object interface for hit matching.
Definition: JMatch.hh:27
JMatch< JHit_t > * clone() const
Clone object.
Definition: JMatch3B.hh:77
double getSinThetaC()
Get average sine of Cherenkov angle of water.
Definition: JConstants.hh:144
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
Base class for match operations inside clusterize methods.
Constants.
double getTanThetaC()
Get average tangent of Cherenkov angle of water.
Definition: JConstants.hh:122
JMatch3B(const double road_width_m, const double Tmax_ns=0.0)
Constructor.
Definition: JMatch3B.hh:44
3D match criterion with road width.
Definition: JMatch3B.hh:34