|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include <TDirectory.h>
25 : m_eventTree(), m_metaTree(),
26 m_event(
mode ), m_eventTreeName(
"UNKNOWN" ),
27 m_enableEventObj(), m_suppressEventObj(),
28 m_enableMetaObj(), m_suppressMetaObj() {
44 ::Error(
"xAOD::TTreeMgr::readFrom",
45 "Couldn't load the first event from file \"%s\"",
47 return StatusCode::FAILURE;
54 return StatusCode::SUCCESS;
62 ::Warning(
"xAOD::TTreeMgr::enableEventObj",
63 "Event tree already created, can't filter its contents "
65 return StatusCode::RECOVERABLE;
72 return StatusCode::SUCCESS;
80 ::Warning(
"xAOD::TTreeMgr::suppressEventObj",
81 "Event tree already created, can't filter its contents "
83 return StatusCode::RECOVERABLE;
90 return StatusCode::SUCCESS;
98 ::Warning(
"xAOD::TTreeMgr::enableMetaObj",
99 "Metadata tree already created, can't filter its contents "
101 return StatusCode::RECOVERABLE;
108 return StatusCode::SUCCESS;
116 ::Warning(
"xAOD::TTreeMgr::suppressMetaObj",
117 "Metadata tree already created, can't filter its contents "
119 return StatusCode::RECOVERABLE;
126 return StatusCode::SUCCESS;
139 ::Error(
"xAOD::TTreeMgr::eventTree",
141 "metadata. Did you use readFrom(...)?" ) );
159 for(
auto ef_itr : *
ef ) {
178 TRegexp
re(
name.c_str() );
192 TRegexp
re(
name.c_str() );
210 ::TClass*
cl = ::TClass::GetClass( efe.
className().c_str(), kTRUE,
215 if(
cl->InheritsFrom(
"SG::IConstAuxStore" ) ) {
220 const std::type_info* ti =
cl->GetTypeInfo();
222 ::Warning(
"xAOD::TTreeMgr::eventTree",
223 "Couldn't find std::type_info object for type %s "
254 ::Error(
"xAOD::TTreeMgr::metaTree",
256 "tree. Did you use readFrom(...)?" ) );
274 for( ::Int_t
i = 0;
i <
branches->GetEntries(); ++
i ) {
277 ::TBranch*
br =
dynamic_cast< ::TBranch*
>(
branches->At(
i ) );
279 ::Error(
"xAOD::TTreeMgr::metaTree",
280 XAOD_MESSAGE(
"Couldn't access branch %i as a TBranch" ),
287 if( ! strcmp(
br->GetName(),
"EventFormat" ) )
continue;
293 TRegexp
re(
name.c_str() );
295 if(
re.Index(
br->GetName(), &
dummy ) >= 0 ) {
307 TRegexp
re(
name.c_str() );
309 if(
re.Index(
br->GetName(), &
dummy ) >= 0 ) {
320 ::TClass*
cl = ::TClass::GetClass(
br->GetClassName(), kTRUE, kTRUE );
324 const std::type_info* ti =
cl->GetTypeInfo();
328 if(
cl->InheritsFrom(
"SG::IConstAuxStore" ) ) {
336 br->GetClassName() );
std::unique_ptr< xAODTEventTree > m_eventTree
The transient event tree.
std::vector< std::string > m_enableEventObj
Names to select for the event tree.
#define RETURN_CHECK(CONTEXT, EXP)
Helper macro for checking return codes in a compact form in the code.
Transient TTree for interactive xAOD event data access.
StatusCode accept(const xAOD::Muon *mu)
std::vector< std::string > m_suppressMetaObj
Names to suppress from the metadata tree.
StatusCode enableEventObj(const std::vector< std::string > &names)
Object/container names that should be used in the event tree.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
::TTree * eventTree()
Get a pointer to the transient event tree.
std::string m_eventTreeName
The name of the event tree to create.
::TTree * metaTree()
Get a pointer to the transient metadata tree.
::TTree * m_inMetaTree
Pointer to the metadata tree in the input file.
TTreeMgr(TEvent::EAuxMode mode=TEvent::kUndefinedAccess)
Constructor, with an optional access mode selector.
TEvent m_event
The internal TEvent object.
::TTree * m_inTree
The main tree that we are reading from.
::StatusCode StatusCode
StatusCode definition for legacy code.
::Int_t getEntry(::Long64_t entry, ::Int_t getall=0)
Function loading a given entry of the input TTree.
std::unique_ptr< xAODTMetaTree > m_metaTree
The transient metadata tree.
StatusCode readFrom(::TFile *file, ::Bool_t useTreeCache=kTRUE, const char *treeName="CollectionTree")
Read from the file given to the function.
::Bool_t contains(const std::string &key)
Function checking if an object is available from the store.
StatusCode suppressEventObj(const std::vector< std::string > &names)
Object/container names that should be vetoed from the event tree.
TEvent & event()
Get the TEvent object being used by the transient tree(s)
StatusCode suppressMetaObj(const std::vector< std::string > &names)
Object/container names that should be suppressed in the metadata tree.
StatusCode enableMetaObj(const std::vector< std::string > &names)
Object/container names that should be used in the metadata tree.
std::vector< std::string > m_suppressEventObj
Names to suppress from the event tree.
EAuxMode
Auxiliary store "mode".
const boost::regex re(r_e)
const EventFormat * inputEventFormat() const
Get information about the input objects.
StatusCode readFrom(::TFile *file, Bool_t useTreeCache=kTRUE, const char *treeName=EVENT_TREE_NAME)
Connect the object to a new input file.
std::vector< std::string > m_enableMetaObj
Names to select for the metatada tree.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Tool for accessing xAOD files outside of Athena.