Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 39 of file G4ParticleHPAngularP.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPAngularP()

G4ParticleHPAngularP::G4ParticleHPAngularP ( )
inline

Definition at line 43 of file G4ParticleHPAngularP.hh.

44 {
45 theCosTh = NULL;
46 theProb = NULL;
47 theEnergy = 0.;
48 nCoeff = 0;
49 }

◆ ~G4ParticleHPAngularP()

G4ParticleHPAngularP::~G4ParticleHPAngularP ( )
inline

Definition at line 50 of file G4ParticleHPAngularP.hh.

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

Member Function Documentation

◆ GetCosTh() [1/2]

G4double G4ParticleHPAngularP::GetCosTh ( )
inline

Definition at line 88 of file G4ParticleHPAngularP.hh.

89 {
90 G4int i;
91 G4double rand = G4UniformRand();
92 G4double run=0, runo=0;
93 for (i=0; i<GetNumberOfPoints(); i++)
94 {
95 runo=run;
96 run += GetProb(i);
97 if(run>rand) break;
98 }
99 if(i == GetNumberOfPoints()) i--;
100 G4double costh = theInt.Interpolate(theManager.GetScheme(i), rand,
101 runo, run, GetCosTh(i-1), GetCosTh(i));
102 return costh;
103 }
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4UniformRand()
Definition: Randomize.hh:52
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 G4ParticleHPAngularP::GetCosTh ( G4int  l)
inline

Definition at line 84 of file G4ParticleHPAngularP.hh.

84{return theCosTh[l];}

Referenced by G4ParticleHPPhotonDist::GetPhotons().

◆ GetEnergy()

G4double G4ParticleHPAngularP::GetEnergy ( )
inline

Definition at line 86 of file G4ParticleHPAngularP.hh.

86{return theEnergy;}

◆ GetNumberOfPoints()

G4int G4ParticleHPAngularP::GetNumberOfPoints ( )
inline

Definition at line 87 of file G4ParticleHPAngularP.hh.

87{ return nCoeff; }

Referenced by GetCosTh().

◆ GetProb()

G4double G4ParticleHPAngularP::GetProb ( G4int  l)
inline

Definition at line 85 of file G4ParticleHPAngularP.hh.

85{return theProb[l];}

Referenced by GetCosTh().

◆ Init() [1/2]

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

Definition at line 72 of file G4ParticleHPAngularP.hh.

73 {
74 theCosTh = new G4double[n];
75 theProb = new G4double[n];
76 theEnergy = e;
77 nCoeff = n;
78 }

◆ Init() [2/2]

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

Definition at line 56 of file G4ParticleHPAngularP.hh.

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

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

◆ SetCosTh()

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

Definition at line 81 of file G4ParticleHPAngularP.hh.

81{theCosTh[l]=coeff;}

Referenced by Init().

◆ SetEnergy()

void G4ParticleHPAngularP::SetEnergy ( G4double  energy)
inline

Definition at line 80 of file G4ParticleHPAngularP.hh.

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

◆ SetProb()

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

Definition at line 82 of file G4ParticleHPAngularP.hh.

82{theProb[l]=coeff;}

Referenced by Init().


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