HepMC3 event record library
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
ReaderuprootTree Class Reference

Detailed Description

ReaderuprootTree.

Definition at line 19 of file ReaderuprootTree.h.

#include <ReaderuprootTree.h>

+ Inheritance diagram for ReaderuprootTree:
+ Collaboration diagram for ReaderuprootTree:

Public Member Functions

 ReaderuprootTree (const std::string &filename, const std::string &treename="hepmc3_tree", const std::string &branchname="hepmc3_event")
 Constructor with tree and branch names. More...
 
bool skip (const int) override
 skip events More...
 
bool read_event (GenEvent &evt) override
 Read event from file. More...
 
void close () override
 Close file. More...
 
bool failed () override
 Get file error state. More...
 
std::shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object. More...
 
void set_options (const std::map< std::string, std::string > &options)
 Set options. More...
 
std::map< std::string,
std::string > 
get_options () const
 Set options. More...
 

Protected Member Functions

void set_run_info (std::shared_ptr< GenRunInfo > run)
 Set the global GenRunInfo object. More...
 

Protected Attributes

std::map< std::string,
std::string > 
m_options
 options More...
 

Private Member Functions

bool init (const std::string &filename)
 init routine More...
 
PyObject * get_function (PyObject *, const std::string &)
 Get python functions. More...
 
PyObject * init_python_module (const std::string &)
 Init python module. More...
 
template<class T >
std::vector< T > get_vector (PyObject *file_name, const std::string &array_name, std::string desired_type="")
 Get arrays. More...
 

Private Attributes

int m_events_count
 Events count. Needed to read the tree. More...
 
GenEventDatam_event_data
 Pointer to structure that holds event data. More...
 
GenRunInfoDatam_run_info_data
 Pointer to structure that holds run info data. More...
 
std::string m_tree_name
 Name of TTree. More...
 
std::string m_branch_name
 Name of TBranch in TTree. More...
 
PyObject * m_file
 Python file handler. More...
 
PyObject * m_tree
 Python tree handler. More...
 
PyObject * m_genruninfo
 Python runInfo handler. More...
 
PyObject * m_access_function
 Python access function for arrays. More...
 
PyObject * m_python_module
 Python module. More...
 
long int m_tree_getEntries
 number of processed events More...
 

Constructor & Destructor Documentation

ReaderuprootTree ( const std::string &  filename,
const std::string &  treename = "hepmc3_tree",
const std::string &  branchname = "hepmc3_event" 
)

Constructor with tree and branch names.

Definition at line 100 of file ReaderuprootTree.cc.

References ReaderuprootTree::init().

Member Function Documentation

void close ( )
overridevirtual

Close file.

Implements Reader.

Definition at line 328 of file ReaderuprootTree.cc.

bool failed ( )
overridevirtual

Get file error state.

Implements Reader.

Definition at line 345 of file ReaderuprootTree.cc.

PyObject * get_function ( PyObject *  m_python_module,
const std::string &  name 
)
private

Get python functions.

Definition at line 66 of file ReaderuprootTree.cc.

std::map<std::string, std::string> get_options ( ) const
inlineinherited

Set options.

Definition at line 58 of file Reader.h.

References Reader::m_options.

std::vector< T > get_vector ( PyObject *  file_name,
const std::string &  array_name,
std::string  desired_type = "" 
)
private

Get arrays.

obtain vector of objects using name and type

Definition at line 9 of file ReaderuprootTree.cc.

bool init ( const std::string &  filename)
private
PyObject * init_python_module ( const std::string &  code)
private

Init python module.

Definition at line 79 of file ReaderuprootTree.cc.

References ReaderuprootTree::m_python_module.

bool read_event ( GenEvent evt)
overridevirtual

Read event from file.

Parameters
[out]evtContains parsed event

Implements Reader.

Definition at line 226 of file ReaderuprootTree.cc.

std::shared_ptr<GenRunInfo> run_info ( ) const
inlineinherited

Get the global GenRunInfo object.

Examples:
LHEF_example_cat.cc.

Definition at line 44 of file Reader.h.

References Reader::m_run_info.

void set_options ( const std::map< std::string, std::string > &  options)
inlineinherited

Set options.

Definition at line 53 of file Reader.h.

References Reader::m_options.

void set_run_info ( std::shared_ptr< GenRunInfo run)
inlineprotectedinherited

Set the global GenRunInfo object.

Definition at line 64 of file Reader.h.

References Reader::m_run_info.

bool skip ( const int  n)
overridevirtual

skip events

Reimplemented from Reader.

Definition at line 217 of file ReaderuprootTree.cc.

References ReaderuprootTree::m_events_count.

Field Documentation

PyObject* m_access_function
private

Python access function for arrays.

Definition at line 58 of file ReaderuprootTree.h.

std::string m_branch_name
private

Name of TBranch in TTree.

Definition at line 49 of file ReaderuprootTree.h.

GenEventData* m_event_data
private

Pointer to structure that holds event data.

Definition at line 46 of file ReaderuprootTree.h.

int m_events_count
private

Events count. Needed to read the tree.

Definition at line 45 of file ReaderuprootTree.h.

PyObject* m_file
private

Python file handler.

Definition at line 52 of file ReaderuprootTree.h.

PyObject* m_genruninfo
private

Python runInfo handler.

Definition at line 56 of file ReaderuprootTree.h.

std::map<std::string, std::string> m_options
protectedinherited

options

Definition at line 68 of file Reader.h.

PyObject* m_python_module
private

Python module.

Definition at line 60 of file ReaderuprootTree.h.

GenRunInfoData* m_run_info_data
private

Pointer to structure that holds run info data.

Definition at line 47 of file ReaderuprootTree.h.

PyObject* m_tree
private

Python tree handler.

Definition at line 54 of file ReaderuprootTree.h.

long int m_tree_getEntries
private

number of processed events

Definition at line 62 of file ReaderuprootTree.h.

std::string m_tree_name
private

Name of TTree.

Definition at line 48 of file ReaderuprootTree.h.


The documentation for this class was generated from the following files: