HepMC3 event record library
|
GenEvent I/O output to files similar to these produced by OPAL software.
Definition at line 23 of file WriterRootTreeOPAL.h.
#include <WriterRootTreeOPAL.h>
Public Member Functions | |
WriterRootTreeOPAL (const std::string &filename, std::shared_ptr< GenRunInfo > run=std::shared_ptr< GenRunInfo >()) | |
Constructor. | |
void | init_branches () |
Init ROOT branches. | |
void | write_event (const GenEvent &evt) |
Write event. | |
void | set_run_number (const int nr) |
Set run number. | |
void | write_run_info () |
Write the GenRunInfo object to file. | |
void | close () override |
Close file stream. | |
bool | failed () override |
Get stream error state flag. | |
virtual void | set_run_info (std::shared_ptr< GenRunInfo > run) |
Set the global GenRunInfo object. | |
virtual std::shared_ptr< GenRunInfo > | run_info () const |
Get the global GenRunInfo object. | |
virtual void | set_options (const std::map< std::string, std::string > &options) |
Set options. | |
virtual std::map< std::string, std::string > | get_options () const |
Set options. | |
Data Fields | |
TTree * | m_tree = nullptr |
Tree handler. Public to allow simple access, e.g. custom branches. | |
Protected Attributes | |
std::map< std::string, std::string > | m_options |
options | |
Private Member Functions | |
bool | init (std::shared_ptr< GenRunInfo > run) |
init routine | |
Private Attributes | |
float | m_Ebeam = 0.0 |
Beam energy in GEV. | |
int | m_Irun = 0 |
Run number. | |
int | m_Ievnt = 0 |
Event number. | |
TFile * | m_file = nullptr |
File handler. | |
int | m_events_count = 0 |
Events count. Needed to read the tree. | |
GenEventData * | m_event_data = nullptr |
Pointer to structure that holds event data. | |
GenRunInfoData * | m_run_info_data = nullptr |
Pointer to structure that holds run info data. | |
std::string | m_tree_name |
Name of TTree. | |
std::string | m_branch_name |
Name of TBranch in TTree. | |
std::shared_ptr< GenRunInfo > | m_run_info |
The global GenRunInfo object. | |
WriterRootTreeOPAL | ( | const std::string & | filename, |
std::shared_ptr< GenRunInfo > | run = std::shared_ptr<GenRunInfo>() ) |
Constructor.
Definition at line 10 of file WriterRootTreeOPAL.cc.
References WriterRootTree::WriterRootTree().
|
overridevirtualinherited |
Close file stream.
Implements Writer.
Definition at line 89 of file WriterRootTree.cc.
References m_event_data, m_file, m_run_info_data, and m_tree.
|
overridevirtualinherited |
Get stream error state flag.
Implements Writer.
Definition at line 97 of file WriterRootTree.cc.
References m_file.
|
inlinevirtualinherited |
Set options.
Reimplemented in WriterPlugin.
Definition at line 54 of file Writer.h.
References m_options.
|
privateinherited |
init routine
Definition at line 38 of file WriterRootTree.cc.
References HEPMC3_ERROR_LEVEL, m_branch_name, m_event_data, m_file, m_run_info_data, m_tree, m_tree_name, Writer::run_info(), and Writer::set_run_info().
void init_branches | ( | ) |
Init ROOT branches.
Definition at line 11 of file WriterRootTreeOPAL.cc.
References m_Ebeam, m_Ievnt, m_Irun, and WriterRootTree::m_tree.
|
inlinevirtualinherited |
Get the global GenRunInfo object.
Reimplemented in WriterGZ< T, C >, and WriterPlugin.
Definition at line 45 of file Writer.h.
References m_run_info.
|
inlinevirtualinherited |
Set options.
Reimplemented in WriterPlugin.
Definition at line 52 of file Writer.h.
References m_options.
|
inlinevirtualinherited |
Set the global GenRunInfo object.
Reimplemented in WriterGZ< T, C >, and WriterPlugin.
Definition at line 42 of file Writer.h.
References m_run_info.
void set_run_number | ( | const int | nr | ) |
|
virtual |
Write event.
Reimplemented from WriterRootTree.
Definition at line 17 of file WriterRootTreeOPAL.cc.
References GenEvent::event_number(), m_Ebeam, m_Ievnt, GenEvent::particles(), and WriterRootTree::write_event().
|
inherited |
Write the GenRunInfo object to file.
Definition at line 87 of file WriterRootTree.cc.
|
privateinherited |
Name of TBranch in TTree.
Definition at line 88 of file WriterRootTree.h.
|
private |
Beam energy in GEV.
Definition at line 35 of file WriterRootTreeOPAL.h.
|
privateinherited |
Pointer to structure that holds event data.
Definition at line 85 of file WriterRootTree.h.
|
privateinherited |
Events count. Needed to read the tree.
Definition at line 84 of file WriterRootTree.h.
|
privateinherited |
File handler.
Definition at line 80 of file WriterRootTree.h.
|
private |
Event number.
Definition at line 37 of file WriterRootTreeOPAL.h.
|
private |
Run number.
Definition at line 36 of file WriterRootTreeOPAL.h.
|
protectedinherited |
|
privateinherited |
The global GenRunInfo object.
|
privateinherited |
Pointer to structure that holds run info data.
Definition at line 86 of file WriterRootTree.h.
|
inherited |
Tree handler. Public to allow simple access, e.g. custom branches.
Definition at line 82 of file WriterRootTree.h.
|
privateinherited |
Name of TTree.
Definition at line 87 of file WriterRootTree.h.