ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCalibTools
src
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
5
#include "
LArCalibTools/LArGainThresholds2Ntuple.h
"
6
#include "
LArIdentifier/LArOnlineID.h
"
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
16
StatusCode
LArGainThresholds2Ntuple::initialize
() {
17
18
ATH_CHECK
(
m_configKey
.initialize());
19
20
return
LArCond2NtupleBase::initialize
();
21
}
22
23
LArGainThresholds2Ntuple::~LArGainThresholds2Ntuple
()
24
=
default
;
25
26
StatusCode
LArGainThresholds2Ntuple::stop
() {
27
28
ATH_MSG_DEBUG
(
" trying stop"
);
29
30
NTuple::Item<long> lower;
31
NTuple::Item<long>
upper
;
32
33
SG::ReadCondHandle<LArFebConfig>
configHdl{
m_configKey
};
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
upper
int upper(int c)
Definition
LArBadChannelParser.cxx:49
LArGainThresholds2Ntuple.h
LArOnlineID.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
ntupleSvc
INTupleSvc * ntupleSvc()
Definition
ServiceAccessor.h:14
HWIdentifier
Definition
HWIdentifier.h:13
LArCond2NtupleBase::initialize
StatusCode initialize()
Definition
LArCond2NtupleBase.cxx:33
LArCond2NtupleBase::m_ntTitle
std::string m_ntTitle
Definition
LArCond2NtupleBase.h:68
LArCond2NtupleBase::m_nt
NTuple::Tuple * m_nt
Definition
LArCond2NtupleBase.h:71
LArCond2NtupleBase::m_onlineId
const LArOnlineID_Base * m_onlineId
Definition
LArCond2NtupleBase.h:88
LArCond2NtupleBase::m_ntpath
std::string m_ntpath
Definition
LArCond2NtupleBase.h:68
LArCond2NtupleBase::fillFromIdentifier
bool fillFromIdentifier(const HWIdentifier &id)
Definition
LArCond2NtupleBase.cxx:290
LArCond2NtupleBase::LArCond2NtupleBase
LArCond2NtupleBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition
LArCond2NtupleBase.cxx:15
LArFebConfig
Definition
LArFebConfig.h:16
LArFebConfig::thresholds
void thresholds(const HWIdentifier &chid, short &lower, short &upper) const
Definition
LArFebConfig.cxx:28
LArGainThresholds2Ntuple::~LArGainThresholds2Ntuple
~LArGainThresholds2Ntuple()
LArGainThresholds2Ntuple::initialize
StatusCode initialize()
Definition
LArGainThresholds2Ntuple.cxx:16
LArGainThresholds2Ntuple::LArGainThresholds2Ntuple
LArGainThresholds2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
Definition
LArGainThresholds2Ntuple.cxx:8
LArGainThresholds2Ntuple::m_configKey
SG::ReadCondHandleKey< LArFebConfig > m_configKey
Definition
LArGainThresholds2Ntuple.h:26
LArGainThresholds2Ntuple::stop
StatusCode stop()
Definition
LArGainThresholds2Ntuple.cxx:26
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
Generated on
for ATLAS Offline Software by
1.17.0