Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pyLCIO import IOIMPL, UTIL, EVENT
- lcioReader = IOIMPL.LCFactory.getInstance().createLCReader()
- lcioReader.open("something.slcio")
- event = lcioReader.readNextEvent()
- mcps = event.getCollection("MCParticlesSkimmed")
- d = {}
- for mcp in mcps:
- d[mcp] = 0 #assigns only
- for i, mcp in enumerate(mcps):
- print i
- d[mcp] += 1 #attempts to access and assign and throws KeyError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement