ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCondUtils
src
LArFEBTempAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArFEBTempAlg.h
"
6
#include "
LArIdentifier/LArOnlineID.h
"
7
8
LArFEBTempAlg::LArFEBTempAlg
(
const
std::string& name, ISvcLocator* pSvcLocator):
AthCondAlgorithm
(name,pSvcLocator){}
9
10
// intialize
11
StatusCode
LArFEBTempAlg::initialize
()
12
{
13
ATH_CHECK
(
m_foldernameKey
.initialize());
14
ATH_CHECK
(
m_tempKey
.initialize());
15
16
return
StatusCode::SUCCESS;
17
}
18
19
StatusCode
LArFEBTempAlg::execute
(
const
EventContext& ctx )
const
20
{
21
SG::WriteCondHandle<LArFEBTempData>
writeHandle{
m_tempKey
,ctx};
22
23
if
(writeHandle.
isValid
()) {
24
ATH_MSG_DEBUG
(
"Found valid write handle"
);
25
return
StatusCode::SUCCESS;
26
}
27
28
SG::ReadCondHandle<CondAttrListCollection>
cHdl(
m_foldernameKey
, ctx);
29
const
CondAttrListCollection
* cattr = *cHdl;
30
if
(!cattr) {
31
ATH_MSG_ERROR
(
"Why do not have FEB TEMP folder ?"
<<
m_foldernameKey
.fullKey());
32
return
StatusCode::FAILURE;
33
}
34
EventIDRange rangeIn;
35
if
(!cHdl.
range
(rangeIn)) {
36
ATH_MSG_ERROR
(
"Failed to retrieve validity range for "
<< cHdl.
key
());
37
return
StatusCode::FAILURE;
38
}
39
// Fill LArFEBTempData
40
std::unique_ptr<LArFEBTempData> febTemp=std::make_unique<LArFEBTempData>();
41
LArFEBTempData
* p_febTemp = febTemp.get();
42
43
for
(
CondAttrListCollection::const_iterator
citr=cattr->
begin
();
44
citr!=cattr->
end
();++citr) {
45
float
temp1=-1;
46
if
(! ((*citr).second)[
"temp1"
].isNull()) temp1 = (((*citr).second)[
"temp1"
]).data<float>();
47
float
temp2 =-1;
48
if
(! ((*citr).second)[
"temp2"
].isNull()) temp2 = (((*citr).second)[
"temp2"
]).data<float>();
49
LArFEBTempData::FEBTemp
temp = std::make_pair(temp1,temp2);
50
51
p_febTemp->
m_mapVec
[
HWIdentifier
(
Identifier32
((*citr).first))] = temp;
52
}
53
54
const
EventIDRange crangeW(rangeIn);
55
if
(writeHandle.
record
(crangeW,febTemp.release()).isFailure()) {
56
ATH_MSG_ERROR
(
"Could not record LArFebConfig object with "
<< writeHandle.
key
()
57
<<
" with EventRange "
<< crangeW <<
" into Conditions Store"
);
58
return
StatusCode::FAILURE;
59
}
60
61
ATH_MSG_INFO
(
"recorded new "
<< writeHandle.
key
() <<
" with range "
<< crangeW <<
" into Conditions Store"
);
62
63
return
StatusCode::SUCCESS;
64
65
}
66
67
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
LArFEBTempAlg.h
LArOnlineID.h
AthCondAlgorithm
Base class for conditions algorithms.
Definition
AthCondAlgorithm.h:22
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number.
Definition
CondAttrListCollection.h:51
CondAttrListCollection::end
const_iterator end() const
Definition
CondAttrListCollection.h:314
CondAttrListCollection::begin
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
Definition
CondAttrListCollection.h:308
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition
CondAttrListCollection.h:62
HWIdentifier
Definition
HWIdentifier.h:13
Identifier32
Definition
Identifier32.h:28
LArFEBTempAlg::m_tempKey
SG::WriteCondHandleKey< LArFEBTempData > m_tempKey
Definition
LArFEBTempAlg.h:27
LArFEBTempAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition
LArFEBTempAlg.cxx:19
LArFEBTempAlg::initialize
virtual StatusCode initialize() override final
Definition
LArFEBTempAlg.cxx:11
LArFEBTempAlg::m_foldernameKey
SG::ReadCondHandleKey< CondAttrListCollection > m_foldernameKey
Definition
LArFEBTempAlg.h:26
LArFEBTempAlg::LArFEBTempAlg
LArFEBTempAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
LArFEBTempAlg.cxx:8
LArFEBTempData
Definition
LArFEBTempData.h:12
LArFEBTempData::m_mapVec
std::map< HWIdentifier, FEBTemp > m_mapVec
Definition
LArFEBTempData.h:26
LArFEBTempData::FEBTemp
std::pair< float, float > FEBTemp
Definition
LArFEBTempData.h:18
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::range
bool range(EventIDRange &r)
Definition
ReadCondHandle.h:223
SG::ReadCondHandle::key
const std::string & key() const
Definition
ReadCondHandle.h:59
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
SG::WriteCondHandle::key
const std::string & key() const
Definition
WriteCondHandle.h:44
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition
WriteCondHandle.h:161
SG::WriteCondHandle::isValid
bool isValid() const
Definition
WriteCondHandle.h:252
Generated on
for ATLAS Offline Software by
1.17.0