ATLAS Offline Software
Loading...
Searching...
No Matches
LArXTalkWeightGlobalCondAlg.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4
7
8LArXTalkWeightGlobalCondAlg::LArXTalkWeightGlobalCondAlg(const std::string& name, ISvcLocator* pSvcLocator) :
9 AthCondAlgorithm(name,pSvcLocator){}
10
11
13 ATH_MSG_DEBUG("LArXTalkWeightGlobalCondAlg::initialize");
14 ATH_CHECK(m_xtalkKey.initialize() );
15 ATH_CHECK(m_xtstripKey.initialize() );
16 ATH_CHECK(m_xtstrip_ecKey.initialize() );
17 ATH_CHECK(m_xtmiddlebackKey.initialize() );
18 ATH_CHECK(m_xtmiddleback_ecowKey.initialize() );
19 ATH_CHECK(m_xtmiddleback_eciwKey.initialize() );
20 ATH_CHECK(m_xtstripmiddleKey.initialize() );
21 ATH_CHECK(m_xtstripmiddle_ecKey.initialize() );
22 ATH_CHECK(m_xt2stripKey.initialize() );
23 ATH_CHECK(m_xt2strip_ecKey.initialize() );
24 ATH_CHECK(m_xtmiddle1Key.initialize() );
25 ATH_CHECK(m_xtmiddle2Key.initialize() );
26 ATH_CHECK(m_xtmiddle1_ecKey.initialize() );
27 ATH_CHECK(m_xtmiddle2_ecKey.initialize() );
28 return StatusCode::SUCCESS;
29}
30
31StatusCode
32LArXTalkWeightGlobalCondAlg::execute(const EventContext& ctx) const {
33
34 ATH_MSG_DEBUG("LArXTalkWeightGlobalCondAlg::execute");
35
37 if ( writeHandle.isValid() ) {
38 ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order.");
39 return StatusCode::SUCCESS;
40 } // otherwise, build the information
41
42 //load everybody
43 std::vector<const LArXTalkWeight*> weights;
44 weights.push_back(pointerFromKey(ctx,m_xtstripKey)); //0
45 weights.push_back(pointerFromKey(ctx,m_xtstrip_ecKey)); //1
46 weights.push_back(pointerFromKey(ctx,m_xtmiddlebackKey)); //2
49 weights.push_back(pointerFromKey(ctx,m_xtstripmiddleKey)); //5
51 weights.push_back(pointerFromKey(ctx,m_xt2stripKey)); //7
52 weights.push_back(pointerFromKey(ctx,m_xt2strip_ecKey)); //8
53 weights.push_back(pointerFromKey(ctx,m_xtmiddle1Key)); //9
54 weights.push_back(pointerFromKey(ctx,m_xtmiddle2Key)); //10
55 weights.push_back(pointerFromKey(ctx,m_xtmiddle1_ecKey)); //11
56 weights.push_back(pointerFromKey(ctx,m_xtmiddle2_ecKey)); //12
57
58 std::unique_ptr<LArXTalkWeightGlobal> xtalk = std::make_unique<LArXTalkWeightGlobal>(weights);
59 writeHandle.addDependency(EventIDRange(IOVInfiniteRange::infiniteRunLB()));
60
61 if(writeHandle.record(std::move(xtalk)).isFailure()) {
62 ATH_MSG_ERROR("Could not record LArXTalk object with "
63 << writeHandle.key()
64 << " with EventRange " << writeHandle.getRange()
65 << " into Conditions Store");
66 return StatusCode::FAILURE;
67 }
68
69 ATH_MSG_DEBUG("recorded new " << writeHandle.key() << " with range "
70 << writeHandle.getRange() << " into Conditions Store");
71 return StatusCode::SUCCESS;
72
73}
74
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
Base class for conditions algorithms.
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddleback_ecowKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddleback_eciwKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddle2_ecKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddle1Key
SG::ReadCondHandleKey< LArXTalkWeight > m_xt2stripKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtstripmiddle_ecKey
const LArXTalkWeight * pointerFromKey(const EventContext &context, const SG::ReadCondHandleKey< LArXTalkWeight > &key) const
virtual StatusCode initialize() override
SG::WriteCondHandleKey< LArXTalkWeightGlobal > m_xtalkKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtstripmiddleKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtstripKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddlebackKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddle2Key
SG::ReadCondHandleKey< LArXTalkWeight > m_xt2strip_ecKey
LArXTalkWeightGlobalCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddle1_ecKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtstrip_ecKey
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const