From 6fc97e22fa2a8cc48a96b2ce22c4d55a8fd2b80f Mon Sep 17 00:00:00 2001 From: tlatorre Date: Sun, 3 Jan 2021 11:40:47 -0600 Subject: cache results from get_events() --- utils/dm-search | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'utils/dm-search') diff --git a/utils/dm-search b/utils/dm-search index 8e2473c..cd91eab 100755 --- a/utils/dm-search +++ b/utils/dm-search @@ -616,7 +616,7 @@ if __name__ == '__main__': # 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) + ev_mc = renormalize_data(ev_mc,mcpl) # Merge weights with MCPL dataframe to get the unique id column in the # weights dataframe since that is what we use to merge with the Monte @@ -653,11 +653,7 @@ if __name__ == '__main__': muon_mc = correct_energy_bias(muon_mc) # Set all prompt events in the MC to be muons - muon_mc.loc[muon_mc.prompt & muon_mc.filename.str.contains("cosmic"),'muon'] = True - - ev = ev.reset_index() - ev_mc = ev_mc.reset_index() - muon_mc = muon_mc.reset_index() + muon_mc.loc[muon_mc.prompt,'muon'] = True # 00-orphan cut ev = ev[(ev.gtid & 0xff) != 0] -- cgit