Skip to content

Commit

Permalink
add a nan protection to avoid crash in fastjet call from pvsorter
Browse files Browse the repository at this point in the history
  • Loading branch information
arizzi committed Jun 11, 2016
1 parent 873ee95 commit 7c4689a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CommonTools/RecoAlgos/src/PrimaryVertexSorting.cc
Expand Up @@ -27,7 +27,13 @@ float PrimaryVertexSorting::score(const reco::Vertex & pv,const std::vector<con
float scale=1.;
if(c->bestTrack() != 0)
{
scale=(c->pt()-c->bestTrack()->ptError())/c->pt();
if(c->pt()!=0) {
scale=(c->pt()-c->bestTrack()->ptError())/c->pt();
}
if(isnan(scale)) {
edm::LogWarning("PrimaryVertexSorting") << "Scaling is NAN ignoring this candidate/track" << std::endl;
scale=0;
}
if(scale<0){
scale=0;
countScale0++;
Expand Down

0 comments on commit 7c4689a

Please sign in to comment.