12 template <
unsigned int N>
25 std::pair<bool, double> chi2P =
30 chi1 +=
sign * chi2P.second;
33 std::vector<RefCountedVertexTrack> newVertexTracks = oldVertex.
tracks();
36 newVertexTracks.push_back(
track);
38 typename std::vector<RefCountedVertexTrack>::iterator
pos =
39 find(newVertexTracks.begin(), newVertexTracks.end(),
track);
40 if (
pos != newVertexTracks.end()) {
41 newVertexTracks.erase(
pos);
43 std::cout <<
"KalmanVertexUpdator::Unable to find requested track in the current vertex" << std::endl;
44 throw VertexException(
"KalmanVertexUpdator::Unable to find requested track in the current vertex");
55 template <
unsigned int N>
62 template <
unsigned int N>
69 template <
unsigned int N>
76 if (!linearizedTrack->isValid())
88 <<
"predictedState error matrix inversion failed. An invalid vertex will be returned.";
100 edm::LogWarning(
"KalmanVertexUpdator") <<
"S matrix inversion failed. An invalid vertex will be returned.";
105 trackParametersWeight - ROOT::Math::Similarity(trackParametersWeight, ROOT::Math::Similarity(
b,
s));
115 (
weight *
sign) * ((ROOT::Math::Transpose(
a) * gB) *
116 (linearizedTrack->predictedStateParameters() - linearizedTrack->constantTerm()));
128 template <
unsigned int N>
136 if (!linearizedTrack->isValid())
137 return std::pair<bool, double>(
false, -1.);
140 newVertexPositionV(0) = newVertexPosition.
x();
141 newVertexPositionV(1) = newVertexPosition.
y();
142 newVertexPositionV(2) = newVertexPosition.
z();
147 AlgebraicVectorN trackParameters = linearizedTrack->predictedStateParameters();
152 <<
"predictedState error matrix inversion failed. An invalid vertex will be returned.";
153 return std::pair<bool, double>(
false, -1.);
158 edm::LogWarning(
"KalmanVertexUpdator") <<
"S matrix inversion failed. An invalid vertex will be returned.";
159 return std::pair<bool, double>(
false, -1.);
164 AlgebraicVectorM newTrackMomentumP =
s * ROOT::Math::Transpose(
b) * trackParametersWeight * vv;
169 linearizedTrack->checkParameters(parameterResiduals);
171 double chi2 =
weight * ROOT::Math::Similarity(parameterResiduals, trackParametersWeight);
174 chi2 +=
helper.vertexChi2(oldVertex, newVertexState);
176 return std::pair<bool, double>(
true,
chi2);