Jpp  15.0.5
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::JHenyeyGreensteinScattering Class Reference

Implementation of the JScatteringModel interface with scattering according to the Henyey-Greenstein function. More...

#include <JScatteringModel.hh>

Inheritance diagram for JMARKOV::JHenyeyGreensteinScattering:
JMARKOV::JScatteringModel

Public Member Functions

 JHenyeyGreensteinScattering (double _lambda_scat, double _g)
 Constructor. More...
 
double getScatteringProbability (double ct)
 Return the probability density as a function of cos(theta) More...
 
JVersor3D generateDirection ()
 Return a randomly generated direction according to the scattering probability distribution. More...
 
virtual double getScatteringLength ()
 

Protected Attributes

double g
 
double lambda_scat
 

Detailed Description

Implementation of the JScatteringModel interface with scattering according to the Henyey-Greenstein function.

Definition at line 402 of file JScatteringModel.hh.

Constructor & Destructor Documentation

JMARKOV::JHenyeyGreensteinScattering::JHenyeyGreensteinScattering ( double  _lambda_scat,
double  _g 
)
inline

Constructor.

g is a parameter that determines how forward the scattering is. g = 0 corresponds to isotropic scattering g = 1 corresponds to fully forward scattering

Definition at line 413 of file JScatteringModel.hh.

413  {
414  lambda_scat = _lambda_scat ;
415  g = _g ;
416  }

Member Function Documentation

double JMARKOV::JHenyeyGreensteinScattering::getScatteringProbability ( double  ct)
inlinevirtual

Return the probability density as a function of cos(theta)

dP / dOmega = dP / dcosTheta dPhi

to scatter in a given direction. Theta=0 is forward scattering.

Implements JMARKOV::JScatteringModel.

Definition at line 418 of file JScatteringModel.hh.

418  {
419  //double ct = cos(dir.getTheta()) ;
420  double den = 1 + g*g - 2*g*ct ;
421  return (1-g*g)/(4*M_PI*den*sqrt(den)) ;
422  }
JVersor3D JMARKOV::JHenyeyGreensteinScattering::generateDirection ( )
inlinevirtual

Return a randomly generated direction according to the scattering probability distribution.

This uses gRandom.

Implements JMARKOV::JScatteringModel.

Definition at line 424 of file JScatteringModel.hh.

424  {
425  double phi = gRandom->Uniform(0,2*M_PI) ;
426  double ct ;
427  if( g>0 ) {
428  double xi = gRandom->Uniform(0,1) ;
429  ct = 1.0/(2*g) * ( 1 + g*g - (1-g*g)*(1-g*g)/( (1-g+2*g*xi)*(1-g+2*g*xi) ) ) ;
430  } else {
431  ct = gRandom->Uniform(-1,1) ;
432  }
433  return JVersor3D( JAngle3D( acos(ct),phi) ) ;
434  }
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:33
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:26
virtual double JMARKOV::JScatteringModel::getScatteringLength ( )
inlinevirtualinherited

Reimplemented in JMARKOV::JCombinedScattering.

Definition at line 72 of file JScatteringModel.hh.

72 { return lambda_scat ; }

Member Data Documentation

double JMARKOV::JHenyeyGreensteinScattering::g
protected

Definition at line 438 of file JScatteringModel.hh.

double JMARKOV::JScatteringModel::lambda_scat
protectedinherited

Definition at line 76 of file JScatteringModel.hh.


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