1 //Dear emacs, this is -*- c++ -*-
3 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
6 //#include "TileCalibCondAlg.h"
7 #include "TileCalibBlobObjs/TileCalibUtils.h"
9 #include "StoreGate/ReadCondHandle.h"
10 #include "StoreGate/WriteCondHandle.h"
13 TileCalibCondAlg<T>::TileCalibCondAlg(const std::string& name, ISvcLocator* pSvcLocator) :
14 AthAlgorithm(name, pSvcLocator)
20 TileCalibCondAlg<T>::~TileCalibCondAlg() {
24 StatusCode TileCalibCondAlg<T>::initialize() {
26 ATH_CHECK( m_conditionsProxy.retrieve() );
27 ATH_CHECK( m_calibDataKey.initialize() );
29 return StatusCode::SUCCESS;
33 StatusCode TileCalibCondAlg<T>::execute() {
35 SG::WriteCondHandle<TileCalibData<T> > calibData{m_calibDataKey};
37 if (calibData.isValid()) {
38 ATH_MSG_DEBUG("Found valid TileCalibData: " << calibData.key());
39 return StatusCode::SUCCESS;
42 // Define validity of the output cond object
43 EventIDRange eventRange;
44 std::unique_ptr<TileCalibData<T>> data = std::make_unique<TileCalibData<T>>();
46 ATH_CHECK( m_conditionsProxy->fillCalibData(*data, eventRange) );
48 if(calibData.record(eventRange, data.release()).isFailure()) {
49 ATH_MSG_ERROR("Could not record TileCalibData object with "
51 << " with EventRange " << eventRange
52 << " into Conditions Store");
53 return StatusCode::FAILURE;
56 ATH_MSG_VERBOSE("Recorded TileCalibData object with "
58 << " with EventRange " << eventRange
59 << " into Conditions Store");
63 return StatusCode::SUCCESS;
68 StatusCode TileCalibCondAlg<T>::finalize() {
69 return StatusCode::SUCCESS;