From 6f61c532e51b8c91519e5e8d38779e358cf1bc76 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 13 Apr 2020 15:54:22 -0500 Subject: update plot-fit-results script to be able to handle files with multi-particle fits --- utils/plot-fit-results | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'utils/plot-fit-results') diff --git a/utils/plot-fit-results b/utils/plot-fit-results index 8bdb7ed..18139ff 100755 --- a/utils/plot-fit-results +++ b/utils/plot-fit-results @@ -308,6 +308,13 @@ if __name__ == '__main__': # merge data and fits on run and gtid data = data.merge(fits,left_on=['filename','run','gtid'],right_on=['fit_filename','fit_run','fit_gtid']) + # For this script, we only want the single particle fit results + data = data[(data.fit_id2 == 0) & (data.fit_id3 == 0)] + + # Select only the best fit for a given run, gtid, and particle + # combo + data = data.sort_values('fit_fmin').groupby(['filename','run','gtid','fit_id1','fit_id2','fit_id3'],as_index=False).nth(0).reset_index(level=0,drop=True) + # calculate true kinetic energy mass = [SNOMAN_MASS[id] for id in data['mcgn_id'].values] data['T'] = data['mcgn_energy'].values - mass -- cgit