Geant4 11.2.2
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 ()
 

Detailed Description

Definition at line 49 of file G4LogLogInterpolator.hh.

Constructor & Destructor Documentation

◆ G4LogLogInterpolator()

G4LogLogInterpolator::G4LogLogInterpolator ( )

Definition at line 41 of file G4LogLogInterpolator.cc.

42{ }

Referenced by Clone().

◆ ~G4LogLogInterpolator()

G4LogLogInterpolator::~G4LogLogInterpolator ( )

Definition at line 46 of file G4LogLogInterpolator.cc.

47{ }

Member Function Documentation

◆ Calculate()

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

Implements G4IInterpolator.

Definition at line 53 of file G4LogLogInterpolator.cc.

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

◆ Clone()

G4IInterpolator * G4LogLogInterpolator::Clone ( ) const
virtual

Implements G4IInterpolator.

Definition at line 49 of file G4LogLogInterpolator.cc.


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