28 template <
typename propagator_state_t,
typename stepper_t>
29 int bid(
const propagator_state_t& ,
30 const stepper_t& )
const {
48 template <
typename propagator_state_t,
typename stepper_t>
49 bool k(
const propagator_state_t& state,
const stepper_t&
stepper,
51 const int i = 0,
const double h = 0.,
54 stepper.charge(state.stepping) / stepper.momentum(state.stepping);
57 knew = qop * stepper.direction(state.stepping).cross(bField);
58 kQoP = {0., 0., 0., 0.};
61 qop * (stepper.direction(state.stepping) +
h * kprev).
cross(bField);
76 template <
typename propagator_state_t,
typename stepper_t>
77 bool finalize(propagator_state_t& state,
const stepper_t& stepper,
78 const double h)
const {
94 template <
typename propagator_state_t,
typename stepper_t>
95 bool finalize(propagator_state_t& state,
const stepper_t& stepper,
109 template <
typename propagator_state_t,
typename stepper_t>
111 const double h)
const {
116 std::hypot(1, state.options.mass / stepper.momentum(state.stepping));
117 state.stepping.t += h * derivative;
118 if (state.stepping.covTransport) {
119 state.stepping.derivative(3) = derivative;
132 template <
typename propagator_state_t,
typename stepper_t>
154 auto& sd = state.stepping.stepData;
155 auto dir = stepper.direction(state.stepping);
157 stepper.charge(state.stepping) / stepper.momentum(state.stepping);
159 D = FreeMatrix::Identity();
161 double half_h = h * 0.5;
164 auto dFdT = D.block<3, 3>(0, 4);
165 auto dFdL = D.block<3, 1>(0, 7);
167 auto dGdT = D.block<3, 3>(4, 4);
168 auto dGdL = D.block<3, 1>(4, 7);
181 dk1dL = dir.cross(sd.B_first);
182 dk2dL = (dir + half_h * sd.k1).
cross(sd.B_middle) +
183 qop * half_h * dk1dL.cross(sd.B_middle);
184 dk3dL = (dir + half_h * sd.k2).
cross(sd.B_middle) +
185 qop * half_h * dk2dL.cross(sd.B_middle);
187 (dir + h * sd.k3).
cross(sd.B_last) + qop * h * dk3dL.cross(sd.B_last);
189 dk1dT(0, 1) = sd.B_first.z();
190 dk1dT(0, 2) = -sd.B_first.y();
191 dk1dT(1, 0) = -sd.B_first.z();
192 dk1dT(1, 2) = sd.B_first.x();
193 dk1dT(2, 0) = sd.B_first.y();
194 dk1dT(2, 1) = -sd.B_first.x();
197 dk2dT += half_h * dk1dT;
200 dk3dT += half_h * dk2dT;
207 dFdT += h / 6. * (dk1dT + dk2dT + dk3dT);
210 dFdL = (h *
h) / 6. * (dk1dL + dk2dL + dk3dL);
212 dGdT += h / 6. * (dk1dT + 2. * (dk2dT + dk3dT) + dk4dT);
214 dGdL = h / 6. * (dk1dL + 2. * (dk2dL + dk3dL) + dk4dL);
217 h * state.options.mass * state.options.mass *
218 stepper.charge(state.stepping) /
219 (stepper.momentum(state.stepping) *
220 std::hypot(1., state.options.mass / stepper.momentum(state.stepping)));