Skip to content

Commit 39c915f

Browse files
fairlyonsolantwin
authored andcommitted
Fix division by 0 error
1 parent 1f07643 commit 39c915f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python/shipDigiReco.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,9 @@ def findTracks(self):
969969
error = "Fit not converged"
970970
ut.reportError(error)
971971
nmeas = fitStatus.getNdf()
972-
chi2 = fitStatus.getChi2() / nmeas
973-
global_variables.h['chi2'].Fill(chi2)
972+
if nmeas > 0:
973+
chi2 = fitStatus.getChi2() / nmeas
974+
global_variables.h['chi2'].Fill(chi2)
974975
# make track persistent
975976
nTrack = self.fGenFitArray.GetEntries()
976977
if not global_variables.debug:

0 commit comments

Comments
 (0)