183 const std::size_t idx,
184 const std::size_t idy)
const
192 const G4double x2 = xVector[idx + 1];
194 const G4double y2 = yVector[idy + 1];
215 const G4double f1x = DerivativeX(idx, idy, dx);
216 const G4double f2x = DerivativeX(idx + 1, idy, dx);
217 const G4double f3x = DerivativeX(idx + 1, idy + 1, dx);
218 const G4double f4x = DerivativeX(idx, idy + 1, dx);
220 const G4double f1y = DerivativeY(idx, idy, dy);
221 const G4double f2y = DerivativeY(idx + 1, idy, dy);
222 const G4double f3y = DerivativeY(idx + 1, idy + 1, dy);
223 const G4double f4y = DerivativeY(idx, idy + 1, dy);
226 const G4double f1xy = DerivativeXY(idx, idy, dxy);
227 const G4double f2xy = DerivativeXY(idx + 1, idy, dxy);
228 const G4double f3xy = DerivativeXY(idx + 1, idy + 1, dxy);
229 const G4double f4xy = DerivativeXY(idx, idy + 1, dxy);
231 return f1 + f1y * h2 + (3 * (f4 - f1) - 2 * f1y - f4y) * h22 +
232 (2 * (f1 - f4) + f1y + f4y) * h23 + f1x * h1 + f1xy * h1 * h2 +
233 (3 * (f4x - f1x) - 2 * f1xy - f4xy) * h1 * h22 +
234 (2 * (f1x - f4x) + f1xy + f4xy) * h1 * h23 +
235 (3 * (f2 - f1) - 2 * f1x - f2x) * h12 +
236 (3 * f2y - 3 * f1y - 2 * f1xy - f2xy) * h12 * h2 +
237 (9 * (f1 - f2 + f3 - f4) + 6 * f1x + 3 * f2x - 3 * f3x - 6 * f4x +
238 6 * f1y - 6 * f2y - 3 * f3y + 3 * f4y + 4 * f1xy + 2 * f2xy + f3xy +
241 (6 * (-f1 + f2 - f3 + f4) - 4 * f1x - 2 * f2x + 2 * f3x + 4 * f4x -
242 3 * f1y + 3 * f2y + 3 * f3y - 3 * f4y - 2 * f1xy - f2xy - f3xy -
245 (2 * (f1 - f2) + f1x + f2x) * h13 +
246 (2 * (f1y - f2y) + f1xy + f2xy) * h13 * h2 +
247 (6 * (-f1 + f2 - f3 + f4) + 3 * (-f1x - f2x + f3x + f4x) - 4 * f1y +
248 4 * f2y + 2 * f3y - 2 * f4y - 2 * f1xy - 2 * f2xy - f3xy - f4xy) *
250 (4 * (f1 - f2 + f3 - f4) + 2 * (f1x + f2x - f3x - f4x) +
251 2 * (f1y - f2y - f3y + f4y) + f1xy + f2xy + f3xy + f4xy) *
258 const std::vector<G4double>& vecY)
261 std::size_t nx = vecX.size();
262 std::size_t ny = vecY.size();
266 ed <<
"G4Physics2DVector is too short: nx= " << nx <<
" ny= " << ny;
268 "Both lengths should be above 1");
274 for(std::size_t i = 0; i < nx; ++i)
276 xVector[i] = vecX[i];
278 for(std::size_t j = 0; j < ny; ++j)
280 yVector[j] = vecY[j];
289 G4long prec = out.precision();
290 out <<
G4int(type) <<
" " << numberOfXNodes <<
" " << numberOfYNodes
292 out << std::setprecision(8);
295 for(std::size_t i = 0; i < numberOfXNodes - 1; ++i)
297 out << xVector[i] <<
" ";
299 out << xVector[numberOfXNodes - 1] <<
G4endl;
300 for(std::size_t j = 0; j < numberOfYNodes - 1; ++j)
302 out << yVector[j] <<
" ";
304 out << yVector[numberOfYNodes - 1] <<
G4endl;
305 for(std::size_t j = 0; j < numberOfYNodes; ++j)
307 for(std::size_t i = 0; i < numberOfXNodes - 1; ++i)
388 std::size_t& idy)
const
390 G4double y = std::min(std::max(yy, yVector[0]), yVector[numberOfYNodes - 1]);
395 G4double x1 = InterpolateLinearX(*(value[idy]), rand);
396 G4double x2 = InterpolateLinearX(*(value[idy + 1]), rand);
398 G4double del = yVector[idy + 1] - yVector[idy];
401 res += (x2 - x1) * (y - yVector[idy]) / del;