diff options
Diffstat (limited to 'utils/plot-fit-results')
-rwxr-xr-x | utils/plot-fit-results | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/utils/plot-fit-results b/utils/plot-fit-results index 48d922a..c3d3f16 100755 --- a/utils/plot-fit-results +++ b/utils/plot-fit-results @@ -84,7 +84,7 @@ if __name__ == '__main__': for i, event in enumerate(data['data']): # get the particle ID - id = event['mctk'][-1]['id'] + id = event['mcgn'][0]['id'] a[i]['id'] = id @@ -95,7 +95,7 @@ if __name__ == '__main__': mass = SNOMAN_MASS[id] # for some reason it's the *second* track which seems to contain the # initial energy - true_energy = event['mctk'][-1]['energy'] + true_energy = event['mcgn'][0]['energy'] # 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 @@ -107,21 +107,21 @@ if __name__ == '__main__': a[i]['dT'] = energy-ke # store the fit position residuals - true_posx = event['mcvx'][0]['posx'] + true_posx = event['mcgn'][0]['posx'] posx = fit[id]['posx'] a[i]['dx'] = posx-true_posx - true_posy = event['mcvx'][0]['posy'] + true_posy = event['mcgn'][0]['posy'] posy = fit[id]['posy'] a[i]['dy'] = posy-true_posy - true_posz = event['mcvx'][0]['posz'] + true_posz = event['mcgn'][0]['posz'] posz = fit[id]['posz'] a[i]['dz'] = posz-true_posz # compute the angle between the fit direction and the true # direction - dirx = event['mctk'][-1]['dirx'] - diry = event['mctk'][-1]['diry'] - dirz = event['mctk'][-1]['dirz'] + dirx = event['mcgn'][0]['dirx'] + diry = event['mcgn'][0]['diry'] + dirz = event['mcgn'][0]['dirz'] true_dir = [dirx,diry,dirz] true_dir = np.array(true_dir)/np.linalg.norm(true_dir) theta = fit[id]['theta'] |