Jpp  18.3.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::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. More...
 
virtual double getScatteringLength ()
 
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...
 

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

Constructor & Destructor Documentation

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

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

Member Function Documentation

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

Reimplemented from JMARKOV::JScatteringModel.

Definition at line 532 of file JScatteringModel.hh.

532  {
533  // calculate effective scattering length
534  double l1 = sm1->getScatteringLength() ;
535  double l2 = sm2->getScatteringLength() ;
536  return 1.0 / ( 1.0/l1 + 1.0/l2 ) ;
537  }
virtual double getScatteringLength()
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 539 of file JScatteringModel.hh.

539  {
540  double val1 = sm1->getScatteringProbability(ct) ;
541  double val2 = sm2->getScatteringProbability(ct) ;
542  double l1 = sm1->getScatteringLength() ;
543  double l2 = sm2->getScatteringLength() ;
544  double lambda = getScatteringLength() ;
545  // effective scattering probability
546  return lambda * ( val1/l1 + val2/l2 ) ;
547  }
virtual double getScatteringLength()
virtual double getScatteringProbability(double ct)=0
Return the probability density as a function of cos(theta)
virtual double getScatteringLength()
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 549 of file JScatteringModel.hh.

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

Member Data Documentation

double JMARKOV::JCombinedScattering::a
protected

Definition at line 563 of file JScatteringModel.hh.

JScatteringModel* JMARKOV::JCombinedScattering::sm1
protected

Definition at line 564 of file JScatteringModel.hh.

JScatteringModel* JMARKOV::JCombinedScattering::sm2
protected

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