Skip to content

Commit

Permalink
Merge pull request #18956 from jhgoh/RPCTimeFix91X
Browse files Browse the repository at this point in the history
Backport: RPCRecHits nan protection
  • Loading branch information
cmsbuild committed Jun 2, 2017
2 parents 4ecd0de + 4dc0794 commit abc68b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RecoLocalMuon/RPCRecHit/src/RPCCluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ int RPCCluster::bx() const { return bunchx; }

bool RPCCluster::hasTime() const { return nTime > 0; }
float RPCCluster::time() const { return hasTime() ? sumTime/nTime : 0; }
float RPCCluster::timeRMS() const { return hasTime() ? sqrt((sumTime2*nTime - sumTime*sumTime)/nTime) : -1; }
float RPCCluster::timeRMS() const { return hasTime() ? sqrt(max(0.F, sumTime2*nTime - sumTime*sumTime))/nTime : -1; }

bool RPCCluster::hasY() const { return nY > 0; }
float RPCCluster::y() const { return hasY() ? sumY/nY : 0; }
float RPCCluster::yRMS() const { return hasY() ? sqrt((sumY2*nY - sumY*sumY)/nY) : -1; }
float RPCCluster::yRMS() const { return hasY() ? sqrt(max(0.F, sumY2*nY - sumY*sumY))/nY : -1; }

bool RPCCluster::isAdjacent(const RPCCluster& cl) const
{
Expand Down

0 comments on commit abc68b5

Please sign in to comment.