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

Transient TTree for interactive xAOD event data access. More...

#include <xAODTEventTree.h>

Inheritance diagram for xAODTEventTree:
Collaboration diagram for xAODTEventTree:

Public Member Functions

 xAODTEventTree (xAOD::TEvent &event, const char *name="CollectionTree", const char *title="xAOD 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< xAODTEventBranch > br)
 Function adding a new xAODTEventBranch to the tree. More...
 

Private Attributes

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

Detailed Description

Transient TTree for interactive xAOD event data 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 xAODTEventTree.h.

Constructor & Destructor Documentation

◆ xAODTEventTree()

xAODTEventTree::xAODTEventTree ( xAOD::TEvent event,
const char *  name = "CollectionTree",
const char *  title = "xAOD transient tree" 
)

Constructor with all the necessary parameters.

Member Function Documentation

◆ AddBranch()

void xAODTEventTree::AddBranch ( std::unique_ptr< xAODTEventBranch br)

Function adding a new xAODTEventBranch to the tree.

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

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

Definition at line 47 of file xAODTEventTree.cxx.

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

◆ GetEntry()

Int_t xAODTEventTree::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 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 29 of file xAODTEventTree.cxx.

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

Member Data Documentation

◆ m_event

xAOD::TEvent* xAODTEventTree::m_event
private

Pointer to the TEvent reading the persistent tree.

Definition at line 52 of file xAODTEventTree.h.


The documentation for this class was generated from the following files:
xAODTEventTree::m_event
xAOD::TEvent * m_event
Pointer to the TEvent reading the persistent tree.
Definition: xAODTEventTree.h:52
XAOD_MESSAGE
#define XAOD_MESSAGE(MESSAGE)
Simple macro for printing error/verbose messages.
Definition: Control/xAODRootAccess/xAODRootAccess/tools/Message.h:19
xAOD::TEvent::getEntry
::Int_t getEntry(::Long64_t entry, ::Int_t getall=0)
Function loading a given entry of the input TTree.
Definition: Control/xAODRootAccess/Root/TEvent.cxx:1324
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
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