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

#include <G4RDLinInterpolation.hh>

Inheritance diagram for G4RDLinInterpolation:
Collaboration diagram for G4RDLinInterpolation:

Public Member Functions

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

Detailed Description

Definition at line 51 of file G4RDLinInterpolation.hh.

Constructor & Destructor Documentation

G4RDLinInterpolation::G4RDLinInterpolation ( )

Definition at line 42 of file G4RDLinInterpolation.cc.

43 { }

Here is the caller graph for this function:

G4RDLinInterpolation::~G4RDLinInterpolation ( )

Definition at line 47 of file G4RDLinInterpolation.cc.

48 { }

Member Function Documentation

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

Implements G4RDVDataSetAlgorithm.

Definition at line 54 of file G4RDLinInterpolation.cc.

57 {
58  G4int nBins = data.size() - 1;
59  G4double value = 0.;
60  if (x < points[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  value = d1 + (d2 - d1)*(x - e1)/(e2 - e1);
71  }
72  else
73  {
74  value = data[nBins];
75  }
76  return value;
77 }
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

Here is the caller graph for this function:

G4RDVDataSetAlgorithm * G4RDLinInterpolation::Clone ( ) const
virtual

Implements G4RDVDataSetAlgorithm.

Definition at line 51 of file G4RDLinInterpolation.cc.

Here is the call graph for this function:


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