ATLAS Offline Software
TileBchStatus.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <algorithm>
7 
8 //=== static memebers
10 TileBchStatus::LockedPrbSet TileBchStatus::s_refNoisy ATLAS_THREAD_SAFE;
11 TileBchStatus::LockedPrbSet TileBchStatus::s_refNoGainL1 ATLAS_THREAD_SAFE;
12 TileBchStatus::LockedPrbSet TileBchStatus::s_refBadTiming ATLAS_THREAD_SAFE;
13 TileBchStatus::LockedPrbSet TileBchStatus::s_refWrongBCID ATLAS_THREAD_SAFE;
14 TileBchStatus::LockedPrbSet TileBchStatus::s_refTimingDmuBcOffset ATLAS_THREAD_SAFE;
15 
16 //
17 //_________________________________________________________
19 {
20  if(!s_refBad.size()) initClassifierDefinitions();
21 }
22 
23 //
24 //_________________________________________________________
26  m_prbSet(prbSet)
27 {
28  if(!s_refBad.size()) initClassifierDefinitions();
29 }
30 
31 //
32 //_________________________________________________________
35 {
36  // PrbSet overlapp;
37  std::insert_iterator<PrbSet> insItr(m_prbSet, m_prbSet.begin());
38  std::set_union(m_prbSet.begin(),m_prbSet.end(), rhs.getPrbs().begin(), rhs.getPrbs().end(), insItr);
39  return *this;
40 }
41 
42 //
43 //_________________________________________________________
46 {
47  m_prbSet.insert(prb);
48  return *this;
49 }
50 
51 //
52 //_________________________________________________________
55 {
56  PrbSet::const_iterator iPrb = rhs.getPrbs().begin();
57  for(; iPrb!=rhs.getPrbs().end(); ++iPrb){
58  m_prbSet.erase(*iPrb);
59  }
60  return *this;
61 }
62 
63 //
64 //_________________________________________________________
67 {
68  m_prbSet.erase(prb);
69  return *this;
70 }
71 
72 //
73 //_________________________________________________________
74 bool
76 {
77  return (m_prbSet == other.m_prbSet);
78 }
79 
80 //
81 //_________________________________________________________
82 bool
84 {
85  return !(m_prbSet == other.m_prbSet);
86 }
87 
88 //
89 //_________________________________________________________
90 void
92 {
93  //=== define which problems trigger a bad state
94  PrbSet refBad;
95  //=== adc
96  refBad.insert(TileBchPrbs::GeneralMaskAdc);
97  refBad.insert(TileBchPrbs::AdcDead);
98  refBad.insert(TileBchPrbs::SevereStuckBit);
99  refBad.insert(TileBchPrbs::SevereDataCorruption);
100  refBad.insert(TileBchPrbs::VeryLargeHfNoise);
101  refBad.insert(TileBchPrbs::NoData);
102  refBad.insert(TileBchPrbs::WrongDspConfig);
103  //=== channel
104  refBad.insert(TileBchPrbs::GeneralMaskChannel);
105  refBad.insert(TileBchPrbs::NoPmt);
106  refBad.insert(TileBchPrbs::NoHV);
107  refBad.insert(TileBchPrbs::WrongHV);
108  //=== online (adc)
109  refBad.insert(TileBchPrbs::OnlineGeneralMaskAdc);
110  s_refBad.set (std::move (refBad));
111 
112  PrbSet refNoisy;
113  //=== define which problems trigger a noisy state
114  refNoisy.insert(TileBchPrbs::LargeHfNoise);
115  refNoisy.insert(TileBchPrbs::CorrelatedNoise);
116  refNoisy.insert(TileBchPrbs::LargeLfNoise);
117  s_refNoisy.set (std::move (refNoisy));
118 
119  PrbSet refNoGainL1;
120  //=== define which problems trigger a NoGainL1 state
121  refNoGainL1.insert(TileBchPrbs::AdcDead);
122  refNoGainL1.insert(TileBchPrbs::NoPmt);
123  refNoGainL1.insert(TileBchPrbs::NoHV);
124  refNoGainL1.insert(TileBchPrbs::TrigGeneralMask);
125  refNoGainL1.insert(TileBchPrbs::TrigNoGain);
126  refNoGainL1.insert(TileBchPrbs::TrigNoisy);
127  refNoGainL1.insert(TileBchPrbs::DisableForL1);
128  s_refNoGainL1.set (std::move (refNoGainL1));
129 
130  PrbSet refBadTiming;
131  //=== define which problems trigger a bad timing
132  refBadTiming.insert(TileBchPrbs::BadTiming);
133  //=== online
134  refBadTiming.insert(TileBchPrbs::OnlineBadTiming);
135  s_refBadTiming.set (std::move (refBadTiming));
136 
137  PrbSet refTimingDmuBcOffset;
138  //=== define which problems trigger an affected timing
139  refTimingDmuBcOffset.insert(TileBchPrbs::TimingDmuBcOffsetPos);
140  refTimingDmuBcOffset.insert(TileBchPrbs::TimingDmuBcOffsetNeg);
141  //=== online
142  refTimingDmuBcOffset.insert(TileBchPrbs::OnlineTimingDmuBcOffsetPos);
143  refTimingDmuBcOffset.insert(TileBchPrbs::OnlineTimingDmuBcOffsetNeg);
144  s_refTimingDmuBcOffset.set (std::move (refTimingDmuBcOffset));
145 
146  PrbSet refWrongBCID;
147  //=== define which problems trigger a wrong BCID
148  refWrongBCID.insert(TileBchPrbs::WrongBCID);
149  //=== online
150  refWrongBCID.insert(TileBchPrbs::OnlineWrongBCID);
151  s_refWrongBCID.set (std::move (refWrongBCID));
152 }
153 
154 //
155 //_________________________________________________________
156 void
158 {
159  s_refBad.set (status.getPrbs());
160 }
161 
162 //
163 //_________________________________________________________
164 void
166 {
167  s_refNoisy.set (status.getPrbs());
168 }
169 
170 //
171 //_________________________________________________________
172 void
174 {
175  s_refNoGainL1.set (status.getPrbs());
176 }
177 
178 //
179 //_________________________________________________________
180 void
182 {
183  s_refBadTiming.set (status.getPrbs());
184 }
185 
186 //
187 //_________________________________________________________
188 void
190 {
191  s_refTimingDmuBcOffset.set (status.getPrbs());
192 }
193 
194 //
195 //_________________________________________________________
196 void
198 {
199  s_refWrongBCID.set (status.getPrbs());
200 }
201 
202 //
203 //_________________________________________________________
206 {
207  return s_refBad;
208 }
209 
210 //
211 //_________________________________________________________
214 {
215  return s_refNoisy;
216 }
217 
218 //
219 //_________________________________________________________
222 {
223  return s_refNoGainL1;
224 }
225 
226 //
227 //_________________________________________________________
230 {
231  return s_refBadTiming;
232 }
233 
234 //
235 //_________________________________________________________
238 {
239  return s_refTimingDmuBcOffset;
240 }
241 
242 //
243 //_________________________________________________________
246 {
247  return s_refWrongBCID;
248 }
249 
250 //
251 //_________________________________________________________
253 TileBchStatus::testFor(const PrbSet& prbSet) const
254 {
255  PrbSet overlapp;
256  std::insert_iterator<PrbSet> insItr(overlapp, overlapp.begin());
257  std::set_intersection(m_prbSet.begin(),m_prbSet.end(), prbSet.begin(), prbSet.end(), insItr);
258  return overlapp;
259 }
260 
261 //
262 //_________________________________________________________
263 std::string
265 {
266  std::string prbStr("");
267  for(PrbSet::const_iterator iPrb = m_prbSet.begin(); iPrb != m_prbSet.end(); ++iPrb){
268  prbStr += TileBchPrbs::getDescription(*iPrb) + "; ";
269  }
270  return prbStr;
271 }
272 
273 //
274 //_________________________________________________________
276 {
277  std::lock_guard lock (m_mutex);
278  PrbSet overlapp;
279  std::insert_iterator<PrbSet> insItr(overlapp, overlapp.begin());
280  std::set_intersection(m_set.begin(),m_set.end(), s.begin(), s.end(), insItr);
281  return !overlapp.empty();
282 }
TileBchStatus::getDefinitionTimingDmuBcOffset
static TileBchStatus getDefinitionTimingDmuBcOffset()
Definition: TileBchStatus.cxx:237
TileBchStatus::getPrbs
const PrbSet & getPrbs() const
Definition: TileBchStatus.h:113
TileBchStatus::operator!=
bool operator!=(const TileBchStatus &other) const
Definition: TileBchStatus.cxx:83
TileBchPrbs::WrongBCID
@ WrongBCID
Definition: TileBchPrbs.h:70
TileBchPrbs::SevereDataCorruption
@ SevereDataCorruption
Definition: TileBchPrbs.h:38
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TileBchStatus::defineTimingDmuBcOffset
static void defineTimingDmuBcOffset(const TileBchStatus &status)
Definition: TileBchStatus.cxx:189
TileBchStatus::getDefinitionBadTiming
static TileBchStatus getDefinitionBadTiming()
Definition: TileBchStatus.cxx:229
TileBchStatus::initClassifierDefinitions
static void initClassifierDefinitions()
Definition: TileBchStatus.cxx:91
TileBchStatus::getDefinitionWrongBCID
static TileBchStatus getDefinitionWrongBCID()
Definition: TileBchStatus.cxx:245
TileBchPrbs::BadTiming
@ BadTiming
Definition: TileBchPrbs.h:64
TileBchPrbs::CorrelatedNoise
@ CorrelatedNoise
Definition: TileBchPrbs.h:43
TileBchPrbs::WrongDspConfig
@ WrongDspConfig
Definition: TileBchPrbs.h:36
TileBchPrbs::OnlineTimingDmuBcOffsetNeg
@ OnlineTimingDmuBcOffsetNeg
Definition: TileBchPrbs.h:92
TileBchPrbs::TimingDmuBcOffsetPos
@ TimingDmuBcOffsetPos
Definition: TileBchPrbs.h:71
TileBchStatus
Class holding bad channel problems.
Definition: TileBchStatus.h:20
TileBchPrbs::OnlineWrongBCID
@ OnlineWrongBCID
Definition: TileBchPrbs.h:90
TileBchPrbs::TrigNoGain
@ TrigNoGain
Definition: TileBchPrbs.h:79
TileBchStatus::LockedPrbSet
Definition: TileBchStatus.h:72
ATLAS_THREAD_SAFE
TileBchStatus::LockedPrbSet TileBchStatus::s_refBad ATLAS_THREAD_SAFE
Definition: TileBchStatus.cxx:9
TileBchPrbs::TrigNoisy
@ TrigNoisy
Definition: TileBchPrbs.h:81
TileBchPrbs::WrongHV
@ WrongHV
Definition: TileBchPrbs.h:56
TileBchStatus::operator-=
TileBchStatus & operator-=(const TileBchStatus &rhs)
Definition: TileBchStatus.cxx:54
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TileBchStatus::PrbSet
std::set< Prb > PrbSet
Definition: TileBchStatus.h:23
TileBchStatus::defineBadTiming
static void defineBadTiming(const TileBchStatus &status)
Definition: TileBchStatus.cxx:181
set_union
Set * set_union(Set *set1, Set *set2)
Perform a union of two sets.
TileBchPrbs::AdcDead
@ AdcDead
Definition: TileBchPrbs.h:33
TileBchStatus::getDefinitionNoisy
static TileBchStatus getDefinitionNoisy()
Definition: TileBchStatus.cxx:213
TileBchStatus::TileBchStatus
TileBchStatus()
Definition: TileBchStatus.cxx:18
TileBchStatus::defineNoisy
static void defineNoisy(const TileBchStatus &status)
Definition: TileBchStatus.cxx:165
TileBchStatus::testFor
PrbSet testFor(const PrbSet &prbSet) const
Definition: TileBchStatus.cxx:253
TileBchPrbs::Prb
Prb
Definition: TileBchPrbs.h:24
TileBchPrbs::LargeLfNoise
@ LargeLfNoise
Definition: TileBchPrbs.h:44
TileBchStatus::defineNoGainL1
static void defineNoGainL1(const TileBchStatus &status)
Definition: TileBchStatus.cxx:173
TileBchPrbs::VeryLargeHfNoise
@ VeryLargeHfNoise
Definition: TileBchPrbs.h:34
TileBchStatus::defineBad
static void defineBad(const TileBchStatus &status)
Definition: TileBchStatus.cxx:157
TileBchPrbs::NoData
@ NoData
Definition: TileBchPrbs.h:35
TileBchPrbs::OnlineTimingDmuBcOffsetPos
@ OnlineTimingDmuBcOffsetPos
Definition: TileBchPrbs.h:91
TileBchStatus.h
TileBchStatus::LockedPrbSet::m_set
PrbSet m_set
Definition: TileBchStatus.h:96
TileBchStatus::operator+=
TileBchStatus & operator+=(const TileBchStatus &rhs)
Definition: TileBchStatus.cxx:34
TileBchStatus::m_prbSet
PrbSet m_prbSet
Definition: TileBchStatus.h:69
TileBchPrbs::NoPmt
@ NoPmt
Definition: TileBchPrbs.h:54
TileBchStatus::operator==
bool operator==(const TileBchStatus &other) const
Definition: TileBchStatus.cxx:75
TileBchStatus::LockedPrbSet::test
bool test(const PrbSet &s) const
Definition: TileBchStatus.cxx:275
TileBchStatus::defineWrongBCID
static void defineWrongBCID(const TileBchStatus &status)
Definition: TileBchStatus.cxx:197
TileBchStatus::LockedPrbSet::m_mutex
std::mutex m_mutex
Definition: TileBchStatus.h:97
TileBchStatus::getDefinitionNoGainL1
static TileBchStatus getDefinitionNoGainL1()
Definition: TileBchStatus.cxx:221
TileBchStatus::getDefinitionBad
static TileBchStatus getDefinitionBad()
Definition: TileBchStatus.cxx:205
TileBchPrbs::OnlineGeneralMaskAdc
@ OnlineGeneralMaskAdc
Definition: TileBchPrbs.h:97
TileBchPrbs::DisableForL1
@ DisableForL1
Definition: TileBchPrbs.h:88
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
TileBchPrbs::TimingDmuBcOffsetNeg
@ TimingDmuBcOffsetNeg
Definition: TileBchPrbs.h:72
TileBchPrbs::TrigGeneralMask
@ TrigGeneralMask
Definition: TileBchPrbs.h:78
merge.status
status
Definition: merge.py:17
TileBchPrbs::LargeHfNoise
@ LargeHfNoise
Definition: TileBchPrbs.h:42
TileBchPrbs::SevereStuckBit
@ SevereStuckBit
Definition: TileBchPrbs.h:37
TileBchPrbs::NoHV
@ NoHV
Definition: TileBchPrbs.h:55
set_intersection
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
TileBchPrbs::OnlineBadTiming
@ OnlineBadTiming
Definition: TileBchPrbs.h:89
TileBchStatus::getString
std::string getString() const
Definition: TileBchStatus.cxx:264
TileBchPrbs::GeneralMaskChannel
@ GeneralMaskChannel
Definition: TileBchPrbs.h:53
TileBchPrbs::GeneralMaskAdc
@ GeneralMaskAdc
Definition: TileBchPrbs.h:32
TileBchPrbs::getDescription
static std::string getDescription(const Prb &prb)
Get description of problem.
Definition: TileBchPrbs.cxx:11