10 float sigmaTolerance)
const {
15 auto const &trajParams =
track.trajParams();
20 unsigned int closest = 0;
21 for (
auto const &
hit :
track.recHits()) {
28 auto globalPosition =
recHit->surface()->toGlobal(trajParams[0].
position());
29 auto distance2 = (vtxPos - globalPosition).
mag2();
31 for (
unsigned int h = closest + 1;
h <
track.recHitsSize(); ++
h) {
33 auto nextHit =
track.recHit(
h);
34 if (!nextHit->isValid())
36 globalPosition = nextHit->surface()->toGlobal(trajParams[
h].
position());
37 auto nextDistance2 = (vtxPos - globalPosition).
mag2();
38 if (nextDistance2 > distance2)
41 distance2 = nextDistance2;
49 auto momDir =
recHit->surface()->toGlobal(trajParams[closest].direction());
50 globalPosition =
recHit->surface()->toGlobal(trajParams[closest].
position());
51 float decayLengthHitToVtx = (vtxPos - globalPosition).
dot(momDir);
57 float vertexError2 = ROOT::Math::Similarity(
j,
vtx.covariance());
58 auto decayLenError =
std::sqrt(vertexError2);