aboutsummaryrefslogtreecommitdiff
path: root/utils/chi2
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2020-08-30 09:25:18 -0500
committertlatorre <tlatorre@uchicago.edu>2020-08-30 09:25:18 -0500
commita01fded9219273c0112c371619427512f8e5b6e8 (patch)
tree9d0a8156064a98072c96441e3523996e9885471c /utils/chi2
parenta7cfee22569ef2afb8d2b89b47ec6ee74c5f8037 (diff)
downloadsddm-a01fded9219273c0112c371619427512f8e5b6e8.tar.gz
sddm-a01fded9219273c0112c371619427512f8e5b6e8.tar.bz2
sddm-a01fded9219273c0112c371619427512f8e5b6e8.zip
treat muons like Monte Carlo
Diffstat (limited to 'utils/chi2')
-rwxr-xr-xutils/chi26
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/chi2 b/utils/chi2
index b393954..bf750cd 100755
--- a/utils/chi2
+++ b/utils/chi2
@@ -168,12 +168,15 @@ FIT_PARS = [
def make_nll(data, muons, mc, bins):
data_hists = get_data_hists(data,bins)
- muon_hists = get_data_hists(muons,bins)
ke_dict = {}
for id in (20,22,2020,2022,2222):
ke_dict[id] = mc[mc.id == id].ke.values
+ ke_dict_muon = {}
+ for id in (20,22,2020,2022,2222):
+ ke_dict_muon[id] = muons[muons.id == id].ke.values
+
def nll(x, grad=None):
if any(x[i] < 0 for i in range(len(x))):
return np.inf
@@ -211,6 +214,7 @@ def make_nll(data, muons, mc, bins):
# Also, it's critical that I first adjust the data energy by whatever
# amount I find with the stopping muons and Michel distributions.
mc_hists = get_mc_hists_fast(ke_dict,x,bins,apply_norm=True)
+ muon_hists = get_mc_hists_fast(ke_dict_muon,x,bins,apply_norm=False)
# Calculate the negative log of the likelihood of observing the data
# given the fit parameters