G4NeutronHPAngularP Class Reference

#include <G4NeutronHPAngularP.hh>


Public Member Functions

 G4NeutronHPAngularP ()
 ~G4NeutronHPAngularP ()
void Init (std::ifstream &aDataFile)
void Init (G4double e, G4int n)
void SetEnergy (G4double energy)
void SetCosTh (G4int l, G4double coeff)
void SetProb (G4int l, G4double coeff)
G4double GetCosTh (G4int l)
G4double GetProb (G4int l)
G4double GetEnergy ()
G4int GetNumberOfPoints ()
G4double GetCosTh ()


Detailed Description

Definition at line 37 of file G4NeutronHPAngularP.hh.


Constructor & Destructor Documentation

G4NeutronHPAngularP::G4NeutronHPAngularP (  )  [inline]

Definition at line 41 of file G4NeutronHPAngularP.hh.

00042   {
00043     theCosTh = 0;
00044     theProb = 0;
00045   }

G4NeutronHPAngularP::~G4NeutronHPAngularP (  )  [inline]

Definition at line 46 of file G4NeutronHPAngularP.hh.

00047   {
00048     if(theCosTh!=0) delete [] theCosTh;
00049     if(theProb!=0) delete [] theProb;
00050   }


Member Function Documentation

G4double G4NeutronHPAngularP::GetCosTh (  )  [inline]

Definition at line 84 of file G4NeutronHPAngularP.hh.

References G4UniformRand, GetNumberOfPoints(), GetProb(), G4InterpolationManager::GetScheme(), and G4NeutronHPInterpolator::Interpolate().

00085   {
00086     G4int i;
00087     G4double rand = G4UniformRand();
00088     G4double run=0, runo=0;
00089     for (i=0; i<GetNumberOfPoints(); i++)
00090     {
00091       runo=run;
00092       run += GetProb(i);
00093       if(run>rand) break;
00094     }
00095     if(i == GetNumberOfPoints()) i--;
00096     G4double costh = theInt.Interpolate(theManager.GetScheme(i), rand, 
00097                                         runo, run, GetCosTh(i-1), GetCosTh(i));
00098     return costh;
00099   }

G4double G4NeutronHPAngularP::GetCosTh ( G4int  l  )  [inline]

Definition at line 80 of file G4NeutronHPAngularP.hh.

Referenced by G4NeutronHPPhotonDist::GetPhotons().

00080 {return theCosTh[l];}

G4double G4NeutronHPAngularP::GetEnergy (  )  [inline]

Definition at line 82 of file G4NeutronHPAngularP.hh.

00082 {return theEnergy;}

G4int G4NeutronHPAngularP::GetNumberOfPoints (  )  [inline]

Definition at line 83 of file G4NeutronHPAngularP.hh.

Referenced by GetCosTh().

00083 { return nCoeff; }

G4double G4NeutronHPAngularP::GetProb ( G4int  l  )  [inline]

Definition at line 81 of file G4NeutronHPAngularP.hh.

Referenced by GetCosTh().

00081 {return theProb[l];}

void G4NeutronHPAngularP::Init ( G4double  e,
G4int  n 
) [inline]

Definition at line 68 of file G4NeutronHPAngularP.hh.

00069   {
00070     theCosTh = new G4double[n];
00071     theProb = new G4double[n];
00072     theEnergy = e;
00073     nCoeff = n;
00074   }

void G4NeutronHPAngularP::Init ( std::ifstream &  aDataFile  )  [inline]

Definition at line 52 of file G4NeutronHPAngularP.hh.

References G4InterpolationManager::Init(), SetCosTh(), and SetProb().

00053   {
00054     G4double eNeu, cosTheta, probDist;
00055     G4int nProb;
00056     aDataFile >> eNeu >> nProb;
00057     theManager.Init(aDataFile);
00058     eNeu *= CLHEP::eV;
00059     Init(eNeu, nProb);
00060     for (G4int iii=0; iii<nProb; iii++)
00061     {
00062       aDataFile >> cosTheta >> probDist;
00063       SetCosTh(iii, cosTheta);
00064       SetProb(iii,probDist);
00065     }  
00066   }

void G4NeutronHPAngularP::SetCosTh ( G4int  l,
G4double  coeff 
) [inline]

Definition at line 77 of file G4NeutronHPAngularP.hh.

Referenced by Init().

00077 {theCosTh[l]=coeff;}

void G4NeutronHPAngularP::SetEnergy ( G4double  energy  )  [inline]

Definition at line 76 of file G4NeutronHPAngularP.hh.

00076 { theEnergy = energy; }

void G4NeutronHPAngularP::SetProb ( G4int  l,
G4double  coeff 
) [inline]

Definition at line 78 of file G4NeutronHPAngularP.hh.

Referenced by Init().

00078 {theProb[l]=coeff;}


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