G4NeutronHPMadlandNixSpectrum Class Reference

#include <G4NeutronHPMadlandNixSpectrum.hh>

Inheritance diagram for G4NeutronHPMadlandNixSpectrum:

G4VNeutronHPEDis

Public Member Functions

 G4NeutronHPMadlandNixSpectrum ()
 ~G4NeutronHPMadlandNixSpectrum ()
void Init (std::ifstream &aDataFile)
G4double GetFractionalProbability (G4double anEnergy)
G4double Sample (G4double anEnergy)

Detailed Description

Definition at line 48 of file G4NeutronHPMadlandNixSpectrum.hh.


Constructor & Destructor Documentation

G4NeutronHPMadlandNixSpectrum::G4NeutronHPMadlandNixSpectrum (  )  [inline]

Definition at line 51 of file G4NeutronHPMadlandNixSpectrum.hh.

00052   {
00053     expm1 = std::exp(-1.);
00054   }

G4NeutronHPMadlandNixSpectrum::~G4NeutronHPMadlandNixSpectrum (  )  [inline]

Definition at line 55 of file G4NeutronHPMadlandNixSpectrum.hh.

00056   {
00057   }


Member Function Documentation

G4double G4NeutronHPMadlandNixSpectrum::GetFractionalProbability ( G4double  anEnergy  )  [inline, virtual]

Implements G4VNeutronHPEDis.

Definition at line 69 of file G4NeutronHPMadlandNixSpectrum.hh.

References G4NeutronHPVector::GetY().

00070   {
00071     return theFractionalProb.GetY(anEnergy);
00072   }

void G4NeutronHPMadlandNixSpectrum::Init ( std::ifstream &  aDataFile  )  [inline, virtual]

Implements G4VNeutronHPEDis.

Definition at line 59 of file G4NeutronHPMadlandNixSpectrum.hh.

References G4NeutronHPVector::Init().

00060   {
00061     theFractionalProb.Init(aDataFile);
00062     aDataFile>> theAvarageKineticPerNucleonForLightFragments;
00063     theAvarageKineticPerNucleonForLightFragments*=CLHEP::eV;
00064     aDataFile>> theAvarageKineticPerNucleonForHeavyFragments;
00065     theAvarageKineticPerNucleonForHeavyFragments*=CLHEP::eV;
00066     theMaxTemp.Init(aDataFile);
00067   }

G4double G4NeutronHPMadlandNixSpectrum::Sample ( G4double  anEnergy  )  [virtual]

Implements G4VNeutronHPEDis.

Definition at line 72 of file G4NeutronHPMadlandNixSpectrum.cc.

References G4UniformRand, and G4NeutronHPVector::GetY().

00073   {
00074     G4double tm = theMaxTemp.GetY(anEnergy);
00075     G4double last=0, buff, current = 100*MeV;
00076     G4double precision = 0.001;
00077     G4double newValue = 0., oldValue=0.;
00078     G4double random = G4UniformRand();
00079     
00080     do
00081     {
00082       oldValue = newValue;
00083       newValue = FissionIntegral(tm, current);
00084       if(newValue < random) 
00085       {
00086         buff = current;
00087         current+=std::abs(current-last)/2.;
00088         last = buff;
00089         if(current>190*MeV) throw G4HadronicException(__FILE__, __LINE__, "Madland-Nix Spectrum has not converged in sampling");
00090       }
00091       else
00092       {
00093         buff = current;
00094         current-=std::abs(current-last)/2.;
00095         last = buff;
00096       }
00097     }
00098     while (std::abs(oldValue-newValue)>precision*newValue);
00099     return current;
00100   }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:39 2013 for Geant4 by  doxygen 1.4.7