ATLAS Offline Software
StoreGate/StoreGate/ReadDecorHandleKey.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  * Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
4  */
14 #ifndef STOREGATE_READDECORHANDLEKEY_H
15 #define STOREGATE_READDECORHANDLEKEY_H
16 
17 
19 #include "AthenaKernel/TopBase.h"
20 
21 
22 namespace SG {
23 
24 
82 template <class T>
84  : public ReadHandleKey<T>
85 {
86 public:
89 
91  typedef typename SG::TopBase<T>::type topbase_t;
92 
93 
103  explicit
104  ReadDecorHandleKey (const std::string& key = "",
105  const std::string& storeName = StoreID::storeName(StoreID::EVENT_STORE));
106 
116  explicit
118  const std::string& decorKey = "",
119  const std::string& storeName = StoreID::storeName(StoreID::EVENT_STORE));
120 
121 
135  template <class OWNER,
137  ReadDecorHandleKey( OWNER* owner,
138  const std::string& name,
139  const std::string& key = {},
140  const std::string& doc = "");
141 
142 
153  template <class OWNER,
155  ReadDecorHandleKey( OWNER* owner,
156  const std::string& name,
157  const VarHandleKey& contKey,
158  const std::string& decorKey = {},
159  const std::string& doc = "");
160 
161 
170  ReadDecorHandleKey& operator= (const std::string& sgkey);
171 
172 
184  virtual StatusCode assign (const std::string& sgkey) override;
185 
186 
192  CLID clid() const;
193 
194 
202  StatusCode initialize (bool used = true);
203 
204 
209 
210 
211 private:
215  virtual std::string pythonRepr() const override;
216 
217 
220 
228  const VarHandleKey* m_contKey{nullptr};
229 };
230 
231 
232 } // namespace SG
233 
234 
236 
237 
238 #endif // not STOREGATE_READDECORHANDLEKEY_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
used
common.sgkey
def sgkey(tool)
Definition: common.py:1028
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::ReadDecorHandleKey::m_contHandleKey
ReadHandleKey< T > m_contHandleKey
The container handle.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:219
athena.value
value
Definition: athena.py:124
ReadDecorHandleKey.icc
SG::TopBase::type
std::conditional< has_base, typename TopBase< Base1 >::type, T >::type type
Definition: TopBase.h:43
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
SG::ReadDecorHandleKey::ReadDecorHandleKey
ReadDecorHandleKey(OWNER *owner, const std::string &name, const std::string &key={}, const std::string &doc="")
auto-declaring Property Constructor.
SG::ReadDecorHandleKey::operator=
ReadDecorHandleKey & operator=(const std::string &sgkey)
Change the key of the object to which we're referring.
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
SG::ReadDecorHandleKey::m_contKey
const VarHandleKey * m_contKey
Optional container from which decorations are read.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:228
SG::ReadDecorHandleKey::ReadDecorHandleKey
ReadDecorHandleKey(OWNER *owner, const std::string &name, const VarHandleKey &contKey, const std::string &decorKey={}, const std::string &doc="")
auto-declaring Property Constructor.
SG::ReadDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
TopBase.h
Calculate topmost accessible base accessible via SG_BASES.
SG::ReadDecorHandleKey::topbase_t
SG::TopBase< T >::type topbase_t
Class for which we set the CLID. See above.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:91
SG::ReadDecorHandleKey::clid
CLID clid() const
Return the class ID for the referenced object.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::ReadDecorHandleKey::ReadDecorHandleKey
ReadDecorHandleKey(const std::string &key="", const std::string &storeName=StoreID::storeName(StoreID::EVENT_STORE))
Constructor.
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SG::ReadDecorHandleKey::assign
virtual StatusCode assign(const std::string &sgkey) override
Change the key of the object to which we're referring.
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::VarHandleKey
A property holding a SG store/key/clid from which a VarHandle is made.
Definition: StoreGate/StoreGate/VarHandleKey.h:62
SG::ReadDecorHandleKey::pythonRepr
virtual std::string pythonRepr() const override
Python representation of Handle.
SG::ReadDecorHandleKey::contHandleKey
const ReadHandleKey< T > & contHandleKey() const
Return the handle key for the container.
StoreID::EVENT_STORE
@ EVENT_STORE
Definition: StoreID.h:26
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
StoreID::storeName
static const std::string & storeName(const StoreID::type &s)
Definition: StoreID.cxx:77
SG::ReadDecorHandleKey::Base
ReadHandleKey< T > Base
Base class.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:88
SG::ReadDecorHandleKey::ReadDecorHandleKey
ReadDecorHandleKey(const VarHandleKey &contKey, const std::string &decorKey="", const std::string &storeName=StoreID::storeName(StoreID::EVENT_STORE))
Constructor with associated container.