Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
JFIT::JPMTW0 Struct Reference

Auxiliary class for handling PMT geometry, rate and response. More...

#include <JPMTW0.hh>

Inheritance diagram for JFIT::JPMTW0:
JDETECTOR::JPMT JLANG::JObjectID JGEOMETRY3D::JAxis3D JDETECTOR::JCalibration JDETECTOR::JStatus JLANG::JMultiEquals< JClass_t, JType_t > JLANG::JComparable< JObjectID > JLANG::JComparable< JObjectID, int > JGEOMETRY3D::JPosition3D JGEOMETRY3D::JDirection3D JLANG::JEquals< JFirst_t, JSecond_t > JGEOMETRY3D::JVector3D JGEOMETRY3D::JVersor3D JMATH::JMath< JVector3D > JMATH::JMath< JVersor3D >

Public Types

enum  JPMTStatusBits_t {
  PMT_DISABLE = 0, HIGH_RATE_VETO_DISABLE = 1, FIFO_FULL_DISABLE = 2, UDP_COUNTER_DISABLE = 3,
  UDP_TRAILER_DISABLE = 4
}
 Enumeration of status bits. More...
 

Public Member Functions

 JPMTW0 ()
 Default constructor. More...
 
 JPMTW0 (const JPMT &pmt, const double rate_Hz, const int numberOfHits)
 Constructor. More...
 
double getR () const
 Get rate. More...
 
int getN () const
 Get number of hits. More...
 
double getDot (const JPMT &pmt) const
 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 JVector3D &vector) const
 Get dot product. More...
 
double getDot (const JAngle3D &angle) const
 Get dot product. More...
 
double getDot (const JVector3D &pos) 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...
 
int getID () const
 Get identifier. More...
 
void setID (const int id)
 Set identifier. More...
 
bool less (const JObjectID &object) const
 Less than method. More...
 
bool less (const int id) const
 Less than method. More...
 
bool more (const int id) const
 More than method. 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...
 
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...
 
JVector3Dsub (const JVector3D &vector)
 Subtract vector. More...
 
JVector3Dmul (const double factor)
 Scale vector. More...
 
JVector3Dmul (const JNullType &object)
 Multiply with object. More...
 
JVersor3Dmul (const JNullType &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...
 
bool equals (const JStatus &status) const
 Equal method. 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...
 
const JCalibrationgetCalibration () const
 Get calibration. More...
 
void setCalibration (const JCalibration &cal)
 Set calibration. More...
 
double getT0 () const
 Get time offset. More...
 
void setT0 (const double t0)
 Set time offset. More...
 
void addT0 (const double t0)
 Add time offset. More...
 
void subT0 (const double t0)
 Subtract time offset. More...
 
const JStatusgetStatus () const
 Get status. More...
 
JStatus getStatus ()
 Get status. More...
 
void setStatus (const JStatus &status)
 Set status. More...
 
bool has (const JPMTStatusBits_t bit) const
 Test PMT status. More...
 
void set (const JPMTStatusBits_t bit)
 Set PMT status. More...
 
void reset (const JPMTStatusBits_t bit)
 Reset PMT status. More...
 
void print (std::ostream &out) const
 Print status. More...
 

Static Public Member Functions

static JDetectorVersiongetVersion ()
 Get detector version. More...
 
static void setVersion (const JVersion &version)
 Set detector version. More...
 

Protected Attributes

double __R
 rate [Hz] More...
 
int __n
 number of hits More...
 
int __id
 
double __x
 
double __y
 
double __z
 
double __dx
 
double __dy
 
double __dz
 
double t0
 
int status
 

Detailed Description

Auxiliary class for handling PMT geometry, rate and response.

Definition at line 22 of file JPMTW0.hh.

Member Enumeration Documentation

Enumeration of status bits.

Additional status bits should be included in JGetPMTStatusBit::JGetPMTStatusBit.

Enumerator
PMT_DISABLE 

Enable (disable) use of this PMT if this status bit is 0 (1);.

HIGH_RATE_VETO_DISABLE 

Enable (disable) use of high-rate veto test if this status bit is 0 (1);.

FIFO_FULL_DISABLE 

Enable (disable) use of FIFO (almost) full test if this status bit is 0 (1);.

UDP_COUNTER_DISABLE 

Enable (disable) use of UDP packet counter test if this status bit is 0 (1);.

UDP_TRAILER_DISABLE 

Enable (disable) use of UDP packet trailer test if this status bit is 0 (1);.

Definition at line 48 of file JStatus.hh.

48  {
49  PMT_DISABLE = 0, //!< Enable (disable) use of this PMT if this status bit is 0 (1);
50  HIGH_RATE_VETO_DISABLE = 1, //!< Enable (disable) use of high-rate veto test if this status bit is 0 (1);
51  FIFO_FULL_DISABLE = 2, //!< Enable (disable) use of FIFO (almost) full test if this status bit is 0 (1);
52  UDP_COUNTER_DISABLE = 3, //!< Enable (disable) use of UDP packet counter test if this status bit is 0 (1);
53  UDP_TRAILER_DISABLE = 4 //!< Enable (disable) use of UDP packet trailer test if this status bit is 0 (1);
54  };
Enable (disable) use of this PMT if this status bit is 0 (1);.
Definition: JStatus.hh:49
Enable (disable) use of FIFO (almost) full test if this status bit is 0 (1);.
Definition: JStatus.hh:51
Enable (disable) use of UDP packet trailer test if this status bit is 0 (1);.
Definition: JStatus.hh:53
Enable (disable) use of high-rate veto test if this status bit is 0 (1);.
Definition: JStatus.hh:50
Enable (disable) use of UDP packet counter test if this status bit is 0 (1);.
Definition: JStatus.hh:52

Constructor & Destructor Documentation

JFIT::JPMTW0::JPMTW0 ( )
inline

Default constructor.

Definition at line 28 of file JPMTW0.hh.

28  :
29  JPMT(),
30  __R(0.0),
31  __n(0)
32  {}
JPMT()
Default constructor.
Definition: JPMT.hh:58
double __R
rate [Hz]
Definition: JPMTW0.hh:73
int __n
number of hits
Definition: JPMTW0.hh:74
JFIT::JPMTW0::JPMTW0 ( const JPMT pmt,
const double  rate_Hz,
const int  numberOfHits 
)
inline

Constructor.

Parameters
pmtPMT
rate_Hzrate [Hz]
numberOfHitsnumber of hits

Definition at line 42 of file JPMTW0.hh.

44  :
45  JPMT(pmt),
46  __R(rate_Hz),
47  __n(numberOfHits)
48  {}
JPMT()
Default constructor.
Definition: JPMT.hh:58
esac $JPP_DIR examples JDetector JTransitTime o $OUTPUT_FILE n N $NPE T $TTS_NS d $DEBUG for HISTOGRAM in tts tt2 pmt
Definition: JTransitTime.sh:36
double __R
rate [Hz]
Definition: JPMTW0.hh:73
int __n
number of hits
Definition: JPMTW0.hh:74

Member Function Documentation

double JFIT::JPMTW0::getR ( ) const
inline

Get rate.

Returns
rate [Hz]

Definition at line 56 of file JPMTW0.hh.

57  {
58  return __R;
59  }
double __R
rate [Hz]
Definition: JPMTW0.hh:73
int JFIT::JPMTW0::getN ( ) const
inline

Get number of hits.

Returns
number of hits

Definition at line 67 of file JPMTW0.hh.

68  {
69  return __n;
70  }
int __n
number of hits
Definition: JPMTW0.hh:74
static JDetectorVersion& JDETECTOR::JPMT::getVersion ( )
inlinestaticinherited

Get detector version.

Definition at line 105 of file JPMT.hh.

106  {
107  static JDetectorVersion version;
108 
109  return version;
110  }
version
Definition: JCalibratePMT.sh:7
static void JDETECTOR::JPMT::setVersion ( const JVersion version)
inlinestaticinherited

Set detector version.

Parameters
versionversion

Definition at line 118 of file JPMT.hh.

119  {
120  getVersion() = JDetectorVersion(version);
121  }
static JDetectorVersion & getVersion()
Get detector version.
Definition: JPMT.hh:105
double JDETECTOR::JPMT::getDot ( const JPMT pmt) const
inlineinherited

Dot product.

The dot product is evaluated for the PMT orientation.

Parameters
pmtPMT
Returns
dot product

Definition at line 132 of file JPMT.hh.

133  {
134  return this->getDirection().getDot(pmt.getDirection());
135  }
const JDirection3D & getDirection() const
Get direction.
double getDot(const JAngle3D &angle) const
Get dot product.
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  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
double getDX() const
Get x direction.
Definition: JAngle3D.hh:106
double getDZ() const
Get z direction.
Definition: JAngle3D.hh:128
double getDY() const
Get y direction.
Definition: JAngle3D.hh:117
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  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
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  }
double getDY() const
Get y direction.
Definition: JVersor3Z.hh:156
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3Z.hh:145
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getDZ() const
Get z direction.
Definition: JVersor3Z.hh:167
double getZ() const
Get z position.
Definition: JVector3D.hh:114
double JGEOMETRY3D::JVector3D::getDot ( const JVector3D vector) const
inlineinherited

Get dot product.

Parameters
vectorvector
Returns
dot product

Definition at line 281 of file JVector3D.hh.

282  {
283  return
284  getX() * vector.getX() +
285  getY() * vector.getY() +
286  getZ() * vector.getZ();
287  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
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  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
double getDX() const
Get x direction.
Definition: JAngle3D.hh:106
double getDZ() const
Get z direction.
Definition: JAngle3D.hh:128
double getDY() const
Get y direction.
Definition: JAngle3D.hh:117
double JGEOMETRY3D::JDirection3D::getDot ( const JVector3D pos) const
inlineinherited

Get dot product.

Parameters
posposition
Returns
dot product

Definition at line 348 of file JDirection3D.hh.

349  {
350  return
351  getDX() * pos.getX() +
352  getDY() * pos.getY() +
353  getDZ() * pos.getZ();
354  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
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  }
double getDY() const
Get y direction.
Definition: JVersor3Z.hh:156
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
double getDX() const
Get x direction.
Definition: JVersor3Z.hh:145
double getDZ() const
Get z direction.
Definition: JVersor3Z.hh:167
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
double JGEOMETRY3D::JVersor3D::getDot ( const JVersor3D versor) const
inlineinherited

Get dot product.

Parameters
versorversor
Returns
dot product

Definition at line 153 of file JVersor3D.hh.

154  {
155  return
156  getDX() * versor.getDX() +
157  getDY() * versor.getDY() +
158  getDZ() * versor.getDZ();
159  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 55 of file JObjectID.hh.

56  {
57  return __id;
58  }
void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 66 of file JObjectID.hh.

67  {
68  this->__id = id;
69  }
bool JLANG::JObjectID::less ( const JObjectID object) const
inlineinherited

Less than method.

Parameters
objectobject identifier
Returns
true if this identifier less than given identifier; else false

Definition at line 78 of file JObjectID.hh.

79  {
80  return this->getID() < object.getID();
81  }
int getID() const
Get identifier.
Definition: JObjectID.hh:55
bool JLANG::JObjectID::less ( const int  id) const
inlineinherited

Less than method.

Parameters
ididentifier
Returns
true if this identifier less than given identifier; else false

Definition at line 90 of file JObjectID.hh.

91  {
92  return this->getID() < id;
93  }
int getID() const
Get identifier.
Definition: JObjectID.hh:55
bool JLANG::JObjectID::more ( const int  id) const
inlineinherited

More than method.

Parameters
ididentifier
Returns
true if this identifier greater than given identifier; else false

Definition at line 102 of file JObjectID.hh.

103  {
104  return this->getID() > id;
105  }
int getID() const
Get identifier.
Definition: JObjectID.hh:55
const JAxis3D& JGEOMETRY3D::JAxis3D::getAxis ( ) const
inlineinherited

Get axis.

Returns
axis

Definition at line 109 of file JAxis3D.hh.

110  {
111  return *this;
112  }
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  }
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JVersor3D & negate()
Negate versor.
Definition: JVersor3D.hh:61
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
JVector3D & negate()
Negate vector.
Definition: JVector3D.hh:125
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  }
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
JPosition3D()
Default constructor.
Definition: JPosition3D.hh:47
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  }
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
const JDirection3D & getDirection() const
Get direction.
Rotation matrix.
Definition: JRotation3D.hh:111
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
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  }
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
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  }
double getDistanceSquared(const JVector3D &pos) const
Get distance squared.
Definition: JAxis3D.hh:206
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:185
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:185
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:185
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:185
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:185
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:199
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:199
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:199
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:199
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
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  }
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 319 of file JDirection3D.hh.

320  {
321  Q.rotate_back(__dx, __dy, __dz);
322 
323  return *this;
324  }
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 370 of file JAxis3D.hh.

371  {
372  JRotation3D R (axis.getDirection());
373  JPosition3D pos(axis.getPosition ());
374 
375  transform(R, pos.rotate(R));
376  }
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:370
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
const JDirection3D & getDirection() const
Get direction.
data_type r[M+1]
Definition: JPolint.hh:709
Rotation around Z-axis.
Definition: JRotation3D.hh:85
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Definition: JVector3D.hh:157
JDirection3D & rotate(const JRotation3D &R)
Rotate.
double getY() const
Get y position.
Definition: JVector3D.hh:103
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
double getX() const
Get x position.
Definition: JVector3D.hh:93
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
data_type v[N+1][M+1]
Definition: JPolint.hh:707
double u[N+1]
Definition: JPolint.hh:706
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:185
void JGEOMETRY3D::JAxis3D::transform ( const JTransformation3D T)
inlineinherited

Transform axis.

Parameters
Ttransformation

Definition at line 448 of file JAxis3D.hh.

449  {
451  }
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
Definition: JAxis3D.hh:370
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
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 205 of file JVector3D.hh.

206  {
207  T.transform(__x, __y, __z);
208 
209  return *this;
210  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
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  }
JVersor3D & normalise()
Normalise versor.
Definition: JVersor3D.hh:168
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 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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JDirection3D & rotate_back(const JRotation3D &R)
Rotate back.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:199
const JDirection3D & getDirection() const
Get direction.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
data_type v[N+1][M+1]
Definition: JPolint.hh:707
double u[N+1]
Definition: JPolint.hh:706
JVector3D & add(const JVector3D &vector)
Add vector.
Definition: JVector3D.hh:141
void JGEOMETRY3D::JAxis3D::transform_back ( const JTransformation3D T)
inlineinherited

Transform back axis.

Parameters
Ttransformation

Definition at line 459 of file JAxis3D.hh.

460  {
462  }
void transform_back(const JRotation3D &R, const JVector3D &pos)
Transform back axis.
Definition: JAxis3D.hh:426
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
const JRotation3D & getRotation() const
Get rotation.
Definition: JRotation3D.hh:272
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  }
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
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  }
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
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  }
Data structure for vector in three dimensions.
Definition: JVector3D.hh:33
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  }
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:31
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
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  }
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:31
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
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  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:23
double getZ() const
Get z position.
Definition: JVector3D.hh:114
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  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
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  }
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  }
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  }
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  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
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  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
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  }
JVector3D & JMATH::JMath< JVector3D , JNullType >::mul ( const JNullType 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  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
JVersor3D & JMATH::JMath< JVersor3D , JNullType >::mul ( const JNullType 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  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
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  }
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 220 of file JVector3D.hh.

222  {
223  return (fabs(getX() - vector.getX()) <= precision &&
224  fabs(getY() - vector.getY()) <= precision &&
225  fabs(getZ() - vector.getZ()) <= precision);
226  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
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 78 of file JVersor3D.hh.

80  {
81  return (fabs(getDX() - versor.getDX()) <= precision &&
82  fabs(getDY() - versor.getDY()) <= precision &&
83  fabs(getDZ() - versor.getDZ()) <= precision);
84  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
bool JDETECTOR::JStatus::equals ( const JStatus status) const
inlineinherited

Equal method.

Parameters
statusstatus
Returns
true if this status equal to given status; else false

Definition at line 114 of file JStatus.hh.

115  {
116  return this->status == status.status;
117  }
double JGEOMETRY3D::JVector3D::getLengthSquared ( ) const
inlineinherited

Get length squared.

Returns
square of length

Definition at line 234 of file JVector3D.hh.

235  {
236  return getX()*getX() + getY()*getY() + getZ()*getZ();
237  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
double JGEOMETRY3D::JVector3D::getLength ( ) const
inlineinherited

Get length.

Returns
length

Definition at line 245 of file JVector3D.hh.

246  {
247  return sqrt(getLengthSquared());
248  }
double getLengthSquared() const
Get length squared.
Definition: JVector3D.hh:234
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 298 of file JVector3D.hh.

300  {
301  __x = first .getY() * second.getZ() - second.getY() * first .getZ();
302  __y = second.getX() * first .getZ() - first .getX() * second.getZ();
303  __z = first .getX() * second.getY() - second.getX() * first .getY();
304 
305  return *this;
306  }
double getY() const
Get y position.
Definition: JVector3D.hh:103
double getX() const
Get x position.
Definition: JVector3D.hh:93
double getZ() const
Get z position.
Definition: JVector3D.hh:114
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
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  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
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  }
Data structure for vector in three dimensions.
Definition: JVector3D.hh:33
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
double JGEOMETRY3D::JVersor3D::getDX ( ) const
inlineinherited

Get x direction.

Returns
x direction

Definition at line 92 of file JVersor3D.hh.

93  {
94  return __dx;
95  }
double JGEOMETRY3D::JVersor3D::getDY ( ) const
inlineinherited

Get y direction.

Returns
y direction

Definition at line 103 of file JVersor3D.hh.

104  {
105  return __dy;
106  }
double JGEOMETRY3D::JVersor3D::getDZ ( ) const
inlineinherited

Get z direction.

Returns
z direction

Definition at line 114 of file JVersor3D.hh.

115  {
116  return __dz;
117  }
double JGEOMETRY3D::JVersor3D::getTheta ( ) const
inlineinherited

Get theta angle.

Returns
theta angle [rad]

Definition at line 125 of file JVersor3D.hh.

126  {
127  if (__dz > +1.0)
128  return 0.0;
129  else if (__dz < -1.0)
130  return JTOOLS::PI;
131  else
132  return acos(__dz);
133  }
static const double PI
Constants.
Definition: JConstants.hh:20
double JGEOMETRY3D::JVersor3D::getPhi ( ) const
inlineinherited

Get phi angle.

Returns
phi angle [rad]

Definition at line 141 of file JVersor3D.hh.

142  {
143  return atan2(__dy, __dx);
144  }
JVersor3D& JGEOMETRY3D::JVersor3D::normalise ( )
inlineinherited

Normalise versor.

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

Returns
this versor

Definition at line 168 of file JVersor3D.hh.

169  {
170  const double v = sqrt(getDX()*getDX() + getDY()*getDY() + getDZ()*getDZ());
171 
172  if (v != 0.0) {
173  __dx /= v;
174  __dy /= v;
175  __dz /= v;
176  }
177 
178  return *this;
179  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:103
double getDX() const
Get x direction.
Definition: JVersor3D.hh:92
data_type v[N+1][M+1]
Definition: JPolint.hh:707
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:114
const JCalibration& JDETECTOR::JCalibration::getCalibration ( ) const
inlineinherited

Get calibration.

Returns
calibration

Definition at line 66 of file JDetector/JCalibration.hh.

67  {
68  return *this;
69  }
void JDETECTOR::JCalibration::setCalibration ( const JCalibration cal)
inlineinherited

Set calibration.

Parameters
calcalibration

Definition at line 77 of file JDetector/JCalibration.hh.

78  {
79  *this = cal;
80  }
double JDETECTOR::JCalibration::getT0 ( ) const
inlineinherited

Get time offset.

Returns
time offset [ns]

Definition at line 88 of file JDetector/JCalibration.hh.

89  {
90  return t0;
91  }
void JDETECTOR::JCalibration::setT0 ( const double  t0)
inlineinherited

Set time offset.

Parameters
t0time offset [ns]

Definition at line 99 of file JDetector/JCalibration.hh.

100  {
101  this->t0 = t0;
102  }
void JDETECTOR::JCalibration::addT0 ( const double  t0)
inlineinherited

Add time offset.

Parameters
t0time offset [ns]

Definition at line 110 of file JDetector/JCalibration.hh.

111  {
112  this->t0 += t0;
113  }
void JDETECTOR::JCalibration::subT0 ( const double  t0)
inlineinherited

Subtract time offset.

Parameters
t0time offset [ns]

Definition at line 121 of file JDetector/JCalibration.hh.

122  {
123  this->t0 -= t0;
124  }
const JStatus& JDETECTOR::JStatus::getStatus ( ) const
inlineinherited

Get status.

Returns
status

Definition at line 80 of file JStatus.hh.

81  {
82  return *this;
83  }
JStatus JDETECTOR::JStatus::getStatus ( )
inlineinherited

Get status.

Returns
status

Definition at line 91 of file JStatus.hh.

92  {
93  return *this;
94  }
void JDETECTOR::JStatus::setStatus ( const JStatus status)
inlineinherited

Set status.

Parameters
statusstatus

Definition at line 102 of file JStatus.hh.

103  {
104  this->status = status.status;
105  }
bool JDETECTOR::JStatus::has ( const JPMTStatusBits_t  bit) const
inlineinherited

Test PMT status.

Parameters
bitbit

Definition at line 125 of file JStatus.hh.

126  {
127  return (this->status & (1<<bit)) != 0;
128  }
void JDETECTOR::JStatus::set ( const JPMTStatusBits_t  bit)
inlineinherited

Set PMT status.

Parameters
bitbit

Definition at line 136 of file JStatus.hh.

137  {
138  this->status |= (1<<bit);
139  }
void JDETECTOR::JStatus::reset ( const JPMTStatusBits_t  bit)
inlineinherited

Reset PMT status.

Parameters
bitbit

Definition at line 147 of file JStatus.hh.

148  {
149  this->status &= ~(1<<bit);
150  }
void JDETECTOR::JStatus::print ( std::ostream &  out) const
inlineinherited

Print status.

Print PMT status.

Parameters
outoutput stream

Definition at line 342 of file JStatus.hh.

343  {
344  using namespace std;
345 
346  for (int i = 0; i != sizeof(JStatus) * 8; ++i) {
347 
348  try {
349 
350  const JPMTStatusBits_t bit = (JPMTStatusBits_t) i;
351 
352  out << setw(24) << left << putPMTStatusBit(bit) << right << this->has(bit) << endl;
353  }
354  catch(const exception&) {}
355  }
356  }
JStatus()
Default constructor.
Definition: JStatus.hh:60
static const JPutPMTStatusBit putPMTStatusBit(getPMTStatusBit)
Function object to map PMT status bit to key.
JPMTStatusBits_t
Enumeration of status bits.
Definition: JStatus.hh:48
bool has(const JPMTStatusBits_t bit) const
Test PMT status.
Definition: JStatus.hh:125

Member Data Documentation

double JFIT::JPMTW0::__R
protected

rate [Hz]

Definition at line 73 of file JPMTW0.hh.

int JFIT::JPMTW0::__n
protected

number of hits

Definition at line 74 of file JPMTW0.hh.

int JLANG::JObjectID::__id
protectedinherited

Definition at line 160 of file JObjectID.hh.

double JGEOMETRY3D::JVector3D::__x
protectedinherited

Definition at line 309 of file JVector3D.hh.

double JGEOMETRY3D::JVector3D::__y
protectedinherited

Definition at line 310 of file JVector3D.hh.

double JGEOMETRY3D::JVector3D::__z
protectedinherited

Definition at line 311 of file JVector3D.hh.

double JGEOMETRY3D::JVersor3D::__dx
protectedinherited

Definition at line 182 of file JVersor3D.hh.

double JGEOMETRY3D::JVersor3D::__dy
protectedinherited

Definition at line 183 of file JVersor3D.hh.

double JGEOMETRY3D::JVersor3D::__dz
protectedinherited

Definition at line 184 of file JVersor3D.hh.

double JDETECTOR::JCalibration::t0
protectedinherited

Definition at line 188 of file JDetector/JCalibration.hh.

int JDETECTOR::JStatus::status
protectedinherited

Definition at line 213 of file JStatus.hh.


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