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/chi2 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'utils/chi2') diff --git a/utils/chi2 b/utils/chi2 index c883deb..f4d94c4 100755 --- a/utils/chi2 +++ b/utils/chi2 @@ -552,7 +552,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 @@ -591,11 +591,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