Jpp
JGeometry2DTestkit.hh
Go to the documentation of this file.
1 #ifndef __JGEOMETRY2DTESTKIT__
2 #define __JGEOMETRY2DTESTKIT__
3 
4 #include "TRandom3.h"
5 
6 #include "JTools/JConstants.hh"
8 #include "JMath/JRandom.hh"
9 
10 /**
11  * \author mdejong
12  */
13 
14 namespace JGEOMETRY2D {}
15 namespace JPP { using namespace JGEOMETRY2D; }
16 
17 namespace JGEOMETRY2D {
18 
19  using JTOOLS::PI;
20  using JMATH::getRandom;
21 
22 
23  /**
24  * Randomize position.
25  *
26  * \param p pointer to valid object
27  */
28  inline void randomize(JPosition2D* p)
29  {
30  new (p) JPosition2D(getRandom<double>(-1.0, +1.0),
31  getRandom<double>(-1.0, +1.0));
32  };
33 }
34 
35 #endif
JGEOMETRY2D
Auxiliary classes and methods for 2D geometrical objects and operations.
Definition: JAngle2D.hh:18
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JGEOMETRY2D::JPosition2D
Data structure for position in two dimensions.
Definition: JPosition2D.hh:30
JGEOMETRY2D::randomize
void randomize(JPosition2D *p)
Randomize position.
Definition: JGeometry2DTestkit.hh:28
JConstants.hh
JPosition2D.hh
JTOOLS::PI
static const double PI
Constants.
Definition: JConstants.hh:20
JRandom.hh
JMATH::getRandom
T getRandom()
Get random value.
Definition: JRandom.hh:113