SHARE
TWEET

Untitled

a guest Sep 4th, 2014 149 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top