1 //dear emacs, this is -*-c++-*-
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
8 StatusCode LArFlatConditionsAlg<T>::initialize() {
10 ATH_CHECK( m_readKey.initialize() );
11 ATH_CHECK( m_writeKey.initialize() );
13 return StatusCode::SUCCESS;
18 StatusCode LArFlatConditionsAlg<T>::execute() {
20 SG::WriteCondHandle<T> writeHandle{m_writeKey};
22 if (writeHandle.isValid()) {
23 ATH_MSG_DEBUG("Found valid write handle");
24 return StatusCode::SUCCESS;
27 SG::ReadCondHandle<CondAttrListCollection> readHandle{m_readKey};
28 const CondAttrListCollection* attr{*readHandle};
30 msg(MSG::ERROR) << "Failed to retrieve CondAttributeListCollection with key " << m_readKey.key() << endmsg;
31 return StatusCode::FAILURE;
33 writeHandle.addDependency(readHandle);
35 std::unique_ptr<T> flat=std::make_unique<T>(attr);
37 if(writeHandle.record(std::move(flat)).isFailure()) {
38 ATH_MSG_ERROR("Could not record LArFlatConditions object with "
40 << " with EventRange " << writeHandle.getRange()
41 << " into Conditions Store");
42 return StatusCode::FAILURE;
44 ATH_MSG_INFO("recorded new " << writeHandle.key() << " with range "
45 << writeHandle.getRange() << " into Conditions Store");
48 return StatusCode::SUCCESS;