From 4eace55dd4053afc2fb40f73bc2eee0ca5a05aa3 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Wed, 14 Nov 2018 11:44:10 -0600 Subject: update yaml format to store fit results as a dictionary indexed by the particle id --- utils/plot.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'utils') diff --git a/utils/plot.py b/utils/plot.py index 83b384e..a7dfa6d 100755 --- a/utils/plot.py +++ b/utils/plot.py @@ -68,24 +68,24 @@ if __name__ == '__main__': # The MCTK bank has the particle's total energy (except for neutrons) # so we need to convert it into kinetic energy ke = true_energy - mass - energy = event['ev'][0]['fit'][0]['energy'] + energy = event['ev'][0]['fit'][id]['energy'] dT.append(energy-ke) true_posx = event['mcvx'][0]['posx'] - posx = event['ev'][0]['fit'][0]['posx'] + posx = event['ev'][0]['fit'][id]['posx'] dx.append(posx-true_posx) true_posy = event['mcvx'][0]['posy'] - posy = event['ev'][0]['fit'][0]['posy'] + posy = event['ev'][0]['fit'][id]['posy'] dy.append(posy-true_posy) true_posz = event['mcvx'][0]['posz'] - posz = event['ev'][0]['fit'][0]['posz'] + posz = event['ev'][0]['fit'][id]['posz'] dz.append(posz-true_posz) dirx = event['mctk'][-1]['dirx'] diry = event['mctk'][-1]['diry'] dirz = event['mctk'][-1]['dirz'] true_dir = [dirx,diry,dirz] true_dir = np.array(true_dir)/np.linalg.norm(true_dir) - theta = event['ev'][0]['fit'][0]['theta'] - phi = event['ev'][0]['fit'][0]['phi'] + theta = event['ev'][0]['fit'][id]['theta'] + phi = event['ev'][0]['fit'][id]['phi'] dir = [np.sin(theta)*np.cos(phi),np.sin(theta)*np.sin(phi),np.cos(theta)] dir = np.array(dir)/np.linalg.norm(dir) thetas.append(np.degrees(np.arccos(np.dot(true_dir,dir)))) -- cgit