Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutronHPSimpleEvapSpectrum Class Reference

#include <G4NeutronHPSimpleEvapSpectrum.hh>

+ Inheritance diagram for G4NeutronHPSimpleEvapSpectrum:

Public Member Functions

 G4NeutronHPSimpleEvapSpectrum ()
 
 ~G4NeutronHPSimpleEvapSpectrum ()
 
void Init (std::ifstream &aDataFile)
 
G4double GetFractionalProbability (G4double anEnergy)
 
G4double Sample (G4double anEnergy)
 
- Public Member Functions inherited from G4VNeutronHPEDis
 G4VNeutronHPEDis ()
 
virtual ~G4VNeutronHPEDis ()
 
virtual void Init (std::ifstream &theData)=0
 
virtual G4double GetFractionalProbability (G4double anEnergy)=0
 
virtual G4double Sample (G4double anEnergy)=0
 

Detailed Description

Definition at line 43 of file G4NeutronHPSimpleEvapSpectrum.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPSimpleEvapSpectrum()

G4NeutronHPSimpleEvapSpectrum::G4NeutronHPSimpleEvapSpectrum ( )
inline

Definition at line 46 of file G4NeutronHPSimpleEvapSpectrum.hh.

47 {
48 expm1 = std::exp(-1.);
49 }

◆ ~G4NeutronHPSimpleEvapSpectrum()

G4NeutronHPSimpleEvapSpectrum::~G4NeutronHPSimpleEvapSpectrum ( )
inline

Definition at line 50 of file G4NeutronHPSimpleEvapSpectrum.hh.

51 {
52 }

Member Function Documentation

◆ GetFractionalProbability()

G4double G4NeutronHPSimpleEvapSpectrum::GetFractionalProbability ( G4double  anEnergy)
inlinevirtual

Implements G4VNeutronHPEDis.

Definition at line 60 of file G4NeutronHPSimpleEvapSpectrum.hh.

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

◆ Init()

void G4NeutronHPSimpleEvapSpectrum::Init ( std::ifstream &  aDataFile)
inlinevirtual

Implements G4VNeutronHPEDis.

Definition at line 54 of file G4NeutronHPSimpleEvapSpectrum.hh.

55 {
56 theFractionalProb.Init(aDataFile, CLHEP::eV);
57 theThetaDist.Init(aDataFile, CLHEP::eV);
58 }
void Init(std::ifstream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)

◆ Sample()

G4double G4NeutronHPSimpleEvapSpectrum::Sample ( G4double  anEnergy)
inlinevirtual

Implements G4VNeutronHPEDis.

Definition at line 65 of file G4NeutronHPSimpleEvapSpectrum.hh.

66 {
67 G4double theta = theThetaDist.GetY(anEnergy)*CLHEP::eV;
68 G4double random, cut, max, result;
69 max = 10.*theta;
70 do
71 {
72 random = G4UniformRand();
73 result = -theta*std::log(random);
74 cut = G4UniformRand();
75 }
76 while(cut>result/max);
77 return result;
78 }
double G4double
Definition: G4Types.hh:64
#define G4UniformRand()
Definition: Randomize.hh:53

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