diff options
Diffstat (limited to 'utils/sddm/plot_energy.py')
-rwxr-xr-x | utils/sddm/plot_energy.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/sddm/plot_energy.py b/utils/sddm/plot_energy.py index c9f5142..88950f7 100755 --- a/utils/sddm/plot_energy.py +++ b/utils/sddm/plot_energy.py @@ -471,13 +471,13 @@ def get_events(filenames, merge_fits=False): ev = ev.groupby('run',group_keys=False).apply(retrigger_cut) if merge_fits: - ev.set_index(['run','gtid']) - ev = pd.merge(fits,ev,how='inner',on=['run','gtid']) + # Set the index to (run, gtid) so we can set columns from the single particle results + ev = ev.set_index(['run','gtid']) ev_single_particle = ev[(ev.id2 == 0) & (ev.id3 == 0)] ev_single_particle = ev_single_particle.sort_values('fmin').groupby(['run','gtid']).nth(0) ev = ev.sort_values('fmin').groupby(['run','gtid']).nth(0) - ev['psi'] /= ev.nhit_cal + #ev['psi'] /= ev.nhit_cal ev['cos_theta'] = np.cos(ev_single_particle['theta1']) ev['r'] = np.sqrt(ev.x**2 + ev.y**2 + ev.z**2) |