ATLAS Offline Software
LArGainThresholds2Ntuple.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 LArGainThresholds2Ntuple::LArGainThresholds2Ntuple(const std::string& name, ISvcLocator* pSvcLocator):
9  LArCond2NtupleBase(name, pSvcLocator) {
10 
11  m_ntTitle="Gain Thresholds";
12  m_ntpath="/NTUPLES/FILE1/GAINTH";
13 }
14 
15 
17 
19 
21 }
22 
24 = default;
25 
27 
28  ATH_MSG_DEBUG(" trying stop");
29 
30  NTuple::Item<long> lower;
31  NTuple::Item<long> upper;
32 
34  const LArFebConfig* febConfig = *configHdl;
35  if (febConfig==nullptr) {
36  ATH_MSG_ERROR( "Unable to retrieve LArFebConfig with key " << m_configKey.key());
37  return StatusCode::FAILURE;
38  }
39  StatusCode sc=m_nt->addItem("lower",lower,-1000,5000);
40  if (sc!=StatusCode::SUCCESS) {
41  ATH_MSG_ERROR( "addItem 'lower' failed" );
42  return StatusCode::FAILURE;
43  }
44 
45  sc=m_nt->addItem("upper",upper,-1000.,5000.);
46  if (sc!=StatusCode::SUCCESS) {
47  ATH_MSG_ERROR( "addItem 'upper' failed" );
48  return StatusCode::FAILURE;
49  }
50 
51  ATH_CHECK(m_nt->addItem("lower",lower,-1000,5000));
52  ATH_CHECK(m_nt->addItem("upper",upper,-1000.,5000.));
53 
54  for (const HWIdentifier hwid: m_onlineId->channel_range()) {
55  short lower_v, upper_v;
56  febConfig->thresholds (hwid, lower_v, upper_v);
57  lower = lower_v;
58  upper = upper_v;
59 
60  fillFromIdentifier(hwid);
61 
62  ATH_CHECK(ntupleSvc()->writeRecord(m_nt));
63  }
64 
65  ATH_MSG_INFO("LArGainThresholds2Ntuple has finished.");
66  return StatusCode::SUCCESS;
67 
68 }
LArGainThresholds2Ntuple.h
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
upper
int upper(int c)
Definition: LArBadChannelParser.cxx:49
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
HWIdentifier
Definition: HWIdentifier.h:13
LArCond2NtupleBase::initialize
StatusCode initialize()
Definition: LArCond2NtupleBase.cxx:33
LArCond2NtupleBase
Definition: LArCond2NtupleBase.h:32
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArGainThresholds2Ntuple::m_configKey
SG::ReadCondHandleKey< LArFebConfig > m_configKey
Definition: LArGainThresholds2Ntuple.h:26
LArFebConfig
Definition: LArFebConfig.h:16
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArOnlineID_Base::channel_range
id_range channel_range() const
Definition: LArOnlineID_Base.cxx:1936
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
LArCond2NtupleBase::m_ntpath
std::string m_ntpath
Definition: LArCond2NtupleBase.h:65
LArCond2NtupleBase::m_nt
NTuple::Tuple * m_nt
Definition: LArCond2NtupleBase.h:68
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArCond2NtupleBase::m_ntTitle
std::string m_ntTitle
Definition: LArCond2NtupleBase.h:65
LArGainThresholds2Ntuple::initialize
StatusCode initialize()
Definition: LArGainThresholds2Ntuple.cxx:16
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArCond2NtupleBase::m_onlineId
const LArOnlineID_Base * m_onlineId
Definition: LArCond2NtupleBase.h:85
LArCond2NtupleBase::fillFromIdentifier
bool fillFromIdentifier(const HWIdentifier &id)
Definition: LArCond2NtupleBase.cxx:288
LArFebConfig::thresholds
void thresholds(const HWIdentifier &chid, short &lower, short &upper) const
Definition: LArFebConfig.cxx:28
LArGainThresholds2Ntuple::LArGainThresholds2Ntuple
LArGainThresholds2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArGainThresholds2Ntuple.cxx:8
LArGainThresholds2Ntuple::~LArGainThresholds2Ntuple
~LArGainThresholds2Ntuple()
ntupleSvc
INTupleSvc * ntupleSvc()
Definition: ServiceAccessor.h:14
LArGainThresholds2Ntuple::stop
StatusCode stop()
Definition: LArGainThresholds2Ntuple.cxx:26
LArOnlineID.h