ATLAS Offline Software
Loading...
Searching...
No Matches
TileBadChannels.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include <algorithm>
7
8
12
13
17
18void TileBadChannels::addAdcStatus(const HWIdentifier channel_id, const HWIdentifier adc_id, const TileBchStatus& adcStatus) {
19 m_channelStatus[channel_id] += adcStatus;
20 m_adcStatus[adc_id] += adcStatus;
21}
22
23
25
26 BchMap::const_iterator adcStatus = m_adcStatus.find(adc_id);
27 if (adcStatus == m_adcStatus.end()) {
28 return m_defaultStatus;
29 } else {
30 return adcStatus->second;
31 }
32
33}
34
36
37 BchMap::const_iterator channelStatus = m_channelStatus.find(channel_id);
38 if (channelStatus == m_channelStatus.end()) {
39 return m_defaultStatus;
40 } else {
41 return channelStatus->second;
42 }
43
44}
45
46
47void TileBadChannels::setMaskedDrawers(std::vector<int>&& maskedDrawers) {
48 m_maskedDrawers = std::move(maskedDrawers);
50}
51
53 uint32_t bad;
54
55 if (status.isGood()) {
56 bad = 0;
57 } else if (status.isBad()) {
58 bad = 3;
59 } else if (status.isNoisy()) {
60 bad = 1;
61 } else if (status.isAffected()) {
62 bad = 2;
63 } else {
64 bad = 4;
65 }
66
67 return bad;
68}
69
70uint32_t TileBadChannels::encodeAdcStatus(const HWIdentifier adc_id) const {
71 return encodeStatus(getAdcStatus(adc_id));
72}
TileBchStatus m_defaultStatus
void setMaskedDrawers(std::vector< int > &&maskedDrawers)
Store Tile drawers masked completely.
static uint32_t encodeStatus(const TileBchStatus &status)
const TileBchStatus & getChannelStatus(const HWIdentifier channel_id) const
Return Tile channel status.
uint32_t encodeAdcStatus(const HWIdentifier adc_id) const
void addAdcStatus(const HWIdentifier channel_id, const HWIdentifier adc_id, const TileBchStatus &adcStatus)
Add status for given Tile ADC and corresponding channel.
virtual ~TileBadChannels()
const TileBchStatus & getAdcStatus(const HWIdentifier adc_id) const
Return Tile ADC status.
std::vector< int > m_maskedDrawers
Class holding bad channel problems.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.