ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonConditions
MuonCondGeneral
MuonCondData
src
TgcDigitThresholdData.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 "
MuonCondData/TgcDigitThresholdData.h
"
6
7
TgcDigitThresholdData::TgcDigitThresholdData
(
const
Muon::IMuonIdHelperSvc
* idHelperSvc):
8
AthMessaging
{
"TgcDigitThresholdData"
},
9
m_idHelperSvc
{idHelperSvc}{}
10
11
bool
TgcDigitThresholdData::setThreshold
(
const
Identifier
& threshId,
const
double
threshold
) {
12
const
Identifier
layerId =
m_idHelperSvc
->layerId(threshId);
13
auto
insert_itr =
m_thresholds
.insert(std::make_pair(layerId,
threshold
));
14
if
(!insert_itr.second) {
15
ATH_MSG_ERROR
(
"Failed to threshold "
<<
threshold
<<
" for "
<<
m_idHelperSvc
->toString(layerId)
16
<<
" as it's been set before to "
<<
m_thresholds
[layerId]);
17
return
false
;
18
}
19
ATH_MSG_DEBUG
(
"Theshold for channel "
<<
m_idHelperSvc
->toString(layerId)<<
" successfully set to "
<<
threshold
);
20
return
true
;
21
}
22
double
TgcDigitThresholdData::getThreshold
(
const
Identifier
& channelId)
const
{
23
auto
itr =
m_thresholds
.find(
m_idHelperSvc
->layerId(channelId));
24
if
(itr !=
m_thresholds
.end())
return
itr->second;
25
constexpr
double
defaultThresh{999999.};
26
ATH_MSG_WARNING
(
"No threshold has been set for channel "
<<
m_idHelperSvc
->toString(channelId)<<
" return "
<<defaultThresh);
27
return
defaultThresh;
28
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
TgcDigitThresholdData.h
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition
IMuonIdHelperSvc.h:27
TgcDigitThresholdData::m_thresholds
std::unordered_map< Identifier, double > m_thresholds
Definition
TgcDigitThresholdData.h:31
TgcDigitThresholdData::setThreshold
bool setThreshold(const Identifier &layerId, const double threshold)
Definition
TgcDigitThresholdData.cxx:11
TgcDigitThresholdData::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition
TgcDigitThresholdData.h:30
TgcDigitThresholdData::getThreshold
double getThreshold(const Identifier &channelId) const
Definition
TgcDigitThresholdData.cxx:22
TgcDigitThresholdData::TgcDigitThresholdData
TgcDigitThresholdData(const Muon::IMuonIdHelperSvc *idHelperSvc)
Definition
TgcDigitThresholdData.cxx:7
Identifier
Definition
IdentifierFieldParser.cxx:14
threshold
Definition
chainparser.cxx:74
Generated on
for ATLAS Offline Software by
1.17.0