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

#include <G4LogLogInterpolator.hh>

+ Inheritance diagram for G4LogLogInterpolator:

Public Member Functions

 G4LogLogInterpolator ()
 
 ~G4LogLogInterpolator ()
 
G4double Calculate (G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const
 
virtual G4IInterpolatorClone () const
 
- Public Member Functions inherited from G4IInterpolator
 G4IInterpolator ()
 
virtual ~G4IInterpolator ()
 
virtual G4double Calculate (G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0
 
virtual G4IInterpolatorClone () const =0
 

Detailed Description

Definition at line 50 of file G4LogLogInterpolator.hh.

Constructor & Destructor Documentation

◆ G4LogLogInterpolator()

G4LogLogInterpolator::G4LogLogInterpolator ( )

Definition at line 42 of file G4LogLogInterpolator.cc.

43{ }

Referenced by Clone().

◆ ~G4LogLogInterpolator()

G4LogLogInterpolator::~G4LogLogInterpolator ( )

Definition at line 47 of file G4LogLogInterpolator.cc.

48{ }

Member Function Documentation

◆ Calculate()

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

Implements G4IInterpolator.

Definition at line 54 of file G4LogLogInterpolator.cc.

57{
58 G4int nBins = data.size() - 1;
59 // ---- MGP ---- To be verified; value = 0. is redundant here
60 G4double value = 0.;
61 if (x < points[0] || x == 0.)
62 {
63 value = 0;
64 }
65 else if (bin < nBins)
66 {
67 G4double e1 = points[bin];
68 G4double e2 = points[bin+1];
69 G4double d1 = data[bin];
70 G4double d2 = data[bin+1];
71
72 if (d1 != 0. && d2 != 0.)
73 {
74 value = (std::log10(d1)*std::log10(e2/x) + std::log10(d2)*std::log10(x/e1)) / std::log10(e2/e1);
75 value = std::pow(10.,value);
76 }
77 else
78 {
79 value = 0.;
80 }
81 }
82 else
83 {
84 value = data[nBins];
85 }
86
87 return value;
88}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66

◆ Clone()

G4IInterpolator * G4LogLogInterpolator::Clone ( ) const
virtual

Implements G4IInterpolator.

Definition at line 50 of file G4LogLogInterpolator.cc.


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