Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleHPAngularP Class Reference

#include <G4ParticleHPAngularP.hh>

Public Member Functions

 G4ParticleHPAngularP ()
 
 ~G4ParticleHPAngularP ()
 
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 38 of file G4ParticleHPAngularP.hh.

Constructor & Destructor Documentation

G4ParticleHPAngularP::G4ParticleHPAngularP ( )
inline

Definition at line 42 of file G4ParticleHPAngularP.hh.

43  {
44  theCosTh = NULL;
45  theProb = NULL;
46  theEnergy = 0.;
47  nCoeff = 0;
48  }
G4ParticleHPAngularP::~G4ParticleHPAngularP ( )
inline

Definition at line 49 of file G4ParticleHPAngularP.hh.

50  {
51  if(theCosTh!=0) delete [] theCosTh;
52  if(theProb!=0) delete [] theProb;
53  }

Member Function Documentation

G4double G4ParticleHPAngularP::GetCosTh ( G4int  l)
inline

Definition at line 83 of file G4ParticleHPAngularP.hh.

83 {return theCosTh[l];}

Here is the caller graph for this function:

G4double G4ParticleHPAngularP::GetCosTh ( )
inline

Definition at line 87 of file G4ParticleHPAngularP.hh.

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

Here is the call graph for this function:

G4double G4ParticleHPAngularP::GetEnergy ( )
inline

Definition at line 85 of file G4ParticleHPAngularP.hh.

85 {return theEnergy;}
G4int G4ParticleHPAngularP::GetNumberOfPoints ( )
inline

Definition at line 86 of file G4ParticleHPAngularP.hh.

86 { return nCoeff; }

Here is the caller graph for this function:

G4double G4ParticleHPAngularP::GetProb ( G4int  l)
inline

Definition at line 84 of file G4ParticleHPAngularP.hh.

84 {return theProb[l];}

Here is the caller graph for this function:

void G4ParticleHPAngularP::Init ( std::istream &  aDataFile)
inline

Definition at line 55 of file G4ParticleHPAngularP.hh.

56  {
57  G4double eNeu, cosTheta, probDist;
58  G4int nProb;
59  aDataFile >> eNeu >> nProb;
60  theManager.Init(aDataFile);
61  eNeu *= CLHEP::eV;
62  Init(eNeu, nProb);
63  for (G4int iii=0; iii<nProb; iii++)
64  {
65  aDataFile >> cosTheta >> probDist;
66  SetCosTh(iii, cosTheta);
67  SetProb(iii,probDist);
68  }
69  }
void Init(std::istream &aDataFile)
void Init(G4int aScheme, G4int aRange)
int G4int
Definition: G4Types.hh:78
void SetCosTh(G4int l, G4double coeff)
static constexpr double eV
double G4double
Definition: G4Types.hh:76
void SetProb(G4int l, G4double coeff)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 71 of file G4ParticleHPAngularP.hh.

72  {
73  theCosTh = new G4double[n];
74  theProb = new G4double[n];
75  theEnergy = e;
76  nCoeff = n;
77  }
double G4double
Definition: G4Types.hh:76
void G4ParticleHPAngularP::SetCosTh ( G4int  l,
G4double  coeff 
)
inline

Definition at line 80 of file G4ParticleHPAngularP.hh.

80 {theCosTh[l]=coeff;}

Here is the caller graph for this function:

void G4ParticleHPAngularP::SetEnergy ( G4double  energy)
inline

Definition at line 79 of file G4ParticleHPAngularP.hh.

79 { theEnergy = energy; }
G4double energy(const ThreeVector &p, const G4double m)

Here is the call graph for this function:

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

Definition at line 81 of file G4ParticleHPAngularP.hh.

81 {theProb[l]=coeff;}

Here is the caller graph for this function:


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