ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCalibTools
src
ForceLoadCondObj.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// ForceLoadCondObj.cxx
6
7
#include "
StoreGate/StoreGateSvc.h
"
8
#include "GaudiKernel/IClassIDSvc.h"
9
#include "GaudiKernel/MsgStream.h"
10
#include "
LArCalibTools/ForceLoadCondObj.h
"
11
12
13
ForceLoadCondObj::~ForceLoadCondObj
() =
default
;
14
15
StatusCode
ForceLoadCondObj::initialize
() {
16
ATH_MSG_DEBUG
(
"in initialize()"
);
17
ATH_CHECK
(
p_clidsvc
.retrieve() );
18
return
StatusCode::SUCCESS;
19
}
20
21
StatusCode
ForceLoadCondObj::execute
(
const
EventContext&)
const
{
22
//Loop through objects
23
for
(
unsigned
int
iobj=0;iobj<
m_objectList
.size();++iobj) {
24
// if object name contains a '#', it represents a specific typename#key
25
std::string::size_type ihash=
m_objectList
[iobj].find_first_of(
'#'
);
26
if
(ihash==std::string::npos) {
27
ATH_MSG_ERROR
(
"Expected syntax 'object#key' for property ObjectList, got"
<<
m_objectList
[iobj] );
28
return
StatusCode::FAILURE;
29
}
30
std::string::size_type ihash2=
m_objectList
[iobj].find_first_of(
'#'
,ihash+1);
31
if
(ihash2 != std::string::npos) ihash2-=(1+ihash);
32
const
std::string objName=
m_objectList
[iobj].substr(0,ihash);
33
const
std::string objKey=
m_objectList
[iobj].substr(ihash+1,ihash2);
34
35
ATH_MSG_INFO
(
"Retrieving object "
<< objName <<
", key "
<< objKey );
36
37
CLID
clid;
38
ATH_CHECK
(
p_clidsvc
->getIDOfTypeName(objName,clid) );
39
40
SG::DataProxy
* proxy=
detStore
()->proxy(clid,objKey);
41
42
if
(!proxy) {
43
ATH_MSG_ERROR
(
"Could not find proxy for object of type "
<< objName <<
" with key "
<< objKey );
44
return
StatusCode::FAILURE;
45
}
46
47
if
(proxy->accessData()!=
nullptr
) {
//This should trigger the conversion
48
ATH_MSG_INFO
(
"Sucessfully retrieved object of type "
<< objName <<
" with key "
<< objKey );
49
}
50
}
51
return
StatusCode::SUCCESS;
52
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
ForceLoadCondObj.h
StoreGateSvc.h
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
ForceLoadCondObj::~ForceLoadCondObj
virtual ~ForceLoadCondObj()
ForceLoadCondObj::p_clidsvc
ServiceHandle< IClassIDSvc > p_clidsvc
Definition
ForceLoadCondObj.h:29
ForceLoadCondObj::m_objectList
StringArrayProperty m_objectList
Definition
ForceLoadCondObj.h:31
ForceLoadCondObj::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
ForceLoadCondObj.cxx:21
ForceLoadCondObj::initialize
virtual StatusCode initialize() override
Definition
ForceLoadCondObj.cxx:15
SG::DataProxy
Definition
DataProxy.h:45
Generated on
for ATLAS Offline Software by
1.17.0