diff options
author | tlatorre <tlatorre@uchicago.edu> | 2020-07-27 12:01:46 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2020-07-27 12:01:46 -0500 |
commit | a64f08376d5a679307606e2b86115cb79c4de80c (patch) | |
tree | 53b445ab3ab8af1c6fce5f012dc622ce778548c7 | |
parent | b72e3949e0de63059ec5a789eaf8b1124550c3f9 (diff) | |
download | sddm-a64f08376d5a679307606e2b86115cb79c4de80c.tar.gz sddm-a64f08376d5a679307606e2b86115cb79c4de80c.tar.bz2 sddm-a64f08376d5a679307606e2b86115cb79c4de80c.zip |
identify muons in the MC by looking for 'cosmic' in the filename
-rwxr-xr-x | utils/plot-muons | 5 | ||||
-rwxr-xr-x | utils/sddm/plot_energy.py | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/utils/plot-muons b/utils/plot-muons index 0646e2e..69dda87 100755 --- a/utils/plot-muons +++ b/utils/plot-muons @@ -79,10 +79,7 @@ if __name__ == '__main__': ev_mc = ev_mc.reset_index() # Set all prompt events in the MC to be muons - #ev_mc.loc[ev_mc.prompt,'muon'] = True - - # FIXME: TESTING - ev_mc.loc[ev_mc.prompt & (ev_mc.id == 22) & (ev_mc.r_psup > 0.9),'muon'] = True + ev_mc.loc[ev_mc.prompt & ev_mc.filename.str.contains("cosmic"),'muon'] = True # First, do basic data cleaning which is done for all events. ev = ev[ev.signal | ev.muon] diff --git a/utils/sddm/plot_energy.py b/utils/sddm/plot_energy.py index 192b8b9..93c872d 100755 --- a/utils/sddm/plot_energy.py +++ b/utils/sddm/plot_energy.py @@ -417,7 +417,7 @@ def michel_spectrum(T): return y def get_events(filenames, merge_fits=False, nhit_thresh=None): - ev = pd.concat([read_hdf(filename, "ev") for filename in filenames],ignore_index=True) + ev = pd.concat([read_hdf(filename, "ev").assign(filename=filename) for filename in filenames],ignore_index=True) fits = pd.concat([read_hdf(filename, "fits") for filename in filenames],ignore_index=True) rhdr = pd.concat([read_hdf(filename, "rhdr") for filename in filenames],ignore_index=True) |