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

#include <G4ParticleHPSimpleEvapSpectrum.hh>

Inheritance diagram for G4ParticleHPSimpleEvapSpectrum:
G4VParticleHPEDis

Public Member Functions

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

Private Member Functions

G4double Evapo (G4double anEnergy, G4double theta)
 

Private Attributes

G4double expm1
 
G4ParticleHPVector theFractionalProb
 
G4ParticleHPVector theThetaDist
 

Detailed Description

Definition at line 45 of file G4ParticleHPSimpleEvapSpectrum.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPSimpleEvapSpectrum()

G4ParticleHPSimpleEvapSpectrum::G4ParticleHPSimpleEvapSpectrum ( )
inline

Definition at line 48 of file G4ParticleHPSimpleEvapSpectrum.hh.

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

References expm1, and G4Exp().

◆ ~G4ParticleHPSimpleEvapSpectrum()

G4ParticleHPSimpleEvapSpectrum::~G4ParticleHPSimpleEvapSpectrum ( )
inline

Definition at line 52 of file G4ParticleHPSimpleEvapSpectrum.hh.

53 {
54 }

Member Function Documentation

◆ Evapo()

G4double G4ParticleHPSimpleEvapSpectrum::Evapo ( G4double  anEnergy,
G4double  theta 
)
inlineprivate

Definition at line 91 of file G4ParticleHPSimpleEvapSpectrum.hh.

92 {
93 G4double result = (anEnergy*CLHEP::eV)*G4Exp(-anEnergy*CLHEP::eV/theta);
94 return result;
95 }
double G4double
Definition: G4Types.hh:83
static constexpr double eV

References CLHEP::eV, and G4Exp().

◆ GetFractionalProbability()

G4double G4ParticleHPSimpleEvapSpectrum::GetFractionalProbability ( G4double  anEnergy)
inlinevirtual

Implements G4VParticleHPEDis.

Definition at line 62 of file G4ParticleHPSimpleEvapSpectrum.hh.

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

References G4ParticleHPVector::GetY(), and theFractionalProb.

◆ Init()

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

Implements G4VParticleHPEDis.

Definition at line 56 of file G4ParticleHPSimpleEvapSpectrum.hh.

57 {
59 theThetaDist.Init(aDataFile, CLHEP::eV);
60 }
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)

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

◆ Sample()

G4double G4ParticleHPSimpleEvapSpectrum::Sample ( G4double  anEnergy)
inlinevirtual

Implements G4VParticleHPEDis.

Definition at line 67 of file G4ParticleHPSimpleEvapSpectrum.hh.

68 {
69 G4double theta = theThetaDist.GetY(anEnergy)*CLHEP::eV;
70 G4double random, cut, max, result=0.;
71 max = 10.*theta;
72 G4int icounter=0;
73 G4int icounter_max=1024;
74 do
75 {
76 icounter++;
77 if ( icounter > icounter_max ) {
78 G4cout << "Loop-counter exceeded the threshold value at " << __LINE__ << "th line of " << __FILE__ << "." << G4endl;
79 break;
80 }
81 random = G4UniformRand();
82 result = -theta*G4Log(random);
83 cut = G4UniformRand();
84 }
85 while(cut>result/max); // Loop checking, 11.05.2015, T. Koi
86 return result;
87 }
G4double G4Log(G4double x)
Definition: G4Log.hh:226
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:52
T max(const T t1, const T t2)
brief Return the largest of the two arguments

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

Field Documentation

◆ expm1

G4double G4ParticleHPSimpleEvapSpectrum::expm1
private

Definition at line 99 of file G4ParticleHPSimpleEvapSpectrum.hh.

Referenced by G4ParticleHPSimpleEvapSpectrum().

◆ theFractionalProb

G4ParticleHPVector G4ParticleHPSimpleEvapSpectrum::theFractionalProb
private

Definition at line 101 of file G4ParticleHPSimpleEvapSpectrum.hh.

Referenced by GetFractionalProbability(), and Init().

◆ theThetaDist

G4ParticleHPVector G4ParticleHPSimpleEvapSpectrum::theThetaDist
private

Definition at line 103 of file G4ParticleHPSimpleEvapSpectrum.hh.

Referenced by Init(), and Sample().


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