pyhepmc icon indicating copy to clipboard operation
pyhepmc copied to clipboard

Adding GenEvent::add_tree

Open janTOffermann opened this issue 7 months ago • 1 comments

As a feature request, I was wondering if it would be possible to add an interface to GenEvent::add_tree()?

I think this would make it relatively straightforward to convert Pythia8 events into HepMC3 ones, entirely in Python -- I think this can currently be achieved with the "standard" HepMC3 Python bindings, see here. One could perhaps cook up a similar function without this exact method*, but being able to run the same algorithm as the "official" converter would be great.

* I've attempted this with pyhepmc but my example only seems to work when initial- and final-state radiation is turned off in Pythia8. Otherwise the GenEvent is missing vertices in the listing once it's written by pyhepmc.io.WriterAscii, with the number of vertices given in the event header still showing the old value.)

janTOffermann avatar Jun 04 '25 17:06 janTOffermann

I like the idea. Are you interested in contributing?

HDembinski avatar Sep 19 '25 07:09 HDembinski