ATLAS Offline Software
Loading...
Searching...
No Matches
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
13#else // XAOD_STANDALONE
14# include "GaudiKernel/IIncidentListener.h"
15#endif // XAOD_STANDALONE
16
17// Forward declaration(s):
18class Incident;
19
20namespace asg {
21
22#ifdef XAOD_STANDALONE
24 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
64#else // XAOD_STANDALONE
66 typedef ServiceHandle< StoreGateSvc > MetaStore_t;
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 {
134 m_useIncidents = flag;
135 }
136
137} // namespace asg
138
139#endif // ASGTOOLS_ASGMETADATATOOL_H
MetaStorePtr_t outputMetaStore() const
Accessor for the output metadata store.
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
virtual StatusCode beginEvent()
Function called when a new events is loaded.
bool m_beginInputFileCalled
Flag helping to discover when the tool misses the opening of the first input file.
MetaStore_t m_outputMetaStore
Object accessing the output metadata store.
virtual void handle(const Incident &inc)
Function receiving incidents from IncidentSvc/TEvent.
const ServiceHandle< StoreGateSvc > & MetaStorePtr_t
Type of the metadata store pointer in standalone mode.
AsgMetadataTool(const std::string &name)
Normal ASG tool constructor with a name.
~AsgMetadataTool()
Destructor.
MetaStore_t m_inputMetaStore
Object accessing the input metadata store.
void setUseIncidents(const bool flag)
ServiceHandle< StoreGateSvc > MetaStore_t
Type of the metadata store object in Athena.
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
virtual StatusCode metaDataStop()
Function called when the tool should write out its metadata.
virtual StatusCode sysInitialize()
Function initialising the tool in the correct way in Athena.
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
Wrapper class providing StoreGate-like access to metadata in ROOT.