Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4RDLinLogInterpolation Class Reference

#include <G4RDLinLogInterpolation.hh>

Inheritance diagram for G4RDLinLogInterpolation:
Collaboration diagram for G4RDLinLogInterpolation:

Public Member Functions

 G4RDLinLogInterpolation ()
 
 ~G4RDLinLogInterpolation ()
 
G4double Calculate (G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const
 
virtual G4RDVDataSetAlgorithmClone () const
 
- Public Member Functions inherited from G4RDVDataSetAlgorithm
 G4RDVDataSetAlgorithm ()
 
virtual ~G4RDVDataSetAlgorithm ()
 

Detailed Description

Definition at line 47 of file G4RDLinLogInterpolation.hh.

Constructor & Destructor Documentation

G4RDLinLogInterpolation::G4RDLinLogInterpolation ( )

Definition at line 40 of file G4RDLinLogInterpolation.cc.

41 { }

Here is the caller graph for this function:

G4RDLinLogInterpolation::~G4RDLinLogInterpolation ( )

Definition at line 46 of file G4RDLinLogInterpolation.cc.

47 { }

Member Function Documentation

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

Implements G4RDVDataSetAlgorithm.

Definition at line 50 of file G4RDLinLogInterpolation.cc.

53 {
54  G4int nBins = data.size() - 1;
55  G4double value = 0.;
56  if (x < points[0])
57  {
58  value = 0.;
59  }
60  else if (bin < nBins)
61  {
62  G4double e1 = points[bin];
63  G4double e2 = points[bin+1];
64  G4double d1 = std::log(data[bin]);
65  G4double d2 = std::log(data[bin+1]);
66  value = std::exp(d1 + (d2 - d1)*(x - e1)/ (e2 - e1));
67  }
68  else
69  {
70  value = data[nBins];
71  }
72  return value;
73 }
tuple bin
Definition: plottest35.py:22
static const G4double d2
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
Definition: expat.h:331
static const G4double d1
double G4double
Definition: G4Types.hh:76
virtual G4RDVDataSetAlgorithm* G4RDLinLogInterpolation::Clone ( ) const
inlinevirtual

Implements G4RDVDataSetAlgorithm.

Definition at line 59 of file G4RDLinLogInterpolation.hh.

Here is the call graph for this function:


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