Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
JMARKOV::JCombinedScattering Class Reference

Implementation of the JScatteringModel interface with that combines two scattering models into one effective model. More...

#include <JScatteringModel.hh>

Inheritance diagram for JMARKOV::JCombinedScattering:
JMARKOV::JScatteringModel

Public Member Functions

 JCombinedScattering (JScatteringModel *_sm1, JScatteringModel *_sm2)
 Constructor.
 
virtual double getScatteringLength ()
 
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.
 

Protected Attributes

double a
 
JScatteringModelsm1
 
JScatteringModelsm2
 
double lambda_scat
 

Detailed Description

Implementation of the JScatteringModel interface with that combines two scattering models into one effective model.

Definition at line 520 of file JScatteringModel.hh.

Constructor & Destructor Documentation

◆ JCombinedScattering()

JMARKOV::JCombinedScattering::JCombinedScattering ( JScatteringModel * _sm1,
JScatteringModel * _sm2 )
inline

Constructor.

Note that this only copies only the pointers to the JScatteringModel instances. So if _sm1 or _sm2 are deleted or changed, it will also affect the behaviour of this instance.

Definition at line 531 of file JScatteringModel.hh.

531: sm1(_sm1), sm2(_sm2) { }

Member Function Documentation

◆ getScatteringLength()

virtual double JMARKOV::JCombinedScattering::getScatteringLength ( )
inlinevirtual

Reimplemented from JMARKOV::JScatteringModel.

Definition at line 533 of file JScatteringModel.hh.

533 {
534 // calculate effective scattering length
535 double l1 = sm1->getScatteringLength() ;
536 double l2 = sm2->getScatteringLength() ;
537 return 1.0 / ( 1.0/l1 + 1.0/l2 ) ;
538 }
virtual double getScatteringLength()

◆ getScatteringProbability()

double JMARKOV::JCombinedScattering::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 540 of file JScatteringModel.hh.

540 {
541 double val1 = sm1->getScatteringProbability(ct) ;
542 double val2 = sm2->getScatteringProbability(ct) ;
543 double l1 = sm1->getScatteringLength() ;
544 double l2 = sm2->getScatteringLength() ;
545 double lambda = getScatteringLength() ;
546 // effective scattering probability
547 return lambda * ( val1/l1 + val2/l2 ) ;
548 }
virtual double getScatteringProbability(double ct)=0
Return the probability density as a function of cos(theta)

◆ generateDirection()

JVersor3D JMARKOV::JCombinedScattering::generateDirection ( )
inlinevirtual

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

This uses gRandom.

Implements JMARKOV::JScatteringModel.

Definition at line 550 of file JScatteringModel.hh.

550 {
551 double l1 = sm1->getScatteringLength() ;
552 double l2 = sm2->getScatteringLength() ;
553 // probability to scatter with process 1
554 double P = l2/(l1+l2) ;
555 if( gRandom->Uniform(0,1)<P ) {
556 return sm1->generateDirection() ;
557 } else {
558 return sm2->generateDirection() ;
559 }
560 }
virtual JVersor3D generateDirection()=0
Return a randomly generated direction according to the scattering probability distribution.

Member Data Documentation

◆ a

double JMARKOV::JCombinedScattering::a
protected

Definition at line 564 of file JScatteringModel.hh.

◆ sm1

JScatteringModel* JMARKOV::JCombinedScattering::sm1
protected

Definition at line 565 of file JScatteringModel.hh.

◆ sm2

JScatteringModel* JMARKOV::JCombinedScattering::sm2
protected

Definition at line 566 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: