diff options
author | tlatorre <tlatorre@uchicago.edu> | 2020-12-22 09:47:38 -0600 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2020-12-22 09:47:38 -0600 |
commit | 0d1e96e76c9a7b2c3f053f7a69f5724feb7f35e9 (patch) | |
tree | 01b478c94bdf6f24dcc2aaa20398266c4f70ed07 /utils/chi2 | |
parent | ae899f497777e7cb1fff7c475ebbf7c6ace4223c (diff) | |
download | sddm-0d1e96e76c9a7b2c3f053f7a69f5724feb7f35e9.tar.gz sddm-0d1e96e76c9a7b2c3f053f7a69f5724feb7f35e9.tar.bz2 sddm-0d1e96e76c9a7b2c3f053f7a69f5724feb7f35e9.zip |
move check earlier
Diffstat (limited to 'utils/chi2')
-rwxr-xr-x | utils/chi2 | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -526,6 +526,12 @@ if __name__ == '__main__': for filename in args.mc: ev_mcs.append(get_events([filename], merge_fits=True, nhit_thresh=args.nhit_thresh, mc=True)) ev_mc = pd.concat([ev_mc for ev_mc in ev_mcs if len(ev_mc) > 0]).reset_index() + + if (~rhdr.run.isin(ev_mc.run)).any(): + print_warning("Error! The following runs have no Monte Carlo: %s" % \ + np.unique(rhdr.run[~rhdr.run.isin(ev_mc.run)].values)) + sys.exit(1) + 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) @@ -624,11 +630,6 @@ if __name__ == '__main__': #muon = ev[ev.muon & ev.prompt & ~ev.atm] #muon_atm = ev[ev.muon & ev.prompt & ev.atm] - if (~rhdr.run.isin(ev_mc.run)).any(): - print_warning("Error! The following runs have no Monte Carlo: %s" % \ - np.unique(rhdr.run[~rhdr.run.isin(ev_mc.run)].values)) - sys.exit(1) - if not args.pull and not args.coverage: ev_mc = ev_mc[ev_mc.run.isin(rhdr.run)] |