Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4ParticleHPFissionSpectrum Class Reference

#include <G4ParticleHPFissionSpectrum.hh>

Inheritance diagram for G4ParticleHPFissionSpectrum:
G4VParticleHPEDis

Public Member Functions

 G4ParticleHPFissionSpectrum ()
 
G4double GetFractionalProbability (G4double anEnergy)
 
void Init (std::istream &aDataFile)
 
G4double Sample (G4double anEnergy)
 
 ~G4ParticleHPFissionSpectrum ()
 

Private Member Functions

G4double Maxwell (G4double anEnergy, G4double theta)
 

Private Attributes

G4double expm1
 
G4ParticleHPVector theFractionalProb
 
G4ParticleHPVector theThetaDist
 

Detailed Description

Definition at line 44 of file G4ParticleHPFissionSpectrum.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPFissionSpectrum()

G4ParticleHPFissionSpectrum::G4ParticleHPFissionSpectrum ( )
inline

Definition at line 47 of file G4ParticleHPFissionSpectrum.hh.

48 {
49 expm1 = G4Exp(-1.);
50 }
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:179

References expm1, and G4Exp().

◆ ~G4ParticleHPFissionSpectrum()

G4ParticleHPFissionSpectrum::~G4ParticleHPFissionSpectrum ( )
inline

Definition at line 51 of file G4ParticleHPFissionSpectrum.hh.

52 {
53 }

Member Function Documentation

◆ GetFractionalProbability()

G4double G4ParticleHPFissionSpectrum::GetFractionalProbability ( G4double  anEnergy)
inlinevirtual

Implements G4VParticleHPEDis.

Definition at line 61 of file G4ParticleHPFissionSpectrum.hh.

62 {
63 return theFractionalProb.GetY(anEnergy);
64 }
G4double GetY(G4double x)

References G4ParticleHPVector::GetY(), and theFractionalProb.

◆ Init()

void G4ParticleHPFissionSpectrum::Init ( std::istream &  aDataFile)
inlinevirtual

Implements G4VParticleHPEDis.

Definition at line 55 of file G4ParticleHPFissionSpectrum.hh.

56 {
58 theThetaDist.Init(aDataFile, CLHEP::eV);
59 }
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
static constexpr double eV

References CLHEP::eV, G4ParticleHPVector::Init(), theFractionalProb, and theThetaDist.

◆ Maxwell()

G4double G4ParticleHPFissionSpectrum::Maxwell ( G4double  anEnergy,
G4double  theta 
)
inlineprivate

Definition at line 95 of file G4ParticleHPFissionSpectrum.hh.

96 {
97 G4double result = std::sqrt(anEnergy/CLHEP::eV)*G4Exp(-anEnergy/CLHEP::eV/theta);
98 return result;
99 }
double G4double
Definition: G4Types.hh:83

References CLHEP::eV, and G4Exp().

Referenced by Sample().

◆ Sample()

G4double G4ParticleHPFissionSpectrum::Sample ( G4double  anEnergy)
inlinevirtual

Implements G4VParticleHPEDis.

Definition at line 66 of file G4ParticleHPFissionSpectrum.hh.

67 {
68 G4double theta = theThetaDist.GetY(anEnergy);
69 // here we need to sample Maxwells distribution, if
70 // need be.
71 G4double result=0., cut;
72 G4double range =50*CLHEP::MeV;
73 G4double max = Maxwell((theta*CLHEP::eV)/2., theta);
74 G4double value;
75 G4int icounter=0;
76 G4int icounter_max=1024;
77 do
78 {
79 icounter++;
80 if ( icounter > icounter_max ) {
81 G4cout << "Loop-counter exceeded the threshold value at " << __LINE__ << "th line of " << __FILE__ << "." << G4endl;
82 break;
83 }
84 result = range*G4UniformRand();
85 value = Maxwell(result, theta);
86 cut = G4UniformRand();
87 }
88 while(cut > value/max); // Loop checking, 11.05.2015, T. Koi
89 return result;
90 }
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:52
G4double Maxwell(G4double anEnergy, G4double theta)
static constexpr double MeV
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References CLHEP::eV, G4cout, G4endl, G4UniformRand, G4ParticleHPVector::GetY(), G4INCL::Math::max(), Maxwell(), CLHEP::MeV, and theThetaDist.

Field Documentation

◆ expm1

G4double G4ParticleHPFissionSpectrum::expm1
private

Definition at line 103 of file G4ParticleHPFissionSpectrum.hh.

Referenced by G4ParticleHPFissionSpectrum().

◆ theFractionalProb

G4ParticleHPVector G4ParticleHPFissionSpectrum::theFractionalProb
private

Definition at line 105 of file G4ParticleHPFissionSpectrum.hh.

Referenced by GetFractionalProbability(), and Init().

◆ theThetaDist

G4ParticleHPVector G4ParticleHPFissionSpectrum::theThetaDist
private

Definition at line 107 of file G4ParticleHPFissionSpectrum.hh.

Referenced by Init(), and Sample().


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