Skip to content

Commit

Permalink
Merge pull request #21120 from cms-btv-pog/GhostTrackStateProtection_…
Browse files Browse the repository at this point in the history
…from-CMSSW_10_0_X_2017-11-01-1100

Added protection for invalid GhostTrackStates
  • Loading branch information
cmsbuild committed Nov 4, 2017
2 parents 5fbe472 + 46cc926 commit 8c6eae3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions RecoVertex/GhostTrackFitter/src/PositiveSideGhostTrackFitter.cc
@@ -1,6 +1,7 @@
#include <cmath>
#include <vector>

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DataFormats/GeometryVector/interface/GlobalVector.h"
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"

Expand Down Expand Up @@ -35,13 +36,17 @@ GhostTrackPrediction PositiveSideGhostTrackFitter::fit(
GhostTrackState testState = state;
testState.linearize(pred, 2. * origin - lambda);
double ndof, chi2;

updater.contribution(prior, testState, ndof, chi2, true);
if (ndof > 0. && chi2 < 10.) {
state = testState;
if (state.weight() != 1.)
state.setWeight(3.);
done = false;

if (testState.isValid()) {
updater.contribution(prior, testState, ndof, chi2, true);
if (ndof > 0. && chi2 < 10.) {
state = testState;
if (state.weight() != 1.)
state.setWeight(3.);
done = false;
}
} else {
edm::LogError("InvalidGhostTrackState") << "Invalid GhostTrackState encountered!";
}
}
}
Expand Down

0 comments on commit 8c6eae3

Please sign in to comment.