Jpp  19.1.0
the software that should make you happy
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 403 of file JScatteringModel.hh.

Constructor & Destructor Documentation

◆ JHenyeyGreensteinScattering()

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 414 of file JScatteringModel.hh.

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

Member Function Documentation

◆ getScatteringProbability()

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 419 of file JScatteringModel.hh.

419  {
420  //double ct = cos(dir.getTheta()) ;
421  double den = 1 + g*g - 2*g*ct ;
422  return (1-g*g)/(4*M_PI*den*sqrt(den)) ;
423  }

◆ generateDirection()

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 425 of file JScatteringModel.hh.

425  {
426  double phi = gRandom->Uniform(0,2*M_PI) ;
427  double ct ;
428  if( g>0 ) {
429  double xi = gRandom->Uniform(0,1) ;
430  ct = 1.0/(2*g) * ( 1 + g*g - (1-g*g)*(1-g*g)/( (1-g+2*g*xi)*(1-g+2*g*xi) ) ) ;
431  } else {
432  ct = gRandom->Uniform(-1,1) ;
433  }
434  return JDirection3D( JAngle3D( acos(ct),phi) ) ;
435  }
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:35
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:35

◆ getScatteringLength()

virtual double JMARKOV::JScatteringModel::getScatteringLength ( )
inlinevirtualinherited

Reimplemented in JMARKOV::JCombinedScattering.

Definition at line 73 of file JScatteringModel.hh.

73 { return lambda_scat ; }

Member Data Documentation

◆ g

double JMARKOV::JHenyeyGreensteinScattering::g
protected

Definition at line 439 of file JScatteringModel.hh.

◆ lambda_scat

double JMARKOV::JScatteringModel::lambda_scat
protectedinherited

Definition at line 77 of file JScatteringModel.hh.


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