Jpp  18.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
JMARKOV::JGaussianGenerator Class Reference

Implementation of the JGenerator interface. More...

#include <JMarkovGenerator.hh>

Inheritance diagram for JMARKOV::JGaussianGenerator:
JMARKOV::JGenerator

Public Member Functions

 JGaussianGenerator (double _sigma)
 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 sigma
 
double C
 

Detailed Description

Implementation of the JGenerator interface.

Generates positions according to a 3D Gaussian distribution centered around the origin.

Definition at line 364 of file JMarkovGenerator.hh.

Constructor & Destructor Documentation

JMARKOV::JGaussianGenerator::JGaussianGenerator ( double  _sigma)
inline

Constructor.

The argument is the width of the gaussian.

Definition at line 370 of file JMarkovGenerator.hh.

370  : sigma(_sigma) {
371  C = 1.0 / ( 2*M_PI*sqrt(2*M_PI) * sigma * sigma * sigma ) ;
372  }

Member Function Documentation

JPosition3D JMARKOV::JGaussianGenerator::getPosition ( )
inlinevirtual

Return a randomly generated position.

Implements JMARKOV::JGenerator.

Definition at line 374 of file JMarkovGenerator.hh.

374  {
375  double x = gRandom->Gaus(0,sigma) ;
376  double y = gRandom->Gaus(0,sigma) ;
377  double z = gRandom->Gaus(0,sigma) ;
378  return JPosition3D(x,y,z) ;
379  }
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
double JMARKOV::JGaussianGenerator::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 381 of file JMarkovGenerator.hh.

381  {
382  return C*exp(-0.5*pos.getLengthSquared()/(sigma*sigma)) ;
383  }
double getLengthSquared() const
Get length squared.
Definition: JVector3D.hh:235
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN

Member Data Documentation

const double JMARKOV::JGaussianGenerator::sigma
protected

Definition at line 387 of file JMarkovGenerator.hh.

double JMARKOV::JGaussianGenerator::C
protected

Definition at line 388 of file JMarkovGenerator.hh.


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