32 #ifndef G4ParticleHPInterpolator_h
33 #define G4ParticleHPInterpolator_h 1
57 if(x2-x1==0)
return (y2+y1)/2.;
58 slope = (y2-y1)/(x2-x1);
95 G4int theScheme = aScheme;
102 result = LinearLinear(x, x1, x2, y1, y2);
105 result = LinearLinear(x, x1, x2, y1, y2);
108 result = LinearLogarithmic(x, x1, x2, y1, y2);
111 result = LogarithmicLinear(x, x1, x2, y1, y2);
114 result = LogarithmicLogarithmic(x, x1, x2, y1, y2);
117 result = Random(x, x1, x2, y1, y2);
121 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPInterpolator::Carthesian Invalid InterpolationScheme");
132 G4int theScheme = aScheme;
137 result = Histogram(x, x1, x2, y1, y2);
140 result = LinearLinear(x, x1, x2, y1, y2);
143 result = LinearLogarithmic(x, x1, x2, y1, y2);
146 result = LogarithmicLinear(x, x1, x2, y1, y2);
149 result = LogarithmicLogarithmic(x, x1, x2, y1, y2);
152 result = Random(x, x1, x2, y1, y2);
156 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPInterpolator::Carthesian Invalid InterpolationScheme");
162 inline G4double G4ParticleHPInterpolator::
170 inline G4double G4ParticleHPInterpolator::
174 if(x2-x1==0)
return (y2+y1)/2.;
175 slope = (y2-y1)/(x2-x1);
181 inline G4double G4ParticleHPInterpolator::
185 if(x==0) result = y1+y2/2.;
186 else if(x1==0) result = y1;
187 else if(x2==0) result = y2;
192 inline G4double G4ParticleHPInterpolator::
196 if(y1==0||y2==0) result = 0;
199 result = LinearLinear(x, x1, x2,
G4Log(y1),
G4Log(y2));
200 result =
G4Exp(result);
205 inline G4double G4ParticleHPInterpolator::
208 if(x==0)
return y1+y2/2.;
209 else if(x1==0)
return y1;
210 else if(x2==0)
return y2;
212 if(y1==0||y2==0) result = 0;
216 result =
G4Exp(result);
221 inline G4double G4ParticleHPInterpolator::
G4double G4ParticleHPJENDLHEData::G4double result
G4double Lin(G4double x, G4double x1, G4double x2, G4double y1, G4double y2)
G4double Interpolate2(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
G4ParticleHPInterpolator()
~G4ParticleHPInterpolator()
G4GLOB_DLL std::ostream G4cout
G4double GetWeightedBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
G4double G4Log(G4double x)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double GetBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)