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 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  {
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  * Match operator.
74  *
75  * \param first hit
76  * \param second hit
77  * \return match result
78  */
79  virtual bool operator()(const JHit_t& first, const JHit_t& second) const
80  {
81  x = first.getX() - second.getX();
82  y = first.getY() - second.getY();
83  z = first.getZ() - second.getZ();
84  d2 = x*x + y*y + z*z;
85  t = fabs(first.getT() - second.getT());
86 
87  if (d2 < D02)
88  dmax = sqrt(d2) * getIndexOfRefraction();
89  else
90  dmax = sqrt(d2 - Rs2) + Rst;
91 
93  return false;
94  }
95 
96  if (d2 > D22)
97  dmin = sqrt(d2 - R2) - Rt;
98  else if (d2 > D12)
99  dmin = sqrt(d2 - D12);
100  else
101  return true;
102 
103  return t >= dmin * getInverseSpeedOfLight() - TMaxExtra_ns;
104  }
105 
106 
107  double roadWidth_m;
108  double TMaxExtra_ns;
109 
110  private:
111  double D0;
112  double D1;
113  double D2;
114  mutable double x;
115  mutable double y;
116  mutable double z;
117  mutable double d;
118  mutable double t;
119  mutable double dmin;
120  mutable double dmax;
121 
122  double D02;
123  double D12;
124  double D22;
125  double Rs2;
126  double Rst;
127  double Rt;
128  double R2;
129  mutable double d2;
130  };
131 }
132 
133 #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:79
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
double getSinThetaC()
Get average sine of Cherenkov angle of water.
Definition: JConstants.hh:155
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
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
double getTanThetaC()
Get average tangent of Cherenkov angle of water.
Definition: JConstants.hh:133
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