ATLAS Offline Software
SGKeyResolver.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-2023 CERN for the benefit of the ATLAS collaboration
4 */
13 #ifndef D3PDMAKERUTILS_SGKEYRESOLVER_H
14 #define D3PDMAKERUTILS_SGKEYRESOLVER_H
15 
16 
17 #include "GaudiKernel/ClassID.h"
18 #include "GaudiKernel/ServiceHandle.h"
19 #include <string>
20 
21 
22 class StoreGateSvc;
23 
24 
25 namespace D3PD {
26 
27 
40 {
41 public:
48  SGKeyResolver (const std::string& name,
50  std::string& sgkey);
51 
52 
58  StatusCode initialize (CLID clid, const std::string& typname);
59 
60 
64  template <typename T>
66 
67 
71  std::string key();
72 
73 
74 private:
76  std::string m_name;
77 
80 
83 
85  std::string m_typname;
86 
88  std::string& m_sgkey;
89 
91  std::string m_usedKey;
92 
94  bool m_haveKey;
95 };
96 
97 
98 } // namespace D3PD
99 
100 
102 
103 
104 #endif // not D3PDMAKERUTILS_SGKEYRESOLVER_H
D3PD::SGKeyResolver::initialize
StatusCode initialize()
Initialize, from a type.
D3PD::SGKeyResolver::m_name
std::string m_name
The name of the tool/alg in which this is used.
Definition: SGKeyResolver.h:76
D3PD::SGKeyResolver::m_usedKey
std::string m_usedKey
The actual key we'll use.
Definition: SGKeyResolver.h:91
common.sgkey
def sgkey(tool)
Definition: common.py:1028
D3PD::SGKeyResolver::m_typname
std::string m_typname
The name of the desired type.
Definition: SGKeyResolver.h:85
D3PD::SGKeyResolver
Helper to resolve the SG key to use.
Definition: SGKeyResolver.h:40
D3PD::SGKeyResolver::m_sgkey
std::string & m_sgkey
The requested SG key.
Definition: SGKeyResolver.h:88
D3PD::SGKeyResolver::m_sg
ServiceHandle< StoreGateSvc > & m_sg
The event storage service.
Definition: SGKeyResolver.h:79
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
D3PD::SGKeyResolver::SGKeyResolver
SGKeyResolver(const std::string &name, ServiceHandle< StoreGateSvc > &sg, std::string &sgkey)
Constructor.
Definition: SGKeyResolver.cxx:27
D3PD::SGKeyResolver::m_haveKey
bool m_haveKey
Flag that m_usedKey is valid.
Definition: SGKeyResolver.h:94
D3PD::SGKeyResolver::key
std::string key()
Return the SG key we should use.
Definition: SGKeyResolver.cxx:55
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SGKeyResolver.icc
D3PD::SGKeyResolver::m_clid
CLID m_clid
The CLID of the desired type.
Definition: SGKeyResolver.h:82
ServiceHandle< StoreGateSvc >