ATLAS Offline Software
AsgMetadataTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ASGTOOLS_ASGMETADATATOOL_H
6 #define ASGTOOLS_ASGMETADATATOOL_H
7 
8 // Local include(s):
9 #include "AsgTools/AsgTool.h"
10 #ifdef XAOD_STANDALONE
11 # include "AsgTools/SgTEventMeta.h"
13 #else // XAOD_STANDALONE
14 # include "GaudiKernel/IIncidentListener.h"
15 #endif // XAOD_STANDALONE
16 
17 // Forward declaration(s):
18 class Incident;
19 
20 namespace asg {
21 
22 #ifdef XAOD_STANDALONE
23  typedef xAOD::TVirtualIncidentListener IIncidentListener;
26  typedef xAOD::TIncident Incident;
27 #endif // XAOD_STANDALONE
28 
47  class AsgMetadataTool : public AsgTool,
48  public virtual IIncidentListener {
49 
50  public:
52  AsgMetadataTool( const std::string& name );
55 
58 
59 #ifdef XAOD_STANDALONE
60  typedef SgTEventMeta MetaStore_t;
64 #else // XAOD_STANDALONE
69 #endif // XAOD_STANDALONE
70 
72 
75 
80 
82 
84  virtual StatusCode sysInitialize();
85 
86 
87  protected:
90 
91  void setUseIncidents(const bool flag);
92 
94  virtual void handle( const Incident& inc );
95 
97  virtual StatusCode beginInputFile();
98 
101  virtual StatusCode endInputFile();
102 
104  virtual StatusCode beginEvent();
105 
107  virtual StatusCode metaDataStop();
108 
110 
111  private:
112 #ifdef XAOD_STANDALONE
117 #else
122 #endif
123 
127 
129 
130  }; // class AsgMetadataTool
131 
132  inline void AsgMetadataTool::setUseIncidents(const bool flag)
133  {
135  }
136 
137 } // namespace asg
138 
139 #endif // ASGTOOLS_ASGMETADATATOOL_H
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
asg::AsgMetadataTool::beginEvent
virtual StatusCode beginEvent()
Function called when a new events is loaded.
Definition: AsgMetadataTool.cxx:196
asg::AsgMetadataTool::AsgMetadataTool
AsgMetadataTool(const std::string &name)
Normal ASG tool constructor with a name.
Definition: AsgMetadataTool.cxx:30
asg
Definition: DataHandleTestTool.h:28
asg::AsgMetadataTool::inputMetaStore
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
Definition: AsgMetadataTool.cxx:88
asg::AsgMetadataTool::MetaStorePtr_t
const ServiceHandle< StoreGateSvc > & MetaStorePtr_t
Type of the metadata store pointer in standalone mode.
Definition: AsgMetadataTool.h:68
xAOD::TVirtualIncidentListener
Class providing an interface for classes listening to xAOD incidents.
Definition: TVirtualIncidentListener.h:25
asg::AsgMetadataTool::m_beginInputFileCalled
bool m_beginInputFileCalled
Flag helping to discover when the tool misses the opening of the first input file.
Definition: AsgMetadataTool.h:126
asg::AsgMetadataTool::endInputFile
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
Definition: AsgMetadataTool.cxx:188
asg::AsgMetadataTool::m_outputMetaStore
MetaStore_t m_outputMetaStore
Object accessing the output metadata store.
Definition: AsgMetadataTool.h:121
TVirtualIncidentListener.h
asg::AsgMetadataTool::setUseIncidents
void setUseIncidents(const bool flag)
Definition: AsgMetadataTool.h:132
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TIncident
Class describing a certain "incident" that is communicated to user code.
Definition: TIncident.h:58
asg::AsgMetadataTool::beginInputFile
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
Definition: AsgMetadataTool.cxx:180
master.flag
bool flag
Definition: master.py:29
SgTEventMeta.h
asg::AsgMetadataTool::metaDataStop
virtual StatusCode metaDataStop()
Function called when the tool should write out its metadata.
Definition: AsgMetadataTool.cxx:204
asg::AsgMetadataTool::m_inputMetaStore
MetaStore_t m_inputMetaStore
Object accessing the input metadata store.
Definition: AsgMetadataTool.h:119
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
asg::AsgMetadataTool::sysInitialize
virtual StatusCode sysInitialize()
Function initialising the tool in the correct way in Athena.
Definition: AsgMetadataTool.cxx:110
asg::AsgMetadataTool::~AsgMetadataTool
~AsgMetadataTool()
Destructor.
Definition: AsgMetadataTool.cxx:62
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
asg::SgTEventMeta
Wrapper class providing StoreGate-like access to metadata in ROOT.
Definition: SgTEventMeta.h:44
asg::AsgMetadataTool::MetaStore_t
ServiceHandle< StoreGateSvc > MetaStore_t
Type of the metadata store object in Athena.
Definition: AsgMetadataTool.h:66
asg::AsgMetadataTool::outputMetaStore
MetaStorePtr_t outputMetaStore() const
Accessor for the output metadata store.
Definition: AsgMetadataTool.cxx:97
AsgTool.h
asg::AsgMetadataTool::handle
virtual void handle(const Incident &inc)
Function receiving incidents from IncidentSvc/TEvent.
Definition: AsgMetadataTool.cxx:130
ServiceHandle< StoreGateSvc >
asg::AsgMetadataTool::m_useIncidents
bool m_useIncidents
Definition: AsgMetadataTool.h:128