Geant4 11.1.1
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 38 of file G4ParticleHPPolynomExpansion.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPPolynomExpansion()

G4ParticleHPPolynomExpansion::G4ParticleHPPolynomExpansion ( )
inline

Definition at line 41 of file G4ParticleHPPolynomExpansion.hh.

42 {
43 theCoeff = 0;
44 nPoly=0;
45 }

◆ ~G4ParticleHPPolynomExpansion()

G4ParticleHPPolynomExpansion::~G4ParticleHPPolynomExpansion ( )
inline

Definition at line 46 of file G4ParticleHPPolynomExpansion.hh.

47 {
48 if(theCoeff!=0) delete [] theCoeff;
49 }

Member Function Documentation

◆ GetValue()

G4double G4ParticleHPPolynomExpansion::GetValue ( G4double  anEnergy)
inline

Definition at line 62 of file G4ParticleHPPolynomExpansion.hh.

63 {
64 G4int i;
65 G4double result=0;
66 G4double base = anEnergy/CLHEP::eV;
67 G4double running = 1;
68 for(i=0; i<nPoly; i++)
69 {
70 result+=theCoeff[i]*running;
71 running *= base;
72 }
73 return result;
74 }
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 51 of file G4ParticleHPPolynomExpansion.hh.

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

Referenced by G4ParticleHPParticleYield::InitMean().


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