13#include "HepMC3/Version.h"
16HEPMC3_DECLARE_READER_FILE(ReaderRootTree)
19 m_tree(0), m_events_count(0), m_tree_name("hepmc3_tree"), m_branch_name("hepmc3_event")
21 m_file = TFile::Open(filename.c_str());
27 m_tree(0), m_events_count(0), m_tree_name(treename.c_str()), m_branch_name(branchname.c_str())
29 m_file = TFile::Open(filename.c_str());
59 HEPMC3_WARNING(
"ReaderRootTree: problem reading branch tree: GenRunInfo. Will attempt to read GenRunInfoData object.")
60 std::shared_ptr<GenRunInfo> ri = std::make_shared<GenRunInfo>();
66 HEPMC3_WARNING(
"ReaderRootTree::init The object was written with HepMC3 version 3.0")
68 HEPMC3_ERROR(
"ReaderRootTree: problem reading object GenRunInfoData")
120 if ( !
m_file->IsOpen() )
return true;
#define HEPMC3_WARNING(MESSAGE)
Macro for printing HEPMC3_HEPMC3_WARNING messages.
#define HEPMC3_ERROR(MESSAGE)
Macro for printing error messages.
Definition of class ReaderRootTree.
Definition of class Units.
Stores event-related information.
void set_run_info(std::shared_ptr< GenRunInfo > run)
Set the GenRunInfo object by smart pointer.
void read_data(const GenEventData &data)
Fill GenEvent based on GenEventData.
GenEvent I/O parsing and serialization for root files based on root TTree.
bool read_event(GenEvent &evt) override
Read event from file.
TTree * m_tree
Tree handler. Public to allow simple access, e.g. custom branches.
ReaderRootTree(const std::string &filename)
Default constructor.
bool failed() override
Get file error state.
bool skip(const int) override
skip events
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.
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.
std::shared_ptr< GenRunInfo > run_info() const
Get the global GenRunInfo object.
void set_run_info(std::shared_ptr< GenRunInfo > run)
Set the global GenRunInfo object.
Stores serializable event information.
std::vector< GenVertexData > vertices
Vertices.
std::vector< int > links2
Second id of the vertex links.
std::vector< std::string > attribute_string
Attribute serialized as string.
std::vector< GenParticleData > particles
Particles.
std::vector< int > links1
First id of the vertex links.
std::vector< std::string > attribute_name
Attribute name.
std::vector< int > attribute_id
Attribute owner id.
Stores serializable run information.
std::vector< std::string > tool_name
Tool names.
std::vector< std::string > tool_version
Tool versions.
std::vector< std::string > attribute_string
Attribute serialized as string.
std::vector< std::string > attribute_name
Attribute name.
std::vector< std::string > tool_description
Tool descriptions.
std::vector< std::string > weight_names
Weight names.