00001
00002
00003 #ifndef ASGTOOLS_ASGMETADATATOOL_H
00004 #define ASGTOOLS_ASGMETADATATOOL_H
00005
00006
00007 #include "AsgTools/AsgTool.h"
00008 #ifdef ASGTOOL_STANDALONE
00009 # include "AsgTools/SgTEventMeta.h"
00010 # include "xAODRootAccess/TVirtualIncidentListener.h"
00011 #elif defined(ASGTOOL_ATHENA)
00012 # include "GaudiKernel/IIncidentListener.h"
00013 #else
00014 # error "What environment are we in?!?"
00015 #endif // Environment selection
00016
00017
00018 class Incident;
00019
00020 namespace asg {
00021
00022 #ifdef ASGTOOL_STANDALONE
00024 typedef xAOD::TVirtualIncidentListener IIncidentListener;
00026 typedef xAOD::TIncident Incident;
00027 #endif // ASGTOOL_STANDALONE
00028
00047 class AsgMetadataTool : public AsgTool,
00048 public virtual IIncidentListener {
00049
00050 public:
00052 AsgMetadataTool( const std::string& name );
00054 ~AsgMetadataTool();
00055
00058
00059 #ifdef ASGTOOL_STANDALONE
00061 typedef SgTEventMeta MetaStore_t;
00063 typedef SgTEventMeta* MetaStorePtr_t;
00064 #elif defined(ASGTOOL_ATHENA)
00066 typedef ServiceHandle< StoreGateSvc > MetaStore_t;
00068 typedef ServiceHandle< StoreGateSvc >& MetaStorePtr_t;
00069 #else
00070 # error "What environment are we in?!?"
00071 #endif // Environment selection
00072
00074
00077
00079 MetaStorePtr_t inputMetaStore() const;
00081 MetaStorePtr_t outputMetaStore() const;
00082
00084
00086 virtual StatusCode sysInitialize();
00087
00088
00097 template< typename T >
00098 StatusCode retrieveMetadata( const std::string& folder,
00099 const std::string& key,
00100 T& out ) __attribute__ ((deprecated));
00101
00102 protected:
00105
00107 virtual void handle( const Incident& inc );
00108
00110 virtual StatusCode beginInputFile();
00111
00114 virtual StatusCode endInputFile();
00115
00117 virtual StatusCode beginEvent();
00118
00120 virtual StatusCode metaDataStop();
00121
00123
00124 private:
00126 mutable MetaStore_t m_inputMetaStore;
00128 mutable MetaStore_t m_outputMetaStore;
00129
00132 bool m_beginInputFileCalled;
00133
00134 };
00135
00136 }
00137
00138
00139 #include "AsgTools/AsgMetadataTool.icc"
00140
00141 #endif // ASGTOOLS_ASGMETADATATOOL_H