#include <G4LinLogLogInterpolation.hh>
|
| G4LinLogLogInterpolation () |
|
| ~G4LinLogLogInterpolation () |
|
G4double | Calculate (G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const |
|
G4double | Calculate (G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data, const G4DataVector &log_energies, const G4DataVector &log_data) const |
|
virtual G4VDataSetAlgorithm * | Clone () const |
|
| G4VDataSetAlgorithm () |
|
virtual | ~G4VDataSetAlgorithm () |
|
virtual G4double | Calculate (G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data) const =0 |
|
virtual G4double | Calculate (G4double point, G4int bin, const G4DataVector &energies, const G4DataVector &data, const G4DataVector &log_energies, const G4DataVector &log_data) const =0 |
|
virtual G4VDataSetAlgorithm * | Clone () const =0 |
|
| G4VDataSetAlgorithm (const G4VDataSetAlgorithm &)=delete |
|
G4VDataSetAlgorithm & | operator= (const G4VDataSetAlgorithm &right)=delete |
|
Definition at line 49 of file G4LinLogLogInterpolation.hh.
◆ G4LinLogLogInterpolation()
G4LinLogLogInterpolation::G4LinLogLogInterpolation |
( |
| ) |
|
◆ ~G4LinLogLogInterpolation()
G4LinLogLogInterpolation::~G4LinLogLogInterpolation |
( |
| ) |
|
◆ Calculate() [1/2]
Implements G4VDataSetAlgorithm.
Definition at line 51 of file G4LinLogLogInterpolation.cc.
54{
55
58 if (x < points[0])
59 {
60 value = 0.;
61 }
62 else if (bin < nBins)
63 {
68 if(d1 > 0.0 && d2 > 0.0) {
69 value = (std::log10(d1)*std::log10(e2/x) + std::log10(d2)*std::log10(x/e1)) / std::log10(e2/e1);
70 value = std::pow(10.,value);
71 } else {
72 value = (d1*std::log10(e2/x) + d2*std::log10(x/e1)) / std::log10(e2/e1);
73 }
74 }
75 else
76 {
77 value = data[nBins];
78 }
79
80 return value;
81}
◆ Calculate() [2/2]
Implements G4VDataSetAlgorithm.
Definition at line 83 of file G4LinLogLogInterpolation.cc.
88{
89
93 if (x < points[0])
94 {
95 value = 0.;
96 }
97 else if (bin < nBins)
98 {
104 G4double log_e2 = log_points[bin+1];
107
108
109
110
111
112 if (d1 > 0.0 && d2 > 0.0)
113 {
114
115
116
117 value = log_d1 + (log_d2 - log_d1)*(log_x - log_e1)/(log_e2 - log_e1);
118
119
120
121
122
123 value = std::pow(10.,value);
124
125
126 }
127 else
128 {
129
130
131 if (e1 == 0.0) e1 = 1e-300;
132 if (e2 == 0.0) e2 = 1e-300;
133 value = d1 + (d2 - d1)*(log_x - log_e1)/(log_e2 - log_e1);
134
135 }
136 }
137 else
138 {
139 value = data[nBins];
140 }
141 return value;
142}
◆ Clone()
The documentation for this class was generated from the following files: