Jpp
Public Member Functions | Protected Attributes | Friends | List of all members
JGEOMETRY3D::JTrack3D Class Reference

3D track. More...

#include <JTrack3D.hh>

Inheritance diagram for JGEOMETRY3D::JTrack3D:
JGEOMETRY3D::JAxis3D JGEOMETRY3D::JTime JGEOMETRY3D::JPosition3D JGEOMETRY3D::JDirection3D JGEOMETRY3D::JVector3D JGEOMETRY3D::JVersor3D JMATH::JMath< JVector3D > JMATH::JMath< JVersor3D > JGEOMETRY3D::JTrack3E

Public Member Functions

 JTrack3D ()
 Default constructor. More...
 
 JTrack3D (const JAxis3D &axis, const JTime &t0)
 Constructor. More...
 
 JTrack3D (const JVector3D &pos, const JVersor3D &dir, const JTime &t0)
 Constructor. More...
 
 JTrack3D (const JVertex3D &vertex, const JVersor3D &dir)
 Constructor. More...
 
JVertex3D getVertex () const
 Get vertex of this track. More...
 
void move (const double step, const double velocity)
 Move vertex along this track with given velocity. More...
 
double getT (const JVector3D &pos) const
 Get arrival time of Cherenkov light at given position. More...
 
JVersor3D getDirection (const JVector3D &pos) const
 Get photon direction of Cherenkov light on PMT. More...
 
double getDot (const JAxis3D &axis) const
 Get cosine angle of impact of Cherenkov light on PMT. More...
 
double getDot (const JVector3D &pos) const
 Get cosine angle of emission of Cherenkov light on PMT. More...
 
double getT () const
 Get time. More...
 
JTimeadd (const JTime &value)
 Addition operator. More...
 
JTimesub (const JTime &value)
 Subtraction operator. More...
 
const JAxis3DgetAxis () const
 Get axis. More...
 
void setAxis (const JAxis3D &axis)
 Set axis. More...
 
JAxis3Dnegate ()
 Negate axis. More...
 
void move (const double step)
 Move vertex along this axis. More...
 
double getIntersection (const JVector3D &pos) const
 Get longitudinal position along axis of position of closest approach with given position. More...
 
double getIntersection (const JAxis3D &axis, const double precision=1.0e-8) const
 Get longitudinal position along axis of position of closest approach with given axis. More...
 
double getDistanceSquared (const JVector3D &pos) const
 Get distance squared. More...
 
double getDistance (const JVector3D &pos) const
 Get distance. More...
 
JAxis3Drotate (const JRotation3D &R)
 Rotate axis. More...
 
JAxis3Drotate (const JRotation3X &R)
 Rotate around X-axis. More...
 
JAxis3Drotate (const JRotation3Y &R)
 Rotate around Y-axis. More...
 
JAxis3Drotate (const JRotation3Z &R)
 Rotate around Z-axis. More...
 
JAxis3Drotate (const JQuaternion3D &Q)
 Rotate axis. More...
 
JAxis3Drotate_back (const JRotation3D &R)
 Rotate back axis. More...
 
JAxis3Drotate_back (const JRotation3X &R)
 Rotate back around X-axis. More...
 
JAxis3Drotate_back (const JRotation3Y &R)
 Rotate back around Y-axis. More...
 
JAxis3Drotate_back (const JRotation3Z &R)
 Rotate back around Z-axis. More...
 
JPosition3Drotate_back (const JQuaternion3D &Q)
 Rotate back. More...
 
JDirection3Drotate_back (const JQuaternion3D &Q)
 Rotate back. More...
 
void transform (const JAxis3D &axis)
 Transform axis to reference frame of given axis. More...
 
void transform (const JRotation3D &R, const JVector3D &pos)
 Transform axis. More...
 
void transform (const JTransformation3D &T)
 Transform axis. More...
 
JVector3Dtransform (const JMatrix3D &T)
 Transform. More...
 
JVector3Dtransform (const JMatrix3D &T)
 Transform. More...
 
JDirection3Dtransform (const JMatrix3D &T)
 Transform. More...
 
void transform_back (const JRotation3D &R, const JVector3D &pos)
 Transform back axis. More...
 
void transform_back (const JTransformation3D &T)
 Transform back axis. More...
 
double getDot (const JAngle3D &angle) const
 Get dot product. More...
 
double getDot (const JAngle3D &angle) const
 Get dot product. More...
 
double getDot (const JVersor3D &dir) const
 Get dot product. More...
 
double getDot (const JVersor3Z &dir) const
 Get dot product. More...
 
double getDot (const JAngle3D &angle) const
 Get dot product. More...
 
double getDot (const JVersor3Z &dir) const
 Get dot product. More...
 
double getDot (const JVersor3D &versor) const
 Get dot product. More...
 
const JPosition3DgetPosition () const
 Get position. More...
 
JPosition3DgetPosition ()
 Get position. More...
 
void setPosition (const JVector3D &pos)
 Set position. More...
 
 operator JAngle3D () const
 Type conversion operator. More...
 
 operator JAngle3D () const
 Type conversion operator. More...
 
 operator JVersor3D () const
 Type conversion operator. More...
 
 operator JVector2D () const
 Type conversion operator. More...
 
double getX () const
 Get x position. More...
 
double getY () const
 Get y position. More...
 
double getZ () const
 Get z position. More...
 
JVector3Dadd (const JVector3D &vector)
 Add vector. More...
 
JVector3Dsub (const JVector3D &vector)
 Subtract vector. More...
 
JVector3Dmul (const double factor)
 Scale vector. More...
 
JVector3Dmul (const JSecond_t &object)
 Multiply with object. More...
 
JVersor3Dmul (const JSecond_t &object)
 Multiply with object. More...
 
JVector3Ddiv (const double factor)
 Scale vector. More...
 
bool equals (const JVector3D &vector, const double precision=std::numeric_limits< double >::min()) const
 Check equality. More...
 
bool equals (const JVersor3D &versor, const double precision=std::numeric_limits< double >::min()) const
 Check equality. More...
 
double getLengthSquared () const
 Get length squared. More...
 
double getLength () const
 Get length. More...
 
JVector3Dcross (const JVector3D &first, const JVector3D &second)
 Get cross product. More...
 
const JDirection3DgetDirection () const
 Get direction. More...
 
JDirection3DgetDirection ()
 Get direction. More...
 
void setDirection (const JDirection3D &dir)
 Set direction. More...
 
 operator JVector3D () const
 Type conversion operator. More...
 
double getDX () const
 Get x direction. More...
 
double getDY () const
 Get y direction. More...
 
double getDZ () const
 Get z direction. More...
 
double getTheta () const
 Get theta angle. More...
 
double getPhi () const
 Get phi angle. More...
 
JVersor3Dnormalise ()
 Normalise versor. More...
 
JTimenegate ()
 Prefix unary minus. More...
 
JTimeadd (const JTime &value)
 Addition operator. More...
 
JTimesub (const JTime &value)
 Subtraction operator. More...
 
JTimemul (const double value)
 Multiplication operator. More...
 
JTimediv (const double value)
 Division operator. More...
 
double getT () const
 Get time. More...
 

Protected Attributes

double __x
 
double __y
 
double __z
 
double __dx
 
double __dy
 
double __dz
 
double __t
 

Friends

std::istream & operator>> (std::istream &in, JTrack3D &track)
 Read track from input. More...
 
std::ostream & operator<< (std::ostream &out, const JTrack3D &track)
 Write track to output. More...
 
JReaderoperator>> (JReader &in, JTrack3D &track)
 Read track from input. More...
 
JWriteroperator<< (JWriter &out, const JTrack3D &track)
 Write track to output. More...
 

Detailed Description

3D track.

Definition at line 30 of file JTrack3D.hh.

Constructor & Destructor Documentation

◆ JTrack3D() [1/4]

JGEOMETRY3D::JTrack3D::JTrack3D ( )
inline

Default constructor.

Definition at line 47 of file JTrack3D.hh.

47  :
48  JAxis3D(),
49  JTime ()
50  {}

◆ JTrack3D() [2/4]

JGEOMETRY3D::JTrack3D::JTrack3D ( const JAxis3D axis,
const JTime t0 
)
inline

Constructor.

Parameters
axistrack axis
t0time at vertex

Definition at line 59 of file JTrack3D.hh.

60  :
61  JAxis3D(axis),
62  JTime (t0)
63  {}

◆ JTrack3D() [3/4]

JGEOMETRY3D::JTrack3D::JTrack3D ( const JVector3D pos,
const JVersor3D dir,
const JTime t0 
)
inline

Constructor.

Parameters
posposition
dirdirection
t0time at vertex

Definition at line 73 of file JTrack3D.hh.

75  :
76  JAxis3D(pos, dir),
77  JTime (t0)
78  {}

◆ JTrack3D() [4/4]

JGEOMETRY3D::JTrack3D::JTrack3D ( const JVertex3D vertex,
const JVersor3D dir 
)
inline

Constructor.

Parameters
vertexvertex
dirdirection

Definition at line 87 of file JTrack3D.hh.

88  :
89  JAxis3D(vertex.getPosition(), dir),
90  JTime (vertex.getT())
91  {}

Member Function Documentation

◆ getVertex()

JVertex3D JGEOMETRY3D::JTrack3D::getVertex ( ) const
inline

Get vertex of this track.

Returns
vertex

Definition at line 99 of file JTrack3D.hh.

100  {
101  return JVertex3D(getPosition(), getT());
102  }

◆ move() [1/2]

void JGEOMETRY3D::JTrack3D::move ( const double  step,
const double  velocity 
)
inline

Move vertex along this track with given velocity.

Parameters
stepstep
velocityvelocity

Definition at line 112 of file JTrack3D.hh.

113  {
114  JAxis3D::move(step);
115 
116  __t += step / velocity;
117  }

◆ getT() [1/3]

double JGEOMETRY3D::JTrack3D::getT ( const JVector3D pos) const
inline

Get arrival time of Cherenkov light at given position.

Parameters
posposition [m]
Returns
time [ns]

Definition at line 126 of file JTrack3D.hh.

127  {
128  using namespace JTOOLS;
129 
130  JPosition3D D(pos);
131 
132  D.sub(this->getPosition());
133 
134  const double dz = D.getDot(this->getDirection());
135  const double rt = sqrt(D.getLengthSquared() - dz*dz);
136 
137  return this->getT() + (dz + rt * getKappaC()) * getInverseSpeedOfLight();
138  }

◆ getDirection() [1/3]

JVersor3D JGEOMETRY3D::JTrack3D::getDirection ( const JVector3D pos) const
inline

Get photon direction of Cherenkov light on PMT.

Parameters
posPMT position
Returns
direction

Definition at line 147 of file JTrack3D.hh.

148  {
149  using namespace JTOOLS;
150 
151  JPosition3D D(pos);
152 
153  D.sub(this->getPosition());
154 
155  const double dz = D.getDot(this->getDirection());
156  const double R = sqrt(D.getLengthSquared() - dz*dz);
157 
158  D.sub(JPosition3D(this->getDirection()) * (dz - R/getTanThetaC()));
159 
160  return JDirection3D(D);
161  }

◆ getDot() [1/9]

double JGEOMETRY3D::JTrack3D::getDot ( const JAxis3D axis) const
inline

Get cosine angle of impact of Cherenkov light on PMT.

Parameters
axisPMT axis
Returns
cosine angle of impact

Definition at line 170 of file JTrack3D.hh.

171  {
172  return getDirection(axis.getPosition()).getDot(axis.getDirection());
173  }

◆ getDot() [2/9]

double JGEOMETRY3D::JTrack3D::getDot ( const JVector3D pos) const
inline

Get cosine angle of emission of Cherenkov light on PMT.

Parameters
posPMT position
Returns
cosine angle of impact

Definition at line 182 of file JTrack3D.hh.

183  {
184  return JDirection3D(pos - getPosition()).getDot(getDirection());
185  }

◆ getT() [2/3]

double JGEOMETRY3D::JTime::getT
inline

Get time.

Returns
time

Definition at line 121 of file JGeometry3D/JTime.hh.

122  {
123  return __t;
124  }

◆ add() [1/3]

JTime& JGEOMETRY3D::JTime::add
inline

Addition operator.

Parameters
valuetime
Returns
time

Definition at line 66 of file JGeometry3D/JTime.hh.

67  {
68  __t += value.getT();
69 
70  return *this;
71  }

◆ sub() [1/3]

JTime& JGEOMETRY3D::JTime::sub
inline

Subtraction operator.

Parameters
valuetime
Returns
time

Definition at line 80 of file JGeometry3D/JTime.hh.

81  {
82  __t -= value.getT();
83 
84  return *this;
85  }

◆ getAxis()

const JAxis3D& JGEOMETRY3D::JAxis3D::getAxis ( ) const
inlineinherited

Get axis.

Returns
axis

Definition at line 109 of file JAxis3D.hh.

110  {
111  return *this;
112  }

◆ setAxis()

void JGEOMETRY3D::JAxis3D::setAxis ( const JAxis3D axis)
inlineinherited

Set axis.

Parameters
axisaxis

Definition at line 120 of file JAxis3D.hh.

121  {
122  *this = axis;
123  }

◆ negate() [1/2]

JAxis3D& JGEOMETRY3D::JAxis3D::negate ( )
inlineinherited

Negate axis.

Returns
this axis

Definition at line 131 of file JAxis3D.hh.

132  {
133  static_cast<JPosition3D&> (*this).negate();
134  static_cast<JDirection3D&>(*this).negate();
135 
136  return *this;
137  }

◆ move() [2/2]

void JGEOMETRY3D::JAxis3D::move ( const double  step)
inlineinherited

Move vertex along this axis.

Parameters
stepstep

Definition at line 145 of file JAxis3D.hh.

146  {
147  getPosition() += step * JPosition3D(getDirection());
148  }

◆ getIntersection() [1/2]

double JGEOMETRY3D::JAxis3D::getIntersection ( const JVector3D pos) const
inlineinherited

Get longitudinal position along axis of position of closest approach with given position.

Parameters
posposition
Returns
longitudinal position

Definition at line 157 of file JAxis3D.hh.

158  {
159  JPosition3D D(pos);
160 
161  D.sub(this->getPosition());
162 
163  return D.getDot(this->getDirection());
164  }

◆ getIntersection() [2/2]

double JGEOMETRY3D::JAxis3D::getIntersection ( const JAxis3D axis,
const double  precision = 1.0e-8 
) const
inlineinherited

Get longitudinal position along axis of position of closest approach with given axis.


If the axes are paralel, this position corresponds to the vertex of the given axis.

Parameters
axisaxis
precisionprecision
Returns
longitudinal position

Definition at line 175 of file JAxis3D.hh.

176  {
177  JPosition3D pos(getPosition ());
178  JDirection3D dir(getDirection());
179 
180  const JRotation3D R(axis.getDirection());
181 
182  // offset this position with position of given axis
183 
184  pos.sub(axis.getPosition());
185 
186  // rotate along given axis
187 
188  pos.rotate(R);
189  dir.rotate(R);
190 
191  // longitudinal position at minimal distance of approach
192 
193  const double alpha = pos.getX() * dir.getDX() + pos.getY() * dir.getDY();
194  const double beta = dir.getDX() * dir.getDX() + dir.getDY() * dir.getDY();
195 
196  return (fabs(beta) > precision ? -alpha/beta : -pos.getZ());
197  }

◆ getDistanceSquared()

double JGEOMETRY3D::JAxis3D::getDistanceSquared ( const JVector3D pos) const
inlineinherited

Get distance squared.

Parameters
posposition
Returns
square of distance

Definition at line 206 of file JAxis3D.hh.

207  {
208  JPosition3D D(pos);
209 
210  D.sub(this->getPosition());
211 
212  const double dz = D.getDot(this->getDirection());
213 
214  return D.getLengthSquared() - dz*dz;
215  }

◆ getDistance()

double JGEOMETRY3D::JAxis3D::getDistance ( const JVector3D pos) const
inlineinherited

Get distance.

Parameters
pososition
Returns
distance

Definition at line 224 of file JAxis3D.hh.

225  {
226  return sqrt(this->getDistanceSquared(pos));
227  }

◆ rotate() [1/5]

JAxis3D& JGEOMETRY3D::JAxis3D::rotate ( const JRotation3D R)
inlineinherited

Rotate axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 236 of file JAxis3D.hh.

237  {
238  static_cast<JPosition3D&> (*this).rotate(R);
239  static_cast<JDirection3D&>(*this).rotate(R);
240 
241  return *this;
242  }

◆ rotate() [2/5]

JAxis3D& JGEOMETRY3D::JAxis3D::rotate ( const JRotation3X R)
inlineinherited

Rotate around X-axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 266 of file JAxis3D.hh.

267  {
268  static_cast<JPosition3D&> (*this).rotate(R);
269  static_cast<JDirection3D&>(*this).rotate(R);
270 
271  return *this;
272  }

◆ rotate() [3/5]

JAxis3D& JGEOMETRY3D::JAxis3D::rotate ( const JRotation3Y R)
inlineinherited

Rotate around Y-axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 296 of file JAxis3D.hh.

297  {
298  static_cast<JPosition3D&> (*this).rotate(R);
299  static_cast<JDirection3D&>(*this).rotate(R);
300 
301  return *this;
302  }

◆ rotate() [4/5]

JAxis3D& JGEOMETRY3D::JAxis3D::rotate ( const JRotation3Z R)
inlineinherited

Rotate around Z-axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 326 of file JAxis3D.hh.

327  {
328  static_cast<JPosition3D&> (*this).rotate(R);
329  static_cast<JDirection3D&>(*this).rotate(R);
330 
331  return *this;
332  }

◆ rotate() [5/5]

JAxis3D& JGEOMETRY3D::JAxis3D::rotate ( const JQuaternion3D Q)
inlineinherited

Rotate axis.

Parameters
Qquaternion
Returns
this axis

Definition at line 356 of file JAxis3D.hh.

357  {
358  static_cast<JPosition3D&> (*this).rotate(Q);
359  static_cast<JDirection3D&>(*this).rotate(Q);
360 
361  return *this;
362  }

◆ rotate_back() [1/6]

JAxis3D& JGEOMETRY3D::JAxis3D::rotate_back ( const JRotation3D R)
inlineinherited

Rotate back axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 251 of file JAxis3D.hh.

252  {
253  static_cast<JPosition3D&> (*this).rotate_back(R);
254  static_cast<JDirection3D&>(*this).rotate_back(R);
255 
256  return *this;
257  }

◆ rotate_back() [2/6]

JAxis3D& JGEOMETRY3D::JAxis3D::rotate_back ( const JRotation3X R)
inlineinherited

Rotate back around X-axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 281 of file JAxis3D.hh.

282  {
283  static_cast<JPosition3D&> (*this).rotate_back(R);
284  static_cast<JDirection3D&>(*this).rotate_back(R);
285 
286  return *this;
287  }

◆ rotate_back() [3/6]

JAxis3D& JGEOMETRY3D::JAxis3D::rotate_back ( const JRotation3Y R)
inlineinherited

Rotate back around Y-axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 311 of file JAxis3D.hh.

312  {
313  static_cast<JPosition3D&> (*this).rotate_back(R);
314  static_cast<JDirection3D&>(*this).rotate_back(R);
315 
316  return *this;
317  }

◆ rotate_back() [4/6]

JAxis3D& JGEOMETRY3D::JAxis3D::rotate_back ( const JRotation3Z R)
inlineinherited

Rotate back around Z-axis.

Parameters
Rrotation matrix
Returns
his axis

Definition at line 341 of file JAxis3D.hh.

342  {
343  static_cast<JPosition3D&> (*this).rotate_back(R);
344  static_cast<JDirection3D&>(*this).rotate_back(R);
345 
346  return *this;
347  }

◆ rotate_back() [5/6]

JPosition3D& JGEOMETRY3D::JPosition3D::rotate_back ( const JQuaternion3D Q)
inlineinherited

Rotate back.

Parameters
Qquaternion
Returns
this position

Definition at line 311 of file JPosition3D.hh.

312  {
313  Q.rotate_back(__x, __y, __z);
314 
315  return *this;
316  }

◆ rotate_back() [6/6]

JDirection3D& JGEOMETRY3D::JDirection3D::rotate_back ( const JQuaternion3D Q)
inlineinherited

Rotate back.

Parameters
Qquaternion
Returns
this position

Definition at line 319 of file JDirection3D.hh.

320  {
321  Q.rotate_back(__dx, __dy, __dz);
322 
323  return *this;
324  }

◆ transform() [1/6]

void JGEOMETRY3D::JAxis3D::transform ( const JAxis3D axis)
inlineinherited

Transform axis to reference frame of given axis.

Parameters
axisaxis

Definition at line 370 of file JAxis3D.hh.

371  {
372  JRotation3D R (axis.getDirection());
373  JPosition3D pos(axis.getPosition ());
374 
375  transform(R, pos.rotate(R));
376  }

◆ transform() [2/6]

void JGEOMETRY3D::JAxis3D::transform ( const JRotation3D R,
const JVector3D pos 
)
inlineinherited

Transform axis.

The final position and direction are obtained as follows:

  1. rotation of the position and the direction according rotation matrix (R);
  2. offset position with position of origin in rotated system (pos);
  3. rotation of position and direction around z-axis, such that final position is in x-z plane;
Parameters
Rrotation matrix
posposition of origin

Definition at line 390 of file JAxis3D.hh.

392  {
393  JPosition3D& u = getPosition ();
395 
396  // rotate axis to system such that direction is along z-axis
397 
398  u.rotate(R);
399  v.rotate(R);
400 
401  // offset with respect to origin
402 
403  u.sub(pos);
404 
405  // rotate axis to x-z plane such that position is in x-z plane
406 
407  const double phi = atan2(u.getY(), u.getX());
408 
409  const JRotation3Z r(-phi);
410 
411  u.rotate(r);
412  v.rotate(r);
413  }

◆ transform() [3/6]

void JGEOMETRY3D::JAxis3D::transform ( const JTransformation3D T)
inlineinherited

Transform axis.

Parameters
Ttransformation

Definition at line 448 of file JAxis3D.hh.

449  {
451  }

◆ transform() [4/6]

JVector3D& JGEOMETRY3D::JVector3D::transform
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this vector

Definition at line 205 of file JVector3D.hh.

206  {
207  T.transform(__x, __y, __z);
208 
209  return *this;
210  }

◆ transform() [5/6]

JVector3D& JGEOMETRY3D::JVector3D::transform ( const JMatrix3D T)
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this vector

Definition at line 205 of file JVector3D.hh.

206  {
207  T.transform(__x, __y, __z);
208 
209  return *this;
210  }

◆ transform() [6/6]

JDirection3D& JGEOMETRY3D::JDirection3D::transform ( const JMatrix3D T)
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this direction

Definition at line 161 of file JDirection3D.hh.

162  {
163  T.transform(__dx, __dy, __dz);
164 
165  normalise();
166 
167  return *this;
168  }

◆ transform_back() [1/2]

void JGEOMETRY3D::JAxis3D::transform_back ( const JRotation3D R,
const JVector3D pos 
)
inlineinherited

Transform back axis.

The final position and direction are obtained as follows:

  1. offset position with position pos;
  2. rotation of position and direction according matrix R;
Parameters
Rrotation matrix
posposition of origin (before rotation)

Definition at line 426 of file JAxis3D.hh.

428  {
429  JPosition3D& u = getPosition ();
431 
432  // offset with respect to origin
433 
434  u.add(pos);
435 
436  // rotate back axis to system with original particle direction
437 
438  u.rotate_back(R);
439  v.rotate_back(R);
440  }

◆ transform_back() [2/2]

void JGEOMETRY3D::JAxis3D::transform_back ( const JTransformation3D T)
inlineinherited

Transform back axis.

Parameters
Ttransformation

Definition at line 459 of file JAxis3D.hh.

460  {
462  }

◆ getDot() [3/9]

double JGEOMETRY3D::JDirection3D::getDot
inlineinherited

Get dot product.

Parameters
angleangle
Returns
dot product

Definition at line 333 of file JDirection3D.hh.

334  {
335  return
336  getDX() * angle.getDX() +
337  getDY() * angle.getDY() +
338  getDZ() * angle.getDZ();
339  }

◆ getDot() [4/9]

double JGEOMETRY3D::JPosition3D::getDot ( const JAngle3D angle) const
inlineinherited

Get dot product.

Parameters
angleangle
Returns
dot product

Definition at line 377 of file JPosition3D.hh.

378  {
379  return
380  getX() * angle.getDX() +
381  getY() * angle.getDY() +
382  getZ() * angle.getDZ();
383  }

◆ getDot() [5/9]

double JGEOMETRY3D::JPosition3D::getDot ( const JVersor3D dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 392 of file JPosition3D.hh.

393  {
394  return
395  getX() * dir.getDX() +
396  getY() * dir.getDY() +
397  getZ() * dir.getDZ();
398  }

◆ getDot() [6/9]

double JGEOMETRY3D::JPosition3D::getDot ( const JVersor3Z dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 407 of file JPosition3D.hh.

408  {
409  return
410  getX() * dir.getDX() +
411  getY() * dir.getDY() +
412  getZ() * dir.getDZ();
413  }

◆ getDot() [7/9]

double JGEOMETRY3D::JDirection3D::getDot ( const JAngle3D angle) const
inlineinherited

Get dot product.

Parameters
angleangle
Returns
dot product

Definition at line 333 of file JDirection3D.hh.

334  {
335  return
336  getDX() * angle.getDX() +
337  getDY() * angle.getDY() +
338  getDZ() * angle.getDZ();
339  }

◆ getDot() [8/9]

double JGEOMETRY3D::JDirection3D::getDot ( const JVersor3Z dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 363 of file JDirection3D.hh.

364  {
365  return
366  getDX() * dir.getDX() +
367  getDY() * dir.getDY() +
368  getDZ() * dir.getDZ();
369  }

◆ getDot() [9/9]

double JGEOMETRY3D::JVersor3D::getDot ( const JVersor3D versor) const
inlineinherited

Get dot product.

Parameters
versorversor
Returns
dot product

Definition at line 152 of file JVersor3D.hh.

153  {
154  return
155  getDX() * versor.getDX() +
156  getDY() * versor.getDY() +
157  getDZ() * versor.getDZ();
158  }

◆ getPosition() [1/2]

const JPosition3D& JGEOMETRY3D::JPosition3D::getPosition ( ) const
inlineinherited

Get position.

Returns
position

Definition at line 129 of file JPosition3D.hh.

130  {
131  return static_cast<const JPosition3D&>(*this);
132  }

◆ getPosition() [2/2]

JPosition3D& JGEOMETRY3D::JPosition3D::getPosition ( )
inlineinherited

Get position.

Returns
position

Definition at line 140 of file JPosition3D.hh.

141  {
142  return static_cast<JPosition3D&>(*this);
143  }

◆ setPosition()

void JGEOMETRY3D::JPosition3D::setPosition ( const JVector3D pos)
inlineinherited

Set position.

Parameters
posposition

Definition at line 151 of file JPosition3D.hh.

152  {
153  static_cast<JVector3D&>(*this) = pos;
154  }

◆ operator JAngle3D() [1/2]

JGEOMETRY3D::JPosition3D::operator JAngle3D ( ) const
inlineinherited

Type conversion operator.

Returns
angle

Definition at line 162 of file JPosition3D.hh.

163  {
164  return JAngle3D(getX(), getY(), getZ());
165  }

◆ operator JAngle3D() [2/2]

JGEOMETRY3D::JDirection3D::operator JAngle3D ( ) const
inlineinherited

Type conversion operator.

Returns
angle

Definition at line 138 of file JDirection3D.hh.

139  {
140  return JAngle3D(getDX(), getDY(), getDZ());
141  }

◆ operator JVersor3D()

JGEOMETRY3D::JPosition3D::operator JVersor3D ( ) const
inlineinherited

Type conversion operator.

Returns
direction

Definition at line 173 of file JPosition3D.hh.

174  {
175  return JVersor3D(getX(), getY(), getZ());
176  }

◆ operator JVector2D()

JGEOMETRY3D::JVector3D::operator JVector2D ( ) const
inlineinherited

Type conversion operator.

Returns
JVector2D

Definition at line 82 of file JVector3D.hh.

83  {
84  return JVector2D(this->getX(), this->getY());
85  }

◆ getX()

double JGEOMETRY3D::JVector3D::getX ( ) const
inlineinherited

Get x position.

Returns
x position

Definition at line 93 of file JVector3D.hh.

94  {
95  return __x;
96  }

◆ getY()

double JGEOMETRY3D::JVector3D::getY ( ) const
inlineinherited

Get y position.

Returns
y position

Definition at line 103 of file JVector3D.hh.

104  {
105  return __y;
106  }

◆ getZ()

double JGEOMETRY3D::JVector3D::getZ ( ) const
inlineinherited

Get z position.

Returns
z position

Definition at line 114 of file JVector3D.hh.

115  {
116  return __z;
117  }

◆ add() [2/3]

JVector3D& JGEOMETRY3D::JVector3D::add ( const JVector3D vector)
inlineinherited

Add vector.

Parameters
vectorvector
Returns
this vector

Definition at line 141 of file JVector3D.hh.

142  {
143  __x += vector.getX();
144  __y += vector.getY();
145  __z += vector.getZ();
146 
147  return *this;
148  }

◆ sub() [2/3]

JVector3D& JGEOMETRY3D::JVector3D::sub ( const JVector3D vector)
inlineinherited

Subtract vector.

Parameters
vectorvector
Returns
this vector

Definition at line 157 of file JVector3D.hh.

158  {
159  __x -= vector.getX();
160  __y -= vector.getY();
161  __z -= vector.getZ();
162 
163  return *this;
164  }

◆ mul() [1/4]

JVector3D& JGEOMETRY3D::JVector3D::mul ( const double  factor)
inlineinherited

Scale vector.

Parameters
factormultiplication factor
Returns
this vector

Definition at line 173 of file JVector3D.hh.

174  {
175  __x *= factor;
176  __y *= factor;
177  __z *= factor;
178 
179  return *this;
180  }

◆ mul() [2/4]

JVector3D & JMATH::JMath< JVector3D , JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }

◆ mul() [3/4]

JVersor3D & JMATH::JMath< JVersor3D , JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }

◆ div() [1/2]

JVector3D& JGEOMETRY3D::JVector3D::div ( const double  factor)
inlineinherited

Scale vector.

Parameters
factordivision factor
Returns
this vector

Definition at line 189 of file JVector3D.hh.

190  {
191  __x /= factor;
192  __y /= factor;
193  __z /= factor;
194 
195  return *this;
196  }

◆ equals() [1/2]

bool JGEOMETRY3D::JVector3D::equals ( const JVector3D vector,
const double  precision = std::numeric_limits<double>::min() 
) const
inlineinherited

Check equality.

Parameters
vectorvector
Returns
true if vectors are equal; else false

Definition at line 219 of file JVector3D.hh.

221  {
222  return (fabs(getX() - vector.getX()) <= precision &&
223  fabs(getY() - vector.getY()) <= precision &&
224  fabs(getZ() - vector.getZ()) <= precision);
225  }

◆ equals() [2/2]

bool JGEOMETRY3D::JVersor3D::equals ( const JVersor3D versor,
const double  precision = std::numeric_limits<double>::min() 
) const
inlineinherited

Check equality.

Parameters
versorversor
Returns
true if versors are equal; else false

Definition at line 77 of file JVersor3D.hh.

79  {
80  return (fabs(getDX() - versor.getDX()) <= precision &&
81  fabs(getDY() - versor.getDY()) <= precision &&
82  fabs(getDZ() - versor.getDZ()) <= precision);
83  }

◆ getLengthSquared()

double JGEOMETRY3D::JVector3D::getLengthSquared ( ) const
inlineinherited

Get length squared.

Returns
square of length

Definition at line 233 of file JVector3D.hh.

234  {
235  return getX()*getX() + getY()*getY() + getZ()*getZ();
236  }

◆ getLength()

double JGEOMETRY3D::JVector3D::getLength ( ) const
inlineinherited

Get length.

Returns
length

Definition at line 244 of file JVector3D.hh.

245  {
246  return sqrt(getLengthSquared());
247  }

◆ cross()

JVector3D& JGEOMETRY3D::JVector3D::cross ( const JVector3D first,
const JVector3D second 
)
inlineinherited

Get cross product.

Note that this vector should not overlap with the first or second vector,

Parameters
firstfirst vector
secondsecond vector
Returns
this vector

Definition at line 297 of file JVector3D.hh.

299  {
300  __x = first .getY() * second.getZ() - second.getY() * first .getZ();
301  __y = second.getX() * first .getZ() - first .getX() * second.getZ();
302  __z = first .getX() * second.getY() - second.getX() * first .getY();
303 
304  return *this;
305  }

◆ getDirection() [2/3]

const JDirection3D& JGEOMETRY3D::JDirection3D::getDirection ( ) const
inlineinherited

Get direction.

Returns
direction

Definition at line 106 of file JDirection3D.hh.

107  {
108  return static_cast<const JDirection3D&>(*this);
109  }

◆ getDirection() [3/3]

JDirection3D& JGEOMETRY3D::JDirection3D::getDirection ( )
inlineinherited

Get direction.

Returns
direction

Definition at line 117 of file JDirection3D.hh.

118  {
119  return static_cast<JDirection3D&>(*this);
120  }

◆ setDirection()

void JGEOMETRY3D::JDirection3D::setDirection ( const JDirection3D dir)
inlineinherited

Set direction.

Parameters
dirdirection

Definition at line 128 of file JDirection3D.hh.

129  {
130  static_cast<JDirection3D&>(*this) = dir;
131  }

◆ operator JVector3D()

JGEOMETRY3D::JDirection3D::operator JVector3D ( ) const
inlineinherited

Type conversion operator.

Returns
position

Definition at line 149 of file JDirection3D.hh.

150  {
151  return JVector3D(getDX(), getDY(), getDZ());
152  }

◆ getDX()

double JGEOMETRY3D::JVersor3D::getDX ( ) const
inlineinherited

Get x direction.

Returns
x direction

Definition at line 91 of file JVersor3D.hh.

92  {
93  return __dx;
94  }

◆ getDY()

double JGEOMETRY3D::JVersor3D::getDY ( ) const
inlineinherited

Get y direction.

Returns
y direction

Definition at line 102 of file JVersor3D.hh.

103  {
104  return __dy;
105  }

◆ getDZ()

double JGEOMETRY3D::JVersor3D::getDZ ( ) const
inlineinherited

Get z direction.

Returns
z direction

Definition at line 113 of file JVersor3D.hh.

114  {
115  return __dz;
116  }

◆ getTheta()

double JGEOMETRY3D::JVersor3D::getTheta ( ) const
inlineinherited

Get theta angle.

Returns
theta angle [rad]

Definition at line 124 of file JVersor3D.hh.

125  {
126  if (__dz > +1.0)
127  return 0.0;
128  else if (__dz < -1.0)
129  return JTOOLS::PI;
130  else
131  return acos(__dz);
132  }

◆ getPhi()

double JGEOMETRY3D::JVersor3D::getPhi ( ) const
inlineinherited

Get phi angle.

Returns
phi angle [rad]

Definition at line 140 of file JVersor3D.hh.

141  {
142  return atan2(__dy, __dx);
143  }

◆ normalise()

JVersor3D& JGEOMETRY3D::JVersor3D::normalise ( )
inlineinherited

Normalise versor.

This operation may set the result to the unit z-vector.

Returns
this versor

Definition at line 167 of file JVersor3D.hh.

168  {
169  const double v = sqrt(getDX()*getDX() + getDY()*getDY() + getDZ()*getDZ());
170 
171  if (v != 0.0) {
172  __dx /= v;
173  __dy /= v;
174  __dz /= v;
175  }
176 
177  return *this;
178  }

◆ negate() [2/2]

JTime& JGEOMETRY3D::JTime::negate ( )
inlineinherited

Prefix unary minus.

Returns
time

Definition at line 52 of file JGeometry3D/JTime.hh.

53  {
54  __t = -__t;
55 
56  return *this;
57  }

◆ add() [3/3]

JTime& JGEOMETRY3D::JTime::add ( const JTime value)
inlineinherited

Addition operator.

Parameters
valuetime
Returns
time

Definition at line 66 of file JGeometry3D/JTime.hh.

67  {
68  __t += value.getT();
69 
70  return *this;
71  }

◆ sub() [3/3]

JTime& JGEOMETRY3D::JTime::sub ( const JTime value)
inlineinherited

Subtraction operator.

Parameters
valuetime
Returns
time

Definition at line 80 of file JGeometry3D/JTime.hh.

81  {
82  __t -= value.getT();
83 
84  return *this;
85  }

◆ mul() [4/4]

JTime& JGEOMETRY3D::JTime::mul ( const double  value)
inlineinherited

Multiplication operator.

Parameters
valuemultiplication factor
Returns
time

Definition at line 94 of file JGeometry3D/JTime.hh.

95  {
96  __t *= value;
97 
98  return *this;
99  }

◆ div() [2/2]

JTime& JGEOMETRY3D::JTime::div ( const double  value)
inlineinherited

Division operator.

Parameters
valuemultiplication factor
Returns
time

Definition at line 108 of file JGeometry3D/JTime.hh.

109  {
110  __t /= value;
111 
112  return *this;
113  }

◆ getT() [3/3]

double JGEOMETRY3D::JTime::getT ( ) const
inlineinherited

Get time.

Returns
time

Definition at line 121 of file JGeometry3D/JTime.hh.

122  {
123  return __t;
124  }

Friends And Related Function Documentation

◆ operator>> [1/2]

std::istream& operator>> ( std::istream &  in,
JTrack3D track 
)
friend

Read track from input.

Parameters
ininput stream
tracktrack
Returns
input stream

Definition at line 195 of file JTrack3D.hh.

196  {
197  in >> static_cast<JAxis3D&>(track);
198  in >> static_cast<JTime&> (track);
199 
200  return in;
201  }

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  out,
const JTrack3D track 
)
friend

Write track to output.

Parameters
outoutput stream
tracktrack
Returns
output stream

Definition at line 211 of file JTrack3D.hh.

212  {
213  out << static_cast<const JAxis3D&>(track);
214  out << ' ';
215  out << static_cast<const JTime&> (track);
216 
217  return out;
218  }

◆ operator>> [2/2]

JReader& operator>> ( JReader in,
JTrack3D track 
)
friend

Read track from input.

Parameters
inreader
tracktrack
Returns
reader

Definition at line 228 of file JTrack3D.hh.

229  {
230  in >> static_cast<JAxis3D&>(track);
231  in >> static_cast<JTime&> (track);
232 
233  return in;
234  }

◆ operator<< [2/2]

JWriter& operator<< ( JWriter out,
const JTrack3D track 
)
friend

Write track to output.

Parameters
outwriter
tracktrack
Returns
writer

Definition at line 244 of file JTrack3D.hh.

245  {
246  out << static_cast<const JAxis3D&>(track);
247  out << static_cast<const JTime&> (track);
248 
249  return out;
250  }

Member Data Documentation

◆ __x

double JGEOMETRY3D::JVector3D::__x
protectedinherited

Definition at line 308 of file JVector3D.hh.

◆ __y

double JGEOMETRY3D::JVector3D::__y
protectedinherited

Definition at line 309 of file JVector3D.hh.

◆ __z

double JGEOMETRY3D::JVector3D::__z
protectedinherited

Definition at line 310 of file JVector3D.hh.

◆ __dx

double JGEOMETRY3D::JVersor3D::__dx
protectedinherited

Definition at line 181 of file JVersor3D.hh.

◆ __dy

double JGEOMETRY3D::JVersor3D::__dy
protectedinherited

Definition at line 182 of file JVersor3D.hh.

◆ __dz

double JGEOMETRY3D::JVersor3D::__dz
protectedinherited

Definition at line 183 of file JVersor3D.hh.

◆ __t

double JGEOMETRY3D::JTime::__t
protectedinherited

Definition at line 188 of file JGeometry3D/JTime.hh.


The documentation for this class was generated from the following file:
JGEOMETRY3D::JVersor3D::getDZ
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:113
JGEOMETRY3D::JVersor3D::__dz
double __dz
Definition: JVersor3D.hh:183
JGEOMETRY3D::JVersor3D::__dx
double __dx
Definition: JVersor3D.hh:181
JGEOMETRY3D::JVector3D::__y
double __y
Definition: JVector3D.hh:309
JGEOMETRY3D::JTime::JTime
JTime()
Default constructor.
Definition: JGeometry3D/JTime.hh:32
JGEOMETRY3D::JVertex3D
3D vertex.
Definition: JVertex3D.hh:31
JGEOMETRY3D::JVector3D::getLengthSquared
double getLengthSquared() const
Get length squared.
Definition: JVector3D.hh:233
JGEOMETRY3D::JQuaternion3D::rotate_back
void rotate_back(double &__x, double &__y, double &__z) const
Rotate back.
Definition: JQuaternion3D.hh:668
JGEOMETRY3D::JDirection3D::getDirection
const JDirection3D & getDirection() const
Get direction.
Definition: JDirection3D.hh:106
JGEOMETRY3D::JVector3D::getZ
double getZ() const
Get z position.
Definition: JVector3D.hh:114
JTOOLS::u
double u[N+1]
Definition: JPolint.hh:706
JGEOMETRY3D::JAxis3D::transform
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
Definition: JAxis3D.hh:370
JGEOMETRY3D::JTime::getT
double getT() const
Get time.
Definition: JGeometry3D/JTime.hh:121
JGEOMETRY3D::JPosition3D::JPosition3D
JPosition3D()
Default constructor.
Definition: JPosition3D.hh:47
JGEOMETRY3D::JDirection3D
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JGEOMETRY3D::JVersor3D
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:23
JGEOMETRY3D::JAxis3D::move
void move(const double step)
Move vertex along this axis.
Definition: JAxis3D.hh:145
JGEOMETRY3D::JVector3D
Data structure for vector in three dimensions.
Definition: JVector3D.hh:33
JTOOLS::getInverseSpeedOfLight
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
JGEOMETRY3D::JTime::__t
double __t
Definition: JGeometry3D/JTime.hh:188
JGEOMETRY3D::JPosition3D
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
JGEOMETRY3D::JAngle3D::getDX
double getDX() const
Get x direction.
Definition: JAngle3D.hh:106
JGEOMETRY3D::JVersor3D::getDX
double getDX() const
Get x direction.
Definition: JVersor3D.hh:91
JGEOMETRY3D::JAxis3D::JAxis3D
JAxis3D()
Default constructor.
Definition: JAxis3D.hh:50
JGEOMETRY3D::JTime
Time.
Definition: JGeometry3D/JTime.hh:26
JGEOMETRY3D::JVersor3D::getDY
double getDY() const
Get y direction.
Definition: JVersor3D.hh:102
JGEOMETRY3D::JVersor3D::__dy
double __dy
Definition: JVersor3D.hh:182
JGEOMETRY3D::JRotation3Z
Rotation around Z-axis.
Definition: JRotation3D.hh:85
JTOOLS::v
data_type v[N+1][M+1]
Definition: JPolint.hh:707
JGEOMETRY3D::JAxis3D::getDistanceSquared
double getDistanceSquared(const JVector3D &pos) const
Get distance squared.
Definition: JAxis3D.hh:206
JTOOLS::getTanThetaC
double getTanThetaC()
Get average tangent of Cherenkov angle of water.
Definition: JConstants.hh:133
JGEOMETRY3D::JAxis3D::transform_back
void transform_back(const JRotation3D &R, const JVector3D &pos)
Transform back axis.
Definition: JAxis3D.hh:426
JGEOMETRY3D::JAngle3D
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:31
JGEOMETRY3D::JAngle3D::getDZ
double getDZ() const
Get z direction.
Definition: JAngle3D.hh:128
JGEOMETRY3D::JVersor3D::normalise
JVersor3D & normalise()
Normalise versor.
Definition: JVersor3D.hh:167
JTOOLS::getKappaC
double getKappaC()
Get average kappa of Cherenkov light in water.
Definition: JConstants.hh:166
JGEOMETRY3D::JDirection3D::JDirection3D
JDirection3D()
Default constructor.
Definition: JDirection3D.hh:42
JGEOMETRY3D::JPosition3D::getPosition
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
JGEOMETRY3D::JVector3D::getY
double getY() const
Get y position.
Definition: JVector3D.hh:103
JTOOLS::PI
static const double PI
Constants.
Definition: JConstants.hh:20
JGEOMETRY3D::JAngle3D::getDY
double getDY() const
Get y direction.
Definition: JAngle3D.hh:117
JGEOMETRY3D::JVersor3Z::getDY
double getDY() const
Get y direction.
Definition: JVersor3Z.hh:156
JGEOMETRY3D::JVector3D::__z
double __z
Definition: JVector3D.hh:310
JMATH::JCalculator
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
JTOOLS::r
data_type r[M+1]
Definition: JPolint.hh:709
JGEOMETRY3D::JVector3D::__x
double __x
Definition: JVector3D.hh:308
JGEOMETRY3D::JVector3D::getX
double getX() const
Get x position.
Definition: JVector3D.hh:93
JTOOLS
Auxiliary classes and methods for multi-dimensional interpolations and histograms.
Definition: JAbstractCollection.hh:9
JGEOMETRY3D::JVersor3Z::getDZ
double getDZ() const
Get z direction.
Definition: JVersor3Z.hh:167
JGEOMETRY3D::JVertex3D::getT
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition: JVertex3D.hh:144
JGEOMETRY3D::JRotation3D::getRotation
const JRotation3D & getRotation() const
Get rotation.
Definition: JRotation3D.hh:272
JGEOMETRY3D::JTrack3D::getDot
double getDot(const JAxis3D &axis) const
Get cosine angle of impact of Cherenkov light on PMT.
Definition: JTrack3D.hh:170
JGEOMETRY3D::JRotation3D
Rotation matrix.
Definition: JRotation3D.hh:111
JGEOMETRY3D::JVersor3Z::getDX
double getDX() const
Get x direction.
Definition: JVersor3Z.hh:145
JMATH::JMatrix3D::sub
JMatrix3D & sub(const JMatrix3D &A)
Matrix subtraction.
Definition: JMath/JMatrix3D.hh:192