From a01fded9219273c0112c371619427512f8e5b6e8 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Sun, 30 Aug 2020 09:25:18 -0500 Subject: treat muons like Monte Carlo --- utils/chi2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit