Skip to content

Commit

Permalink
Fix division by 0 error
Browse files Browse the repository at this point in the history
  • Loading branch information
fairlyons authored and olantwin committed Nov 4, 2024
1 parent 1f07643 commit 39c915f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/shipDigiReco.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,9 @@ def findTracks(self):
error = "Fit not converged"
ut.reportError(error)
nmeas = fitStatus.getNdf()
chi2 = fitStatus.getChi2() / nmeas
global_variables.h['chi2'].Fill(chi2)
if nmeas > 0:
chi2 = fitStatus.getChi2() / nmeas
global_variables.h['chi2'].Fill(chi2)
# make track persistent
nTrack = self.fGenFitArray.GetEntries()
if not global_variables.debug:
Expand Down

0 comments on commit 39c915f

Please sign in to comment.