8 double step,
double eps)
const
10 const double Safety = 0.9;
11 double remainigStep =
step;
12 double stepSize =
step;
15 std::pair<CartesianState, double> tryStep;
20 if (tryStep.second <eps) {
21 if (remainigStep - stepSize < eps/2) {
23 << nsteps <<
" steps" << std::endl;
27 remainigStep -= stepSize;
30 stepSize =
std::min( stepSize*factor, remainigStep);
31 currentStart = tryStep.first;
33 <<
" remain after " << nsteps <<
" steps. Step size increased by "
34 << factor <<
" to " << stepSize << std::endl;
41 if (
verbose())
std::cout <<
"Accuracy not yet reached: delta = " << tryStep.second
42 <<
", step reduced by " << factor <<
" to " << stepSize
44 <<
", " << currentStart.
position().
z() << std::endl;
46 }
while (remainigStep > eps/2);
51 std::pair<CartesianState, double>
60 return std::pair<CartesianState, double>(secondHalf,
diff);
tuple start
Check for commandline option errors.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
double distance(const CartesianState &a, const CartesianState &b) const
CartesianState operator()(const CartesianState &start, const RKCartesianDerivative &deriv, double step, double eps) const
T z() const
Cartesian z coordinate.
std::pair< CartesianState, double > stepWithAccuracy(const CartesianState &start, const RKCartesianDerivative &deriv, double step) const
T perp() const
Magnitude of transverse component.
const Vector3D & momentum() const
const Vector3D & position() const
Power< A, B >::type pow(const A &a, const B &b)