Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleHPPolynomExpansion Class Reference

#include <G4ParticleHPPolynomExpansion.hh>

Public Member Functions

 G4ParticleHPPolynomExpansion ()
 
 ~G4ParticleHPPolynomExpansion ()
 
void Init (std::istream &theData)
 
G4double GetValue (G4double anEnergy)
 

Detailed Description

Definition at line 39 of file G4ParticleHPPolynomExpansion.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPPolynomExpansion()

G4ParticleHPPolynomExpansion::G4ParticleHPPolynomExpansion ( )
inline

Definition at line 42 of file G4ParticleHPPolynomExpansion.hh.

43 {
44 theCoeff = nullptr;
45 nPoly = 0;
46 }

◆ ~G4ParticleHPPolynomExpansion()

G4ParticleHPPolynomExpansion::~G4ParticleHPPolynomExpansion ( )
inline

Definition at line 47 of file G4ParticleHPPolynomExpansion.hh.

47{ delete[] theCoeff; }

Member Function Documentation

◆ GetValue()

G4double G4ParticleHPPolynomExpansion::GetValue ( G4double anEnergy)
inline

Definition at line 59 of file G4ParticleHPPolynomExpansion.hh.

60 {
61 G4int i;
62 G4double result = 0;
63 G4double base = anEnergy / CLHEP::eV;
64 G4double running = 1;
65 for (i = 0; i < nPoly; i++) {
66 result += theCoeff[i] * running;
67 running *= base;
68 }
69 return result;
70 }
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85

Referenced by G4ParticleHPParticleYield::GetMean().

◆ Init()

void G4ParticleHPPolynomExpansion::Init ( std::istream & theData)
inline

Definition at line 49 of file G4ParticleHPPolynomExpansion.hh.

50 {
51 theData >> nPoly;
52 theCoeff = new G4double[nPoly];
53 G4int i;
54 for (i = 0; i < nPoly; i++) {
55 theData >> theCoeff[i];
56 }
57 }

Referenced by G4ParticleHPParticleYield::InitMean().


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