ATLAS Offline Software
Loading...
Searching...
No Matches
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"
7
8LArFEBTempAlg::LArFEBTempAlg(const std::string& name, ISvcLocator* pSvcLocator):AthCondAlgorithm(name,pSvcLocator){}
9
10// intialize
12{
13 ATH_CHECK(m_foldernameKey.initialize());
14 ATH_CHECK(m_tempKey.initialize());
15
16 return StatusCode::SUCCESS;
17}
18
19StatusCode LArFEBTempAlg::execute(const EventContext& ctx ) const
20{
22
23 if (writeHandle.isValid()) {
24 ATH_MSG_DEBUG("Found valid write handle");
25 return StatusCode::SUCCESS;
26 }
27
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
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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Base class for conditions algorithms.
This class is a collection of AttributeLists where each one is associated with a channel number.
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
SG::WriteCondHandleKey< LArFEBTempData > m_tempKey
virtual StatusCode execute(const EventContext &ctx) const override final
virtual StatusCode initialize() override final
SG::ReadCondHandleKey< CondAttrListCollection > m_foldernameKey
LArFEBTempAlg(const std::string &name, ISvcLocator *pSvcLocator)
std::map< HWIdentifier, FEBTemp > m_mapVec
std::pair< float, float > FEBTemp
bool range(EventIDRange &r)
const std::string & key() const
const std::string & key() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED