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

#include <G4NeutronHPAngularP.hh>

Public Member Functions

 G4NeutronHPAngularP ()
 
 ~G4NeutronHPAngularP ()
 
void Init (std::istream &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 36 of file G4NeutronHPAngularP.hh.

Constructor & Destructor Documentation

G4NeutronHPAngularP::G4NeutronHPAngularP ( )
inline

Definition at line 40 of file G4NeutronHPAngularP.hh.

41  {
42  theCosTh = 0;
43  theProb = 0;
44  }
G4NeutronHPAngularP::~G4NeutronHPAngularP ( )
inline

Definition at line 45 of file G4NeutronHPAngularP.hh.

46  {
47  if(theCosTh!=0) delete [] theCosTh;
48  if(theProb!=0) delete [] theProb;
49  }

Member Function Documentation

G4double G4NeutronHPAngularP::GetCosTh ( G4int  l)
inline

Definition at line 79 of file G4NeutronHPAngularP.hh.

Referenced by G4NeutronHPPhotonDist::GetPhotons().

79 {return theCosTh[l];}
G4double G4NeutronHPAngularP::GetCosTh ( )
inline

Definition at line 83 of file G4NeutronHPAngularP.hh.

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

84  {
85  G4int i;
86  G4double rand = G4UniformRand();
87  G4double run=0, runo=0;
88  for (i=0; i<GetNumberOfPoints(); i++)
89  {
90  runo=run;
91  run += GetProb(i);
92  if(run>rand) break;
93  }
94  if(i == GetNumberOfPoints()) i--;
95  G4double costh = theInt.Interpolate(theManager.GetScheme(i), rand,
96  runo, run, GetCosTh(i-1), GetCosTh(i));
97  return costh;
98  }
G4double GetProb(G4int l)
int G4int
Definition: G4Types.hh:78
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
#define G4UniformRand()
Definition: Randomize.hh:87
G4InterpolationScheme GetScheme(G4int index) const
double G4double
Definition: G4Types.hh:76
G4double G4NeutronHPAngularP::GetEnergy ( )
inline

Definition at line 81 of file G4NeutronHPAngularP.hh.

81 {return theEnergy;}
G4int G4NeutronHPAngularP::GetNumberOfPoints ( )
inline

Definition at line 82 of file G4NeutronHPAngularP.hh.

Referenced by GetCosTh().

82 { return nCoeff; }
G4double G4NeutronHPAngularP::GetProb ( G4int  l)
inline

Definition at line 80 of file G4NeutronHPAngularP.hh.

Referenced by GetCosTh().

80 {return theProb[l];}
void G4NeutronHPAngularP::Init ( std::istream &  aDataFile)
inline

Definition at line 51 of file G4NeutronHPAngularP.hh.

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

Referenced by G4NeutronHPPhotonDist::InitAngular().

52  {
53  G4double eNeu, cosTheta, probDist;
54  G4int nProb;
55  aDataFile >> eNeu >> nProb;
56  theManager.Init(aDataFile);
57  eNeu *= CLHEP::eV;
58  Init(eNeu, nProb);
59  for (G4int iii=0; iii<nProb; iii++)
60  {
61  aDataFile >> cosTheta >> probDist;
62  SetCosTh(iii, cosTheta);
63  SetProb(iii,probDist);
64  }
65  }
void Init(G4int aScheme, G4int aRange)
void SetProb(G4int l, G4double coeff)
int G4int
Definition: G4Types.hh:78
void Init(std::istream &aDataFile)
void SetCosTh(G4int l, G4double coeff)
double G4double
Definition: G4Types.hh:76
void G4NeutronHPAngularP::Init ( G4double  e,
G4int  n 
)
inline

Definition at line 67 of file G4NeutronHPAngularP.hh.

References n.

68  {
69  theCosTh = new G4double[n];
70  theProb = new G4double[n];
71  theEnergy = e;
72  nCoeff = n;
73  }
const G4int n
double G4double
Definition: G4Types.hh:76
void G4NeutronHPAngularP::SetCosTh ( G4int  l,
G4double  coeff 
)
inline

Definition at line 76 of file G4NeutronHPAngularP.hh.

Referenced by Init().

76 {theCosTh[l]=coeff;}
void G4NeutronHPAngularP::SetEnergy ( G4double  energy)
inline

Definition at line 75 of file G4NeutronHPAngularP.hh.

References energy().

75 { theEnergy = energy; }
double precision function energy(A, Z)
Definition: dpm25nuc6.f:4106
void G4NeutronHPAngularP::SetProb ( G4int  l,
G4double  coeff 
)
inline

Definition at line 77 of file G4NeutronHPAngularP.hh.

Referenced by Init().

77 {theProb[l]=coeff;}

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