Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
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...
 
struct  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 unit 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...
 
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...
 
class  JWeighedCenter3D
 Weighed center. More...
 

Typedefs

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

Functions

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

Variables

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

Detailed Description

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

Author
mdejong
mjongen
mdejong, adomi

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.

◆ JShower3D

Type definition of 3D shower.

Definition at line 19 of file JShower3D.hh.

◆ JShower3E

Type definition of 3D shower with energy.

Definition at line 19 of file JShower3E.hh.

◆ JShower3EY

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

Definition at line 19 of file JShower3EY.hh.

◆ JRangeZ

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

◆ 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 };
Data structure for position in three dimensions.

◆ 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 };
Data structure for direction in three dimensions.

◆ 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>(-2.0*PI, +2.0*PI);
69
70 new (p) JQuaternion3D(alpha, JVersor3D(x, y, z));
71 }
Data structure for unit quaternion in three dimensions.
Data structure for normalised vector in three dimensions.
Definition JVersor3D.hh:28

◆ 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 }
Data structure for Euler angles in three dimensions.

◆ 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 }
const JPosition3D & getPosition() const
Get position.
double getRadius() const
Get radius.
Definition JSphere3D.hh:59
Data structure for vector in three dimensions.
Definition JVector3D.hh:36

◆ 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 }
double getRadius() const
Get radius.
Definition JCircle2D.hh:144
double getY() const
Get y position.
Definition JVector2D.hh:74
double getX() const
Get x position.
Definition JVector2D.hh:63
double getZmin() const
Get minimal z position.
double getZmax() const
Get maximal z position.

◆ getAngle()

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.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
static const double PI
Mathematical constants.

Variable Documentation

◆ getSmallestDistance3D

const JSmallestDistance3D JGEOMETRY3D::getSmallestDistance3D
static

Function object for smallest distance determination.

Definition at line 246 of file JGeometry3DToolkit.hh.

◆ JVector3X_t

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

unit x-vector

◆ JVector3Y_t

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

unit y-vector

◆ JVector3Z_t

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

unit z-vector

◆ JVersor3X_t

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

unit x-vector

◆ JVersor3Y_t

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

unit y-vector

◆ JVersor3Z_t

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

unit z-vector