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

#include <G4NeutronHPWattSpectrum.hh>

+ Inheritance diagram for G4NeutronHPWattSpectrum:

Public Member Functions

 G4NeutronHPWattSpectrum ()
 
 ~G4NeutronHPWattSpectrum ()
 
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 G4NeutronHPWattSpectrum.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPWattSpectrum()

G4NeutronHPWattSpectrum::G4NeutronHPWattSpectrum ( )
inline

Definition at line 46 of file G4NeutronHPWattSpectrum.hh.

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

◆ ~G4NeutronHPWattSpectrum()

G4NeutronHPWattSpectrum::~G4NeutronHPWattSpectrum ( )
inline

Definition at line 50 of file G4NeutronHPWattSpectrum.hh.

51 {
52 }

Member Function Documentation

◆ GetFractionalProbability()

G4double G4NeutronHPWattSpectrum::GetFractionalProbability ( G4double  anEnergy)
inlinevirtual

Implements G4VNeutronHPEDis.

Definition at line 61 of file G4NeutronHPWattSpectrum.hh.

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

◆ Init()

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

Implements G4VNeutronHPEDis.

Definition at line 54 of file G4NeutronHPWattSpectrum.hh.

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

◆ Sample()

G4double G4NeutronHPWattSpectrum::Sample ( G4double  anEnergy)
virtual

Implements G4VNeutronHPEDis.

Definition at line 33 of file G4NeutronHPWattSpectrum.cc.

34 {
35 G4double a = theApar.GetY(anEnergy)*eV;
36 G4double b = theBpar.GetY(anEnergy)/eV;
37 G4double result;
38 G4double random, cut, max;
39 max = std::sinh(std::sqrt(b*15.*a));
40 do
41 {
42 random = G4UniformRand();
43 result = -a*std::log(random);
44 cut = G4UniformRand();
45 }
46 while(cut>std::sinh(std::sqrt(b*result))/max);
47 return result;
48 }
double G4double
Definition: G4Types.hh:64
#define G4UniformRand()
Definition: Randomize.hh:53

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