Jpp  19.1.0
the software that should make you happy
JMatch3B.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JMATCH3B__
2 #define __JTRIGGER__JMATCH3B__
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 
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 JClonable< JMatch<JHit_t>, JMatch3B<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  x(0.0),
49  y(0.0),
50  z(0.0),
51  d(0.0),
52  t(0.0),
53  dmin(0.0),
54  dmax(0.0),
55  d2(0.0)
56  {
57  //
58  // calculation D2 in thesis is wrong, here correct
59  //
60  const double tt2 = getTanThetaC() * getTanThetaC();
61 
62  D0 = roadWidth_m;
63  D1 = roadWidth_m * 2.0;
64  D2 = roadWidth_m * 0.5 * sqrt(tt2 + 10.0 + 9.0/tt2);
65 
66  D02 = D0 * D0;
67  D12 = D1 * D1;
68  D22 = D2 * D2;
69 
70  const double R = roadWidth_m;
71  const double Rs = R * getSinThetaC();
72 
73  R2 = R * R;
74  Rs2 = Rs * Rs;
75  Rst = Rs * getTanThetaC();
76  Rt = R * getTanThetaC();
77  }
78 
79 
80  /**
81  * Match operator.
82  *
83  * \param first hit
84  * \param second hit
85  * \return match result
86  */
87  virtual bool operator()(const JHit_t& first, const JHit_t& second) const override
88  {
89  x = first.getX() - second.getX();
90  y = first.getY() - second.getY();
91  z = first.getZ() - second.getZ();
92  d2 = x*x + y*y + z*z;
93  t = fabs(first.getT() - second.getT());
94 
95  if (d2 < D02)
96  dmax = sqrt(d2) * getIndexOfRefraction();
97  else
98  dmax = sqrt(d2 - Rs2) + Rst;
99 
101  return false;
102  }
103 
104  if (d2 > D22)
105  dmin = sqrt(d2 - R2) - Rt;
106  else if (d2 > D12)
107  dmin = sqrt(d2 - D12);
108  else
109  return true;
110 
111  return t >= dmin * getInverseSpeedOfLight() - TMaxExtra_ns;
112  }
113 
114 
115  double roadWidth_m;
116  double TMaxExtra_ns;
117 
118  private:
119  double D0;
120  double D1;
121  double D2;
122  mutable double x;
123  mutable double y;
124  mutable double z;
125  mutable double d;
126  mutable double t;
127  mutable double dmin;
128  mutable double dmax;
129 
130  double D02;
131  double D12;
132  double D22;
133  double Rs2;
134  double Rst;
135  double Rt;
136  double R2;
137  mutable double d2;
138  };
139 }
140 
141 #endif
Base class for match operations for cluster and hit-preprocessing methods.
Physics constants.
3D match criterion with road width.
Definition: JMatch3B.hh:36
JMatch3B(const double road_width_m, const double Tmax_ns=0.0)
Constructor.
Definition: JMatch3B.hh:44
virtual bool operator()(const JHit_t &first, const JHit_t &second) const override
Match operator.
Definition: JMatch3B.hh:87
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
double getSinThetaC()
Get average sine of Cherenkov angle of water corresponding to group velocity.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
Template class for object cloning.
Definition: JClonable.hh:59