Diana Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QRootFileReaderBase Class Reference

Base class for readers for diana and apollo root files. More...

Inheritance diagram for QRootFileReaderBase:
MRootFileReader

Public Member Functions

virtual ~QRootFileReaderBase ()
 
virtual const QErrorJumpToEvent (Long64_t event)
 Jump to a particular event in the chain. More...
 
virtual void SetBranches (Diana::QEventAssembler &eva)
 Set the branch caches. More...
 

Protected Member Functions

virtual void LoadQChain ()
 Build a QChain. More...
 
virtual void AddToEvent (const char *brname, Diana::QObject **evData, Diana::QEventAssembler &eva)
 Add an object from a branch to the event. More...
 
virtual std::vector< TBranch * > GetBranches (QChain *chain, Diana::QEventAssembler &eva)
 Get a list of the branches needed by the event. More...
 

Protected Attributes

QChainfChain
 Pointer to the QChain built by LoadQChain() More...
 
Long64_t fEvents
 Total number of events in fChain. More...
 
Long64_t fEventNumber
 Current event number in the loop. More...
 
bool fDeleteInput
 Flag to delete the input files. More...
 
bool fInclusive
 Flag to automatically include ALL branches. More...
 
std::map< std::string, Diana::QObject ** > fObjectList
 ??? More...
 

Detailed Description

Base class for readers for diana and apollo root files.

Author
Jon Ouellet

Contains common branch access and event jumping methods. Root File Readers should inherit from and overload from this class.

Definition at line 23 of file QRootFileReaderBase.hh.

Constructor & Destructor Documentation

◆ ~QRootFileReaderBase()

QRootFileReaderBase::~QRootFileReaderBase ( )
virtual

Definition at line 22 of file QRootFileReaderBase.cc.

Member Function Documentation

◆ AddToEvent()

void QRootFileReaderBase::AddToEvent ( const char *  brname,
Diana::QObject **  evData,
Diana::QEventAssembler &  eva 
)
protectedvirtual

Add an object from a branch to the event.

Parses a branch name and creates a space for the data in the event.

Definition at line 66 of file QRootFileReaderBase.cc.

References QEventAssembler::Add(), QEventLabel::GetName(), and QEventLabel::GetOwner().

◆ GetBranches()

std::vector< TBranch * > QRootFileReaderBase::GetBranches ( QChain chain,
Diana::QEventAssembler &  eva 
)
protectedvirtual

Get a list of the branches needed by the event.

Loops over all the branches in fChain and returns a list of the ones needed by the event. A branch is needed if:

  • The event is empty at the time of the call.
  • The branch already exists and have been falgged as required

Definition at line 76 of file QRootFileReaderBase.cc.

References QEventAssembler::Get(), QEventAssembler::GetLabels(), QChain::GetListOfAllBranches(), QEventLabel::name, QEventLabel::owner, and QChain::ResetLists().

◆ JumpToEvent()

const QError & QRootFileReaderBase::JumpToEvent ( Long64_t  event)
virtual

Jump to a particular event in the chain.

Reimplemented in MRootFileReader.

Definition at line 53 of file QRootFileReaderBase.cc.

References QERR_OUT_OF_RANGE, and QERR_SUCCESS.

Referenced by MRootFileReader::JumpToEvent().

◆ LoadQChain()

void QRootFileReaderBase::LoadQChain ( )
protectedvirtual

Build a QChain.

Goes through the files in fFileList and add them to fChain

Definition at line 30 of file QRootFileReaderBase.cc.

References err.

◆ SetBranches()

void QRootFileReaderBase::SetBranches ( Diana::QEventAssembler &  eva)
virtual

Set the branch caches.

Goes through the branches, and sets the cache for each branch to be the object contained in the event. Any branches that are not in the event are added to the event and made required if InclusiveMode is on.

Definition at line 110 of file QRootFileReaderBase.cc.

Member Data Documentation

◆ fChain

QChain* QRootFileReaderBase::fChain
protected

Pointer to the QChain built by LoadQChain()

Definition at line 68 of file QRootFileReaderBase.hh.

◆ fDeleteInput

bool QRootFileReaderBase::fDeleteInput
protected

Flag to delete the input files.

Definition at line 74 of file QRootFileReaderBase.hh.

◆ fEventNumber

Long64_t QRootFileReaderBase::fEventNumber
protected

Current event number in the loop.

Definition at line 72 of file QRootFileReaderBase.hh.

◆ fEvents

Long64_t QRootFileReaderBase::fEvents
protected

Total number of events in fChain.

Definition at line 70 of file QRootFileReaderBase.hh.

◆ fInclusive

bool QRootFileReaderBase::fInclusive
protected

Flag to automatically include ALL branches.

Definition at line 76 of file QRootFileReaderBase.hh.

◆ fObjectList

std::map<std::string,Diana::QObject **> QRootFileReaderBase::fObjectList
protected

???

Map of the event data being stored in the event

Definition at line 81 of file QRootFileReaderBase.hh.


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