Skip to content

Commit

Permalink
Do not fit vertex for single track in PFTauSecondaryVertexProducer
Browse files Browse the repository at this point in the history
By requiring at least 2 tracks when doing a vertex, we can avoid most
of the possible exceptions.
  • Loading branch information
Dr15Jones committed Feb 20, 2018
1 parent 25156e1 commit ac57efd
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions RecoTauTag/RecoTau/plugins/PFTauSecondaryVertexProducer.cc
Expand Up @@ -103,11 +103,15 @@ void PFTauSecondaryVertexProducer::produce(edm::StreamID, edm::Event& iEvent,con
// Fit the secondary vertex
bool FitOk(true);
KalmanVertexFitter kvf(true);
try{
transVtx = kvf.vertex(transTrk); //KalmanVertexFitter
}catch(...){
FitOk=false;
}
if(transTrk.size() > 1) {
try{
transVtx = kvf.vertex(transTrk); //KalmanVertexFitter
}catch(...){
FitOk=false;
}
} else {
FitOk = false;
}
if(!transVtx.hasRefittedTracks()) FitOk=false;
if(transVtx.refittedTracks().size()!=transTrk.size()) FitOk=false;
if(FitOk){
Expand Down

0 comments on commit ac57efd

Please sign in to comment.