12 #include "HepMC/Units.h" 18 m_file(filename.c_str()),m_tree(0),m_events_count(0),m_tree_name(
"hepmc3_tree"),m_branch_name(
"hepmc3_event")
25 m_file(filename.c_str()),m_tree(0),m_events_count(0),m_tree_name(treename.c_str()),m_branch_name(branchname.c_str())
34 ERROR(
"ReaderRootTree: problem opening file: " <<
m_file.GetName() )
37 shared_ptr<GenRunInfo> ri = make_shared<GenRunInfo>();
53 ERROR(
"ReaderRootTree: problem opening tree: " << m_tree_name)
57 int result=
m_tree->SetBranchAddress(m_branch_name.c_str(),&m_event_data);
60 ERROR(
"ReaderRootTree: problem reading branch tree: " << m_tree_name)
75 m_event_data->
links1.clear();
76 m_event_data->
links2.clear();
95 if ( !
m_file.IsOpen() )
return true;
std::vector< std::string > attribute_string
Attribute serialized as string.
std::vector< int > links1
First id of the vertex links.
Stores serializable run information.
bool failed()
Get stream error state.
TFile m_file
File handler.
std::vector< GenVertexData > vertices
Vertices.
int m_events_count
Events count. Needed to read the tree.
Definition of class ReaderRootTree.
void set_run_info(shared_ptr< GenRunInfo > run)
Set the global GenRunInfo object.
Stores event-related information.
ReaderRootTree(const std::string &filename)
Default constructor.
std::vector< int > attribute_id
Attribute owner id.
void read_data(const GenEventData &data)
Fill GenEvent based on GenEventData.
std::vector< int > links2
Second id of the vertex links.
void close()
Close file stream.
TTree * m_tree
Tree handler. Public to allow simple access, e.g. custom branches.
bool read_event(GenEvent &evt)
Read event from file.
std::vector< std::string > attribute_name
Attribute name.
Definition of template class SmartPointer.
std::vector< GenParticleData > particles
Particles.
Stores serializable event information.