ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonAlignment
MuonAlignmentData
src
NswPassivationDbData.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 "
MuonAlignmentData/NswPassivationDbData.h
"
6
#include "
MuonIdHelpers/MmIdHelper.h
"
7
NswPassivationDbData::NswPassivationDbData
(
const
MmIdHelper
& mmIdHelper):
8
m_mmIdHelper
(mmIdHelper) {}
9
10
11
void
NswPassivationDbData::setData
(
const
Identifier
& chnlId,
12
const
int
pcb,
13
const
float
indiv,
14
const
float
extra,
15
const
std::string& position) {
16
unsigned
long
long
channelId = chnlId.
get_compact
();
17
PCBPassivation
& passiv =
m_data
[channelId];
18
passiv.
valid
=
true
;
19
if
(position==
"left"
) passiv.
left
= indiv + extra;
20
else
if
(position==
"right"
) passiv.
right
= indiv + extra;
21
else
{
22
passiv.
left
= extra;
23
passiv.
right
= extra;
24
}
25
if
(extra==0)
return
;
26
/* in case an extra passivation is given (extra>0), it is applied (1/2)
27
to top or bottom depending on the following cases:
28
* if pcb = 1 or 6 => only top
29
* if pcb = 5 or 8 => only bottom
30
* else (if pcb = 2, 3, 4 or 7) => both top and bottom
31
*/
32
if
(pcb!=5 && pcb!=8) passiv.
top
= extra/2;
33
if
(pcb!=1 && pcb!=6) passiv.
bottom
= extra/2;
34
}
35
// retrieval functions -------------------------------
36
37
// getChannelIds
38
std::vector<Identifier>
NswPassivationDbData::getChannelIds
()
const
{
39
std::vector<Identifier> keys;
40
std::transform(
m_data
.begin(),
m_data
.end(), std::back_inserter(keys),
41
[](
const
PassivationMap::value_type& key_pair) ->Identifier{
42
return Identifier{key_pair.first};
43
});
44
return
keys;
45
}
46
47
const
NswPassivationDbData::PCBPassivation
&
NswPassivationDbData::getPassivation
(
const
Identifier
&
id
)
const
{
48
unsigned
long
long
channelId =
m_mmIdHelper
.pcbID(
id
).get_compact();
49
PassivationMap::const_iterator itr =
m_data
.find(channelId);
50
if
(itr !=
m_data
.end())
return
itr->second;
51
static
const
PCBPassivation
dummy{};
52
return
dummy;
53
}
MmIdHelper.h
NswPassivationDbData.h
Identifier::get_compact
value_type get_compact() const
Get the compact id.
MmIdHelper
Definition
MmIdHelper.h:54
NswPassivationDbData::m_mmIdHelper
const MmIdHelper & m_mmIdHelper
ID helpers.
Definition
NswPassivationDbData.h:43
NswPassivationDbData::NswPassivationDbData
NswPassivationDbData(const MmIdHelper &)
Definition
NswPassivationDbData.cxx:7
NswPassivationDbData::getChannelIds
std::vector< Identifier > getChannelIds() const
Definition
NswPassivationDbData.cxx:38
NswPassivationDbData::m_data
PassivationMap m_data
Definition
NswPassivationDbData.h:46
NswPassivationDbData::getPassivation
const PCBPassivation & getPassivation(const Identifier &id) const
Definition
NswPassivationDbData.cxx:47
NswPassivationDbData::setData
void setData(const Identifier &chnlId, const int pcb, const float indiv, const float extra, const std::string &position)
Definition
NswPassivationDbData.cxx:11
Identifier
Definition
IdentifierFieldParser.cxx:14
NswPassivationDbData::PCBPassivation
Helper struct to save the four passivation values of each PCB.
Definition
NswPassivationDbData.h:24
NswPassivationDbData::PCBPassivation::bottom
double bottom
Definition
NswPassivationDbData.h:28
NswPassivationDbData::PCBPassivation::top
double top
Definition
NswPassivationDbData.h:27
NswPassivationDbData::PCBPassivation::right
double right
Definition
NswPassivationDbData.h:26
NswPassivationDbData::PCBPassivation::valid
bool valid
Definition
NswPassivationDbData.h:29
NswPassivationDbData::PCBPassivation::left
double left
Definition
NswPassivationDbData.h:25
Generated on
for ATLAS Offline Software by
1.17.0