Geant4-11
Public Member Functions
G4LinInterpolator Class Reference

#include <G4LinInterpolator.hh>

Inheritance diagram for G4LinInterpolator:
G4IInterpolator

Public Member Functions

G4double Calculate (G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const
 
G4IInterpolatorClone () const
 
 G4LinInterpolator ()
 
 ~G4LinInterpolator ()
 

Detailed Description

Definition at line 49 of file G4LinInterpolator.hh.

Constructor & Destructor Documentation

◆ G4LinInterpolator()

G4LinInterpolator::G4LinInterpolator ( )

Definition at line 41 of file G4LinInterpolator.cc.

42{ }

Referenced by Clone().

◆ ~G4LinInterpolator()

G4LinInterpolator::~G4LinInterpolator ( )

Definition at line 46 of file G4LinInterpolator.cc.

47{ }

Member Function Documentation

◆ Calculate()

G4double G4LinInterpolator::Calculate ( G4double  point,
G4int  bin,
const G4DataVector energies,
const G4DataVector data 
) const
virtual

Implements G4IInterpolator.

Definition at line 53 of file G4LinInterpolator.cc.

56{
57 G4int nBins = data.size() - 1;
58 G4double value = 0.;
59 if (x < points[0])
60 {
61 value = 0.;
62 }
63 else if (bin < nBins)
64 {
65 G4double e1 = points[bin];
66 G4double e2 = points[bin+1];
67 G4double d1 = data[bin];
68 G4double d2 = data[bin+1];
69 value = d1 + (d2 - d1)*(x - e1)/(e2 - e1);
70 }
71 else
72 {
73 value = data[nBins];
74 }
75 return value;
76}
static const G4double e1[44]
static const G4double e2[44]
static const G4double d1
static const G4double d2
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85

References d1, d2, e1, and e2.

◆ Clone()

G4IInterpolator * G4LinInterpolator::Clone ( ) const
virtual

Implements G4IInterpolator.

Definition at line 50 of file G4LinInterpolator.cc.

51{ return new G4LinInterpolator; }

References G4LinInterpolator().


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