Geant4  10.02.p03
G4ParticleHPAngularP Class Reference

#include <G4ParticleHPAngularP.hh>

Collaboration diagram for G4ParticleHPAngularP:

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 ()
 

Private Attributes

G4double theEnergy
 
G4ParticleHPInterpolator theInt
 
G4int nCoeff
 
G4InterpolationManager theManager
 
G4doubletheCosTh
 
G4doubletheProb
 

Detailed Description

Definition at line 38 of file G4ParticleHPAngularP.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPAngularP()

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::~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

◆ GetCosTh() [1/2]

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:

◆ GetCosTh() [2/2]

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--;
100  runo, run, GetCosTh(i-1), GetCosTh(i));
101  return costh;
102  }
G4InterpolationManager theManager
G4ParticleHPInterpolator theInt
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:97
G4InterpolationScheme GetScheme(G4int index) const
double G4double
Definition: G4Types.hh:76
G4double GetProb(G4int l)
Here is the call graph for this function:

◆ GetEnergy()

G4double G4ParticleHPAngularP::GetEnergy ( )
inline

Definition at line 85 of file G4ParticleHPAngularP.hh.

85 {return theEnergy;}

◆ GetNumberOfPoints()

G4int G4ParticleHPAngularP::GetNumberOfPoints ( )
inline

Definition at line 86 of file G4ParticleHPAngularP.hh.

86 { return nCoeff; }
Here is the caller graph for this function:

◆ GetProb()

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:

◆ Init() [1/2]

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)
G4InterpolationManager theManager
int G4int
Definition: G4Types.hh:78
void SetCosTh(G4int l, G4double coeff)
double G4double
Definition: G4Types.hh:76
static const double eV
void SetProb(G4int l, G4double coeff)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init() [2/2]

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  }
Char_t n[5]
double G4double
Definition: G4Types.hh:76

◆ SetCosTh()

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:

◆ SetEnergy()

void G4ParticleHPAngularP::SetEnergy ( G4double  energy)
inline

Definition at line 79 of file G4ParticleHPAngularP.hh.

79 { theEnergy = energy; }
double energy
Definition: plottest35.C:25

◆ SetProb()

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:

Member Data Documentation

◆ nCoeff

G4int G4ParticleHPAngularP::nCoeff
private

Definition at line 108 of file G4ParticleHPAngularP.hh.

◆ theCosTh

G4double* G4ParticleHPAngularP::theCosTh
private

Definition at line 110 of file G4ParticleHPAngularP.hh.

◆ theEnergy

G4double G4ParticleHPAngularP::theEnergy
private

Definition at line 106 of file G4ParticleHPAngularP.hh.

◆ theInt

G4ParticleHPInterpolator G4ParticleHPAngularP::theInt
private

Definition at line 107 of file G4ParticleHPAngularP.hh.

◆ theManager

G4InterpolationManager G4ParticleHPAngularP::theManager
private

Definition at line 109 of file G4ParticleHPAngularP.hh.

◆ theProb

G4double* G4ParticleHPAngularP::theProb
private

Definition at line 111 of file G4ParticleHPAngularP.hh.


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