ATLAS Offline Software
Loading...
Searching...
No Matches
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
8LArGainThresholds2Ntuple::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
18 ATH_CHECK(m_configKey.initialize());
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
61
62 ATH_CHECK(ntupleSvc()->writeRecord(m_nt));
63 }
64
65 ATH_MSG_INFO("LArGainThresholds2Ntuple has finished.");
66 return StatusCode::SUCCESS;
67
68}
#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)
int upper(int c)
static Double_t sc
INTupleSvc * ntupleSvc()
const LArOnlineID_Base * m_onlineId
bool fillFromIdentifier(const HWIdentifier &id)
LArCond2NtupleBase(const std::string &name, ISvcLocator *pSvcLocator)
void thresholds(const HWIdentifier &chid, short &lower, short &upper) const
LArGainThresholds2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< LArFebConfig > m_configKey