aboutsummaryrefslogtreecommitdiff
path: root/utils/chi2
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2020-08-30 09:17:01 -0500
committertlatorre <tlatorre@uchicago.edu>2020-08-30 09:17:01 -0500
commita7cfee22569ef2afb8d2b89b47ec6ee74c5f8037 (patch)
tree9952d8149ec15d7016aebdac8aa4dbaa2909d56a /utils/chi2
parent5d8a61777f8d7a65402c3bbd776041c9466d33c9 (diff)
downloadsddm-a7cfee22569ef2afb8d2b89b47ec6ee74c5f8037.tar.gz
sddm-a7cfee22569ef2afb8d2b89b47ec6ee74c5f8037.tar.bz2
sddm-a7cfee22569ef2afb8d2b89b47ec6ee74c5f8037.zip
update energy resolution -> max(EPSILON,resolution)
This commit updates the chi2 script to make sure that the energy resolution is nonzero otherwise we get nans.
Diffstat (limited to 'utils/chi2')
-rwxr-xr-xutils/chi26
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/chi2 b/utils/chi2
index 0a8fc00..b393954 100755
--- a/utils/chi2
+++ b/utils/chi2
@@ -120,13 +120,13 @@ def get_mc_hists_fast(ke_dict,x,bins,apply_norm=False):
if id in (20,2020):
ke = ke*x[1]
- scale = bincenters2*x[2]
+ scale = bincenters2*max(EPSILON,x[2])
elif id in (22,2222):
ke = ke*x[3]
- scale = bincenters2*x[4]
+ scale = bincenters2*max(EPSILON,x[4])
elif id == 2022:
ke = ke*x[5]
- scale = bincenters2*x[6]
+ scale = bincenters2*max(EPSILON,x[6])
hist = np.histogram(ke,bins=bins2)[0]