diff options
-rwxr-xr-x | utils/sddm/plot_energy.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/sddm/plot_energy.py b/utils/sddm/plot_energy.py index 1971c8d..1a55a85 100755 --- a/utils/sddm/plot_energy.py +++ b/utils/sddm/plot_energy.py @@ -33,6 +33,12 @@ MUON_MASS = 105.6583745 # MeV PROTON_MASS = 938.272081 # MeV FINE_STRUCTURE_CONSTANT = 7.297352566417e-3 +TRIG_NHIT_100_LO = 0x00000001 +TRIG_NHIT_100_MED = 0x00000002 +TRIG_NHIT_100_HI = 0x00000004 +TRIG_NHIT_20 = 0x00000008 +TRIG_NHIT_20_LB = 0x00000010 + def unwrap(p, delta, axis=-1): """ A modified version of np.unwrap() useful for unwrapping the 50 MHz clock. @@ -558,6 +564,9 @@ def get_events(filenames, merge_fits=False): # only need the lower nhit events for neutrons. ev = ev[ev.nhit_cal >= 100] + # 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] + if merge_fits: ev = pd.merge(ev,fits,how='left',on=['run','gtid']) # Reset n, id1, id2, and id3 columns to integers |