ATLAS Offline Software
TTreeMgr.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 //
3 // Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 //
5 #ifndef XAODROOTACCESS_TTREEMGR_H
6 #define XAODROOTACCESS_TTREEMGR_H
7 
8 // System include(s):
9 #include <memory>
10 #include <string>
11 #include <vector>
12 
13 // Local include(s):
14 #include "xAODRootAccess/TEvent.h"
18 
19 // Forward declaration(s):
20 class TTree;
21 class TFile;
22 
23 namespace xAOD {
24 
34  class TTreeMgr {
35 
36  public:
39 
42 
44  StatusCode readFrom( ::TFile* file, ::Bool_t useTreeCache = kTRUE,
45  const char* treeName = "CollectionTree" );
46 
48 
51 
53  StatusCode enableEventObj( const std::vector< std::string >& names );
55  StatusCode suppressEventObj( const std::vector< std::string >& names );
56 
58  StatusCode enableMetaObj( const std::vector< std::string >& names );
60  StatusCode suppressMetaObj( const std::vector< std::string >& names );
61 
63 
66 
68  ::TTree* eventTree();
69 
71  ::TTree* metaTree();
72 
74 
76  TEvent& event();
77 
78  private:
80  std::unique_ptr< xAODTEventTree > m_eventTree;
82  std::unique_ptr< xAODTMetaTree > m_metaTree;
83 
86 
88  std::string m_eventTreeName;
89 
91  std::vector< std::string > m_enableEventObj;
93  std::vector< std::string > m_suppressEventObj;
94 
96  std::vector< std::string > m_enableMetaObj;
98  std::vector< std::string > m_suppressMetaObj;
99 
100  }; // class TTreeMgr
101 
102 } // namespace xAOD
103 
104 #endif // XAODROOTACCESS_TTREEMGR_H
xAOD::TTreeMgr
Class creating (a) transient tree(s) from xAOD files.
Definition: TTreeMgr.h:34
xAOD::TTreeMgr::m_eventTree
std::unique_ptr< xAODTEventTree > m_eventTree
The transient event tree.
Definition: TTreeMgr.h:80
xAOD::TTreeMgr::m_enableEventObj
std::vector< std::string > m_enableEventObj
Names to select for the event tree.
Definition: TTreeMgr.h:91
xAOD::TEvent::kUndefinedAccess
@ kUndefinedAccess
Undefined, to be selected by the object.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:102
xAOD::TTreeMgr::m_suppressMetaObj
std::vector< std::string > m_suppressMetaObj
Names to suppress from the metadata tree.
Definition: TTreeMgr.h:98
xAOD::TTreeMgr::enableEventObj
StatusCode enableEventObj(const std::vector< std::string > &names)
Object/container names that should be used in the event tree.
Definition: TTreeMgr.cxx:58
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::TTreeMgr::eventTree
::TTree * eventTree()
Get a pointer to the transient event tree.
Definition: TTreeMgr.cxx:129
xAOD::TTreeMgr::m_eventTreeName
std::string m_eventTreeName
The name of the event tree to create.
Definition: TTreeMgr.h:88
xAOD::TTreeMgr::metaTree
::TTree * metaTree()
Get a pointer to the transient metadata tree.
Definition: TTreeMgr.cxx:245
xAOD::TTreeMgr::TTreeMgr
TTreeMgr(TEvent::EAuxMode mode=TEvent::kUndefinedAccess)
Constructor, with an optional access mode selector.
Definition: TTreeMgr.cxx:24
xAOD::TTreeMgr::m_event
TEvent m_event
The internal TEvent object.
Definition: TTreeMgr.h:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TTreeMgr::m_metaTree
std::unique_ptr< xAODTMetaTree > m_metaTree
The transient metadata tree.
Definition: TTreeMgr.h:82
TEvent.h
file
TFile * file
Definition: tile_monitor.h:29
dumpFileToPlots.treeName
string treeName
Definition: dumpFileToPlots.py:20
Preparation.mode
mode
Definition: Preparation.py:94
xAOD::TTreeMgr::readFrom
StatusCode readFrom(::TFile *file, ::Bool_t useTreeCache=kTRUE, const char *treeName="CollectionTree")
Read from the file given to the function.
Definition: TTreeMgr.cxx:32
xAOD::TTreeMgr::suppressEventObj
StatusCode suppressEventObj(const std::vector< std::string > &names)
Object/container names that should be vetoed from the event tree.
Definition: TTreeMgr.cxx:76
StatusCode.h
xAOD::TTreeMgr::event
TEvent & event()
Get the TEvent object being used by the transient tree(s)
Definition: TTreeMgr.cxx:344
xAOD::TTreeMgr::suppressMetaObj
StatusCode suppressMetaObj(const std::vector< std::string > &names)
Object/container names that should be suppressed in the metadata tree.
Definition: TTreeMgr.cxx:112
xAODTEventTree.h
xAOD::TTreeMgr::enableMetaObj
StatusCode enableMetaObj(const std::vector< std::string > &names)
Object/container names that should be used in the metadata tree.
Definition: TTreeMgr.cxx:94
xAOD::TTreeMgr::m_suppressEventObj
std::vector< std::string > m_suppressEventObj
Names to suppress from the event tree.
Definition: TTreeMgr.h:93
xAOD::TEvent::EAuxMode
EAuxMode
Auxiliary store "mode".
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:98
xAODTMetaTree.h
xAOD::TTreeMgr::m_enableMetaObj
std::vector< std::string > m_enableMetaObj
Names to select for the metatada tree.
Definition: TTreeMgr.h:96
xAOD::TEvent
Tool for accessing xAOD files outside of Athena.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:84