Jpp  18.1.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions | Variables
JGEOMETRY3D Namespace Reference

Auxiliary classes and methods for 3D geometrical objects and operations. More...

Classes

class  JAngle3D
 Data structure for angles in three dimensions. More...
 
class  JAxis3D
 Axis object. More...
 
class  JCylinder3D
 Cylinder object. More...
 
class  JDirection3D
 Data structure for direction in three dimensions. More...
 
struct  JEigenValues3D
 Eigen values in 3D. More...
 
class  JEulerAngle3D
 Data structure for Euler angles in three dimensions. More...
 
class  JEulerMatrix3D
 Euler matrix. More...
 
class  JCenter3D
 Center. More...
 
class  JWeighedCenter3D
 Weighed center. More...
 
class  JSmallestDistance3D
 Auxiliary class for determination of smallest distance between pair of 3D points. More...
 
struct  JOmega3D_t
 Base class for direction set. More...
 
class  JOmega3D
 Direction set covering (part of) solid angle. More...
 
class  JPolyline3D
 Data structure for polyline in three dimensions. More...
 
class  JPosition3D
 Data structure for position in three dimensions. More...
 
struct  JQuaternion2D
 This class represents a rotation. More...
 
struct  JQuaternion3X
 This class represents a rotation around the x-axis. More...
 
struct  JQuaternion3Y
 This class represents a rotation around the y-axis. More...
 
struct  JQuaternion3Z
 This class represents a rotation around the z-axis. More...
 
class  JQuaternion3D
 Data structure for unit quaternion in three dimensions. More...
 
class  JRotation3X
 Rotation around X-axis. More...
 
class  JRotation3Y
 Rotation around Y-axis. More...
 
class  JRotation3Z
 Rotation around Z-axis. More...
 
class  JRotation3D
 Rotation matrix. More...
 
class  JRotator3D
 Rotation set. More...
 
class  JSegment3D
 Line segment in two dimensions. More...
 
class  JSphere3D
 3D sphere. More...
 
class  JTime
 Time. More...
 
class  JTrack3D
 3D track. More...
 
class  JTrack3E
 3D track with energy. More...
 
class  JTrack3EY
 3D track with energy and Bjorken Y. More...
 
struct  JTransformation3D
 Transformation. More...
 
class  JVector3D
 Data structure for vector in three dimensions. More...
 
class  JVersor3D
 Data structure for normalised vector in three dimensions. More...
 
class  JVersor3Z
 Data structure for normalised vector in positive z-direction. More...
 
class  JVertex3D
 3D vertex. More...
 

Typedefs

typedef std::vector< JRotation3DJRotator3D_t
 Type definition of rotation set. More...
 
typedef std::pair< JPosition3D,
JPosition3D
JSegment3D_t
 Type definition of line segment in two dimensions. More...
 
typedef JTrack3D JShower3D
 Type definition of 3D shower. More...
 
typedef JTrack3E JShower3E
 Type definition of 3D shower with energy. More...
 
typedef JTrack3EY JShower3EY
 Type definition of 3D shower with energy and Bjorken Y. More...
 
typedef std::pair< double, double > JRangeZ
 < Type definition of range along y-axis. More...
 

Functions

void randomize (JPosition3D *p)
 Randomize position. More...
 
void randomize (JDirection3D *p)
 Randomize direction. More...
 
void randomize (JQuaternion3D *p)
 Randomize quaternion. More...
 
void randomize (JEulerAngle3D *p)
 Randomize Euler angle. More...
 
void randomize (JEulerMatrix3D *p)
 Randomize Euler matrix. More...
 
JVector3D getRandomPosition (const JSphere3D &sphere)
 Get random position. More...
 
JVector3D getRandomPosition (const JCylinder3D &cylinder)
 Get random position. More...
 
double getAngle (const JQuaternion3D &first, const JQuaternion3D &second)
 Get space angle between quanternions. More...
 

Variables

static const JSmallestDistance3D getSmallestDistance3D
 Function object for smallest distance determination. More...
 
static const JVector3D JVector3X_t (1, 0, 0)
 unit x-vector More...
 
static const JVector3D JVector3Y_t (0, 1, 0)
 unit y-vector More...
 
static const JVector3D JVector3Z_t (0, 0, 1)
 unit z-vector More...
 
static const JVersor3D JVersor3X_t (1, 0, 0)
 unit x-vector More...
 
static const JVersor3D JVersor3Y_t (0, 1, 0)
 unit y-vector More...
 
static const JVersor3D JVersor3Z_t (0, 0, 1)
 unit z-vector More...
 

Detailed Description

Auxiliary classes and methods for 3D geometrical objects and operations.

Author
mdejong
mjongen
mdejong, adomi

Typedef Documentation

Type definition of rotation set.

Definition at line 23 of file JRotator3D.hh.

Type definition of line segment in two dimensions.

Definition at line 27 of file JSegment3D.hh.

Type definition of 3D shower.

Definition at line 19 of file JShower3D.hh.

Type definition of 3D shower with energy.

Definition at line 19 of file JShower3E.hh.

Type definition of 3D shower with energy and Bjorken Y.

Definition at line 19 of file JShower3EY.hh.

typedef std::pair<double, double> JGEOMETRY3D::JRangeZ

< Type definition of range along y-axis.

Type definition of range along z-axis.

Definition at line 26 of file JVector3D.hh.

Function Documentation

void JGEOMETRY3D::randomize ( JPosition3D p)
inline

Randomize position.

Parameters
ppointer to valid object

Definition at line 34 of file JGeometry3DTestkit.hh.

35  {
36  new (p) JPosition3D(getRandom<double>(-1.0, +1.0),
37  getRandom<double>(-1.0, +1.0),
38  getRandom<double>(-1.0, +1.0));
39  };
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
void JGEOMETRY3D::randomize ( JDirection3D p)
inline

Randomize direction.

Parameters
ppointer to valid object

Definition at line 47 of file JGeometry3DTestkit.hh.

48  {
49  double x, y, z;
50 
51  gRandom->Sphere(x, y, z, 1.0);
52 
53  new (p) JDirection3D(x, y, z);
54  };
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
void JGEOMETRY3D::randomize ( JQuaternion3D p)
inline

Randomize quaternion.

Parameters
ppointer to valid object

Definition at line 62 of file JGeometry3DTestkit.hh.

63  {
64  double x, y, z;
65 
66  gRandom->Sphere(x, y, z, 1.0);
67 
68  const double alpha = getRandom<double>(-2.0*PI, +2.0*PI);
69 
70  new (p) JQuaternion3D(alpha, JVersor3D(x, y, z));
71  }
static const double PI
Mathematical constants.
Data structure for unit quaternion in three dimensions.
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:26
void JGEOMETRY3D::randomize ( JEulerAngle3D p)
inline

Randomize Euler angle.

Parameters
ppointer to valid object

Definition at line 79 of file JGeometry3DTestkit.hh.

80  {
81  new (p) JEulerAngle3D(getRandom<double>(0.0, PI),
82  getRandom<double>(0.0, PI),
83  getRandom<double>(0.0, PI));
84  }
Data structure for Euler angles in three dimensions.
static const double PI
Mathematical constants.
void JGEOMETRY3D::randomize ( JEulerMatrix3D p)
inline

Randomize Euler matrix.

Parameters
ppointer to valid object

Definition at line 92 of file JGeometry3DTestkit.hh.

93  {
94  new (p) JEulerMatrix3D(getRandom<JEulerAngle3D>());
95  }
JVector3D JGEOMETRY3D::getRandomPosition ( const JSphere3D sphere)
inline

Get random position.


The positions are uniformly distributed in given sphere.

Parameters
spheresphere
Returns
position

Definition at line 105 of file JGeometry3DTestkit.hh.

106  {
107  const double R3max = sphere.getRadius() * sphere.getRadius() * sphere.getRadius();
108 
109  const double R3 = gRandom->Uniform(0.0, R3max);
110  const double ct = gRandom->Uniform(-1.0, +1.0);
111  const double phi = gRandom->Uniform(-PI, +PI);
112 
113  const double R = cbrt(R3);
114  const double st = sqrt((1.0 + ct) * (1.0 - ct));
115 
116  return sphere.getPosition() + JVector3D(R * st * cos(phi),
117  R * st * sin(phi),
118  R * ct);
119  }
then usage set_variable ACOUSTICS_WORKDIR $WORKDIR set_variable FORMULA sin([0]+2 *$PI *([1]+[2]*x)*x)" set_variable DY 1.0e-8 mkdir $WORKDIR for DETECTOR in $DETECTORS[*]
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
static const double PI
Mathematical constants.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
double getRadius() const
Get radius.
Definition: JSphere3D.hh:59
JVector3D JGEOMETRY3D::getRandomPosition ( const JCylinder3D cylinder)
inline

Get random position.


The positions are uniformly distributed in given cylinder.

Parameters
cylindercylinder
Returns
position

Definition at line 129 of file JGeometry3DTestkit.hh.

130  {
131  const double R2max = cylinder.getRadius() * cylinder.getRadius();
132 
133  const double R2 = gRandom->Uniform(0.0, R2max);
134  const double phi = gRandom->Uniform(-PI, +PI);
135  const double z = gRandom->Uniform(cylinder.getZmin(), cylinder.getZmax());
136 
137  const double R = sqrt(R2);
138 
139  return JVector3D(cylinder.getX() + R * cos(phi),
140  cylinder.getY() + R * sin(phi),
141  z);
142  }
double getRadius() const
Get radius.
Definition: JCircle2D.hh:144
double getZmin() const
Get minimal z position.
Definition: JCylinder3D.hh:111
double getY() const
Get y position.
Definition: JVector2D.hh:74
then usage set_variable ACOUSTICS_WORKDIR $WORKDIR set_variable FORMULA sin([0]+2 *$PI *([1]+[2]*x)*x)" set_variable DY 1.0e-8 mkdir $WORKDIR for DETECTOR in $DETECTORS[*]
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
double getX() const
Get x position.
Definition: JVector2D.hh:63
static const double PI
Mathematical constants.
double getZmax() const
Get maximal z position.
Definition: JCylinder3D.hh:122
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
double JGEOMETRY3D::getAngle ( const JQuaternion3D first,
const JQuaternion3D second 
)
inline

Get space angle between quanternions.

Parameters
firstfirst quanternion
secondsecond quanternion
Returns
angle [deg]

Definition at line 1165 of file JQuaternion3D.hh.

1167  {
1168  double dot = (first.getA() * second.getA() +
1169  first.getB() * second.getB() +
1170  first.getC() * second.getC() +
1171  first.getD() * second.getD());
1172 
1173  dot = 2.0 * dot * dot - 1.0;
1174 
1175  if (dot > +1.0)
1176  return 0.0;
1177  else if (dot < -1.0)
1178  return 180.0;
1179  else
1180  return 0.5 * acos(dot) * 180.0 / JMATH::PI;
1181  }
double getB() const
Get b value.
static const double PI
Mathematical constants.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.

Variable Documentation

const JSmallestDistance3D JGEOMETRY3D::getSmallestDistance3D
static

Function object for smallest distance determination.

Definition at line 243 of file JGeometry3DToolkit.hh.

const JVector3D JGEOMETRY3D::JVector3X_t(1, 0, 0)
static

unit x-vector

const JVector3D JGEOMETRY3D::JVector3Y_t(0, 1, 0)
static

unit y-vector

const JVector3D JGEOMETRY3D::JVector3Z_t(0, 0, 1)
static

unit z-vector

const JVersor3D JGEOMETRY3D::JVersor3X_t(1, 0, 0)
static

unit x-vector

const JVersor3D JGEOMETRY3D::JVersor3Y_t(0, 1, 0)
static

unit y-vector

const JVersor3D JGEOMETRY3D::JVersor3Z_t(0, 0, 1)
static

unit z-vector