Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4NeutronHPMadlandNixSpectrum Class Reference

#include <G4NeutronHPMadlandNixSpectrum.hh>

Inheritance diagram for G4NeutronHPMadlandNixSpectrum:
G4VNeutronHPEDis

Public Member Functions

 G4NeutronHPMadlandNixSpectrum ()
 
 ~G4NeutronHPMadlandNixSpectrum ()
 
void Init (std::istream &aDataFile)
 
G4double GetFractionalProbability (G4double anEnergy)
 
G4double Sample (G4double anEnergy)
 
- Public Member Functions inherited from G4VNeutronHPEDis
 G4VNeutronHPEDis ()
 
virtual ~G4VNeutronHPEDis ()
 

Detailed Description

Definition at line 47 of file G4NeutronHPMadlandNixSpectrum.hh.

Constructor & Destructor Documentation

G4NeutronHPMadlandNixSpectrum::G4NeutronHPMadlandNixSpectrum ( )
inline

Definition at line 50 of file G4NeutronHPMadlandNixSpectrum.hh.

51  {
52  expm1 = std::exp(-1.);
53  }
G4NeutronHPMadlandNixSpectrum::~G4NeutronHPMadlandNixSpectrum ( )
inline

Definition at line 54 of file G4NeutronHPMadlandNixSpectrum.hh.

55  {
56  }

Member Function Documentation

G4double G4NeutronHPMadlandNixSpectrum::GetFractionalProbability ( G4double  anEnergy)
inlinevirtual

Implements G4VNeutronHPEDis.

Definition at line 68 of file G4NeutronHPMadlandNixSpectrum.hh.

References G4NeutronHPVector::GetY().

69  {
70  return theFractionalProb.GetY(anEnergy);
71  }
G4double GetY(G4double x)
void G4NeutronHPMadlandNixSpectrum::Init ( std::istream &  aDataFile)
inlinevirtual

Implements G4VNeutronHPEDis.

Definition at line 58 of file G4NeutronHPMadlandNixSpectrum.hh.

References G4NeutronHPVector::Init().

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

Implements G4VNeutronHPEDis.

Definition at line 72 of file G4NeutronHPMadlandNixSpectrum.cc.

References G4UniformRand, G4NeutronHPVector::GetY(), and python.hepunit::MeV.

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  }
G4double GetY(G4double x)
#define G4UniformRand()
Definition: Randomize.hh:87
double G4double
Definition: G4Types.hh:76

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