Jpp  17.2.0
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::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:779
then cat $TRIPOD_INITIAL<< EOF1 256877.5 4743716.7-2438.42 256815.5 4743395.0-2435.53 257096.2 4743636.0-2439.5EOFfiif[[!-f $DETECTOR]];then JEditDetector-a $DETECTOR_INITIAL-s"-1 addz -6.9"-o $DETECTOR--!eval`JPrintDetector-a $DETECTOR-O SUMMARY`for STRING in ${STRINGS[*]};do set_variable MODULE`getModule-a $DETECTOR-L"$STRING 0"`JEditDetector-a $DETECTOR-M"$MODULE setz -2.9"-o $DETECTOR--!donefiif[[!-f $TRIPOD]];then cp-p $TRIPOD_INITIAL $TRIPODfiJAcoustics.sh $DETECTOR_IDcat > acoustics_trigger_parameters txt<< EOFQ=0.0;TMax_s=0.020;quantile=0.9;numberOfHits=90;EOFJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]INPUT_FILES=(`ls KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_0 *${^RUNS}_event.root`) cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$DETECTOR $WORKDIR cp-p $HOMEDIR/$TRIPOD $WORKDIR cp-p $HOMEDIR/${^INPUT_FILES}$WORKDIR cp-p $HOMEDIR/{acoustics_fit_parameters, acoustics_trigger_parameters, disable, hydrophone, mechanics, sound_velocity, tripod, waveform}.txt $WORKDIRfisource $JPP_DIR/examples/JAcoustics/acoustics-fit-toolkit.shJConvertDetectorFormat-a $DETECTOR-o $HOMEDIR/detector_backup.datxJDetachPMTs-a $DETECTOR-o $DETECTORtimer_startinitialise stage_1B 0.002 0.1 0 > &stage log
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:779
double getLength() const
Get length.
Definition: JVector3D.hh:246
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::JExpRsqInvGenerator::lambda
protected

Definition at line 174 of file JMarkovGenerator.hh.


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