ATLAS Offline Software
Loading...
Searching...
No Matches
NswPassivationDbData Class Reference

#include <NswPassivationDbData.h>

Collaboration diagram for NswPassivationDbData:

Classes

struct  PCBPassivation
 Helper struct to save the four passivation values of each PCB. More...

Public Member Functions

 NswPassivationDbData (const MmIdHelper &)
virtual ~NswPassivationDbData ()=default
void setData (const Identifier &chnlId, const int pcb, const float indiv, const float extra, const std::string &position)
std::vector< IdentifiergetChannelIds () const
const PCBPassivationgetPassivation (const Identifier &id) const

Private Types

using PassivationMap = std::unordered_map<Identifier::value_type, PCBPassivation>

Private Attributes

const MmIdHelperm_mmIdHelper
 ID helpers.
PassivationMap m_data {}

Detailed Description

Definition at line 20 of file NswPassivationDbData.h.

Member Typedef Documentation

◆ PassivationMap

using NswPassivationDbData::PassivationMap = std::unordered_map<Identifier::value_type, PCBPassivation>
private

Definition at line 45 of file NswPassivationDbData.h.

Constructor & Destructor Documentation

◆ NswPassivationDbData()

NswPassivationDbData::NswPassivationDbData ( const MmIdHelper & mmIdHelper)

Definition at line 7 of file NswPassivationDbData.cxx.

7 :
8 m_mmIdHelper(mmIdHelper) {}
const MmIdHelper & m_mmIdHelper
ID helpers.

◆ ~NswPassivationDbData()

virtual NswPassivationDbData::~NswPassivationDbData ( )
virtualdefault

Member Function Documentation

◆ getChannelIds()

std::vector< Identifier > NswPassivationDbData::getChannelIds ( ) const

Definition at line 38 of file NswPassivationDbData.cxx.

38 {
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}

◆ getPassivation()

const NswPassivationDbData::PCBPassivation & NswPassivationDbData::getPassivation ( const Identifier & id) const

Definition at line 47 of file NswPassivationDbData.cxx.

47 {
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}
Helper struct to save the four passivation values of each PCB.

◆ setData()

void NswPassivationDbData::setData ( const Identifier & chnlId,
const int pcb,
const float indiv,
const float extra,
const std::string & position )

Definition at line 11 of file NswPassivationDbData.cxx.

15 {
16 unsigned long long channelId = chnlId.get_compact();
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}
value_type get_compact() const
Get the compact id.

Member Data Documentation

◆ m_data

PassivationMap NswPassivationDbData::m_data {}
private

Definition at line 46 of file NswPassivationDbData.h.

46{};

◆ m_mmIdHelper

const MmIdHelper& NswPassivationDbData::m_mmIdHelper
private

ID helpers.

Definition at line 43 of file NswPassivationDbData.h.


The documentation for this class was generated from the following files: