Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
JMARKOV::JExpRsqInvGenerator Class Reference

Implementation of the JGenerator interface. More...

#include <JMarkovGenerator.hh>

Inheritance diagram for JMARKOV::JExpRsqInvGenerator:
JMARKOV::JGenerator

Public Member Functions

 JExpRsqInvGenerator (double _lambda)
 Constructor. More...
 
JPosition3D getPosition ()
 Return a randomly generated position. More...
 
double getWeight (JPosition3D pos)
 return the weight (=probability density dP/dV) for the given position. More...
 

Protected Attributes

const double lambda
 

Detailed Description

Implementation of the JGenerator interface.

Generates positions according to the distribution

1/r^2 exp(-r/lambda)

around the origin.

Definition at line 151 of file JMarkovGenerator.hh.

Constructor & Destructor Documentation

JMARKOV::JExpRsqInvGenerator::JExpRsqInvGenerator ( double  _lambda)
inline

Constructor.

The argument is the radius of the ball.

Definition at line 157 of file JMarkovGenerator.hh.

157 : lambda(_lambda) {}

Member Function Documentation

JPosition3D JMARKOV::JExpRsqInvGenerator::getPosition ( )
inlinevirtual

Return a randomly generated position.

Implements JMARKOV::JGenerator.

Definition at line 159 of file JMarkovGenerator.hh.

159  {
160  double xi = gRandom->Uniform() ;
161  double r = -lambda*log(1-xi) ;
162  double x,y,z ;
163  gRandom->Sphere(x,y,z,r) ;
164  return JPosition3D(x,y,z) ;
165  }
data_type r[M+1]
Definition: JPolint.hh:742
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
double JMARKOV::JExpRsqInvGenerator::getWeight ( JPosition3D  pos)
inlinevirtual

return the weight (=probability density dP/dV) for the given position.

When the generator is properly normalized, the integral of this quantity over the whole space is 1.

Implements JMARKOV::JGenerator.

Definition at line 167 of file JMarkovGenerator.hh.

167  {
168  double r = pos.getLength() ;
169  return lambda*exp(-r/lambda)/(r*r*4*M_PI) ;
170  }
data_type r[M+1]
Definition: JPolint.hh:742
then set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))*exp(-0.5 *(y-[1])*(y-[1])/([2]*[2]))" JF2 -o $WORKDIR/f2.root -F "$FORMULA" -@ "p0
double getLength() const
Get length.
Definition: JVector3D.hh:246

Member Data Documentation

const double JMARKOV::JExpRsqInvGenerator::lambda
protected

Definition at line 174 of file JMarkovGenerator.hh.


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