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