diff options
Diffstat (limited to 'utils/chi2')
-rwxr-xr-x | utils/chi2 | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -192,6 +192,9 @@ def get_mc_hists_fast(df_dict,x,bins,scale=1.0,reweight=False): else: cdf = fast_cdf(bins[:,np.newaxis],ke,resolution) + if 'flux_weight' in df.columns: + cdf *= df.flux_weight.values + mc_hists[id] = np.sum(cdf[1:] - cdf[:-1],axis=-1) mc_hists[id] *= scale return mc_hists @@ -474,6 +477,7 @@ if __name__ == '__main__': from sddm.plot import * from sddm import setup_matplotlib import nlopt + from sddm.renormalize import * parser = argparse.ArgumentParser("plot fit results") parser.add_argument("filenames", nargs='+', help="input files") @@ -490,6 +494,7 @@ if __name__ == '__main__': parser.add_argument("--walkers", type=int, default=100, help="number of walkers") parser.add_argument("--thin", type=int, default=10, help="number of steps to thin") parser.add_argument("--run-list", default=None, help="run list") + parser.add_argument("--mcpl", nargs='+', required=True, help="GENIE MCPL files") args = parser.parse_args() setup_matplotlib(args.save) @@ -520,6 +525,11 @@ if __name__ == '__main__': muon_mc = get_events(args.muon_mc, merge_fits=True, nhit_thresh=args.nhit_thresh, mc=True) weights = pd.concat([read_hdf(filename, "weights") for filename in args.weights],ignore_index=True) + # Add the "flux_weight" column to the ev_mc data since I stupidly simulated + # the muon neutrino flux for the tau neutrino flux in GENIE. Doh! + mcpl = load_mcpl_files(args.mcpl) + ev_mc = renormalize_data(ev_mc.reset_index(),mcpl) + # There are a handful of weights which turn out to be slightly negative for # some reason. For example: # |