HepMC3 event record library
Data Structures
IO-related classes and interfaces

Data Structures

class  Reader
 Base class for all I/O readers. More...
 
class  ReaderAscii
 GenEvent I/O parsing for structured text files. More...
 
class  ReaderAsciiHepMC2
 Parser for HepMC2 I/O files. More...
 
class  ReaderGZ< T >
 GenEvent I/O parsing for compressed files. More...
 
class  ReaderHEPEVT
 GenEvent I/O parsing and serialization for HEPEVT files. More...
 
class  ReaderLHEF
 GenEvent I/O parsing and serialization for LHEF files. More...
 
class  ReaderMT< T, m_number_of_threads >
 Multithreader GenEvent I/O parsing. More...
 
class  ReaderPlugin
 GenEvent I/O parsing and serialization using external plugin. More...
 
class  Writer
 Base class for all I/O writers. More...
 
class  WriterAscii
 GenEvent I/O serialization for structured text files. More...
 
class  WriterAsciiHepMC2
 GenEvent I/O serialization for structured text files. More...
 
class  WriterGZ< T, C >
 GenEvent I/O serialization for compressed files. More...
 
class  WriterHEPEVT
 GenEvent I/O serialization for HEPEVT files. More...
 
class  WriterPlugin
 GenEvent I/O parsing and serialization using external plugin. More...
 
class  ReaderRoot
 GenEvent I/O parsing and serialization for root files. More...
 
class  ReaderRootTree
 GenEvent I/O parsing and serialization for root files based on root TTree. More...
 
class  WriterRoot
 GenEvent I/O serialization for root files. More...
 
class  WriterRootTree
 GenEvent I/O serialization for root files based on root TTree. More...
 

Detailed Description

This module contains interfaces for different IO formats, including an adapter for older version of HepMC files. To link rootIO engine in your code use libHepMC3rootIO.so (libHepMC3rootIO.dylib) library.


Optionally the I/O capabilities can be implemented as plugin Reader/Writer classes compiled separately into dynamically loadable libraries and used via RearedPlugin and WriterPlugin classes. Please note that all required libraries/dlls should be loadable. See examples for details.

In some cases the fine tuning of the Reader/Writer classes behavior can be done using a map of string "options"

void Reader::set_options(const std::map<std::string, std::string>& options)
std::map<std::string, std::string> Reader::get_options() const

The options for ReaderAsciiHepMC2

"particle_flows_are_separated" "event_random_states_are_separated" "vertex_weights_are_separated" "particle_flows_are_separated" regulate if the corresponding information from IO_GenEvent would be stored into multiple attributes as individual numbers, i.e. "separated" or as a single std::vector. The former behavior is used if the corresponding option name is present in the list of options, regardless of the option value. The later behavior is the default one.

The option for WriterAscii and WriterAsciiHepMC2

"float_printf_specifier"

specifies the float printf specifier used for the output format of the floats. Two first characters from the option value are used. The default behavior is equivalent to setting this option to "e" and results in the output formatted as " %.*e". To save the disk space one can use the "g" option, e.g.

WriterAscii outputA("someoutput.hepmc");
auto optionsA = outputA.get_options();
optionsA["float_printf_specifier"] = "g";
outputA.set_options(optionsA);

This option will be the default on in the future. Last update 12 Jun 2021