Geant4 11.3.0
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) const
 

Detailed Description

Definition at line 39 of file G4ParticleHPPolynomExpansion.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPPolynomExpansion()

G4ParticleHPPolynomExpansion::G4ParticleHPPolynomExpansion ( )
inline

Definition at line 43 of file G4ParticleHPPolynomExpansion.hh.

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

◆ ~G4ParticleHPPolynomExpansion()

G4ParticleHPPolynomExpansion::~G4ParticleHPPolynomExpansion ( )
inline

Definition at line 48 of file G4ParticleHPPolynomExpansion.hh.

48{ delete[] theCoeff; }

Member Function Documentation

◆ GetValue()

G4double G4ParticleHPPolynomExpansion::GetValue ( G4double anEnergy) const
inline

Definition at line 60 of file G4ParticleHPPolynomExpansion.hh.

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

◆ Init()

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

Definition at line 50 of file G4ParticleHPPolynomExpansion.hh.

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

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