Skip to content

simple python module to have easy HepMC event loops in python

License

Notifications You must be signed in to change notification settings

sznajder/hepmcanalysis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hepmcanalysis

DOI

simple python module to have easy HepMC event loops in python. This is very light wrapper around pyhepmc.

Installation

git clone https://github.com/lukasheinrich/hepmcanalysis.git
cd hepmcanalysis
python setup.py build
python setup.py install

Usage

A complete example looping events and printing them looks like this:

#!/usr/bin/env python

from hepmcanalysis.events import fromfile

def main():
    for e in fromfile('test.hepmc'):
        print 'numer of particles: {}'.format(len(e.particles()))

if __name__ == '__main__':
    main()

example: http://nbviewer.ipython.org/github/lukasheinrich/hepmcanalysis/blob/master/hepmczanalysis.ipynb

About

simple python module to have easy HepMC event loops in python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 78.3%
  • Python 10.9%
  • C++ 10.8%