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);
CachingVertex< N > remove(const CachingVertex< N > &oldVertex, const RefCountedVertexTrack track) const override
VertexState positionUpdate(const VertexState &oldVertex, const RefCountedLinearizedTrackState linearizedTrack, const float weight, int sign) const
bool isValid() const
Make the ReferenceCountingProxy method to check validity public.
CachingVertex< N > update(const CachingVertex< N > &oldVertex, const RefCountedVertexTrack track, float weight, int sign) const
VertexState const & vertexState() const
ROOT::Math::SMatrix< double, N, 3, ROOT::Math::MatRepStd< double, N, 3 > > AlgebraicMatrixN3
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
float totalChiSquared() const
ROOT::Math::SMatrix< double, N - 2, N - 2, ROOT::Math::MatRepSym< double, N - 2 > > AlgebraicSymMatrixMM
VertexState const & priorVertexState() const
std::vector< RefCountedVertexTrack > tracks() const
ROOT::Math::SVector< double, N - 2 > AlgebraicVectorM
GlobalWeight weight() const
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
Abs< T >::type abs(const T &t)
ROOT::Math::SVector< double, N > AlgebraicVectorN
const AlgebraicSymMatrix33 matrix() const
GlobalErrorBase< double, WeightMatrixTag > GlobalWeight
AlgebraicVector3 weightTimesPosition() const
std::pair< bool, double > chi2Increment(const VertexState &oldVertex, const VertexState &newVertexState, const RefCountedLinearizedTrackState linearizedTrack, float weight) const
ROOT::Math::SVector< double, 3 > AlgebraicVector3
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
CachingVertex< N > add(const CachingVertex< N > &oldVertex, const RefCountedVertexTrack track) const override
Log< level::Warning, false > LogWarning
ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N > > AlgebraicSymMatrixNN
GlobalPoint position() const
ROOT::Math::SMatrix< double, N, N - 2, ROOT::Math::MatRepStd< double, N, N - 2 > > AlgebraicMatrixNM