HepMC3 event record library
Public Member Functions | Data Fields | Private Attributes
WriterRootTreeOPAL Class Reference

Detailed Description

GenEvent I/O output to files similar to these produced by OPAL software.

Examples:
convert_example.cc.

Definition at line 18 of file WriterRootTreeOPAL.h.

#include <WriterRootTreeOPAL.h>

+ Inheritance diagram for WriterRootTreeOPAL:
+ Collaboration diagram for WriterRootTreeOPAL:

Public Member Functions

 WriterRootTreeOPAL (const std::string &filename, shared_ptr< GenRunInfo > run=shared_ptr< GenRunInfo >())
 Constructor. More...
 
void init_branches ()
 Init ROOT branches. More...
 
void write_event (const GenEvent &evt)
 Write event. More...
 
void set_run_number (const int nr)
 Set run number. More...
 
void write_run_info ()
 Write the GenRunInfo object to file. More...
 
void close ()
 Close file stream. More...
 
bool failed ()
 Get stream error state flag. More...
 
void set_run_info (shared_ptr< GenRunInfo > run)
 Set the global GenRunInfo object. More...
 
shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object. More...
 

Data Fields

TTree * m_tree
 Tree handler. Public to allow simple access, e.g. custom branches. More...
 

Private Attributes

float m_Ebeam
 Beam energy in GEV. More...
 
int m_Irun
 Run number. More...
 
int m_Ievnt
 Event number. More...
 

Constructor & Destructor Documentation

WriterRootTreeOPAL ( const std::string &  filename,
shared_ptr< GenRunInfo run = shared_ptr<GenRunInfo>() 
)

Constructor.

Definition at line 7 of file WriterRootTreeOPAL.cc.

Member Function Documentation

void close ( )
virtualinherited

Close file stream.

Implements Writer.

Definition at line 91 of file WriterRootTree.cc.

References WriterRootTree::m_event_data, WriterRootTree::m_file, WriterRootTree::m_run_info_data, and WriterRootTree::m_tree.

bool failed ( )
virtualinherited

Get stream error state flag.

Implements Writer.

Definition at line 100 of file WriterRootTree.cc.

References WriterRootTree::m_file.

void init_branches ( )
shared_ptr<GenRunInfo> run_info ( ) const
inlineinherited

Get the global GenRunInfo object.

Definition at line 44 of file Writer.h.

References Writer::m_run_info.

void set_run_info ( shared_ptr< GenRunInfo run)
inlineinherited

Set the global GenRunInfo object.

Definition at line 39 of file Writer.h.

References Writer::m_run_info.

void set_run_number ( const int  nr)

Set run number.

Definition at line 28 of file WriterRootTreeOPAL.cc.

References WriterRootTreeOPAL::m_Irun.

void write_event ( const GenEvent evt)
virtual
void write_run_info ( )
inherited

Write the GenRunInfo object to file.

Definition at line 89 of file WriterRootTree.cc.

Field Documentation

float m_Ebeam
private

Beam energy in GEV.

Definition at line 30 of file WriterRootTreeOPAL.h.

int m_Ievnt
private

Event number.

Definition at line 32 of file WriterRootTreeOPAL.h.

int m_Irun
private

Run number.

Definition at line 31 of file WriterRootTreeOPAL.h.

TTree* m_tree
inherited

Tree handler. Public to allow simple access, e.g. custom branches.

Definition at line 81 of file WriterRootTree.h.


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