11 Trajectory::DataContainer::const_iterator i_fwd = trajectory.
measurements().begin();
12 Trajectory::DataContainer::const_reverse_iterator i_bwd = trajectory.
measurements().rbegin();
13 Trajectory::DataContainer::const_iterator i_end = trajectory.
measurements().end();
14 Trajectory::DataContainer::const_reverse_iterator i_rend = trajectory.
measurements().rend();
16 for (; forward ? i_fwd != i_end : i_bwd != i_rend; ++i_fwd, ++i_bwd, ++i_residual) {
18 if (!
i->recHit()->isValid() ||
i->recHit()->det() ==
nullptr)
21 if (!
i->forwardPredictedState().isValid() || !
i->backwardPredictedState().isValid()) {
22 edm::LogError(
"InvalideState") <<
"one of the step is invalid";
29 edm::LogError(
"InvalideState") <<
"the combined state is invalid";
35 LocalPoint &&dethit_localpos =
i->recHit()->localPosition();
36 LocalError &&dethit_localerr =
i->recHit()->localPositionError();
37 auto const &error_including_alignment = dethit_localerr;
39 auto x = (dethit_localpos.
x() - combo_localpos.
x());
40 auto y = (dethit_localpos.
y() - combo_localpos.
y());
45 (dethit_localpos.
x() - combo_localpos.
x()) /
std::sqrt(error_including_alignment.xx() + combo_localerr.
xx());
47 (dethit_localpos.
y() - combo_localpos.
y()) /
std::sqrt(error_including_alignment.yy() + combo_localerr.
yy());