Jpp  19.1.0-rc.1
the software that should make you happy
Public Member Functions | Private Attributes | List of all members
JACOUSTICS::JCheck Struct Reference

Auxiliary data structure for final check on event. More...

Public Member Functions

 JCheck (const JHistogram_t &X, const JHistogram_t &Y, const JHistogram_t &Z, const double V, const double Tmax_s, const int Nmin)
 Constructor. More...
 
bool is_valid () const
 Check validity. More...
 
template<class T >
bool operator() (const hit_type &root, T __begin, T __end) const
 Check event. More...
 

Private Attributes

std::vector< JVector3DU
 
const double V
 
const double Dmax_m
 
const int Nmin
 

Detailed Description

Auxiliary data structure for final check on event.

Definition at line 200 of file JBillabong.cc.

Constructor & Destructor Documentation

◆ JCheck()

JACOUSTICS::JCheck::JCheck ( const JHistogram_t X,
const JHistogram_t Y,
const JHistogram_t Z,
const double  V,
const double  Tmax_s,
const int  Nmin 
)
inline

Constructor.

Parameters
Xx-scan
Yy-scan
Zz-scan
Vsound velocity [m/s]
Tmax_smaximal time [s]
Nminminimum number of hits

Definition at line 211 of file JBillabong.cc.

216  :
217  V(V),
218  Dmax_m(Tmax_s * V),
219  Nmin(Nmin)
220  {
221  for (double x = X.getLowerLimit(); x < X.getUpperLimit() + 0.5*X.getBinWidth(); x += X.getBinWidth()) {
222  for (double y = Y.getLowerLimit(); y < Y.getUpperLimit() + 0.5*Y.getBinWidth(); y += Y.getBinWidth()) {
223  for (double z = Z.getLowerLimit(); z < Z.getUpperLimit() + 0.5*Z.getBinWidth(); z += Z.getBinWidth()) {
224  U.push_back(JVector3D(x,y,z));
225  }
226  }
227  }
228  }
Data structure for vector in three dimensions.
Definition: JVector3D.hh:36
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
const double V
Definition: JBillabong.cc:284
std::vector< JVector3D > U
Definition: JBillabong.cc:283
const double Dmax_m
Definition: JBillabong.cc:285
double getBinWidth() const
Get bin width.

Member Function Documentation

◆ is_valid()

bool JACOUSTICS::JCheck::is_valid ( ) const
inline

Check validity.

Returns
true if valid; else false

Definition at line 236 of file JBillabong.cc.

237  {
238  return !U.empty();
239  }

◆ operator()()

template<class T >
bool JACOUSTICS::JCheck::operator() ( const hit_type root,
__begin,
__end 
) const
inline

Check event.

Parameters
rootroot hit
__beginbegin of data
__endend of data
Returns
true if accepted; else false

Definition at line 251 of file JBillabong.cc.

252  {
253  using namespace std;
254  using namespace JPP;
255 
256  for (vector<JVector3D>::const_iterator u = U.begin(); u != U.end(); ++u) {
257 
258  const JVector3D p0 = root.getPosition() + *u; // vertex position
259  const double t0 = root.getToA() * V - u->getLength(); // vertex time
260 
261  int n = 1;
262 
263  for (T p = __begin; p != __end; ++p) {
264 
265  const double t1 = p->getToA() * V - p0.getDistance(*p);
266 
267  if (fabs(t1 - t0) <= Dmax_m) {
268  n += 1;
269  } else if (n + distance(p,__end) == Nmin) {
270  break;
271  }
272  }
273 
274  if (n >= Nmin) {
275  return true;
276  }
277  }
278 
279  return false;
280  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition: JVector3D.hh:270
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
const int n
Definition: JPolint.hh:786
double u[N+1]
Definition: JPolint.hh:865
Definition: root.py:1
Definition: JSTDTypes.hh:14

Member Data Documentation

◆ U

std::vector<JVector3D> JACOUSTICS::JCheck::U
private

Definition at line 283 of file JBillabong.cc.

◆ V

const double JACOUSTICS::JCheck::V
private

Definition at line 284 of file JBillabong.cc.

◆ Dmax_m

const double JACOUSTICS::JCheck::Dmax_m
private

Definition at line 285 of file JBillabong.cc.

◆ Nmin

const int JACOUSTICS::JCheck::Nmin
private

Definition at line 286 of file JBillabong.cc.


The documentation for this struct was generated from the following file: