ATLAS Offline Software
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 
8 LArXTalkWeightGlobalCondAlg::LArXTalkWeightGlobalCondAlg(const std::string& name, ISvcLocator* pSvcLocator) :
9  AthReentrantAlgorithm(name,pSvcLocator){}
10 
11 
13  ATH_MSG_DEBUG("LArXTalkWeightGlobalCondAlg::initialize");
28  return StatusCode::SUCCESS;
29 }
30 
32 LArXTalkWeightGlobalCondAlg::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
47  weights.push_back(pointerFromKey(ctx,m_xtmiddleback_ecowKey)); //3
48  weights.push_back(pointerFromKey(ctx,m_xtmiddleback_eciwKey)); //4
49  weights.push_back(pointerFromKey(ctx,m_xtstripmiddleKey)); //5
50  weights.push_back(pointerFromKey(ctx,m_xtstripmiddle_ecKey)); //6
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 
LArXTalkWeightGlobalCondAlg::initialize
virtual StatusCode initialize() override
Definition: LArXTalkWeightGlobalCondAlg.cxx:12
LArXTalkWeightGlobalCondAlg::m_xtmiddleback_ecowKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddleback_ecowKey
Definition: LArXTalkWeightGlobalCondAlg.h:29
LArXTalkWeightGlobalCondAlg::m_xtmiddle1Key
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddle1Key
Definition: LArXTalkWeightGlobalCondAlg.h:35
LArXTalkWeightGlobalCondAlg::LArXTalkWeightGlobalCondAlg
LArXTalkWeightGlobalCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightGlobalCondAlg.cxx:8
LArXTalkWeightGlobalCondAlg::m_xtstripmiddle_ecKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtstripmiddle_ecKey
Definition: LArXTalkWeightGlobalCondAlg.h:32
LArXTalkWeightGlobalCondAlg::m_xt2strip_ecKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xt2strip_ecKey
Definition: LArXTalkWeightGlobalCondAlg.h:34
LArXTalkWeightGlobalCondAlg.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArXTalkWeightGlobalCondAlg::m_xtmiddle1_ecKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddle1_ecKey
Definition: LArXTalkWeightGlobalCondAlg.h:37
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArXTalkWeightGlobalCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: LArXTalkWeightGlobalCondAlg.cxx:32
IOVInfiniteRange::infiniteRunLB
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
Definition: IOVInfiniteRange.h:39
LArXTalkWeightGlobalCondAlg::m_xtmiddleback_eciwKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddleback_eciwKey
Definition: LArXTalkWeightGlobalCondAlg.h:30
LArXTalkWeightGlobalCondAlg::m_xtstripKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtstripKey
Definition: LArXTalkWeightGlobalCondAlg.h:26
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArXTalkWeightGlobalCondAlg::m_xtstripmiddleKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtstripmiddleKey
Definition: LArXTalkWeightGlobalCondAlg.h:31
IOVInfiniteRange.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArXTalkWeightGlobalCondAlg::m_xtmiddle2_ecKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddle2_ecKey
Definition: LArXTalkWeightGlobalCondAlg.h:38
weights
Definition: herwig7_interface.h:38
LArXTalkWeightGlobalCondAlg::m_xtstrip_ecKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtstrip_ecKey
Definition: LArXTalkWeightGlobalCondAlg.h:27
LArXTalkWeightGlobalCondAlg::pointerFromKey
const LArXTalkWeight * pointerFromKey(const EventContext &context, const SG::ReadCondHandleKey< LArXTalkWeight > &key) const
Definition: LArXTalkWeightGlobalCondAlg.h:43
LArXTalkWeightGlobalCondAlg::m_xtmiddle2Key
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddle2Key
Definition: LArXTalkWeightGlobalCondAlg.h:36
LArXTalkWeightGlobalCondAlg::m_xt2stripKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xt2stripKey
Definition: LArXTalkWeightGlobalCondAlg.h:33
LArXTalkWeightGlobalCondAlg::m_xtalkKey
SG::WriteCondHandleKey< LArXTalkWeightGlobal > m_xtalkKey
Definition: LArXTalkWeightGlobalCondAlg.h:24
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
LArXTalkWeightGlobalCondAlg::m_xtmiddlebackKey
SG::ReadCondHandleKey< LArXTalkWeight > m_xtmiddlebackKey
Definition: LArXTalkWeightGlobalCondAlg.h:28