def main(): proxy = ifstream_proxy('./input.hepmc') g = hepmc.IO_GenEvent(proxy.stream()) for i,e in enumerate(events(g)): print 'event #{}: number of particles in event:{}'.format(i,len(e.particles())) print e
def readhepmc(hepmcfile): proxy = ifstream_proxy(hepmcfile) g = hepmc.IO_GenEvent(proxy.stream()) for e in events(g): yield e
def main(): proxy = ifstream_proxy(args.file) g = hepmc.IO_GenEvent(proxy.stream()) for i,e in enumerate(events(g)): print '----------------' finalstate = [p for p in e.particles() if p.status()==1] print 'event #{0}: number of particles in event: {1}'.format(i,len(finalstate))