diff options
author | tlatorre <tlatorre@uchicago.edu> | 2020-07-27 10:59:13 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2020-07-27 10:59:13 -0500 |
commit | 2094974ef3c0c070583a89eec063b4168a470e4b (patch) | |
tree | eb157ce90fe33cee57c3bcdedd0d4efed30cc37e | |
parent | 60e49cdc00ce3c6a2f372aa43ddccdac533070e9 (diff) | |
download | sddm-2094974ef3c0c070583a89eec063b4168a470e4b.tar.gz sddm-2094974ef3c0c070583a89eec063b4168a470e4b.tar.bz2 sddm-2094974ef3c0c070583a89eec063b4168a470e4b.zip |
only merge fit info for events with at least 10 fits
This commit updates get_events() to only merge fit info for events with
at least 10 events. The reason for this is that when analyzing recent
data where not all the fits have completed we don't want to plot the
data for events which haven't completely finished being fit.
-rwxr-xr-x | utils/sddm/plot_energy.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/sddm/plot_energy.py b/utils/sddm/plot_energy.py index cf59bc6..192b8b9 100755 --- a/utils/sddm/plot_energy.py +++ b/utils/sddm/plot_energy.py @@ -570,8 +570,12 @@ def get_events(filenames, merge_fits=False, nhit_thresh=None): # Require at least 1 NHIT trigger to fire ev = ev[(ev.trg_type & (TRIG_NHIT_100_LO | TRIG_NHIT_100_MED | TRIG_NHIT_100_HI | TRIG_NHIT_20 | TRIG_NHIT_20_LB)) != 0] + # Require all 10 fits + fits = fits.groupby(['run','gtid']).filter(lambda x: len(x) >= 10).reset_index() + if merge_fits: ev = pd.merge(ev,fits,how='left',on=['run','gtid']) + # Reset n, id1, id2, and id3 columns to integers for column in ['n','id','id1','id2','id3']: ev[column] = ev[column].fillna(0) |