diff options
author | tlatorre <tlatorre@uchicago.edu> | 2019-01-15 01:08:54 -0600 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2019-01-15 01:08:54 -0600 |
commit | 9c910abe7a0359018677a874822d8742d0e616b9 (patch) | |
tree | 52dda30fd3c5b0eb78050dee4dec10bdf8557ed7 /utils/plot | |
parent | 272d793cda5456fb8a69d3e2a407bf24d3600cd4 (diff) | |
download | sddm-9c910abe7a0359018677a874822d8742d0e616b9.tar.gz sddm-9c910abe7a0359018677a874822d8742d0e616b9.tar.bz2 sddm-9c910abe7a0359018677a874822d8742d0e616b9.zip |
update zebra library to be able to use links
This commit updates the zebra library files zebra.{c,h} so that it's now
possible to traverse the data structure using links! This was originally
motivated by wanting to figure out which MC particles were generated from the
MCGN bank (from which it's only possible to access the tracks and vertices
using structural links).
I've also added a new test to test-zebra which checks the consistency of all of
the next/up/orig, structural, and reference links in a zebra file.
Diffstat (limited to 'utils/plot')
-rwxr-xr-x | utils/plot | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -75,7 +75,7 @@ if __name__ == '__main__': psi = [] for event in data['data']: # get the particle ID - id = event['mctk'][-1]['id'] + id = event['mcgn'][0]['id'] if 'ev' not in event: continue @@ -88,24 +88,24 @@ 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 energy = fit[id]['energy'] dT.append(energy-ke) - true_posx = event['mcvx'][0]['posx'] + true_posx = event['mcgn'][0]['posx'] posx = fit[id]['posx'] dx.append(posx-true_posx) - true_posy = event['mcvx'][0]['posy'] + true_posy = event['mcgn'][0]['posy'] posy = fit[id]['posy'] dy.append(posy-true_posy) - true_posz = event['mcvx'][0]['posz'] + true_posz = event['mcgn'][0]['posz'] posz = fit[id]['posz'] dz.append(posz-true_posz) - 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'] |