HepMC3 event record library
|
GenEvent I/O output to files similar to these produced by OPAL software. More...
#include <WriterRootTreeOPAL.h>
Public Member Functions | |
WriterRootTreeOPAL (const std::string &filename, std::shared_ptr< GenRunInfo > run=std::shared_ptr< GenRunInfo >()) | |
Constructor. More... | |
void | init_branches () |
Init ROOT branches. More... | |
void | write_event (const GenEvent &evt) |
Write event. More... | |
void | set_run_number (const int nr) |
Set run number. More... | |
void | write_run_info () |
Write the GenRunInfo object to file. More... | |
void | close () override |
Close file stream. More... | |
bool | failed () override |
Get stream error state flag. More... | |
void | set_run_info (std::shared_ptr< GenRunInfo > run) |
Set the global GenRunInfo object. More... | |
std::shared_ptr< GenRunInfo > | run_info () const |
Get the global GenRunInfo object. More... | |
void | set_options (const std::map< std::string, std::string > &options) |
Set options. More... | |
std::map< std::string, std::string > | get_options () const |
Set options. More... | |
Data Fields | |
TTree * | m_tree |
Tree handler. Public to allow simple access, e.g. custom branches. More... | |
Protected Attributes | |
std::map< std::string, std::string > | m_options |
options More... | |
Private Attributes | |
float | m_Ebeam |
Beam energy in GEV. More... | |
int | m_Irun |
Run number. More... | |
int | m_Ievnt |
Event number. More... | |
GenEvent I/O output to files similar to these produced by OPAL software.
Definition at line 18 of file WriterRootTreeOPAL.h.
WriterRootTreeOPAL | ( | const std::string & | filename, |
std::shared_ptr< GenRunInfo > | run = std::shared_ptr<GenRunInfo>() |
||
) |
Constructor.
Definition at line 7 of file WriterRootTreeOPAL.cc.
|
overridevirtualinherited |
Close file stream.
Implements Writer.
Definition at line 93 of file WriterRootTree.cc.
References WriterRootTree::m_event_data, WriterRootTree::m_file, WriterRootTree::m_run_info_data, and WriterRootTree::m_tree.
|
overridevirtualinherited |
Get stream error state flag.
Implements Writer.
Definition at line 102 of file WriterRootTree.cc.
References WriterRootTree::m_file.
|
inlineinherited |
void init_branches | ( | ) |
Init ROOT branches.
Definition at line 8 of file WriterRootTreeOPAL.cc.
References WriterRootTreeOPAL::m_Ebeam, WriterRootTreeOPAL::m_Ievnt, WriterRootTreeOPAL::m_Irun, and WriterRootTree::m_tree.
|
inlineinherited |
Get the global GenRunInfo object.
Definition at line 47 of file Writer.h.
References Writer::m_run_info.
|
inlineinherited |
|
inlineinherited |
Set the global GenRunInfo object.
Definition at line 42 of file Writer.h.
References Writer::m_run_info.
void set_run_number | ( | const int | nr | ) |
Set run number.
Definition at line 28 of file WriterRootTreeOPAL.cc.
References WriterRootTreeOPAL::m_Irun.
|
virtual |
Write event.
Implements Writer.
Definition at line 14 of file WriterRootTreeOPAL.cc.
References HepMC3::abs(), GenEvent::event_number(), WriterRootTreeOPAL::m_Ebeam, WriterRootTreeOPAL::m_Ievnt, GenEvent::particles(), and WriterRootTree::write_event().
|
inherited |
Write the GenRunInfo object to file.
Definition at line 91 of file WriterRootTree.cc.
|
private |
Beam energy in GEV.
Definition at line 30 of file WriterRootTreeOPAL.h.
|
private |
Event number.
Definition at line 32 of file WriterRootTreeOPAL.h.
|
private |
Run number.
Definition at line 31 of file WriterRootTreeOPAL.h.
|
protectedinherited |
|
inherited |
Tree handler. Public to allow simple access, e.g. custom branches.
Definition at line 81 of file WriterRootTree.h.