ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonConditions
MuonCondGeneral
MuonCondData
src
NswCalibDbThresholdData.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonCondData/NswCalibDbThresholdData.h
"
6
#include "
MuonIdHelpers/IMuonIdHelperSvc.h
"
7
8
#include "
MuonIdHelpers/MmIdHelper.h
"
9
#include "
MuonIdHelpers/sTgcIdHelper.h
"
10
#include <algorithm>
11
#include <iterator>
12
13
using namespace
Muon::MuonStationIndex
;
14
// general functions ---------------------------------
15
NswCalibDbThresholdData::NswCalibDbThresholdData
(
const
Muon::IMuonIdHelperSvc
* idHelperSvc):
16
AthMessaging
{
"NswCalibDbThresholdData"
},
17
m_idHelperSvc
{idHelperSvc} {}
18
19
20
// setting functions ---------------------------------
21
22
// setData
23
void
NswCalibDbThresholdData::setData
(
const
Identifier
& chnlId,
const
float
threshold
) {
24
25
auto
insert_itr =
m_data
.insert(std::make_pair(chnlId,
threshold
));
26
if
(!insert_itr.second) {
27
ATH_MSG_WARNING
(
"Threshold data for channel "
<<
m_idHelperSvc
->toString(chnlId)
28
<<
" already set to "
<<insert_itr.first->second<<
". Cannot apply "
<<
threshold
);
29
}
30
}
31
32
// setZero
33
void
NswCalibDbThresholdData::setZero
(
ThrsldTechType
tech,
const
float
threshold
) {
34
m_zero
[
toInt
(tech)] =
threshold
;
35
}
36
37
38
// retrieval functions -------------------------------
39
40
// getChannelIds
41
std::vector<Identifier>
42
NswCalibDbThresholdData::getChannelIds
(std::string_view tech, std::string_view side)
const
{
43
std::vector<Identifier> keys;
44
keys.reserve(
m_data
.size());
45
for
(
const
auto
& p :
m_data
) {
46
keys.emplace_back(p.first);
47
}
48
49
if
(tech.empty() && side.empty()) {
50
return
keys;
51
}
52
std::vector<Identifier> chnls;
53
std::ranges::copy_if(keys, std::back_inserter(chnls), [&](
const
Identifier
& copyMe){
54
const
int
eta
=
m_idHelperSvc
->stationEta(copyMe);
55
if
(!side.empty() && ((
eta
< 0 && side ==
"A"
) || (
eta
> 0 && side ==
"C"
))){
56
return
false
;
57
}
58
return
tech.empty() ||
technologyName
(
m_idHelperSvc
->technologyIndex(copyMe)) == tech;
59
});
60
return
chnls;
61
}
62
63
// getThreshold
64
std::optional<float>
NswCalibDbThresholdData::getThreshold
(
const
Identifier
& chnlId)
const
{
65
ChannelMap::const_iterator chan_itr =
m_data
.find(chnlId);
67
if
(chan_itr !=
m_data
.end()) {
68
return
chan_itr->second;
69
}
70
// if channelId doesn't exist in buffer, use 0 channel data ("all channels"), if exists
71
const
ThrsldTechType
tech = (
m_idHelperSvc
->issTgc(chnlId))? ThrsldTechType::STGC : ThrsldTechType::MM;
72
return
m_zero
[
toInt
(tech)];
73
}
74
75
76
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
IMuonIdHelperSvc.h
MmIdHelper.h
NswCalibDbThresholdData.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
NswCalibDbThresholdData::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition
NswCalibDbThresholdData.h:62
NswCalibDbThresholdData::ThrsldTechType
MuonCond::CalibTechType ThrsldTechType
Definition
NswCalibDbThresholdData.h:38
NswCalibDbThresholdData::m_zero
ZeroMap m_zero
Definition
NswCalibDbThresholdData.h:59
NswCalibDbThresholdData::setData
void setData(const Identifier &channelId, const float)
Definition
NswCalibDbThresholdData.cxx:23
NswCalibDbThresholdData::setZero
void setZero(const ThrsldTechType tech, const float)
Definition
NswCalibDbThresholdData.cxx:33
NswCalibDbThresholdData::getChannelIds
std::vector< Identifier > getChannelIds(std::string_view={}, std::string_view={}) const
Definition
NswCalibDbThresholdData.cxx:42
NswCalibDbThresholdData::NswCalibDbThresholdData
NswCalibDbThresholdData(const Muon::IMuonIdHelperSvc *idHelperSvc)
Definition
NswCalibDbThresholdData.cxx:15
NswCalibDbThresholdData::getThreshold
std::optional< float > getThreshold(const Identifier &channelId) const
Definition
NswCalibDbThresholdData.cxx:64
NswCalibDbThresholdData::m_data
ChannelMap m_data
Definition
NswCalibDbThresholdData.h:58
Identifier
Definition
IdentifierFieldParser.cxx:14
Muon::MuonStationIndex
Definition
MuonStationIndex.h:14
Muon::MuonStationIndex::toInt
constexpr int toInt(const EnumType enumVal)
Definition
MuonStationIndex.h:62
Muon::MuonStationIndex::technologyName
const std::string & technologyName(TechnologyIndex index)
convert LayerIndex into a string
Definition
MuonStationIndex.cxx:170
sTgcIdHelper.h
threshold
Definition
chainparser.cxx:74
Generated on
for ATLAS Offline Software by
1.17.0