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

#include <CCalDataSet.hh>

Public Member Functions

void insert (double anEnergy, double aXsection)
 
double getCrossSection (double anEnergy)
 

Detailed Description

Definition at line 34 of file CCalDataSet.hh.

Member Function Documentation

double CCalDataSet::getCrossSection ( double  anEnergy)
inline

Definition at line 44 of file CCalDataSet.hh.

45  {
46  double result;
47  if(anEnergy < theData[0].first)
48  {
49  result = 0;
50  }
51  else
52  {
53  double x1,x2;
54  double y1,y2;
55  if(anEnergy > theData[theData.size()-1].second)
56  {
57  // extrapolation
58  int n=theData.size();
59  x1 = theData[n-1].first;
60  y1 = theData[n-1].second;
61  x2 = theData[n-2].first;
62  y2 = theData[n-2].second;
63  }
64  else
65  {
66  // linear search and interpolation
67  unsigned int i;
68  for(i=0; i<theData.size(); i++)
69  {
70  if(theData[i].first>anEnergy) break;
71  }
72  x1 = theData[i-1].first;
73  y1 = theData[i-1].second;
74  x2 = theData[i].first;
75  y2 = theData[i].second;
76  }
77  // interpolate logarithmic in energy and linear in cross-section
78  result = theInterpolator.Interpolate(LOGLIN, anEnergy, x1,x2,y1,y2);
79  }
80  return result*barn;
81  }
G4double G4ParticleHPJENDLHEData::G4double result
const G4int n
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
static constexpr double barn
Definition: G4SIunits.hh:105

Here is the call graph for this function:

void CCalDataSet::insert ( double  anEnergy,
double  aXsection 
)
inline

Definition at line 38 of file CCalDataSet.hh.

39  {
40  pair<double, double> aPoint(anEnergy, aXsection);
41  theData.push_back(aPoint);
42  }

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