ATLAS Offline Software
SGGetterImpl.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
16 #ifndef D3PDMAKERUTILS_SGGETTERIMPL_H
17 #define D3PDMAKERUTILS_SGGETTERIMPL_H
18 
19 
22 #include "StoreGate/StoreGateSvc.h"
23 #include "GaudiKernel/IClassIDSvc.h"
24 #include "GaudiKernel/ServiceHandle.h"
25 
26 
27 namespace D3PD {
28 
29 
51  : virtual public IObjGetterTool
52 {
53 public:
59  SGGetterImpl (const std::string& name, ServiceHandle<StoreGateSvc>& sg);
60 
61 
65  virtual const std::type_info& typeinfo() const;
66 
67 
71  CLID clid() const;
72 
73 
82  virtual const void* getUntyped (bool allowMissing = false);
83 
84 
90 #define SGGETTERIMPL_PROPS \
91  do { \
92  this->declareProperty ("TypeName", this->m_typename, \
93  "Name of the type of the object being retrieved");\
94  this->declareProperty ("SGKey", this->m_sgkey, \
95  "StoreGate key of the object being retrieved. " \
96  "This may be a comma or space-separated list; " \
97  "the first existing key will be used."); \
98  this->declareProperty ("ClassIDSvc", this->m_clidsvc, \
99  "ClassIDSvc instance to use."); \
100  } while (0)
101 
102 
103 protected:
110 
111 
113  std::string m_typename;
114 
116  std::string m_sgkey;
117 
120 
123 
124 private:
127 
130 };
131 
132 
133 } // namespace D3PD
134 
135 
136 #endif // not D3PDMAKERUTILS_SGGETTERIMPL_H
D3PD::SGGetterImpl::typeinfo
virtual const std::type_info & typeinfo() const
Return the type of object retrieved by this tool.
Definition: SGGetterImpl.cxx:39
D3PD::SGGetterImpl::m_sgkey
std::string m_sgkey
Property: StoreGate key of the object being retrieved.
Definition: SGGetterImpl.h:116
D3PD::SGKeyResolver
Helper to resolve the SG key to use.
Definition: SGKeyResolver.h:40
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
D3PD::SGGetterImpl::clid
CLID clid() const
Return the class ID being read by this tool.
Definition: SGGetterImpl.cxx:54
SGKeyResolver.h
Helper to resolve the SG key to use.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
D3PD::SGGetterImpl::SGGetterImpl
SGGetterImpl(const std::string &name, ServiceHandle< StoreGateSvc > &sg)
Constructor.
Definition: SGGetterImpl.cxx:26
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
D3PD::SGGetterImpl::m_clid
CLID m_clid
CLID for the object being retrieved.
Definition: SGGetterImpl.h:126
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
IObjGetterTool.h
Abstract interface to get an object to put in the tuple.
D3PD::SGGetterImpl::m_typename
std::string m_typename
Property: Name of the type of the object being retrieved.
Definition: SGGetterImpl.h:113
D3PD::SGGetterImpl::m_resolver
SGKeyResolver m_resolver
Helper: Resolve the SG key to use.
Definition: SGGetterImpl.h:122
D3PD::IObjGetterTool
Abstract interface to get an object to put in the tuple.
Definition: IObjGetterTool.h:47
D3PD::SGGetterImpl::m_clidsvc
ServiceHandle< IClassIDSvc > m_clidsvc
Property: Instance of the ClassIDSvc to use.
Definition: SGGetterImpl.h:119
D3PD::SGGetterImpl::m_sg
ServiceHandle< StoreGateSvc > & m_sg
The event storage service.
Definition: SGGetterImpl.h:129
StoreGateSvc.h
D3PD::SGGetterImpl::getUntyped
virtual const void * getUntyped(bool allowMissing=false)
Return the target object.
Definition: SGGetterImpl.cxx:68
D3PD::SGGetterImpl::initializeImpl
StatusCode initializeImpl()
Initialize this mixin class.
Definition: SGGetterImpl.cxx:105
ServiceHandle< StoreGateSvc >
D3PD::SGGetterImpl
Common object getter code for retrieving from StoreGate.
Definition: SGGetterImpl.h:52