ATLAS Offline Software
Loading...
Searching...
No Matches
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
9
10
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
38std::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
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}
value_type get_compact() const
Get the compact id.
const MmIdHelper & m_mmIdHelper
ID helpers.
NswPassivationDbData(const MmIdHelper &)
std::vector< Identifier > getChannelIds() const
const PCBPassivation & getPassivation(const Identifier &id) const
void setData(const Identifier &chnlId, const int pcb, const float indiv, const float extra, const std::string &position)
Helper struct to save the four passivation values of each PCB.