Advertisement
Guest User

Untitled

a guest
Sep 4th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. from pyLCIO import IOIMPL, UTIL, EVENT
  2. lcioReader = IOIMPL.LCFactory.getInstance().createLCReader()
  3. lcioReader.open("something.slcio")
  4.  
  5. event = lcioReader.readNextEvent()
  6.  
  7. mcps = event.getCollection("MCParticlesSkimmed")
  8.  
  9. d = {}
  10.  
  11. for mcp in mcps:
  12.     d[mcp] = 0 #assigns only
  13.  
  14. for i, mcp in enumerate(mcps):
  15.     print i
  16.     d[mcp] += 1 #attempts to access and assign and throws KeyError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement