Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JACOUSTICS::JVelo Struct Reference

Vertex locator. More...

Inheritance diagram for JACOUSTICS::JVelo:
std::vector< JPosition3D >

Public Member Functions

 JVelo (const JAbstractSoundVelocity &V, const JVector3D &center, const double RMax_m, const double Xv_m, const double factor=1.0)
 Constructor.
 
template<class T >
int operator() (const JVertex3D &vx, T __begin, T __end) const
 Check vertex.
 
template<class T >
vertex_type operator() (const JPosition3D &position, const hit_type &root, T __begin, T __end) const
 Update vertex at given position.
 
template<class T >
vertex_type operator() (const hit_type &root, T __begin, T __end, const int numberOfHits=0) const
 Locate vertex.
 

Public Attributes

const JAbstractSoundVelocityV
 
const double Tmax_s
 

Detailed Description

Vertex locator.

Definition at line 275 of file JAcousticsTriggerProcessor.cc.

Constructor & Destructor Documentation

◆ JVelo()

JACOUSTICS::JVelo::JVelo ( const JAbstractSoundVelocity & V,
const JVector3D & center,
const double RMax_m,
const double Xv_m,
const double factor = 1.0 )
inline

Constructor.

Parameters
Vsound velocity
centercenter for generation of vertices
RMax_mradius for generation of vertices [m]
Xv_mstep size for generation of vertices [m]
factormultiplication factor for corresponding time window

Definition at line 287 of file JAcousticsTriggerProcessor.cc.

291 :
292 V(V),
293 Tmax_s(factor * Xv_m / V())
294 {
295 this->push_back(center);
296
297 if (RMax_m > 0.0 && Xv_m > 0.0) {
298 for (double x = 0.5*Xv_m; x <= RMax_m; x += Xv_m) {
299 for (double y = 0.5*Xv_m; y <= RMax_m; y += Xv_m) {
300 if (x*x + y*y <= RMax_m*RMax_m) {
301 this->push_back(JVector3D(center.getX() - x, center.getY() + y, center.getZ()));
302 this->push_back(JVector3D(center.getX() + x, center.getY() + y, center.getZ()));
303 this->push_back(JVector3D(center.getX() - x, center.getY() - y, center.getZ()));
304 this->push_back(JVector3D(center.getX() + x, center.getY() - y, center.getZ()));
305 }
306 }
307 }
308 }
309 }
Data structure for vector in three dimensions.
Definition JVector3D.hh:36
double getY() const
Get y position.
Definition JVector3D.hh:104
double getZ() const
Get z position.
Definition JVector3D.hh:115
double getX() const
Get x position.
Definition JVector3D.hh:94
const JAbstractSoundVelocity & V

Member Function Documentation

◆ operator()() [1/3]

template<class T >
int JACOUSTICS::JVelo::operator() ( const JVertex3D & vx,
T __begin,
T __end ) const
inline

Check vertex.

Parameters
vxvertex
__beginbegin of data
__endend of data
Returns
number of hits

Definition at line 321 of file JAcousticsTriggerProcessor.cc.

322 {
323 const JPosition3D& p0 = vx.getPosition();
324 const double t0 = vx.getT();
325
326 int n0 = 0;
327 double q0 = 0.0;
328
329 for (T p = __begin; p != __end; ++p) {
330
331 const double t1 = p->getToA() - V.getTime(p0.getDistance(p->getPosition()), p0.getZ(), p->getZ());
332
333 if (fabs(t1 - t0) <= Tmax_s) {
334 n0 += 1;
335 q0 += p->getQ();
336 }
337 }
338
339 return n0;
340 }
Data structure for position in three dimensions.
const JPosition3D & getPosition() const
Get position.
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition JVector3D.hh:270
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition JVertex3D.hh:147
virtual double getTime(const double D_m, const double z1, const double z2) const =0
Get propagation time of sound.

◆ operator()() [2/3]

template<class T >
vertex_type JACOUSTICS::JVelo::operator() ( const JPosition3D & position,
const hit_type & root,
T __begin,
T __end ) const
inline

Update vertex at given position.

Parameters
positionposition
rootroot hit
__beginbegin of data
__endend of data
Returns
vertex

Definition at line 353 of file JAcousticsTriggerProcessor.cc.

354 {
355 const JPosition3D& p0 = position;
356 const double t0 = root.getToA() - V.getTime(p0.getDistance(root.getPosition()), p0.getZ(), root.getZ());
357
358 int n0 = 1;
359 double q0 = root.getQ();
360
361 for (T p = __begin; p != __end; ++p) {
362
363 const double t1 = p->getToA() - V.getTime(p0.getDistance(p->getPosition()), p0.getZ(), p->getZ());
364
365 if (fabs(t1 - t0) <= Tmax_s) {
366 n0 += 1;
367 q0 += p->getQ();
368 }
369 }
370
371 return vertex_type(p0, t0, n0, q0);
372 }
Definition root.py:1

◆ operator()() [3/3]

template<class T >
vertex_type JACOUSTICS::JVelo::operator() ( const hit_type & root,
T __begin,
T __end,
const int numberOfHits = 0 ) const
inline

Locate vertex.

Parameters
rootroot hit
__beginbegin of data
__endend of data
numberOfHitsnumber of hits
Returns
vertex

Definition at line 385 of file JAcousticsTriggerProcessor.cc.

386 {
387 vertex_type vertex;
388
389 for (const_iterator i = this->cbegin(); i != this->cend(); ++i) {
390
391 const JPosition3D& p0 = *i;
392 const double t0 = root.getToA() - V.getTime(p0.getDistance(root.getPosition()), p0.getZ(), root.getZ());
393
394 int n0 = 1;
395 double q0 = root.getQ();
396
397 for (T p = __begin; p != __end && n0 + distance(p, __end) >= numberOfHits && n0 + distance(p, __end) >= vertex.N; ++p) {
398
399 const double t1 = p->getToA() - V.getTime(p0.getDistance(p->getPosition()), p0.getZ(), p->getZ());
400
401 if (fabs(t1 - t0) <= Tmax_s) {
402 n0 += 1;
403 q0 += p->getQ();
404 }
405 }
406
407 if (q0 > vertex.Q) {
408 vertex = vertex_type(p0, t0, n0, q0);
409 }
410 }
411
412 return vertex;
413 }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.

Member Data Documentation

◆ V

const JAbstractSoundVelocity& JACOUSTICS::JVelo::V

Definition at line 415 of file JAcousticsTriggerProcessor.cc.

◆ Tmax_s

const double JACOUSTICS::JVelo::Tmax_s

Definition at line 416 of file JAcousticsTriggerProcessor.cc.


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