ATLAS Offline Software
MDTNoisyTubes.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // Tool to mask Noisy Tubes
7 // Nov. 2009
8 // Author Justin Griffiths <griffith@cern.ch>
10 
11 #include "MDTNoisyTubes.h"
12 
13 using std::map;
14 using std::set;
15 using std::string;
16 
18 
19 bool MDTNoisyTubes::isNoisy(const Muon::MdtPrepData* mdtCollection) const {
20  set<Identifier> noisyTubes;
21  map<IdentifierHash, set<Identifier> >::const_iterator itr = m_noise_map.find(mdtCollection->collectionHash());
22  if (itr == m_noise_map.end())
23  return false;
24  else
25  noisyTubes = itr->second;
26 
27  return noisyTubes.find(mdtCollection->identify()) != noisyTubes.end();
28 }
29 
31  set<Identifier> noisyTubes;
32  map<IdentifierHash, set<Identifier> >::const_iterator itr = m_noise_map.find(idHash);
33  if (itr == m_noise_map.end()) return noisyTubes;
34 
35  return itr->second;
36 }
37 
39  if (!doMask) return; // Option to turn off tube masking
40 
41  IdentifierHash idHash;
42  std::set<Identifier> tubes;
43 
44  // This noisy tube list was made using:
45  // data15_13TeV.00267639.physics_Main.merge.HIST.f603_h51/data15_13TeV.00267639.physics_Main.merge.HIST.f603_h51._0001.1
46 
47  unsigned long long id = 0;
48 
49  // BIL6A05 //
50  idHash = 68;
51  id = 0x6072046000000000;
52  tubes.insert(static_cast<Identifier>(id)); // hist bin #36
53  m_noise_map.insert(make_pair(idHash, tubes));
54  tubes.clear();
55 
56  // BIL6A09 //
57  idHash = 70;
58  id = 0x6074046000000000;
59  tubes.insert(static_cast<Identifier>(id)); // hist bin #36
60  m_noise_map.insert(make_pair(idHash, tubes));
61  tubes.clear();
62 
63  // BIS6C06 //
64  idHash = 90;
65  id = 0x6112704000000000;
66  tubes.insert(static_cast<Identifier>(id)); // hist bin #213
67  m_noise_map.insert(make_pair(idHash, tubes));
68  tubes.clear();
69 
70  // BML2C09 //
71  idHash = 236;
72  id = 0x623456e000000000;
73  tubes.insert(static_cast<Identifier>(id)); // hist bin #280
74  m_noise_map.insert(make_pair(idHash, tubes));
75  tubes.clear();
76 
77  // BML1C01 //
78  idHash = 240;
79  id = 0x623853e000000000;
80  tubes.insert(static_cast<Identifier>(id)); // hist bin #160
81  m_noise_map.insert(make_pair(idHash, tubes));
82  tubes.clear();
83 
84  // BMS1C02 //
85  idHash = 326;
86  id = 0x6338218000000000;
87  tubes.insert(static_cast<Identifier>(id)); // hist bin #125
88  m_noise_map.insert(make_pair(idHash, tubes));
89  tubes.clear();
90 
91  // BMS1C06 //
92  idHash = 328;
93  id = 0x633a06a000000000;
94  tubes.insert(static_cast<Identifier>(id)); // hist bin #54
95  m_noise_map.insert(make_pair(idHash, tubes));
96  tubes.clear();
97 
98  // BMS1C16 //
99  idHash = 331;
100  id = 0x633f06e000000000;
101  tubes.insert(static_cast<Identifier>(id)); // hist bin #56
102  m_noise_map.insert(make_pair(idHash, tubes));
103  tubes.clear();
104 
105  // BMS1A08 //
106  idHash = 335;
107  id = 0x634b020000000000;
108  tubes.insert(static_cast<Identifier>(id)); // hist bin #17
109  id = 0x634b068000000000;
110  tubes.insert(static_cast<Identifier>(id)); // hist bin #53
111  m_noise_map.insert(make_pair(idHash, tubes));
112  tubes.clear();
113 
114  // BMS1A10 //
115  idHash = 336;
116  id = 0x634c42e000000000;
117  tubes.insert(static_cast<Identifier>(id)); // hist bin #192
118  m_noise_map.insert(make_pair(idHash, tubes));
119  tubes.clear();
120 
121  // BMS1A16 //
122  idHash = 337;
123  id = 0x634f200000000000;
124  tubes.insert(static_cast<Identifier>(id)); // hist bin #113
125  id = 0x634f62e000000000;
126  tubes.insert(static_cast<Identifier>(id)); // hist bin #304
127  m_noise_map.insert(make_pair(idHash, tubes));
128  tubes.clear();
129 
130  // BOL6A13 //
131  idHash = 463;
132  id = 0x6476600000000000;
133  tubes.insert(static_cast<Identifier>(id)); // hist bin #281
134  m_noise_map.insert(make_pair(idHash, tubes));
135  tubes.clear();
136 
137  // BOL7A13 //
138  idHash = 465;
139  id = 0x647e118000000000;
140  tubes.insert(static_cast<Identifier>(id)); // hist bin #85
141  m_noise_map.insert(make_pair(idHash, tubes));
142  tubes.clear();
143 
144  // BOS6C02 //
145  idHash = 466;
146  id = 0x651045e000000000;
147  tubes.insert(static_cast<Identifier>(id)); // hist bin #240
148  id = 0x6510660000000000;
149  tubes.insert(static_cast<Identifier>(id)); // hist bin #369
150  m_noise_map.insert(make_pair(idHash, tubes));
151  tubes.clear();
152 
153  // BOS6C04 //
154  idHash = 467;
155  id = 0x651155c000000000;
156  tubes.insert(static_cast<Identifier>(id)); // hist bin #303
157  id = 0x6511618000000000;
158  tubes.insert(static_cast<Identifier>(id)); // hist bin #333
159  m_noise_map.insert(make_pair(idHash, tubes));
160  tubes.clear();
161 
162  // BOS6C08 //
163  idHash = 469;
164  id = 0x651325a000000000;
165  tubes.insert(static_cast<Identifier>(id)); // hist bin #174
166  id = 0x6513608000000000;
167  tubes.insert(static_cast<Identifier>(id)); // hist bin #325
168  m_noise_map.insert(make_pair(idHash, tubes));
169  tubes.clear();
170 
171  // BOS5C08 //
172  idHash = 475;
173  id = 0x651b200000000000;
174  tubes.insert(static_cast<Identifier>(id)); // hist bin #145
175  m_noise_map.insert(make_pair(idHash, tubes));
176  tubes.clear();
177 
178  // BOS2C10 //
179  idHash = 494;
180  id = 0x6534624000000000;
181  tubes.insert(static_cast<Identifier>(id)); // hist bin #379
182  m_noise_map.insert(make_pair(idHash, tubes));
183  tubes.clear();
184 
185  // BOS2A16 //
186  idHash = 513;
187  id = 0x6557400000000000;
188  tubes.insert(static_cast<Identifier>(id)); // hist bin #217
189  m_noise_map.insert(make_pair(idHash, tubes));
190  tubes.clear();
191 
192  // BOS4A04 //
193  idHash = 521;
194  id = 0x6561200000000000;
195  tubes.insert(static_cast<Identifier>(id)); // hist bin #145
196  m_noise_map.insert(make_pair(idHash, tubes));
197  tubes.clear();
198 
199  // BOS4A10 //
200  idHash = 524;
201  id = 0x656458c000000000;
202  tubes.insert(static_cast<Identifier>(id)); // hist bin #359
203  m_noise_map.insert(make_pair(idHash, tubes));
204  tubes.clear();
205 
206  // BOS4A16 //
207  idHash = 525;
208  id = 0x6567000000000000;
209  tubes.insert(static_cast<Identifier>(id)); // hist bin #1
210  m_noise_map.insert(make_pair(idHash, tubes));
211  tubes.clear();
212 
213  // BOS6A02 //
214  idHash = 532;
215  id = 0x657024a000000000;
216  tubes.insert(static_cast<Identifier>(id)); // hist bin #166
217  m_noise_map.insert(make_pair(idHash, tubes));
218  tubes.clear();
219 
220  // BOS6A04 //
221  idHash = 533;
222  id = 0x657165c000000000;
223  tubes.insert(static_cast<Identifier>(id)); // hist bin #367
224  m_noise_map.insert(make_pair(idHash, tubes));
225  tubes.clear();
226 
227  // BIR2A15 //
228  idHash = 585;
229  id = 0x675751e000000000;
230  tubes.insert(static_cast<Identifier>(id)); // hist bin #166
231  m_noise_map.insert(make_pair(idHash, tubes));
232  tubes.clear();
233 
234  // BMF1C12 //
235  idHash = 598;
236  id = 0x683d07a000000000;
237  tubes.insert(static_cast<Identifier>(id)); // hist bin #62
238  m_noise_map.insert(make_pair(idHash, tubes));
239  tubes.clear();
240 
241  // BMF1A12 //
242  idHash = 600;
243  id = 0x684d000000000000;
244  tubes.insert(static_cast<Identifier>(id)); // hist bin #1
245  m_noise_map.insert(make_pair(idHash, tubes));
246  tubes.clear();
247 
248  // BMF1A14 //
249  idHash = 601;
250  id = 0x684e270000000000;
251  tubes.insert(static_cast<Identifier>(id)); // hist bin #201
252  m_noise_map.insert(make_pair(idHash, tubes));
253  tubes.clear();
254 
255  // BOF1A12 //
256  idHash = 614;
257  id = 0x694d616000000000;
258  tubes.insert(static_cast<Identifier>(id)); // hist bin #372
259  m_noise_map.insert(make_pair(idHash, tubes));
260  tubes.clear();
261 
262  // BOF5A14 //
263  idHash = 619;
264  id = 0x695e02c000000000;
265  tubes.insert(static_cast<Identifier>(id)); // hist bin #23
266  m_noise_map.insert(make_pair(idHash, tubes));
267  tubes.clear();
268 
269  // EIL1A05 //
270  idHash = 676;
271  id = 0x6b4a708000000000;
272  tubes.insert(static_cast<Identifier>(id)); // hist bin #257
273  m_noise_map.insert(make_pair(idHash, tubes));
274  tubes.clear();
275 
276  // EIL2A15 //
277  idHash = 689;
278  id = 0x6b57046000000000;
279  tubes.insert(static_cast<Identifier>(id)); // hist bin #36
280  m_noise_map.insert(make_pair(idHash, tubes));
281  tubes.clear();
282 
283  // EML5C11 //
284  idHash = 775;
285  id = 0x6e1d43a000000000;
286  tubes.insert(static_cast<Identifier>(id)); // hist bin #222
287  m_noise_map.insert(make_pair(idHash, tubes));
288  tubes.clear();
289 
290  // EML1C11 //
291  idHash = 807;
292  id = 0x6e3d264000000000;
293  tubes.insert(static_cast<Identifier>(id)); // hist bin #163
294  m_noise_map.insert(make_pair(idHash, tubes));
295  tubes.clear();
296 
297  // EML1A13 //
298  idHash = 816;
299  id = 0x6e4e53c000000000;
300  tubes.insert(static_cast<Identifier>(id)); // hist bin #255
301  m_noise_map.insert(make_pair(idHash, tubes));
302  tubes.clear();
303 
304  // EML2A13 //
305  idHash = 824;
306  id = 0x6e56512000000000;
307  tubes.insert(static_cast<Identifier>(id)); // hist bin #266
308  m_noise_map.insert(make_pair(idHash, tubes));
309  tubes.clear();
310 
311  // EML2A15 //
312  idHash = 825;
313  id = 0x6e57612000000000;
314  tubes.insert(static_cast<Identifier>(id)); // hist bin #330
315  m_noise_map.insert(make_pair(idHash, tubes));
316  tubes.clear();
317 
318  // EMS3C10 //
319  idHash = 870;
320  id = 0x6f2c17a000000000;
321  tubes.insert(static_cast<Identifier>(id)); // hist bin #126
322  m_noise_map.insert(make_pair(idHash, tubes));
323  tubes.clear();
324 
325  // EMS2A08 //
326  idHash = 901;
327  id = 0x6f53410000000000;
328  tubes.insert(static_cast<Identifier>(id)); // hist bin #201
329  m_noise_map.insert(make_pair(idHash, tubes));
330  tubes.clear();
331 
332  // EMS2A14 //
333  idHash = 904;
334  id = 0x6f56578000000000;
335  tubes.insert(static_cast<Identifier>(id)); // hist bin #317
336  m_noise_map.insert(make_pair(idHash, tubes));
337  tubes.clear();
338 
339  // EMS3A02 //
340  idHash = 906;
341  id = 0x6f58274000000000;
342  tubes.insert(static_cast<Identifier>(id)); // hist bin #187
343  m_noise_map.insert(make_pair(idHash, tubes));
344  tubes.clear();
345 
346  // BME1C14 //
347  idHash = 1174;
348  id = 0x7e3e374000000000;
349  tubes.insert(static_cast<Identifier>(id)); // hist bin #293
350  id = 0x7e3e474000000000;
351  tubes.insert(static_cast<Identifier>(id)); // hist bin #293
352  m_noise_map.insert(make_pair(idHash, tubes));
353  tubes.clear();
354 }
MDTNoisyTubes.h
MDTNoisyTubes::m_noise_map
std::map< IdentifierHash, std::set< Identifier > > m_noise_map
Definition: MDTNoisyTubes.h:29
MDTNoisyTubes::~MDTNoisyTubes
~MDTNoisyTubes()
MDTNoisyTubes::MDTNoisyTubes
MDTNoisyTubes(bool doMask=true)
Definition: MDTNoisyTubes.cxx:38
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:33
MDTNoisyTubes::isNoisy
bool isNoisy(const Muon::MdtPrepData *) const
Definition: MDTNoisyTubes.cxx:19
Muon::MdtPrepData::collectionHash
virtual IdentifierHash collectionHash() const
Returns the IdentifierHash corresponding to the Mdt tube which was hit.
Definition: MdtPrepData.h:148
MDTNoisyTubes::getNoiseList
std::set< Identifier > getNoiseList(IdentifierHash)
Definition: MDTNoisyTubes.cxx:30
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
Identifier
Definition: IdentifierFieldParser.cxx:14