Geant4-11
Public Member Functions | Private Attributes
G4ParticleHPAngularP Class Reference

#include <G4ParticleHPAngularP.hh>

Public Member Functions

 G4ParticleHPAngularP ()
 
G4double GetCosTh ()
 
G4double GetCosTh (G4int l)
 
G4double GetEnergy ()
 
G4int GetNumberOfPoints ()
 
G4double GetProb (G4int l)
 
void Init (G4double e, G4int n)
 
void Init (std::istream &aDataFile)
 
void SetCosTh (G4int l, G4double coeff)
 
void SetEnergy (G4double energy)
 
void SetProb (G4int l, G4double coeff)
 
 ~G4ParticleHPAngularP ()
 

Private Attributes

G4int nCoeff
 
G4doubletheCosTh
 
G4double theEnergy
 
G4ParticleHPInterpolator theInt
 
G4InterpolationManager theManager
 
G4doubletheProb
 

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 }

References nCoeff, theCosTh, theEnergy, and theProb.

◆ ~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 }

References theCosTh, and theProb.

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--;
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
G4InterpolationManager theManager
G4ParticleHPInterpolator theInt
G4double GetProb(G4int l)
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
Definition: run.py:1

References G4UniformRand, GetCosTh(), GetNumberOfPoints(), GetProb(), G4InterpolationManager::GetScheme(), G4ParticleHPInterpolator::Interpolate(), theInt, and theManager.

Referenced by GetCosTh().

◆ GetCosTh() [2/2]

G4double G4ParticleHPAngularP::GetCosTh ( G4int  l)
inline

Definition at line 84 of file G4ParticleHPAngularP.hh.

84{return theCosTh[l];}

References theCosTh.

Referenced by G4ParticleHPPhotonDist::GetPhotons().

◆ GetEnergy()

G4double G4ParticleHPAngularP::GetEnergy ( )
inline

Definition at line 86 of file G4ParticleHPAngularP.hh.

86{return theEnergy;}

References theEnergy.

◆ GetNumberOfPoints()

G4int G4ParticleHPAngularP::GetNumberOfPoints ( )
inline

Definition at line 87 of file G4ParticleHPAngularP.hh.

87{ return nCoeff; }

References nCoeff.

Referenced by GetCosTh().

◆ GetProb()

G4double G4ParticleHPAngularP::GetProb ( G4int  l)
inline

Definition at line 85 of file G4ParticleHPAngularP.hh.

85{return theProb[l];}

References theProb.

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 }

References CLHEP::detail::n, nCoeff, theCosTh, theEnergy, and theProb.

◆ 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)
static constexpr double eV

References CLHEP::eV, G4InterpolationManager::Init(), Init(), SetCosTh(), SetProb(), and theManager.

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;}

References theCosTh.

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)

References G4INCL::KinematicsUtils::energy(), and theEnergy.

◆ SetProb()

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

Definition at line 82 of file G4ParticleHPAngularP.hh.

82{theProb[l]=coeff;}

References theProb.

Referenced by Init().

Field Documentation

◆ nCoeff

G4int G4ParticleHPAngularP::nCoeff
private

Definition at line 109 of file G4ParticleHPAngularP.hh.

Referenced by G4ParticleHPAngularP(), GetNumberOfPoints(), and Init().

◆ theCosTh

G4double* G4ParticleHPAngularP::theCosTh
private

◆ theEnergy

G4double G4ParticleHPAngularP::theEnergy
private

Definition at line 107 of file G4ParticleHPAngularP.hh.

Referenced by G4ParticleHPAngularP(), GetEnergy(), Init(), and SetEnergy().

◆ theInt

G4ParticleHPInterpolator G4ParticleHPAngularP::theInt
private

Definition at line 108 of file G4ParticleHPAngularP.hh.

Referenced by GetCosTh().

◆ theManager

G4InterpolationManager G4ParticleHPAngularP::theManager
private

Definition at line 110 of file G4ParticleHPAngularP.hh.

Referenced by GetCosTh(), and Init().

◆ theProb

G4double* G4ParticleHPAngularP::theProb
private

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