ATLAS Offline Software
Loading...
Searching...
No Matches
LArXTalkWeightCondAlg.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4
8
10 ATH_MSG_DEBUG("LArXTalkWeightCondAlg::initialize");
11 ATH_CHECK(m_xtalkKey.initialize() );
12 return StatusCode::SUCCESS;
13}
14
15StatusCode
16LArXTalkWeightCondAlg::execute(const EventContext& ctx) const {
17
18 ATH_MSG_DEBUG("LArXTalkWeightCondAlg::execute");
19
21 if ( writeHandle.isValid() ) {
22 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.");
23 return StatusCode::SUCCESS;
24 }
25 // just to handle a special case
26 std::vector<int> endcap_case_table;
27 if(!((m_endcap_case_table.size()==1)&&(m_endcap_case_table[0]==0)) ) {
28 endcap_case_table.insert(endcap_case_table.end(),
29 m_endcap_case_table.begin(),
31 }
32 std::unique_ptr<LArXTalkWeight> xtalk = std::make_unique<LArXTalkWeight>(m_xtalk_to_inject, m_xtalk_factor,endcap_case_table);
33 writeHandle.addDependency(EventIDRange(IOVInfiniteRange::infiniteRunLB()));
34 if(writeHandle.record(std::move(xtalk)).isFailure()) {
35 ATH_MSG_ERROR("Could not record LArXTalk object with "
36 << writeHandle.key()
37 << " with EventRange " << writeHandle.getRange()
38 << " into Conditions Store");
39 return StatusCode::FAILURE;
40 }
41
42 ATH_MSG_INFO("recorded new " << writeHandle.key() << " with range "
43 << writeHandle.getRange() << " into Conditions Store");
44 return StatusCode::SUCCESS;
45
46}
47
48LArXTalkWeightCondAlg::LArXTalkWeightCondAlg(const std::string& name, ISvcLocator* pSvcLocator) :
49 AthCondAlgorithm(name,pSvcLocator){}
50
57
64
71
78
85
92
99
100LArXTalkWeightCondAlg_2strip::LArXTalkWeightCondAlg_2strip(const std::string& name,ISvcLocator* pSvcLocator) : LArXTalkWeightCondAlg(name,pSvcLocator){
101 for(int i=0;i<380;i++) m_xtalk_to_inject.push_back(0.004);
102 for(int i=0;i<68;i++) m_xtalk_to_inject.push_back(0.005);
105 m_xtalkKey = std::string("LArXTalkWeight_2strip");
106}
107
108LArXTalkWeightCondAlg_2strip_ec::LArXTalkWeightCondAlg_2strip_ec(const std::string& name,ISvcLocator* pSvcLocator) : LArXTalkWeightCondAlg(name,pSvcLocator){
109 for(int i=0;i<40;i++) m_xtalk_to_inject.push_back(0.004);
110 for(int i=0;i<110;i++) m_xtalk_to_inject.push_back(0.0025);
111 for(int i=0;i<298;i++) m_xtalk_to_inject.push_back(0.004);
114 m_xtalkKey = std::string("LArXTalkWeight_2strip_ec");
115}
116
123
130
137
144
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(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.
LArXTalkWeightCondAlg_2strip_ec(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_2strip(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_middle1_ec(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_middle1(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_middle2_ec(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_middle2(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_middleback_eciw(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_middleback_ecow(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_middleback(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_strip_ec(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_strip(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_stripmiddle_ec(const std::string &name, ISvcLocator *pSvcLocator)
LArXTalkWeightCondAlg_stripmiddle(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override
std::vector< float > m_xtalk_to_inject
virtual StatusCode initialize() override
std::vector< int > m_endcap_case_table
SG::WriteCondHandleKey< LArXTalkWeight > m_xtalkKey
LArXTalkWeightCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
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