13 #include "HepMC3/Version.h"
16 HEPMC3_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.
std::vector< int > attribute_id
Attribute owner id.
std::vector< std::string > attribute_name
Attribute name.
std::vector< int > links2
Second id of the vertex links.
Definition of class ReaderRootTree.
GenRunInfoData * m_run_info_data
Pointer to structure that holds run info data.
TTree * m_tree
Tree handler. Public to allow simple access, e.g. custom branches.
TFile * m_file
File handler.
std::vector< int > links1
First id of the vertex links.
bool skip(const int) override
skip events
std::vector< std::string > attribute_string
Attribute serialized as string.
Stores event-related information.
Stores serializable event information.
std::vector< std::string > attribute_string
Attribute serialized as string.
std::vector< std::string > tool_name
Tool names.
std::vector< std::string > attribute_name
Attribute name.
Stores serializable run information.
std::shared_ptr< GenRunInfo > run_info() const
Get the global GenRunInfo object.
int m_events_count
Events count. Needed to read the tree.
void close() override
Close file.
std::string m_tree_name
Name of TTree.
void read_data(const GenEventData &data)
Fill GenEvent based on GenEventData.
Definition of class Units.
std::vector< GenParticleData > particles
Particles.
GenEvent I/O parsing and serialization for root files based on root TTree.
void set_run_info(std::shared_ptr< GenRunInfo > run)
Set the GenRunInfo object by smart pointer.
bool read_event(GenEvent &evt) override
Read event from file.
bool failed() override
Get file error state.
std::vector< GenVertexData > vertices
Vertices.
void set_run_info(std::shared_ptr< GenRunInfo > run)
Set the global GenRunInfo object.
#define HEPMC3_ERROR(MESSAGE)
Macro for printing error messages.
std::vector< std::string > tool_version
Tool versions.
GenEventData * m_event_data
Pointer to structure that holds event data.
std::string m_branch_name
Name of TBranch in TTree.
std::vector< std::string > weight_names
Weight names.
std::vector< std::string > tool_description
Tool descriptions.
ReaderRootTree(const std::string &filename)
Default constructor.