ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTEventTree.cxx
Go to the documentation of this file.
1//
2// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3//
4
5// Local include(s):
9
11
12xAODTEventTree::xAODTEventTree( xAOD::TEvent& event, const char* name,
13 const char* title )
14 : ::TTree( name, title ), m_event( &event ) {
15
16 // Set up the base class's variables:
17 fEntries = m_event->getEntries();
18}
19
29::Int_t xAODTEventTree::GetEntry( ::Long64_t entry, ::Int_t getall ) {
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}
41
47void xAODTEventTree::AddBranch( std::unique_ptr< xAODTEventBranch > br ) {
48
49 // Add the branch:
50 fBranches.Add( br.release() );
51 return;
52}
#define XAOD_MESSAGE(MESSAGE)
Simple macro for printing error/verbose messages.
Transient TTree for interactive xAOD event data access.
xAODTEventTree(xAOD::TEvent &event, const char *name="CollectionTree", const char *title="xAOD transient tree")
Constructor with all the necessary parameters.
xAOD::TEvent * m_event
Pointer to the TEvent reading the persistent tree.
void AddBranch(std::unique_ptr< xAODTEventBranch > br)
Function adding a new xAODTEventBranch to the tree.
virtual::Int_t GetEntry(::Long64_t entry, ::Int_t getall=0)
Function overriding the base class's GetEntry(...)
Tool for accessing xAOD files outside of Athena.
ClassImp(xAODTEventTree) xAODTEventTree