ATLAS Offline Software
Loading...
Searching...
No Matches
TileCalibCondAlg.icc
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2/*
3 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4*/
5
6//#include "TileCalibCondAlg.h"
7#include "TileCalibBlobObjs/TileCalibUtils.h"
8
9#include "StoreGate/ReadCondHandle.h"
10#include "StoreGate/WriteCondHandle.h"
11
12template<class T>
13TileCalibCondAlg<T>::TileCalibCondAlg(const std::string& name, ISvcLocator* pSvcLocator) :
14 AthCondAlgorithm(name, pSvcLocator)
15{
16
17}
18
19template<class T>
20TileCalibCondAlg<T>::~TileCalibCondAlg() {
21}
22
23template<class T>
24StatusCode TileCalibCondAlg<T>::initialize() {
25
26 ATH_CHECK( m_conditionsProxy.retrieve() );
27 ATH_CHECK( m_calibDataKey.initialize() );
28
29 return StatusCode::SUCCESS;
30}
31
32template<class T>
33StatusCode TileCalibCondAlg<T>::execute(const EventContext& ctx) const {
34
35 SG::WriteCondHandle<TileCalibData<T> > calibData{m_calibDataKey, ctx};
36
37 if (calibData.isValid()) {
38 ATH_MSG_DEBUG("Found valid TileCalibData: " << calibData.key());
39 return StatusCode::SUCCESS;
40 }
41
42 // Define validity of the output cond object
43 EventIDRange eventRange;
44 std::unique_ptr<TileCalibData<T>> data = std::make_unique<TileCalibData<T>>();
45
46 ATH_CHECK( m_conditionsProxy->fillCalibData(*data, eventRange) );
47
48 if(calibData.record(eventRange, data.release()).isFailure()) {
49 ATH_MSG_ERROR("Could not record TileCalibData object with "
50 << calibData.key()
51 << " with EventRange " << eventRange
52 << " into Conditions Store");
53 return StatusCode::FAILURE;
54 } else {
55
56 ATH_MSG_VERBOSE("Recorded TileCalibData object with "
57 << calibData.key()
58 << " with EventRange " << eventRange
59 << " into Conditions Store");
60 }
61
62
63 return StatusCode::SUCCESS;
64
65}
66
67template<class T>
68StatusCode TileCalibCondAlg<T>::finalize() {
69 return StatusCode::SUCCESS;
70}