6#ifndef HEPMC3_WRITERROOTTREE_H
7#define HEPMC3_WRITERROOTTREE_H
50 std::shared_ptr<GenRunInfo> run = std::shared_ptr<GenRunInfo>());
52 WriterRootTree(
const std::string &filename,
const std::string &treename,
const std::string &branchname,
53 std::shared_ptr<GenRunInfo> run = std::shared_ptr<GenRunInfo>());
68 void close()
override;
75 bool init(std::shared_ptr<GenRunInfo> run);
Definition of struct GenEventData.
Definition of class GenEvent.
Definition of struct GenRunInfoData.
Definition of interface Writer.
Stores event-related information.
GenEvent I/O serialization for root files based on root TTree.
TTree * m_tree
Tree handler. Public to allow simple access, e.g. custom branches.
bool failed() override
Get stream error state flag.
GenEventData * m_event_data
Pointer to structure that holds event data.
int m_events_count
Events count. Needed to read the tree.
void close() override
Close file stream.
bool init(std::shared_ptr< GenRunInfo > run)
init routine
std::string m_tree_name
Name of TTree.
std::string m_branch_name
Name of TBranch in TTree.
TFile * m_file
File handler.
GenRunInfoData * m_run_info_data
Pointer to structure that holds run info data.
void write_event(const GenEvent &evt) override
Write event to file.
void write_run_info()
Write the GenRunInfo object to file.
Base class for all I/O writers.
Stores serializable event information.
Stores serializable run information.