ATLAS Offline Software
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");
12  return StatusCode::SUCCESS;
13 }
14 
16 LArXTalkWeightCondAlg::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(),
30  m_endcap_case_table.end());
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 
48 LArXTalkWeightCondAlg::LArXTalkWeightCondAlg(const std::string& name, ISvcLocator* pSvcLocator) :
49  AthReentrantAlgorithm(name,pSvcLocator){}
50 
51 LArXTalkWeightCondAlg_strip::LArXTalkWeightCondAlg_strip(const std::string& name,ISvcLocator* pSvcLocator) : LArXTalkWeightCondAlg(name,pSvcLocator){
55  m_xtalkKey = std::string("LArXTalkWeight_strip");
56 }
57 
58 LArXTalkWeightCondAlg_strip_ec::LArXTalkWeightCondAlg_strip_ec(const std::string& name,ISvcLocator* pSvcLocator) : LArXTalkWeightCondAlg(name,pSvcLocator){
62  m_xtalkKey = std::string("LArXTalkWeight_strip_ec");
63 }
64 
65 LArXTalkWeightCondAlg_middleback::LArXTalkWeightCondAlg_middleback(const std::string& name,ISvcLocator* pSvcLocator) : LArXTalkWeightCondAlg(name,pSvcLocator){
69  m_xtalkKey = std::string("LArXTalkWeight_middleback");
70 }
71 
76  m_xtalkKey = std::string("LArXTalkWeight_middleback_ecow");
77 }
78 
83  m_xtalkKey = std::string("LArXTalkWeight_middleback_eciw");
84 }
85 
90  m_xtalkKey = std::string("LArXTalkWeight_stripmiddle");
91 }
92 
97  m_xtalkKey = std::string("LArXTalkWeight_stripmiddle_ec");
98 }
99 
100 LArXTalkWeightCondAlg_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 
108 LArXTalkWeightCondAlg_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 
117 LArXTalkWeightCondAlg_middle1::LArXTalkWeightCondAlg_middle1(const std::string& name,ISvcLocator* pSvcLocator) : LArXTalkWeightCondAlg(name,pSvcLocator){
121  m_xtalkKey = std::string("LArXTalkWeight_middle1");
122 }
123 
124 LArXTalkWeightCondAlg_middle2::LArXTalkWeightCondAlg_middle2(const std::string& name,ISvcLocator* pSvcLocator) : LArXTalkWeightCondAlg(name,pSvcLocator){
128  m_xtalkKey = std::string("LArXTalkWeight_middle2");
129 }
130 
131 LArXTalkWeightCondAlg_middle1_ec::LArXTalkWeightCondAlg_middle1_ec(const std::string& name,ISvcLocator* pSvcLocator) : LArXTalkWeightCondAlg(name,pSvcLocator){
135  m_xtalkKey = std::string("LArXTalkWeight_middle1_ec");
136 }
137 
138 LArXTalkWeightCondAlg_middle2_ec::LArXTalkWeightCondAlg_middle2_ec(const std::string& name,ISvcLocator* pSvcLocator) : LArXTalkWeightCondAlg(name,pSvcLocator){
142  m_xtalkKey = std::string("LArXTalkWeight_middle2_ec");
143 }
144 
LArXTalkWeightCondAlg
Definition: LArXTalkWeightCondAlg.h:14
LArXTalkWeightConstants::xtalk_middle1
const float xtalk_middle1[]
Definition: LArXTalkWeightConstants.h:223
LArXTalkWeightConstants::xtalk_middleback
const float xtalk_middleback[]
Definition: LArXTalkWeightConstants.h:99
LArXTalkWeightConstants::xtalk_middleback_ecow
const float xtalk_middleback_ecow[]
Definition: LArXTalkWeightConstants.h:113
LArXTalkWeightCondAlg::m_xtalk_to_inject
std::vector< float > m_xtalk_to_inject
Definition: LArXTalkWeightCondAlg.h:23
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LArXTalkWeightCondAlg_middle2_ec::LArXTalkWeightCondAlg_middle2_ec
LArXTalkWeightCondAlg_middle2_ec(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:138
LArXTalkWeightConstants::xtalk_middleback_eciw
const float xtalk_middleback_eciw[]
Definition: LArXTalkWeightConstants.h:125
LArXTalkWeightConstants::factor_middle2
const float factor_middle2
Definition: LArXTalkWeightConstants.h:249
LArXTalkWeightCondAlg_middle1_ec::LArXTalkWeightCondAlg_middle1_ec
LArXTalkWeightCondAlg_middle1_ec(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:131
LArXTalkWeightConstants::factor_strip
const float factor_strip
Definition: LArXTalkWeightConstants.h:66
LArXTalkWeightConstants::factor_stripmiddle_ec
const float factor_stripmiddle_ec
Definition: LArXTalkWeightConstants.h:219
LArXTalkWeightConstants::factor_middleback
const float factor_middleback
Definition: LArXTalkWeightConstants.h:111
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
LArXTalkWeightCondAlg_stripmiddle_ec::LArXTalkWeightCondAlg_stripmiddle_ec
LArXTalkWeightCondAlg_stripmiddle_ec(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:93
LArXTalkWeightConstants::xtalk_strip
const float xtalk_strip[]
Definition: LArXTalkWeightConstants.h:8
LArXTalkWeightCondAlg_strip::LArXTalkWeightCondAlg_strip
LArXTalkWeightCondAlg_strip(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:51
LArXTalkWeightConstants::factor_2strip
const float factor_2strip
Definition: LArXTalkWeightConstants.h:220
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
LArXTalkWeightConstants::factor_middle2_ec
const float factor_middle2_ec
Definition: LArXTalkWeightConstants.h:273
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
LArXTalkWeightConstants::xtalk_middle2_ec
const float xtalk_middle2_ec[]
Definition: LArXTalkWeightConstants.h:263
LArXTalkWeightConstants::xtalk_strip_ec
const float xtalk_strip_ec[]
Definition: LArXTalkWeightConstants.h:68
LArXTalkWeightConstants::factor_stripmiddle
const float factor_stripmiddle
Definition: LArXTalkWeightConstants.h:188
LArXTalkWeightConstants::factor_middleback_ecow
const float factor_middleback_ecow
Definition: LArXTalkWeightConstants.h:123
LArXTalkWeightCondAlg::m_xtalkKey
SG::WriteCondHandleKey< LArXTalkWeight > m_xtalkKey
Definition: LArXTalkWeightCondAlg.h:22
LArXTalkWeightCondAlg_middleback::LArXTalkWeightCondAlg_middleback
LArXTalkWeightCondAlg_middleback(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:65
LArXTalkWeightCondAlg_middle1::LArXTalkWeightCondAlg_middle1
LArXTalkWeightCondAlg_middle1(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:117
LArXTalkWeightCondAlg::m_endcap_case_table
std::vector< int > m_endcap_case_table
Definition: LArXTalkWeightCondAlg.h:24
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArXTalkWeightCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: LArXTalkWeightCondAlg.cxx:16
LArXTalkWeightConstants.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
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
LArXTalkWeightConstants::factor_middle1
const float factor_middle1
Definition: LArXTalkWeightConstants.h:235
LArXTalkWeightCondAlg_strip_ec::LArXTalkWeightCondAlg_strip_ec
LArXTalkWeightCondAlg_strip_ec(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:58
IOVInfiniteRange::infiniteRunLB
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
Definition: IOVInfiniteRange.h:39
LArXTalkWeightCondAlg_2strip_ec::LArXTalkWeightCondAlg_2strip_ec
LArXTalkWeightCondAlg_2strip_ec(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:108
LArXTalkWeightConstants::table_noregion
const int table_noregion[]
Definition: LArXTalkWeightConstants.h:6
LArXTalkWeightCondAlg_middleback_eciw::LArXTalkWeightCondAlg_middleback_eciw
LArXTalkWeightCondAlg_middleback_eciw(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:79
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArXTalkWeightConstants::factor_strip_ec
const float factor_strip_ec
Definition: LArXTalkWeightConstants.h:97
LArXTalkWeightCondAlg::m_xtalk_factor
float m_xtalk_factor
Definition: LArXTalkWeightCondAlg.h:25
IOVInfiniteRange.h
LArXTalkWeightCondAlg_stripmiddle::LArXTalkWeightCondAlg_stripmiddle
LArXTalkWeightCondAlg_stripmiddle(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:86
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LArXTalkWeightCondAlg_middle2::LArXTalkWeightCondAlg_middle2
LArXTalkWeightCondAlg_middle2(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:124
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArXTalkWeightConstants::xtalk_middle1_ec
const float xtalk_middle1_ec[]
Definition: LArXTalkWeightConstants.h:251
LArXTalkWeightConstants::table_withregion
const int table_withregion[]
Definition: LArXTalkWeightConstants.h:7
LArXTalkWeightCondAlg_middleback_ecow::LArXTalkWeightCondAlg_middleback_ecow
LArXTalkWeightCondAlg_middleback_ecow(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:72
LArXTalkWeightConstants::xtalk_middle2
const float xtalk_middle2[]
Definition: LArXTalkWeightConstants.h:237
LArXTalkWeightCondAlg_2strip::LArXTalkWeightCondAlg_2strip
LArXTalkWeightCondAlg_2strip(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:100
LArXTalkWeightConstants::factor_2strip_ec
const float factor_2strip_ec
Definition: LArXTalkWeightConstants.h:221
LArXTalkWeightConstants::xtalk_stripmiddle
const float xtalk_stripmiddle[]
Definition: LArXTalkWeightConstants.h:130
LArXTalkWeightCondAlg.h
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
LArXTalkWeightConstants::factor_middleback_eciw
const float factor_middleback_eciw
Definition: LArXTalkWeightConstants.h:128
LArXTalkWeightConstants::xtalk_stripmiddle_ec
const float xtalk_stripmiddle_ec[]
Definition: LArXTalkWeightConstants.h:190
LArXTalkWeightConstants::factor_middle1_ec
const float factor_middle1_ec
Definition: LArXTalkWeightConstants.h:261
LArXTalkWeightCondAlg::LArXTalkWeightCondAlg
LArXTalkWeightCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArXTalkWeightCondAlg.cxx:48
LArXTalkWeightCondAlg::initialize
virtual StatusCode initialize() override
Definition: LArXTalkWeightCondAlg.cxx:9