Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
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.
 
double getScatteringProbability (double ct)
 Return the probability density as a function of cos(theta)
 
JVersor3D generateDirection ()
 Return a randomly generated direction according to the scattering probability distribution.
 
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

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

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

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 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 }

◆ 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 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 JDirection3D( JAngle3D( acos(ct),phi) ) ;
434 }

◆ getScatteringLength()

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

◆ g

double JMARKOV::JHenyeyGreensteinScattering::g
protected

Definition at line 438 of file JScatteringModel.hh.

◆ lambda_scat

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: