|
HepMC3 event record library
|
The following is a list of main differences that should be taken into account when transitioning from HepMC2 to HepMC3.
###########################################################################
########################################################################### ###########################################################################
###########################################################################
Following changes in header files have been applied:
The structure of GenCrossSection class has been changed to handle multiple values of cross-sections. The cross-section values and errors (uncertainties) can be accessed only by public functions, the corresponding data members are private. By default, the number of cross-section values in every event is equal to the number of event weights. Accordingly, each cross-section value can be accessed using the corresponding event weight name (std::string) or event weight index (int).
Following header files are no longer available:
###########################################################################
########################################################################### An example of interface to Pythia6 Fortran blocks is given in the examples.
###########################################################################
###########################################################################
Multiple file formats are supported. The implementation of reading and wrining is separated in HepMC3. All the reading operations are performed in "reader" objects inherited from HepMC::Reader and the writing operations in the "writer" objects inherited from HePMC::Writer. Therefore it is to use the desired headers explicitely, as needed.
The IO_GenEvent.h header is not available anymore. to write and/or read HepMC2 files the following includes
should be used instead of
Please note that HepMC2 format is outdated and is not able to contain a lot of information stored into event record by the modern Monte Carlo event generators. It is recommended to use HepMC3 native event record in plain text or in ROOT TTree format. The corresponding readers and writers are
and
Implementation of custom Reader and Writer objects is possible as well.
###########################################################################
########################################################################### Particles and vertices are managed using shared pointers, so they should not be created through the call to 'new'.
###########################################################################
###########################################################################
The iterator-bases classe and access functions from HepMC2, e.g.
were removed. The C++11 itarations should be used instead, e.g. instead of
one should use
or alternatively
###########################################################################
###########################################################################
Particles and vertices in HepMC3 are stored in topological order. This means that when creating vertices, incoming particles must have id lower than any of the outgoing particles.
This forces the tree structure to be constructed top-to-bottom and disallows creating loops.
###########################################################################
########################################################################### ###########################################################################
###########################################################################
Deleting a particle using GenEvent::remove_particle() will also remove its end_vertex if this is the only particle that is on this vertex particles_in() list.
Deleting a vertex will delete all of its outgoing particles. (and subsequently, all of their decays).
###########################################################################
###########################################################################
Barcodes are no longer available. Use attributes to provide additional information that was previously encoded using barcodes (see module Standard attributes).
The unique identifier of particles and vertices is now called id() to separate its role from barcodes. Id is set automatically and cannot be changed. Id is not permanently attached to particle/vertex. When a particle or vertex is removed from the event, id's of other particles or vertices may change.
###########################################################################
###########################################################################
The default units are set to GEV and MM. They can be provided as constructor parameters or changed later using HepMC::GenEvent::set_units
###########################################################################
###########################################################################
A lot of HepMC2 functions has been declared obsolete and are marked as deprecated. Warnings displayed at compilation time hint to what functions or classes should be used instead.
###########################################################################
###########################################################################
For the user convenience and backward compatibility the following standard attributes are supported for the
GenEvent
GenVertex
GenParticle
The presence of cycles in the event structure is indecated with an attribute
Note that attributes belong to the event, therefore these can be set only for particles and vertices that belong to a GenEvent object.
Last update 24 Jan 2019