Skip to content

Instantly share code, notes, and snippets.

View l-althueser's full-sized avatar

Lutz Althüser l-althueser

  • University of Münster
View GitHub Profile
@l-althueser
l-althueser / MC_uproot.py
Last active April 26, 2018 15:56
Some examples on how to treat MC files with uproot.
import uproot
# Just load one file and look at it
f = uproot.open('optPhot_00001_g4mc_G4.root')['events/events']
eventid = f['eventid'].array()
f.keys()
# Iterate over several branches of a single file
f = uproot.open('optPhot_00001_g4mc_G4.root')['events/events']
for x, y, z in f.iterate(["xp_pri", "yp_pri", "zp_pri"], outputtype=tuple):
@l-althueser
l-althueser / ToC.ipynb
Last active August 30, 2017 22:56
Floating table of content in Jupyter
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.