Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4RDLinLogLogInterpolation Class Reference

#include <G4RDLinLogLogInterpolation.hh>

Inheritance diagram for G4RDLinLogLogInterpolation:
G4RDVDataSetAlgorithm

Public Member Functions

 G4RDLinLogLogInterpolation ()
 
 ~G4RDLinLogLogInterpolation ()
 
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 46 of file G4RDLinLogLogInterpolation.hh.

Constructor & Destructor Documentation

G4RDLinLogLogInterpolation::G4RDLinLogLogInterpolation ( )

Definition at line 39 of file G4RDLinLogLogInterpolation.cc.

Referenced by Clone().

40 { }
G4RDLinLogLogInterpolation::~G4RDLinLogLogInterpolation ( )

Definition at line 44 of file G4RDLinLogLogInterpolation.cc.

45 { }

Member Function Documentation

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

Implements G4RDVDataSetAlgorithm.

Definition at line 51 of file G4RDLinLogLogInterpolation.cc.

References plottest35::bin.

54 {
55  G4int nBins = data.size() - 1;
56  G4double value = 0.;
57  if (x < points[0])
58  {
59  value = 0.;
60  }
61  else if (bin < nBins)
62  {
63  G4double e1 = points[bin];
64  G4double e2 = points[bin+1];
65  G4double d1 = data[bin];
66  G4double d2 = data[bin+1];
67  if(d1 > 0.0 && d2 > 0.0) {
68  value = (std::log10(d1)*std::log10(e2/x) + std::log10(d2)*std::log10(x/e1)) / std::log10(e2/e1);
69  value = std::pow(10.,value);
70  } else {
71  value = (d1*std::log10(e2/x) + d2*std::log10(x/e1)) / std::log10(e2/e1);
72  }
73  }
74  else
75  {
76  value = data[nBins];
77  }
78 
79  return value;
80 }
tuple bin
Definition: plottest35.py:22
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
double G4double
Definition: G4Types.hh:76
G4RDVDataSetAlgorithm * G4RDLinLogLogInterpolation::Clone ( ) const
virtual

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