From 3c77f5827644971fb0697a23120a8d3d3ae92e1f Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 3 Dec 2018 09:54:49 -0600 Subject: add a goodness of fit parameter psi to the fit --- utils/plot | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'utils/plot') diff --git a/utils/plot b/utils/plot index c6d8b4f..06d9951 100755 --- a/utils/plot +++ b/utils/plot @@ -72,10 +72,14 @@ if __name__ == '__main__': likelihood_ratio = [] t_electron = [] t_muon = [] + psi = [] for event in data['data']: # get the particle ID id = event['mctk'][-1]['id'] + if 'ev' not in event: + continue + if id not in event['ev'][0]['fit']: continue @@ -115,6 +119,11 @@ if __name__ == '__main__': t_electron.append(event['ev'][0]['fit'][IDP_E_MINUS]['time']) if IDP_MU_MINUS in event['ev'][0]['fit']: t_muon.append(event['ev'][0]['fit'][IDP_MU_MINUS]['time']) + nhit = event['ev'][0]['nhit'] + psi.append(event['ev'][0]['fit'][id]['psi']/nhit) + + if len(t_electron) < 2 or len(t_muon) < 2: + continue mean, mean_error, std, std_error = get_stats(dT) print("dT = %.2g +/- %.2g" % (mean, mean_error)) @@ -155,6 +164,9 @@ if __name__ == '__main__': plt.figure(8) plot_hist(np.array(t_muon)/1e3/60.0, label=filename) plt.xlabel(r"Muon Fit time (minutes)") + plt.figure(9) + plot_hist(psi, label=filename) + plt.xlabel(r"$\Psi$/Nhit") plot_legend(1) plot_legend(2) @@ -164,4 +176,5 @@ if __name__ == '__main__': plot_legend(6) plot_legend(7) plot_legend(8) + plot_legend(9) plt.show() -- cgit