Jpp  17.1.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
JGEOMETRY3D::JTrack3EY Class Reference

3D track with energy and Bjorken Y. More...

#include <JTrack3EY.hh>

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

Public Member Functions

 JTrack3EY ()
 Default constructor. More...
 
 JTrack3EY (const JTrack3E &track, const double Y)
 Constructor. More...
 
 JTrack3EY (const JVector3D &pos, const JVersor3D &dir, const JTime &t0, const double E, const double Y)
 Constructor. More...
 
 JTrack3EY (const JVertex3D &vertex, const JVersor3D &dir, const double E, const double Y)
 Constructor. More...
 
double getBjY () const
 Get Bjorken Y. More...
 
double getE () const
 Get energy. More...
 
void setE (const double E)
 Set energy. More...
 
void move (const double step, const double velocity, const JGeane &geane)
 Move vertex along this track with given velocity. More...
 
void move (const double step, const double velocity)
 Move vertex along this track with given velocity. More...
 
void move (const double step)
 Move vertex along this axis. More...
 
JVertex3D getVertex () const
 Get vertex of this track. More...
 
double getT (const JVector3D &pos) const
 Get arrival time of Cherenkov light at given position. More...
 
double getT () const
 Get time. More...
 
JVersor3D getDirection (const JVector3D &pos) const
 Get photon direction of Cherenkov light on PMT. More...
 
const JDirection3DgetDirection () const
 Get direction. More...
 
JDirection3DgetDirection ()
 Get direction. 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 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 JAxis3DgetAxis () const
 Get axis. More...
 
void setAxis (const JAxis3D &axis)
 Set axis. More...
 
JAxis3Dnegate ()
 Negate axis. More...
 
JTimenegate ()
 Prefix unary minus. 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...
 
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...
 
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...
 
JTimeadd (const JTime &value)
 Addition operator. More...
 
JVector3Dsub (const JVector3D &vector)
 Subtract vector. More...
 
JTimesub (const JTime &value)
 Subtraction operator. More...
 
JVector3Dmul (const double factor)
 Scale vector. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
JTimemul (const double value)
 Multiplication operator. More...
 
JVector3Ddiv (const double factor)
 Scale vector. More...
 
JTimediv (const double value)
 Division operator. 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...
 
JVector3DgetCross (const JVector3D &first, const JVector3D &second)
 Get cross product. More...
 
JVersor3DgetCross (const JVersor3D &first, const JVersor3D &second)
 Get cross product. 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...
 

Protected Attributes

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

Friends

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

Detailed Description

3D track with energy and Bjorken Y.

Definition at line 29 of file JTrack3EY.hh.

Constructor & Destructor Documentation

JGEOMETRY3D::JTrack3EY::JTrack3EY ( )
inline

Default constructor.

Definition at line 36 of file JTrack3EY.hh.

36  :
37  JTrack3E(),
38  __Y(0.0)
39  {}
JTrack3E()
Default constructor.
Definition: JTrack3E.hh:37
JGEOMETRY3D::JTrack3EY::JTrack3EY ( const JTrack3E track,
const double  Y 
)
inline

Constructor.

Parameters
tracktrack
YBjorken Y

Definition at line 48 of file JTrack3EY.hh.

49  :
50  JTrack3E(track),
51  __Y(Y)
52  {}
JTrack3E()
Default constructor.
Definition: JTrack3E.hh:37
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
JGEOMETRY3D::JTrack3EY::JTrack3EY ( const JVector3D pos,
const JVersor3D dir,
const JTime t0,
const double  E,
const double  Y 
)
inline

Constructor.

Parameters
posposition
dirdirection
t0time at vertex
Eenergy at vertex
YBjorken Y

Definition at line 64 of file JTrack3EY.hh.

68  :
69  JTrack3E(pos, dir, t0, E),
70  __Y(Y)
71  {}
then usage E
Definition: JMuonPostfit.sh:35
JTrack3E()
Default constructor.
Definition: JTrack3E.hh:37
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
JGEOMETRY3D::JTrack3EY::JTrack3EY ( const JVertex3D vertex,
const JVersor3D dir,
const double  E,
const double  Y 
)
inline

Constructor.

Parameters
vertexvertex
dirdirection
Eenergy at vertex
YBjorken Y

Definition at line 82 of file JTrack3EY.hh.

85  :
86  JTrack3E(vertex, dir, E),
87  __Y(Y)
88  {}
then usage E
Definition: JMuonPostfit.sh:35
JTrack3E()
Default constructor.
Definition: JTrack3E.hh:37
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y

Member Function Documentation

double JGEOMETRY3D::JTrack3EY::getBjY ( ) const
inline

Get Bjorken Y.

Returns
Bjorken Y

Definition at line 96 of file JTrack3EY.hh.

97  {
98  return __Y;
99  }
double JGEOMETRY3D::JTrack3E::getE ( ) const
inlineinherited

Get energy.

Returns
energy

Definition at line 93 of file JTrack3E.hh.

94  {
95  return __E;
96  }
void JGEOMETRY3D::JTrack3E::setE ( const double  E)
inlineinherited

Set energy.

Parameters
Eenergy

Definition at line 104 of file JTrack3E.hh.

105  {
106  __E = E;
107  }
then usage E
Definition: JMuonPostfit.sh:35
void JGEOMETRY3D::JTrack3E::move ( const double  step,
const double  velocity,
const JGeane geane 
)
inlineinherited

Move vertex along this track with given velocity.

Parameters
stepstep
velocityvelocity
geaneenergy loss

Definition at line 117 of file JTrack3E.hh.

118  {
119  JTrack3D::move(step, velocity);
120 
121  __E = geane(__E, step);
122  }
void move(const double step, const double velocity)
Move vertex along this track with given velocity.
Definition: JTrack3D.hh:112
void JGEOMETRY3D::JTrack3D::move ( const double  step,
const double  velocity 
)
inlineinherited

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  }
void move(const double step)
Move vertex along this axis.
Definition: JAxis3D.hh:134
void JGEOMETRY3D::JAxis3D::move ( const double  step)
inlineinherited

Move vertex along this axis.

Parameters
stepstep

Definition at line 134 of file JAxis3D.hh.

135  {
136  getPosition() += step * JPosition3D(getDirection());
137  }
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
JPosition3D()
Default constructor.
Definition: JPosition3D.hh:48
JVertex3D JGEOMETRY3D::JTrack3D::getVertex ( ) const
inlineinherited

Get vertex of this track.

Returns
vertex

Definition at line 99 of file JTrack3D.hh.

100  {
101  return JVertex3D(getPosition(), getT());
102  }
double getT() const
Get time.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
double JGEOMETRY3D::JTrack3D::getT ( const JVector3D pos) const
inlineinherited

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 JPHYSICS;
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  }
double getT() const
Get time.
double getKappaC()
Get average R-dependence of arrival time of Cherenkov light (a.k.a.
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
const double getInverseSpeedOfLight()
Get inverse speed of light.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
double JGEOMETRY3D::JTime::getT ( ) const
inlineinherited

Get time.

Returns
time

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

123  {
124  return __t;
125  }
JVersor3D JGEOMETRY3D::JTrack3D::getDirection ( const JVector3D pos) const
inlineinherited

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 JPHYSICS;
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  }
JDirection3D()
Default constructor.
Definition: JDirection3D.hh:43
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
JPosition3D()
Default constructor.
Definition: JPosition3D.hh:48
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
const JDirection3D& JGEOMETRY3D::JDirection3D::getDirection ( ) const
inlineinherited

Get direction.

Returns
direction

Definition at line 107 of file JDirection3D.hh.

108  {
109  return static_cast<const JDirection3D&>(*this);
110  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D& JGEOMETRY3D::JDirection3D::getDirection ( )
inlineinherited

Get direction.

Returns
direction

Definition at line 118 of file JDirection3D.hh.

119  {
120  return static_cast<JDirection3D&>(*this);
121  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
double JGEOMETRY3D::JTrack3D::getDot ( const JAxis3D axis) const
inlineinherited

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  }
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
double getDot(const JAxis3D &axis) const
Get cosine angle of impact of Cherenkov light on PMT.
Definition: JTrack3D.hh:170
double JGEOMETRY3D::JTrack3D::getDot ( const JVector3D pos) const
inlineinherited

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  }
JDirection3D()
Default constructor.
Definition: JDirection3D.hh:43
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
double JGEOMETRY3D::JPosition3D::getDot ( const JAngle3D angle) const
inlineinherited

Get dot product.

Parameters
angleangle
Returns
dot product

Definition at line 378 of file JPosition3D.hh.

379  {
380  return
381  getX() * angle.getDX() +
382  getY() * angle.getDY() +
383  getZ() * angle.getDZ();
384  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double getDX() const
Get x direction.
Definition: JAngle3D.hh:108
double getDZ() const
Get z direction.
Definition: JAngle3D.hh:130
double getDY() const
Get y direction.
Definition: JAngle3D.hh:119
double JGEOMETRY3D::JPosition3D::getDot ( const JVersor3D dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 393 of file JPosition3D.hh.

394  {
395  return
396  getX() * dir.getDX() +
397  getY() * dir.getDY() +
398  getZ() * dir.getDZ();
399  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
double JGEOMETRY3D::JPosition3D::getDot ( const JVersor3Z dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 408 of file JPosition3D.hh.

409  {
410  return
411  getX() * dir.getDX() +
412  getY() * dir.getDY() +
413  getZ() * dir.getDZ();
414  }
double getDY() const
Get y direction.
Definition: JVersor3Z.hh:158
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getDX() const
Get x direction.
Definition: JVersor3Z.hh:147
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getDZ() const
Get z direction.
Definition: JVersor3Z.hh:169
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double JGEOMETRY3D::JDirection3D::getDot ( const JAngle3D angle) const
inlineinherited

Get dot product.

Parameters
angleangle
Returns
dot product

Definition at line 335 of file JDirection3D.hh.

336  {
337  return
338  getDX() * angle.getDX() +
339  getDY() * angle.getDY() +
340  getDZ() * angle.getDZ();
341  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
double getDX() const
Get x direction.
Definition: JAngle3D.hh:108
double getDZ() const
Get z direction.
Definition: JAngle3D.hh:130
double getDY() const
Get y direction.
Definition: JAngle3D.hh:119
double JGEOMETRY3D::JDirection3D::getDot ( const JVersor3Z dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 365 of file JDirection3D.hh.

366  {
367  return
368  getDX() * dir.getDX() +
369  getDY() * dir.getDY() +
370  getDZ() * dir.getDZ();
371  }
double getDY() const
Get y direction.
Definition: JVersor3Z.hh:158
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
double getDX() const
Get x direction.
Definition: JVersor3Z.hh:147
double getDZ() const
Get z direction.
Definition: JVersor3Z.hh:169
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
double JGEOMETRY3D::JVersor3D::getDot ( const JVersor3D versor) const
inlineinherited

Get dot product.

Parameters
versorversor
Returns
dot product

Definition at line 156 of file JVersor3D.hh.

157  {
158  return
159  getDX() * versor.getDX() +
160  getDY() * versor.getDY() +
161  getDZ() * versor.getDZ();
162  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
const JAxis3D& JGEOMETRY3D::JAxis3D::getAxis ( ) const
inlineinherited

Get axis.

Returns
axis

Definition at line 98 of file JAxis3D.hh.

99  {
100  return *this;
101  }
void JGEOMETRY3D::JAxis3D::setAxis ( const JAxis3D axis)
inlineinherited

Set axis.

Parameters
axisaxis

Definition at line 109 of file JAxis3D.hh.

110  {
111  *this = axis;
112  }
JAxis3D& JGEOMETRY3D::JAxis3D::negate ( )
inlineinherited

Negate axis.

Returns
this axis

Definition at line 120 of file JAxis3D.hh.

121  {
122  static_cast<JPosition3D&> (*this).negate();
123  static_cast<JDirection3D&>(*this).negate();
124 
125  return *this;
126  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JVersor3D & negate()
Negate versor.
Definition: JVersor3D.hh:64
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JVector3D & negate()
Negate vector.
Definition: JVector3D.hh:126
JTime& JGEOMETRY3D::JTime::negate ( )
inlineinherited

Prefix unary minus.

Returns
time

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

54  {
55  __t = -__t;
56 
57  return *this;
58  }
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 146 of file JAxis3D.hh.

147  {
148  JPosition3D D(pos);
149 
150  D.sub(this->getPosition());
151 
152  return D.getDot(this->getDirection());
153  }
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
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 164 of file JAxis3D.hh.

165  {
166  JPosition3D pos(getPosition ());
167  JDirection3D dir(getDirection());
168 
169  const JRotation3D R(axis.getDirection());
170 
171  // offset this position with position of given axis
172 
173  pos.sub(axis.getPosition());
174 
175  // rotate along given axis
176 
177  pos.rotate(R);
178  dir.rotate(R);
179 
180  // longitudinal position at minimal distance of approach
181 
182  const double alpha = pos.getX() * dir.getDX() + pos.getY() * dir.getDY();
183  const double beta = dir.getDX() * dir.getDX() + dir.getDY() * dir.getDY();
184 
185  return (fabs(beta) > precision ? -alpha/beta : -pos.getZ());
186  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
const JDirection3D & getDirection() const
Get direction.
Rotation matrix.
Definition: JRotation3D.hh:111
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
double JGEOMETRY3D::JAxis3D::getDistanceSquared ( const JVector3D pos) const
inlineinherited

Get distance squared.

Parameters
posposition
Returns
square of distance

Definition at line 195 of file JAxis3D.hh.

196  {
197  JPosition3D D(pos);
198 
199  D.sub(this->getPosition());
200 
201  const double dz = D.getDot(this->getDirection());
202 
203  return D.getLengthSquared() - dz*dz;
204  }
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
double JGEOMETRY3D::JAxis3D::getDistance ( const JVector3D pos) const
inlineinherited

Get distance.

Parameters
pososition
Returns
distance

Definition at line 213 of file JAxis3D.hh.

214  {
215  return sqrt(this->getDistanceSquared(pos));
216  }
double getDistanceSquared(const JVector3D &pos) const
Get distance squared.
Definition: JAxis3D.hh:195
JAxis3D& JGEOMETRY3D::JAxis3D::rotate ( const JRotation3D R)
inlineinherited

Rotate axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 225 of file JAxis3D.hh.

226  {
227  static_cast<JPosition3D&> (*this).rotate(R);
228  static_cast<JDirection3D&>(*this).rotate(R);
229 
230  return *this;
231  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:186
JAxis3D& JGEOMETRY3D::JAxis3D::rotate ( const JRotation3X R)
inlineinherited

Rotate around X-axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 255 of file JAxis3D.hh.

256  {
257  static_cast<JPosition3D&> (*this).rotate(R);
258  static_cast<JDirection3D&>(*this).rotate(R);
259 
260  return *this;
261  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:186
JAxis3D& JGEOMETRY3D::JAxis3D::rotate ( const JRotation3Y R)
inlineinherited

Rotate around Y-axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 285 of file JAxis3D.hh.

286  {
287  static_cast<JPosition3D&> (*this).rotate(R);
288  static_cast<JDirection3D&>(*this).rotate(R);
289 
290  return *this;
291  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:186
JAxis3D& JGEOMETRY3D::JAxis3D::rotate ( const JRotation3Z R)
inlineinherited

Rotate around Z-axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 315 of file JAxis3D.hh.

316  {
317  static_cast<JPosition3D&> (*this).rotate(R);
318  static_cast<JDirection3D&>(*this).rotate(R);
319 
320  return *this;
321  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:186
JAxis3D& JGEOMETRY3D::JAxis3D::rotate ( const JQuaternion3D Q)
inlineinherited

Rotate axis.

Parameters
Qquaternion
Returns
this axis

Definition at line 345 of file JAxis3D.hh.

346  {
347  static_cast<JPosition3D&> (*this).rotate(Q);
348  static_cast<JDirection3D&>(*this).rotate(Q);
349 
350  return *this;
351  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:186
JAxis3D& JGEOMETRY3D::JAxis3D::rotate_back ( const JRotation3D R)
inlineinherited

Rotate back axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 240 of file JAxis3D.hh.

241  {
242  static_cast<JPosition3D&> (*this).rotate_back(R);
243  static_cast<JDirection3D&>(*this).rotate_back(R);
244 
245  return *this;
246  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:200
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JAxis3D& JGEOMETRY3D::JAxis3D::rotate_back ( const JRotation3X R)
inlineinherited

Rotate back around X-axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 270 of file JAxis3D.hh.

271  {
272  static_cast<JPosition3D&> (*this).rotate_back(R);
273  static_cast<JDirection3D&>(*this).rotate_back(R);
274 
275  return *this;
276  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:200
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JAxis3D& JGEOMETRY3D::JAxis3D::rotate_back ( const JRotation3Y R)
inlineinherited

Rotate back around Y-axis.

Parameters
Rrotation matrix
Returns
this axis

Definition at line 300 of file JAxis3D.hh.

301  {
302  static_cast<JPosition3D&> (*this).rotate_back(R);
303  static_cast<JDirection3D&>(*this).rotate_back(R);
304 
305  return *this;
306  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:200
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JAxis3D& JGEOMETRY3D::JAxis3D::rotate_back ( const JRotation3Z R)
inlineinherited

Rotate back around Z-axis.

Parameters
Rrotation matrix
Returns
his axis

Definition at line 330 of file JAxis3D.hh.

331  {
332  static_cast<JPosition3D&> (*this).rotate_back(R);
333  static_cast<JDirection3D&>(*this).rotate_back(R);
334 
335  return *this;
336  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:200
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JPosition3D& JGEOMETRY3D::JPosition3D::rotate_back ( const JQuaternion3D Q)
inlineinherited

Rotate back.

Parameters
Qquaternion
Returns
this position

Definition at line 312 of file JPosition3D.hh.

313  {
314  Q.rotate_back(__x, __y, __z);
315 
316  return *this;
317  }
void rotate_back(double &__x, double &__y, double &__z) const
Rotate back.
JDirection3D& JGEOMETRY3D::JDirection3D::rotate_back ( const JQuaternion3D Q)
inlineinherited

Rotate back.

Parameters
Qquaternion
Returns
this position

Definition at line 321 of file JDirection3D.hh.

322  {
323  Q.rotate_back(__dx, __dy, __dz);
324 
325  return *this;
326  }
void rotate_back(double &__x, double &__y, double &__z) const
Rotate back.
void JGEOMETRY3D::JAxis3D::transform ( const JAxis3D axis)
inlineinherited

Transform axis to reference frame of given axis.

Parameters
axisaxis

Definition at line 359 of file JAxis3D.hh.

360  {
361  JRotation3D R (axis.getDirection());
362  JPosition3D pos(axis.getPosition ());
363 
364  transform(R, pos.rotate(R));
365  }
const JDirection3D & getDirection() const
Get direction.
Rotation matrix.
Definition: JRotation3D.hh:111
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
Definition: JAxis3D.hh:359
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
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 379 of file JAxis3D.hh.

381  {
382  JPosition3D& u = getPosition ();
384 
385  // rotate axis to system such that direction is along z-axis
386 
387  u.rotate(R);
388  v.rotate(R);
389 
390  // offset with respect to origin
391 
392  u.sub(pos);
393 
394  // rotate axis to x-z plane such that position is in x-z plane
395 
396  const double phi = atan2(u.getY(), u.getX());
397 
398  const JRotation3Z r(-phi);
399 
400  u.rotate(r);
401  v.rotate(r);
402  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
const JDirection3D & getDirection() const
Get direction.
data_type r[M+1]
Definition: JPolint.hh:779
Rotation around Z-axis.
Definition: JRotation3D.hh:85
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Definition: JVector3D.hh:158
JDirection3D & rotate(const JRotation3D &R)
Rotate.
double getY() const
Get y position.
Definition: JVector3D.hh:104
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
double getX() const
Get x position.
Definition: JVector3D.hh:94
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
data_type v[N+1][M+1]
Definition: JPolint.hh:777
double u[N+1]
Definition: JPolint.hh:776
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:186
void JGEOMETRY3D::JAxis3D::transform ( const JTransformation3D T)
inlineinherited

Transform axis.

Parameters
Ttransformation

Definition at line 437 of file JAxis3D.hh.

438  {
440  }
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
Definition: JAxis3D.hh:359
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
const JRotation3D & getRotation() const
Get rotation.
Definition: JRotation3D.hh:272
JVector3D& JGEOMETRY3D::JVector3D::transform ( const JMatrix3D T)
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this vector

Definition at line 206 of file JVector3D.hh.

207  {
208  T.transform(__x, __y, __z);
209 
210  return *this;
211  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JDirection3D& JGEOMETRY3D::JDirection3D::transform ( const JMatrix3D T)
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this direction

Definition at line 163 of file JDirection3D.hh.

164  {
165  T.transform(__dx, __dy, __dz);
166 
167  normalise();
168 
169  return *this;
170  }
JVersor3D & normalise()
Normalise versor.
Definition: JVersor3D.hh:192
do set_variable OUTPUT_DIRECTORY $WORKDIR T
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 415 of file JAxis3D.hh.

417  {
418  JPosition3D& u = getPosition ();
420 
421  // offset with respect to origin
422 
423  u.add(pos);
424 
425  // rotate back axis to system with original particle direction
426 
427  u.rotate_back(R);
428  v.rotate_back(R);
429  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:200
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
data_type v[N+1][M+1]
Definition: JPolint.hh:777
double u[N+1]
Definition: JPolint.hh:776
JVector3D & add(const JVector3D &vector)
Add vector.
Definition: JVector3D.hh:142
void JGEOMETRY3D::JAxis3D::transform_back ( const JTransformation3D T)
inlineinherited

Transform back axis.

Parameters
Ttransformation

Definition at line 448 of file JAxis3D.hh.

449  {
451  }
void transform_back(const JRotation3D &R, const JVector3D &pos)
Transform back axis.
Definition: JAxis3D.hh:415
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
const JRotation3D & getRotation() const
Get rotation.
Definition: JRotation3D.hh:272
const JPosition3D& JGEOMETRY3D::JPosition3D::getPosition ( ) const
inlineinherited

Get position.

Returns
position

Definition at line 130 of file JPosition3D.hh.

131  {
132  return static_cast<const JPosition3D&>(*this);
133  }
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JPosition3D& JGEOMETRY3D::JPosition3D::getPosition ( )
inlineinherited

Get position.

Returns
position

Definition at line 141 of file JPosition3D.hh.

142  {
143  return static_cast<JPosition3D&>(*this);
144  }
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
void JGEOMETRY3D::JPosition3D::setPosition ( const JVector3D pos)
inlineinherited

Set position.

Parameters
posposition

Definition at line 152 of file JPosition3D.hh.

153  {
154  static_cast<JVector3D&>(*this) = pos;
155  }
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
JGEOMETRY3D::JPosition3D::operator JAngle3D ( ) const
inlineinherited

Type conversion operator.

Returns
angle

Definition at line 163 of file JPosition3D.hh.

164  {
165  return JAngle3D(getX(), getY(), getZ());
166  }
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:33
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
JGEOMETRY3D::JDirection3D::operator JAngle3D ( ) const
inlineinherited

Type conversion operator.

Returns
angle

Definition at line 140 of file JDirection3D.hh.

141  {
142  return JAngle3D(getDX(), getDY(), getDZ());
143  }
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:33
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
JGEOMETRY3D::JPosition3D::operator JVersor3D ( ) const
inlineinherited

Type conversion operator.

Returns
direction

Definition at line 174 of file JPosition3D.hh.

175  {
176  return JVersor3D(getX(), getY(), getZ());
177  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:26
double getZ() const
Get z position.
Definition: JVector3D.hh:115
JGEOMETRY3D::JVector3D::operator JVector2D ( ) const
inlineinherited

Type conversion operator.

Returns
JVector2D

Definition at line 83 of file JVector3D.hh.

84  {
85  return JVector2D(this->getX(), this->getY());
86  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double JGEOMETRY3D::JVector3D::getX ( ) const
inlineinherited

Get x position.

Returns
x position

Definition at line 94 of file JVector3D.hh.

95  {
96  return __x;
97  }
double JGEOMETRY3D::JVector3D::getY ( ) const
inlineinherited

Get y position.

Returns
y position

Definition at line 104 of file JVector3D.hh.

105  {
106  return __y;
107  }
double JGEOMETRY3D::JVector3D::getZ ( ) const
inlineinherited

Get z position.

Returns
z position

Definition at line 115 of file JVector3D.hh.

116  {
117  return __z;
118  }
JVector3D& JGEOMETRY3D::JVector3D::add ( const JVector3D vector)
inlineinherited

Add vector.

Parameters
vectorvector
Returns
this vector

Definition at line 142 of file JVector3D.hh.

143  {
144  __x += vector.getX();
145  __y += vector.getY();
146  __z += vector.getZ();
147 
148  return *this;
149  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
JTime& JGEOMETRY3D::JTime::add ( const JTime value)
inlineinherited

Addition operator.

Parameters
valuetime
Returns
time

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

68  {
69  __t += value.getT();
70 
71  return *this;
72  }
double getT() const
Get time.
JVector3D& JGEOMETRY3D::JVector3D::sub ( const JVector3D vector)
inlineinherited

Subtract vector.

Parameters
vectorvector
Returns
this vector

Definition at line 158 of file JVector3D.hh.

159  {
160  __x -= vector.getX();
161  __y -= vector.getY();
162  __z -= vector.getZ();
163 
164  return *this;
165  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
JTime& JGEOMETRY3D::JTime::sub ( const JTime value)
inlineinherited

Subtraction operator.

Parameters
valuetime
Returns
time

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

82  {
83  __t -= value.getT();
84 
85  return *this;
86  }
double getT() const
Get time.
JVector3D& JGEOMETRY3D::JVector3D::mul ( const double  factor)
inlineinherited

Scale vector.

Parameters
factormultiplication factor
Returns
this vector

Definition at line 174 of file JVector3D.hh.

175  {
176  __x *= factor;
177  __y *= factor;
178  __z *= factor;
179 
180  return *this;
181  }
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
JTime& JGEOMETRY3D::JTime::mul ( const double  value)
inlineinherited

Multiplication operator.

Parameters
valuemultiplication factor
Returns
time

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

96  {
97  __t *= value;
98 
99  return *this;
100  }
JVector3D& JGEOMETRY3D::JVector3D::div ( const double  factor)
inlineinherited

Scale vector.

Parameters
factordivision factor
Returns
this vector

Definition at line 190 of file JVector3D.hh.

191  {
192  __x /= factor;
193  __y /= factor;
194  __z /= factor;
195 
196  return *this;
197  }
JTime& JGEOMETRY3D::JTime::div ( const double  value)
inlineinherited

Division operator.

Parameters
valuemultiplication factor
Returns
time

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

110  {
111  __t /= value;
112 
113  return *this;
114  }
bool JGEOMETRY3D::JVector3D::equals ( const JVector3D vector,
const double  precision = std::numeric_limits<double>::min() 
) const
inlineinherited

Check equality.

Parameters
vectorvector
precisionprecision
Returns
true if vectors are equal; else false

Definition at line 221 of file JVector3D.hh.

223  {
224  return (fabs(getX() - vector.getX()) <= precision &&
225  fabs(getY() - vector.getY()) <= precision &&
226  fabs(getZ() - vector.getZ()) <= precision);
227  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
bool JGEOMETRY3D::JVersor3D::equals ( const JVersor3D versor,
const double  precision = std::numeric_limits<double>::min() 
) const
inlineinherited

Check equality.

Parameters
versorversor
precisionprecision
Returns
true if versors are equal; else false

Definition at line 81 of file JVersor3D.hh.

83  {
84  return (fabs(getDX() - versor.getDX()) <= precision &&
85  fabs(getDY() - versor.getDY()) <= precision &&
86  fabs(getDZ() - versor.getDZ()) <= precision);
87  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
double JGEOMETRY3D::JVector3D::getLengthSquared ( ) const
inlineinherited

Get length squared.

Returns
square of length

Definition at line 235 of file JVector3D.hh.

236  {
237  return getX()*getX() + getY()*getY() + getZ()*getZ();
238  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double JGEOMETRY3D::JVector3D::getLength ( ) const
inlineinherited

Get length.

Returns
length

Definition at line 246 of file JVector3D.hh.

247  {
248  return sqrt(getLengthSquared());
249  }
double getLengthSquared() const
Get length squared.
Definition: JVector3D.hh:235
JVector3D& JGEOMETRY3D::JVector3D::getCross ( 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 299 of file JVector3D.hh.

301  {
302  __x = first .getY() * second.getZ() - second.getY() * first .getZ();
303  __y = second.getX() * first .getZ() - first .getX() * second.getZ();
304  __z = first .getX() * second.getY() - second.getX() * first .getY();
305 
306  return *this;
307  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
JVersor3D& JGEOMETRY3D::JVersor3D::getCross ( const JVersor3D first,
const JVersor3D second 
)
inlineinherited

Get cross product.

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

Parameters
firstfirst versor
secondsecond versor
Returns
this versor

Definition at line 173 of file JVersor3D.hh.

175  {
176  __dx = first .getDY() * second.getDZ() - second.getDY() * first .getDZ();
177  __dy = second.getDX() * first .getDZ() - first .getDX() * second.getDZ();
178  __dz = first .getDX() * second.getDY() - second.getDX() * first .getDY();
179 
180  normalise();
181 
182  return *this;
183  }
JVersor3D & normalise()
Normalise versor.
Definition: JVersor3D.hh:192
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
void JGEOMETRY3D::JDirection3D::setDirection ( const JDirection3D dir)
inlineinherited

Set direction.

Parameters
dirdirection

Definition at line 129 of file JDirection3D.hh.

130  {
131  static_cast<JDirection3D&>(*this) = dir;
132  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
JGEOMETRY3D::JDirection3D::operator JVector3D ( ) const
inlineinherited

Type conversion operator.

Returns
position

Definition at line 151 of file JDirection3D.hh.

152  {
153  return JVector3D(getDX(), getDY(), getDZ());
154  }
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
double JGEOMETRY3D::JVersor3D::getDX ( ) const
inlineinherited

Get x direction.

Returns
x direction

Definition at line 95 of file JVersor3D.hh.

96  {
97  return __dx;
98  }
double JGEOMETRY3D::JVersor3D::getDY ( ) const
inlineinherited

Get y direction.

Returns
y direction

Definition at line 106 of file JVersor3D.hh.

107  {
108  return __dy;
109  }
double JGEOMETRY3D::JVersor3D::getDZ ( ) const
inlineinherited

Get z direction.

Returns
z direction

Definition at line 117 of file JVersor3D.hh.

118  {
119  return __dz;
120  }
double JGEOMETRY3D::JVersor3D::getTheta ( ) const
inlineinherited

Get theta angle.

Returns
theta angle [rad]

Definition at line 128 of file JVersor3D.hh.

129  {
130  if (__dz > +1.0)
131  return 0.0;
132  else if (__dz < -1.0)
133  return JMATH::PI;
134  else
135  return acos(__dz);
136  }
static const double PI
Mathematical constants.
double JGEOMETRY3D::JVersor3D::getPhi ( ) const
inlineinherited

Get phi angle.

Returns
phi angle [rad]

Definition at line 144 of file JVersor3D.hh.

145  {
146  return atan2(__dy, __dx);
147  }
JVersor3D& JGEOMETRY3D::JVersor3D::normalise ( )
inlineinherited

Normalise versor.

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

Returns
this versor

Definition at line 192 of file JVersor3D.hh.

193  {
194  const double v = sqrt(getDX()*getDX() + getDY()*getDY() + getDZ()*getDZ());
195 
196  if (v != 0.0) {
197  __dx /= v;
198  __dy /= v;
199  __dz /= v;
200  }
201 
202  return *this;
203  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
data_type v[N+1][M+1]
Definition: JPolint.hh:777
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117

Friends And Related Function Documentation

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

Read track from input.

Parameters
ininput stream
tracktrack
Returns
input stream

Definition at line 109 of file JTrack3EY.hh.

110  {
111  in >> static_cast<JTrack3E&>(track);
112  in >> track.__Y;
113 
114  return in;
115  }
3D track with energy.
Definition: JTrack3E.hh:30
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::ostream& operator<< ( std::ostream &  out,
const JTrack3EY track 
)
friend

Write track to output.

Parameters
outoutput stream
tracktrack
Returns
output stream

Definition at line 125 of file JTrack3EY.hh.

126  {
127  const JFormat format(out, getFormat<JTrack3EY>(JFormat_t(9, 3, std::ios::fixed | std::ios::showpos)));
128 
129  out << static_cast<const JTrack3E&>(track);
130  out << ' ';
131  out << format << track.__Y;
132 
133  return out;
134  }
Auxiliary class to temporarily define format specifications.
Definition: JManip.hh:632
Data structure for format specifications.
Definition: JManip.hh:522
JReader& operator>> ( JReader in,
JTrack3EY track 
)
friend

Read track from input.

Parameters
inreader
tracktrack
Returns
reader

Definition at line 144 of file JTrack3EY.hh.

145  {
146  in >> static_cast<JTrack3E&>(track);
147  in >> track.__Y;
148 
149  return in;
150  }
3D track with energy.
Definition: JTrack3E.hh:30
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
JWriter& operator<< ( JWriter out,
const JTrack3EY track 
)
friend

Write track to output.

Parameters
outwriter
tracktrack
Returns
writer

Definition at line 160 of file JTrack3EY.hh.

161  {
162  out << static_cast<const JTrack3E&>(track);
163  out << track.__Y;
164 
165  return out;
166  }

Member Data Documentation

double JGEOMETRY3D::JTrack3EY::__Y
protected

Definition at line 169 of file JTrack3EY.hh.

double JGEOMETRY3D::JTrack3E::__E
protectedinherited

Definition at line 192 of file JTrack3E.hh.

double JGEOMETRY3D::JVector3D::__x
protectedinherited

Definition at line 310 of file JVector3D.hh.

double JGEOMETRY3D::JVector3D::__y
protectedinherited

Definition at line 311 of file JVector3D.hh.

double JGEOMETRY3D::JVector3D::__z
protectedinherited

Definition at line 312 of file JVector3D.hh.

double JGEOMETRY3D::JVersor3D::__dx
protectedinherited

Definition at line 206 of file JVersor3D.hh.

double JGEOMETRY3D::JVersor3D::__dy
protectedinherited

Definition at line 207 of file JVersor3D.hh.

double JGEOMETRY3D::JVersor3D::__dz
protectedinherited

Definition at line 208 of file JVersor3D.hh.

double JGEOMETRY3D::JTime::__t
protectedinherited

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


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