Geant4 11.2.2
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 42 of file G4ParticleHPAngularP.hh.

43 {
44 theCosTh = nullptr;
45 theProb = nullptr;
46 theEnergy = 0.;
47 nCoeff = 0;
48 }

◆ ~G4ParticleHPAngularP()

G4ParticleHPAngularP::~G4ParticleHPAngularP ( )
inline

Definition at line 49 of file G4ParticleHPAngularP.hh.

50 {
51 delete[] theCosTh;
52 delete[] theProb;
53 }

Member Function Documentation

◆ GetCosTh() [1/2]

G4double G4ParticleHPAngularP::GetCosTh ( )
inline

Definition at line 86 of file G4ParticleHPAngularP.hh.

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

82{ return theCosTh[l]; }

Referenced by G4ParticleHPPhotonDist::GetPhotons().

◆ GetEnergy()

G4double G4ParticleHPAngularP::GetEnergy ( )
inline

Definition at line 84 of file G4ParticleHPAngularP.hh.

84{ return theEnergy; }

◆ GetNumberOfPoints()

G4int G4ParticleHPAngularP::GetNumberOfPoints ( )
inline

Definition at line 85 of file G4ParticleHPAngularP.hh.

85{ return nCoeff; }

Referenced by GetCosTh().

◆ GetProb()

G4double G4ParticleHPAngularP::GetProb ( G4int l)
inline

Definition at line 83 of file G4ParticleHPAngularP.hh.

83{ return theProb[l]; }

Referenced by GetCosTh().

◆ Init() [1/2]

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

Definition at line 70 of file G4ParticleHPAngularP.hh.

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

◆ Init() [2/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 aDataFile >> cosTheta >> probDist;
65 SetCosTh(iii, cosTheta);
66 SetProb(iii, probDist);
67 }
68 }
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 79 of file G4ParticleHPAngularP.hh.

79{ theCosTh[l] = coeff; }

Referenced by Init().

◆ SetEnergy()

void G4ParticleHPAngularP::SetEnergy ( G4double energy)
inline

Definition at line 78 of file G4ParticleHPAngularP.hh.

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

◆ SetProb()

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

Definition at line 80 of file G4ParticleHPAngularP.hh.

80{ theProb[l] = coeff; }

Referenced by Init().


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