ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
xAODTMetaTree Class Reference

Transient TTree for interactive xAOD metadata access. More...

#include <xAODTMetaTree.h>

Inheritance diagram for xAODTMetaTree:
Collaboration diagram for xAODTMetaTree:

Public Member Functions

 xAODTMetaTree (xAOD::TEvent &event, const char *name="MetaData", const char *title="xAOD metadata transient tree")
 Constructor with all the necessary parameters. More...
 
virtual ::Int_t GetEntry (::Long64_t entry, ::Int_t getall=0)
 Function overriding the base class's GetEntry(...) More...
 
void AddBranch (std::unique_ptr< xAODTMetaBranch > br)
 Function adding a new xAOD::TBranch to the tree. More...
 

Private Attributes

xAOD::TEventm_event
 Pointer to the TEvent reading the persistent metadata tree. More...
 

Detailed Description

Transient TTree for interactive xAOD metadata access.

This is pretty much the same sort of thing that ARA's TTreeTrans was designed for. In order to implement everything that we need from the transient tree, we need to override some functions within the class. But to the outside user we still want to present the usual TTree interface.

This class is only meant for interactive and PyROOT access to an xAOD file. It should not be used in compiled analysis code, or for writing information into a file. (The first one will be slow, the second one just impossible.)

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 37 of file xAODTMetaTree.h.

Constructor & Destructor Documentation

◆ xAODTMetaTree()

xAODTMetaTree::xAODTMetaTree ( xAOD::TEvent event,
const char *  name = "MetaData",
const char *  title = "xAOD metadata transient tree" 
)

Constructor with all the necessary parameters.

Member Function Documentation

◆ AddBranch()

void xAODTMetaTree::AddBranch ( std::unique_ptr< xAODTMetaBranch br)

Function adding a new xAOD::TBranch to the tree.

This is a simple convenience function for setting up the object with all of its branches.

Parameters
brThe xAOD::TMetaBranch object that should be added to the tree

Definition at line 48 of file xAODTMetaTree.cxx.

48  {
49 
50  // Add the branch:
51  fBranches.Add( br.release() );
52  return;
53 }

◆ GetEntry()

Int_t xAODTMetaTree::GetEntry ( ::Long64_t  entry,
::Int_t  getall = 0 
)

Function overriding the base class's GetEntry(...)

This function is not actually used when browsing the TTree, or when using TTree::Draw(...).

So in interactive usage there's little point to it. But it is very important for PyROOT usage.

Parameters
entryThe entry from the TTree (the file number) that should be read
getallWhen set to 1, read all the (active) branches
Returns
The number of bytes read, or a negative number in case of problems.

Definition at line 30 of file xAODTMetaTree.cxx.

30  {
31 
32  // Forward the call to the TEvent object:
33  if( m_event->getFile( entry, getall ) < 0 ) {
34  Error( "GetEntry",
35  XAOD_MESSAGE( "Problems with loading entry/file %lld" ), entry );
36  return -1;
37  }
38 
39  // Let the base class know what happened:
40  return ::TTree::GetEntry( entry, getall );
41 }

Member Data Documentation

◆ m_event

xAOD::TEvent* xAODTMetaTree::m_event
private

Pointer to the TEvent reading the persistent metadata tree.

Definition at line 52 of file xAODTMetaTree.h.


The documentation for this class was generated from the following files:
xAOD::TEvent::getFile
::Int_t getFile(::Long64_t file, ::Int_t getall=0)
Load the first event for a given file from the input TChain.
Definition: Control/xAODRootAccess/Root/TEvent.cxx:1472
XAOD_MESSAGE
#define XAOD_MESSAGE(MESSAGE)
Simple macro for printing error/verbose messages.
Definition: Control/xAODRootAccess/xAODRootAccess/tools/Message.h:19
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
xAODTMetaTree::m_event
xAOD::TEvent * m_event
Pointer to the TEvent reading the persistent metadata tree.
Definition: xAODTMetaTree.h:52
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
PlotCalibFromCool.br
br
Definition: PlotCalibFromCool.py:355