aboutsummaryrefslogtreecommitdiff
path: root/utils/dm-search
diff options
context:
space:
mode:
Diffstat (limited to 'utils/dm-search')
-rwxr-xr-xutils/dm-search10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/dm-search b/utils/dm-search
index 214ad59..262e664 100755
--- a/utils/dm-search
+++ b/utils/dm-search
@@ -209,6 +209,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
@@ -532,6 +535,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")
@@ -547,6 +551,7 @@ if __name__ == '__main__':
parser.add_argument("--thin", type=int, default=10, help="number of steps to thin")
parser.add_argument("--test", type=int, default=0, help="run tests to check discovery threshold")
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)
@@ -589,6 +594,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:
#