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

Specialised class for browsing xAOD metadata interface objects in ROOT. More...

#include <xAODTMetaBranch.h>

Inheritance diagram for xAODTMetaBranch:
Collaboration diagram for xAODTMetaBranch:

Public Member Functions

 xAODTMetaBranch (::TTree &parent, xAOD::TEvent &event, const std::type_info &ti, const char *brName, const char *brType)
 Constructor with all the needed parameters. More...
 
virtual ::Int_t GetEntry (::Long64_t entry, ::Int_t getall)
 Function getting the current entry/file for this branch. More...
 
virtual ::TClass * IsA () const
 Function returning the type of ::TBranchObject. More...
 

Private Attributes

xAOD::TEventm_event
 Pointer to the TEvent object reading the persistent tree. More...
 
const std::type_info * m_ti
 The type of the object that needs to be read. More...
 
const void * m_object
 Pointer to the object read in using TEvent. More...
 

Detailed Description

Specialised class for browsing xAOD metadata interface objects in ROOT.

This is a class extremely similar to xAOD::TEventBranch. But instead of giving access to event level information, it provides a convenient view of the ROOT-readable metadata payload of xAOD files.

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 27 of file xAODTMetaBranch.h.

Constructor & Destructor Documentation

◆ xAODTMetaBranch()

xAODTMetaBranch::xAODTMetaBranch ( ::TTree &  parent,
xAOD::TEvent event,
const std::type_info &  ti,
const char *  brName,
const char *  brType 
)

Constructor with all the needed parameters.

Member Function Documentation

◆ GetEntry()

Int_t xAODTMetaBranch::GetEntry ( ::Long64_t  entry,
::Int_t  getall 
)

Function getting the current entry/file for this branch.

This is the function doing the heavy lifting.

It loads the interface object for the current file (entry) requested. Only doing some minimal overhead in the meanwhile.

Parameters
entryThe entry/file to be read for this object
getallWhen set to 1, read all information about the branch (Not used.)
Returns
The number of bytes read, or a negative number if not successful

Definition at line 32 of file xAODTMetaBranch.cxx.

32  {
33 
34  // Check if the branch is active:
35  if( TestBit( kDoNotProcess ) ) {
36  return 0;
37  }
38 
39  // Check whether we already have the requested entry:
40  if( fReadEntry == entry ) {
41  return 1;
42  }
43 
44  // Load the requested file:
45  if( m_event->getFile( entry ) < 0 ) {
46  Error( "GetEntry",
47  XAOD_MESSAGE( "Problems with loading entry/file %lld" ), entry );
48  return -1;
49  }
50 
51  // Update the internal pointer:
52  m_object = m_event->getInputObject( GetName(), *m_ti, kFALSE, kTRUE );
53  if( ! m_object ) {
54  Error( "GetEntry",
55  XAOD_MESSAGE( "Failed to read variable of type \"%s\" with "
56  "key \"%s\"" ),
57  GetClassName(), GetName() );
58  return -1;
59  }
60 
61  // We were successful:
62  fReadEntry = entry;
63  return 1;
64 }

◆ IsA()

TClass * xAODTMetaBranch::IsA ( ) const

Function returning the type of ::TBranchObject.

I took this from the ARA code directly.

Apparenly TTree would not know how to handle this object if it reported its actual type. So we pretend that this is a TBranchObject object. That way TBrowser shows its contents nicely.

Returns
The class for TBranchObject

Definition at line 73 of file xAODTMetaBranch.cxx.

73  {
74 
76 }

Member Data Documentation

◆ m_event

xAOD::TEvent* xAODTMetaBranch::m_event
private

Pointer to the TEvent object reading the persistent tree.

Definition at line 47 of file xAODTMetaBranch.h.

◆ m_object

const void* xAODTMetaBranch::m_object
private

Pointer to the object read in using TEvent.

Definition at line 51 of file xAODTMetaBranch.h.

◆ m_ti

const std::type_info* xAODTMetaBranch::m_ti
private

The type of the object that needs to be read.

Definition at line 49 of file xAODTMetaBranch.h.


The documentation for this class was generated from the following files:
xAODTMetaBranch::m_object
const void * m_object
Pointer to the object read in using TEvent.
Definition: xAODTMetaBranch.h:51
IsA
#define IsA
Declare the TObject style functions.
Definition: xAODTEventBranch.h:59
xAOD::TEvent::getInputObject
const void * getInputObject(SG::sgkey_t key, const std::type_info &ti, bool silent=false) override
Function for retrieving an input object in a non-template way.
Definition: Control/xAODRootAccess/Root/TEvent.cxx:1938
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
xAODTMetaBranch::m_event
xAOD::TEvent * m_event
Pointer to the TEvent object reading the persistent tree.
Definition: xAODTMetaBranch.h:47
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
xAODTMetaBranch::m_ti
const std::type_info * m_ti
The type of the object that needs to be read.
Definition: xAODTMetaBranch.h:49
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16