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

#include <G4NeutronHPMadlandNixSpectrum.hh>

+ Inheritance diagram for G4NeutronHPMadlandNixSpectrum:

Public Member Functions

 G4NeutronHPMadlandNixSpectrum ()
 
 ~G4NeutronHPMadlandNixSpectrum ()
 
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 48 of file G4NeutronHPMadlandNixSpectrum.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPMadlandNixSpectrum()

G4NeutronHPMadlandNixSpectrum::G4NeutronHPMadlandNixSpectrum ( )
inline

Definition at line 51 of file G4NeutronHPMadlandNixSpectrum.hh.

52 {
53 expm1 = std::exp(-1.);
54 }

◆ ~G4NeutronHPMadlandNixSpectrum()

G4NeutronHPMadlandNixSpectrum::~G4NeutronHPMadlandNixSpectrum ( )
inline

Definition at line 55 of file G4NeutronHPMadlandNixSpectrum.hh.

56 {
57 }

Member Function Documentation

◆ GetFractionalProbability()

G4double G4NeutronHPMadlandNixSpectrum::GetFractionalProbability ( G4double  anEnergy)
inlinevirtual

Implements G4VNeutronHPEDis.

Definition at line 69 of file G4NeutronHPMadlandNixSpectrum.hh.

70 {
71 return theFractionalProb.GetY(anEnergy);
72 }
G4double GetY(G4double x)

◆ Init()

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

Implements G4VNeutronHPEDis.

Definition at line 59 of file G4NeutronHPMadlandNixSpectrum.hh.

60 {
61 theFractionalProb.Init(aDataFile);
62 aDataFile>> theAvarageKineticPerNucleonForLightFragments;
63 theAvarageKineticPerNucleonForLightFragments*=CLHEP::eV;
64 aDataFile>> theAvarageKineticPerNucleonForHeavyFragments;
65 theAvarageKineticPerNucleonForHeavyFragments*=CLHEP::eV;
66 theMaxTemp.Init(aDataFile);
67 }
void Init(std::ifstream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)

◆ Sample()

G4double G4NeutronHPMadlandNixSpectrum::Sample ( G4double  anEnergy)
virtual

Implements G4VNeutronHPEDis.

Definition at line 72 of file G4NeutronHPMadlandNixSpectrum.cc.

73 {
74 G4double tm = theMaxTemp.GetY(anEnergy);
75 G4double last=0, buff, current = 100*MeV;
76 G4double precision = 0.001;
77 G4double newValue = 0., oldValue=0.;
78 G4double random = G4UniformRand();
79
80 do
81 {
82 oldValue = newValue;
83 newValue = FissionIntegral(tm, current);
84 if(newValue < random)
85 {
86 buff = current;
87 current+=std::abs(current-last)/2.;
88 last = buff;
89 if(current>190*MeV) throw G4HadronicException(__FILE__, __LINE__, "Madland-Nix Spectrum has not converged in sampling");
90 }
91 else
92 {
93 buff = current;
94 current-=std::abs(current-last)/2.;
95 last = buff;
96 }
97 }
98 while (std::abs(oldValue-newValue)>precision*newValue);
99 return current;
100 }
double G4double
Definition: G4Types.hh:64
#define G4UniformRand()
Definition: Randomize.hh:53

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