Jpp
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  JCenter3D
 Center. More...
 
class  JCylinder3D
 Cylinder object. More...
 
class  JDirection3D
 Data structure for direction in three dimensions. More...
 
class  JEigenValues3D
 Eigen values in 3D. More...
 
class  JEulerAngle3D
 Data structure for Euler angles in three dimensions. More...
 
class  JEulerMatrix3D
 Euler matrix. More...
 
class  JOmega3D
 Direction set covering (part of) solid angle. More...
 
struct  JOmega3D_t
 Base class for direction set. 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...
 
class  JQuaternion3D
 Data structure for quaternion in three dimensions. 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  JRotation3D
 Rotation matrix. More...
 
class  JRotation3X
 Rotation around X-axis. More...
 
class  JRotation3Y
 Rotation around Y-axis. More...
 
class  JRotation3Z
 Rotation around Z-axis. More...
 
class  JRotator3D
 Rotation set. More...
 
class  JSegment3D
 Line segment in two dimensions. More...
 
class  JSmallestDistance3D
 Auxiliary class for determination of smallest distance between pair of 3D points. More...
 
class  JSphere3D
 3D sphere. More...
 
class  JTime
 Time. More...
 
class  JTrack3D
 3D track. More...
 
class  JTrack3E
 3D track with energy. 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...
 
class  JWeighedCenter3D
 Weighed center. More...
 

Typedefs

typedef std::vector< JRotation3DJRotator3D_t
 Type definition of rotation set. More...
 
typedef std::pair< JPosition3D, JPosition3DJSegment3D_t
 Type definition of line segment in two dimensions. More...
 
typedef JTOOLS::JRange< double > JRangeZ
 Type definition of range along z-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...
 

Variables

static const JSmallestDistance3D getSmallestDistance3D
 Function object for smallest distance determination. 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

Typedef Documentation

◆ JRotator3D_t

Type definition of rotation set.

Definition at line 23 of file JRotator3D.hh.

◆ JSegment3D_t

Type definition of line segment in two dimensions.

Definition at line 27 of file JSegment3D.hh.

◆ JRangeZ

Type definition of range along z-axis.

Definition at line 25 of file JVector3D.hh.

Function Documentation

◆ randomize() [1/5]

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  };

◆ randomize() [2/5]

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  };

◆ randomize() [3/5]

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>(-PI, +PI);
69 
70  new (p) JQuaternion3D(alpha, JVersor3D(x, y, z));
71  }

◆ randomize() [4/5]

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  }

◆ randomize() [5/5]

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  }

◆ getRandomPosition() [1/2]

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  }

◆ getRandomPosition() [2/2]

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  }

Variable Documentation

◆ getSmallestDistance3D

const JSmallestDistance3D JGEOMETRY3D::getSmallestDistance3D
static

Function object for smallest distance determination.

Definition at line 243 of file JGeometry3DToolkit.hh.

◆ JVersor3X_t

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

unit x-vector

◆ JVersor3Y_t

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

unit y-vector

◆ JVersor3Z_t

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

unit z-vector

JGEOMETRY3D::JCylinder3D::getZmin
double getZmin() const
Get minimal z position.
Definition: JCylinder3D.hh:101
JGEOMETRY3D::JSphere3D::getRadius
double getRadius() const
Get radius.
Definition: JSphere3D.hh:58
JGEOMETRY3D::JDirection3D
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
JGEOMETRY3D::JVersor3D
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:23
JGEOMETRY2D::JCircle2D::getRadius
double getRadius() const
Get radius.
Definition: JCircle2D.hh:121
JGEOMETRY3D::JVector3D
Data structure for vector in three dimensions.
Definition: JVector3D.hh:33
JGEOMETRY3D::JPosition3D
Data structure for position in three dimensions.
Definition: JPosition3D.hh:35
JGEOMETRY3D::JQuaternion3D
Data structure for quaternion in three dimensions.
Definition: JQuaternion3D.hh:240
JGEOMETRY3D::JPosition3D::getPosition
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
JGEOMETRY3D::JCylinder3D::getZmax
double getZmax() const
Get maximal z position.
Definition: JCylinder3D.hh:112
JTOOLS::PI
static const double PI
Constants.
Definition: JConstants.hh:20
JGEOMETRY2D::JVector2D::getX
double getX() const
Get x position.
Definition: JVector2D.hh:62
JGEOMETRY2D::JVector2D::getY
double getY() const
Get y position.
Definition: JVector2D.hh:73
JGEOMETRY3D::JEulerAngle3D
Data structure for Euler angles in three dimensions.
Definition: JEulerAngle3D.hh:34
JGEOMETRY3D::JEulerMatrix3D
Euler matrix.
Definition: JEulerMatrix3D.hh:32