ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonConditions
MuonCondGeneral
MuonCondTest
src
TgcDigtThresholdTestAlg.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 "
TgcDigtThresholdTestAlg.h
"
6
7
// Constructor
8
TgcDigtThresholdTestAlg::TgcDigtThresholdTestAlg
(
const
std::string& name, ISvcLocator* pSvcLocator) :
AthAlgorithm
(name, pSvcLocator) {}
9
10
// Destructor
11
TgcDigtThresholdTestAlg::~TgcDigtThresholdTestAlg
() =
default
;
12
13
// Initialize
14
StatusCode
TgcDigtThresholdTestAlg::initialize
() {
15
ATH_MSG_INFO
(
"Calling initialize"
);
16
ATH_CHECK
(
m_readKey
.initialize());
17
ATH_CHECK
(
m_idHelperSvc
.retrieve());
18
return
StatusCode::SUCCESS;
19
}
20
21
// Execute
22
StatusCode
TgcDigtThresholdTestAlg::execute
(
const
EventContext& ctx) {
23
24
ATH_MSG_INFO
(
"Calling execute"
);
25
SG::ReadCondHandle<TgcDigitThresholdData>
readHandle{
m_readKey
, ctx};
26
if
(!readHandle.
isValid
()) {
27
ATH_MSG_ERROR
(
"Null pointer to the read conditions object"
);
28
return
StatusCode::FAILURE;
29
}
30
31
ATH_MSG_INFO
(
"Loaded successfully the dead channel data"
);
32
const
TgcIdHelper
& idHelper{
m_idHelperSvc
->tgcIdHelper()};
33
std::unordered_set<Identifier> uniqueThreshData{};
34
for
(
MuonIdHelper::const_id_iterator
ch_itr = idHelper.
module_begin
();
35
ch_itr !=idHelper.
module_end
(); ++ch_itr) {
36
const
Identifier
& chambId{*ch_itr};
37
ATH_MSG_DEBUG
(
"Test dead gas gaps in chamber "
<<
m_idHelperSvc
->toString(chambId));
38
for
(
int
gasGap = idHelper.
gasGapMin
(chambId); gasGap <= idHelper.
gasGapMax
(chambId); ++gasGap) {
39
for
(
bool
isStrip : {
false
,
true
}) {
40
const
Identifier
gasGapId = idHelper.
channelID
(chambId, gasGap, isStrip, 1);
41
const
double
threshold
= readHandle->getThreshold(gasGapId);
42
if
(
threshold
< 0) {
43
ATH_MSG_WARNING
(
"No energy threshold given for "
<<
m_idHelperSvc
->toString(gasGapId));
44
}
45
if
(!uniqueThreshData.insert(idHelper.
channelID
(idHelper.
stationName
(chambId),
46
std::abs(idHelper.
stationEta
(chambId)),
47
1, gasGap, isStrip,1)).second)
continue
;
48
ATH_MSG_ALWAYS
(
"Chamber "
<<
m_idHelperSvc
->toString(gasGapId)<<
" has an energy thresold of "
<<
threshold
);
49
}
50
}
51
}
52
return
StatusCode::SUCCESS;
53
}
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_ALWAYS
#define ATH_MSG_ALWAYS(x)
Definition
AthMsgStreamMacros.h:35
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
TgcDigtThresholdTestAlg.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
MuonIdHelper::const_id_iterator
std::vector< Identifier >::const_iterator const_id_iterator
Definition
MuonIdHelper.h:130
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition
MuonIdHelper.cxx:790
MuonIdHelper::module_end
const_id_iterator module_end() const
Definition
MuonIdHelper.cxx:763
MuonIdHelper::module_begin
const_id_iterator module_begin() const
Iterators over full set of ids.
Definition
MuonIdHelper.cxx:761
MuonIdHelper::stationName
int stationName(const Identifier &id) const
Definition
MuonIdHelper.cxx:785
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::isValid
bool isValid()
Definition
ReadCondHandle.h:205
TgcDigtThresholdTestAlg::m_readKey
SG::ReadCondHandleKey< TgcDigitThresholdData > m_readKey
Definition
TgcDigtThresholdTestAlg.h:30
TgcDigtThresholdTestAlg::TgcDigtThresholdTestAlg
TgcDigtThresholdTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
TgcDigtThresholdTestAlg.cxx:8
TgcDigtThresholdTestAlg::~TgcDigtThresholdTestAlg
virtual ~TgcDigtThresholdTestAlg()
TgcDigtThresholdTestAlg::initialize
virtual StatusCode initialize() override
Definition
TgcDigtThresholdTestAlg.cxx:14
TgcDigtThresholdTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
TgcDigtThresholdTestAlg.cxx:22
TgcDigtThresholdTestAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
TgcDigtThresholdTestAlg.h:32
TgcIdHelper
Definition
TgcIdHelper.h:50
TgcIdHelper::gasGapMax
static int gasGapMax(bool triplet)
Definition
TgcIdHelper.cxx:672
TgcIdHelper::gasGapMin
static int gasGapMin()
Definition
TgcIdHelper.cxx:670
TgcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
Definition
TgcIdHelper.cxx:592
Identifier
Definition
IdentifierFieldParser.cxx:14
threshold
Definition
chainparser.cxx:74
Generated on
for ATLAS Offline Software by
1.17.0