Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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::G4NeutronHPAngularP ( )
inline

Definition at line 41 of file G4NeutronHPAngularP.hh.

42 {
43 theCosTh = 0;
44 theProb = 0;
45 }

◆ ~G4NeutronHPAngularP()

G4NeutronHPAngularP::~G4NeutronHPAngularP ( )
inline

Definition at line 46 of file G4NeutronHPAngularP.hh.

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

Member Function Documentation

◆ GetCosTh() [1/2]

G4double G4NeutronHPAngularP::GetCosTh ( )
inline

Definition at line 84 of file G4NeutronHPAngularP.hh.

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

Referenced by GetCosTh().

◆ GetCosTh() [2/2]

G4double G4NeutronHPAngularP::GetCosTh ( G4int  l)
inline

Definition at line 80 of file G4NeutronHPAngularP.hh.

80{return theCosTh[l];}

Referenced by G4NeutronHPPhotonDist::GetPhotons().

◆ GetEnergy()

G4double G4NeutronHPAngularP::GetEnergy ( )
inline

Definition at line 82 of file G4NeutronHPAngularP.hh.

82{return theEnergy;}

◆ GetNumberOfPoints()

G4int G4NeutronHPAngularP::GetNumberOfPoints ( )
inline

Definition at line 83 of file G4NeutronHPAngularP.hh.

83{ return nCoeff; }

Referenced by GetCosTh().

◆ GetProb()

G4double G4NeutronHPAngularP::GetProb ( G4int  l)
inline

Definition at line 81 of file G4NeutronHPAngularP.hh.

81{return theProb[l];}

Referenced by GetCosTh().

◆ Init() [1/2]

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

Definition at line 68 of file G4NeutronHPAngularP.hh.

69 {
70 theCosTh = new G4double[n];
71 theProb = new G4double[n];
72 theEnergy = e;
73 nCoeff = n;
74 }

◆ Init() [2/2]

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

Definition at line 52 of file G4NeutronHPAngularP.hh.

53 {
54 G4double eNeu, cosTheta, probDist;
55 G4int nProb;
56 aDataFile >> eNeu >> nProb;
57 theManager.Init(aDataFile);
58 eNeu *= CLHEP::eV;
59 Init(eNeu, nProb);
60 for (G4int iii=0; iii<nProb; iii++)
61 {
62 aDataFile >> cosTheta >> probDist;
63 SetCosTh(iii, cosTheta);
64 SetProb(iii,probDist);
65 }
66 }
void Init(G4int aScheme, G4int aRange)
void Init(std::ifstream &aDataFile)
void SetCosTh(G4int l, G4double coeff)
void SetProb(G4int l, G4double coeff)

Referenced by Init(), and G4NeutronHPPhotonDist::InitAngular().

◆ SetCosTh()

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

Definition at line 77 of file G4NeutronHPAngularP.hh.

77{theCosTh[l]=coeff;}

Referenced by Init().

◆ SetEnergy()

void G4NeutronHPAngularP::SetEnergy ( G4double  energy)
inline

Definition at line 76 of file G4NeutronHPAngularP.hh.

76{ theEnergy = energy; }

◆ SetProb()

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

Definition at line 78 of file G4NeutronHPAngularP.hh.

78{theProb[l]=coeff;}

Referenced by Init().


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