ATLAS Offline Software
TileMBTSMonitorAlgorithm.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 
9 
11 
12 #include "StoreGate/ReadHandle.h"
13 
15 
17 
19 
20  ATH_MSG_INFO("in initialize()");
21 
22  if (m_energyCut.size() != MAX_MBTS_COUNTER) {
23  int numberOfCounters{MAX_MBTS_COUNTER};
24  ATH_MSG_ERROR("Energy cuts are not provided for all ("
25  << numberOfCounters << ") MBTS. Provided only "
26  << m_energyCut.size() << " energy cuts");
27 
28  return StatusCode::FAILURE;
29  }
30 
31  ATH_CHECK( m_cablingSvc.retrieve() );
32  m_cabling = m_cablingSvc->cablingService();
33 
36 
39  ATH_CHECK( m_mbtsCellContainerKey.initialize() );
40 
41  memset(m_MBTSchannels, -1, sizeof(m_MBTSchannels));
42  memset(m_MBTScounters, -1, sizeof(m_MBTScounters));
43  for (unsigned int ros = 3; ros < Tile::MAX_ROS ; ++ros) {
44  for (unsigned int drawer = 0; drawer < Tile::MAX_DRAWER; ++drawer) {
45  HWIdentifier drawerHWID = m_tileHWID->drawer_id(ros, drawer);
46  Identifier mbtsID = m_cabling->drawer2MBTS_id(drawerHWID);
47  if (mbtsID.is_valid()) {
50 
51  int counter = getMBTSCounter(mbtsID);
53 
54  ATH_MSG_DEBUG( "Found MBTS: drawer/channel (counter)=> " << drawer << "/" << channel << "(" << counter << ")" );
55 
56  }
57  }
58  }
59 
61  m_energyGroups = Monitored::buildToolMap<int>(m_tools, "TileEnergyMBTS", MAX_MBTS_COUNTER);
62  m_energyLBGroups = Monitored::buildToolMap<int>(m_tools, "TileEnergyLBMBTS", MAX_MBTS_COUNTER);
63 
64  m_timeGroups = Monitored::buildToolMap<int>(m_tools, "TileTimeMBTS", MAX_MBTS_COUNTER);
65 
66  m_hfnGroups = Monitored::buildToolMap<int>(m_tools, "TileHFNoiseMBTS", MAX_MBTS_COUNTER);
67  m_pedestalGroups = Monitored::buildToolMap<int>(m_tools, "TilePedestalMBTS", MAX_MBTS_COUNTER);
68 
69  m_pulseGroups = Monitored::buildToolMap<int>(m_tools, "TileAveragePulseMBTS", MAX_MBTS_COUNTER);
70  }
71 
72  bool doMenuInit = false;
73  if (m_useTrigger && (m_ctpID.size() != MAX_MBTS_COUNTER)) {
74  if (m_l1Triggers.size() != MAX_MBTS_COUNTER) {
75  int numberOfCounters{MAX_MBTS_COUNTER};
76  ATH_MSG_WARNING("Names are not provided for all ("
77  << numberOfCounters << ") L1 MBTS triggers. Provided only "
78  << m_l1Triggers.size() << " L1 MBTS");
79 
80  ATH_MSG_WARNING("Autoconfiguration of CTP ID to L1 MBTS mapping is not possible: force useTrigger=false");
81  m_useTrigger = false;
82  } else {
83  doMenuInit = true;
84  }
85  }
86  ATH_CHECK( m_L1MenuKey.initialize( doMenuInit ) );
87 
89  if (m_useTrigger) {
90  m_energyTrigGroups = Monitored::buildToolMap<int>(m_tools, "TileEnergyTrigMBTS", MAX_MBTS_COUNTER);
91  m_energyTrigLBGroups = Monitored::buildToolMap<int>(m_tools, "TileEnergyTrigLBMBTS", MAX_MBTS_COUNTER);
92  m_timeTrigGroups = Monitored::buildToolMap<int>(m_tools, "TileTimeTrigMBTS", MAX_MBTS_COUNTER);
93  m_pulseTrigGroups = Monitored::buildToolMap<int>(m_tools, "TileAveragePulseTrigMBTS", MAX_MBTS_COUNTER);
94  m_effTrigGroups = Monitored::buildToolMap<int>(m_tools, "TileEfficiencyTrigMBTS", MAX_MBTS_COUNTER);
95 
96  int nTriggers = 3;
97  m_trigGroups = Monitored::buildToolMap<int>(m_tools, "MBTS_Triggers", nTriggers);
98  m_trigInWinGroups = Monitored::buildToolMap<int>(m_tools, "MBTS_TriggersInWindow", nTriggers);
99  m_trigSumGroups = Monitored::buildToolMap<int>(m_tools, "MBTS_TriggersSum", nTriggers);
100  m_coinTrigGroups = Monitored::buildToolMap<int>(m_tools, "MBTS_CoincidentTriggers", nTriggers);
101  m_deltaBCIDSumGroups = Monitored::buildToolMap<int>(m_tools, "MBTS_DeltaBCID_Summary", nTriggers);
102  m_deltaBCIDGroups = Monitored::buildToolMap<std::vector<int>>(m_tools, "MBTS_DeltaBCID", nTriggers, MAX_MBTS_COUNTER);
103  m_bcidGroups = Monitored::buildToolMap<std::vector<int>>(m_tools, "MBTS_BCID", nTriggers, MAX_MBTS_COUNTER);
104  }
105 
106  return StatusCode::SUCCESS;
107 }
108 
110 
111  if (m_useTrigger && (m_ctpID.size() != MAX_MBTS_COUNTER)) {
112  m_ctpID.value().resize(MAX_MBTS_COUNTER, -1);
113  ATH_MSG_INFO("Try to autoconfigure CTP ID to L1 MBTS trigger mapping from L1 menu");
115  if( l1MenuHandle.isValid() ) {
116  for (const TrigConf::L1Item& item: *l1MenuHandle) {
117  auto it = std::find(m_l1Triggers.begin(), m_l1Triggers.end(), item.name());
118  if (it != m_l1Triggers.end()) {
119  unsigned int counter = std::distance(m_l1Triggers.begin(), it);
120  m_ctpID[counter] = item.ctpId();
121  ATH_MSG_DEBUG("Found in L1 Menu: " << item.name() << ", CTP ID: " << item.ctpId() << ", counter: " << counter);
122  }
123  }
124  } else {
125  ATH_MSG_WARNING("L1 menu is not available: force useTrigger=false");
126  m_useTrigger = false;
127  }
128  }
129 
130  return StatusCode::SUCCESS;
131 }
132 
133 StatusCode TileMBTSMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const {
134 
135  // In case you want to measure the execution time
136  auto timer = Monitored::Timer("TIME_execute");
137  auto timeerGroup = Monitored::Group(getGroup("TileMBTSMonExecuteTime"), timer);
138 
139  const xAOD::EventInfo* eventInfo = GetEventInfo(ctx).get();
140 
141  const int Trig_b7(7);
142  uint32_t l1TriggerType(eventInfo->level1TriggerType());
143  bool physicRun = (l1TriggerType == 0) || (((l1TriggerType >> Trig_b7) & 1) == 1);
144 
145  if (!physicRun) {
146  ATH_MSG_DEBUG("Calibration Event found => skip filling histograms.");
147  return StatusCode::SUCCESS;
148  }
149 
150  auto lumiBlock = Monitored::Scalar<int>("lumiBlock", eventInfo->lumiBlock());
151 
152  int nHitsA(0);
153  int nHitsC(0);
154  double timeA(0.0);
155  double timeC(0.0);
156 
157  // unsigned int l1aBCID(0);
158  std::vector<bool> hasTBP(MAX_MBTS_COUNTER, false);
159 
160  if (m_useTrigger) {
161  SG::ReadHandle<CTP_RDO> ctpRdoContainer(m_ctpRdoKey, ctx);
162  ATH_CHECK( ctpRdoContainer.isValid() );
163 
164  uint32_t nBunches(0);
165  CTP_Decoder ctpDecoder;
166 
167  ctpDecoder.setRDO(ctpRdoContainer.get());
168  nBunches = ctpRdoContainer->getNumberOfBunches();
169 
170  if (nBunches > 0) {
171  short l1aBunch = ctpRdoContainer->getL1AcceptBunchPosition();
172  const std::vector<CTP_BC>& ctpBunchCrossings = ctpDecoder.getBunchCrossings();
173  const CTP_BC & bunch = ctpBunchCrossings[l1aBunch];
174  auto l1aBCID = Monitored::Scalar<unsigned int>("bcid", bunch.getBCID());
175  unsigned int bcid;
176  auto triggerMultiplicityA = Monitored::Scalar<int>("multiplicityA", 0);
177  auto triggerMultiplicityC = Monitored::Scalar<int>("multiplicityC", 0);
178 
179  const std::bitset<512> currentTBP(bunch.getTBP());
180  for (size_t counter = 0; counter < m_ctpID.size(); ++counter) {
181  if (m_ctpID[counter] < 0) continue;
182  if (currentTBP.test(m_ctpID[counter])) {
183  hasTBP[counter] = true;
184  if (counter < 16) {
185  ++triggerMultiplicityA;
186  } else {
187  ++triggerMultiplicityC;
188  }
189  }
190  }
191 
192  fill("TileTriggerMultiplicityMBTSA", l1aBCID, triggerMultiplicityA);
193  fill("TileTriggerMultiplicityMBTSC", l1aBCID, triggerMultiplicityC);
194  fill("TileTriggerMultiplicityPerSideMBTS", triggerMultiplicityA, triggerMultiplicityC);
195 
196  std::vector<int> triggerTypes; // A-Inner, A-Outer, A-Total, C-Inner, C-Outer, C-Total
197  std::vector<int> triggerCounters;
198  std::vector<int> triggerInWindowCounters;
199  std::vector<int> deltaBCIDs;
200 
201  //int deltaBCID;
202  // Loop over bunch crossings in CTP window
203  for (const CTP_BC& ctpBunchCrossing : ctpBunchCrossings) {
204  bcid = ctpBunchCrossing.getBCID();
205 
206  int deltaBCID = l1aBCID - bcid;
207 
208  std::vector<std::reference_wrapper<const std::bitset<512>>> triggers;
209  triggers.push_back(ctpBunchCrossing.getTBP());
210  triggers.push_back(ctpBunchCrossing.getTAP());
211  triggers.push_back(ctpBunchCrossing.getTAV());
212 
213  int triggerIdx = 0;
214  for (const std::bitset<512>& currentTrigger : triggers) {
215  triggerTypes.clear();
216  triggerCounters.clear();
217  triggerInWindowCounters.clear();
218  deltaBCIDs.clear();
219 
220  for (size_t counter = 0; counter < m_ctpID.size(); ++counter) {
221  if (m_ctpID[counter] < 0) continue;
222  if (currentTrigger.test(m_ctpID[counter])) {
223  triggerInWindowCounters.push_back(counter);
224  auto monBCID = Monitored::Scalar<unsigned int>("MBTS_BCID", bcid);
225  fill(m_tools[m_bcidGroups[triggerIdx][counter]], monBCID);
226  deltaBCIDs.push_back(deltaBCID);
227  auto monDeltaBCID = Monitored::Scalar<float>("DeltaBCID", deltaBCID);
228  fill(m_tools[m_deltaBCIDGroups[triggerIdx][counter]], monDeltaBCID);
229  if (bcid == l1aBCID) {
230  triggerCounters.push_back(counter);
231  int mbtsType = counter / 8; // A-Inner, A-Outer, C-Inner, C-Outer
232  if (counter > 15) {
233  mbtsType += 1; // Shift C-Side to allow A-Total
234  }
235  triggerTypes.push_back(mbtsType);
236  triggerTypes.push_back(counter < 16 ? 2 : 5); // A-Total, C-Total
237  }
238  }
239  }
240 
241  auto monTriggerInWindowCounter = Monitored::Collection("TriggerCounter", triggerInWindowCounters);
242  fill(m_tools[m_trigInWinGroups[triggerIdx]], monTriggerInWindowCounter);
243 
244  auto monDeltaBCID = Monitored::Collection("DeltaBCID", deltaBCIDs);
245  fill(m_tools[m_deltaBCIDSumGroups[triggerIdx]], monTriggerInWindowCounter, monDeltaBCID);
246 
247  if (bcid == l1aBCID) {
248  auto monTriggerType = Monitored::Collection("TriggerType", triggerTypes);
249  fill(m_tools[m_trigSumGroups[triggerIdx]], monTriggerType);
250 
251  auto monTriggerCounter = Monitored::Collection("TriggerCounter", triggerCounters);
252  fill(m_tools[m_trigGroups[triggerIdx]], monTriggerCounter);
253 
254  std::vector<int> coincidentTriggers1;
255  std::vector<int> coincidentTriggers2;
256  for (int counter1 : triggerCounters) {
257  for (int counter2 : triggerCounters) {
258  coincidentTriggers1.push_back(counter1);
259  coincidentTriggers2.push_back(counter2);
260  }
261  }
262  auto monCoincidentTrigger1 = Monitored::Collection("CoincidentTrigger1", coincidentTriggers1);
263  auto monCoincidentTrigger2 = Monitored::Collection("CoincidentTrigger2", coincidentTriggers2);
264  fill(m_tools[m_coinTrigGroups[triggerIdx]], monCoincidentTrigger1, monCoincidentTrigger2);
265  }
266  ++triggerIdx;
267  }
268  }
269 
270  }
271  }
272 
273  auto monEnergy = Monitored::Scalar<float>("Energy", 0.0F);
274  auto monTime = Monitored::Scalar<float>("Time", 0.0F);
275 
276  std::vector<float> energyCounters;
277  energyCounters.reserve(MAX_MBTS_COUNTER);
278  auto monEnergyCounter = Monitored::Collection("EnergyCounter", energyCounters);
279 
280  std::vector<float> energies;
281  energies.reserve(MAX_MBTS_COUNTER);
282  auto monSummaryEnergy = Monitored::Collection("SummaryEnergy", energies);
283 
284  std::vector<float> timeCounters;
285  auto monTimeCounter = Monitored::Collection("TimeCounter", timeCounters);
286 
287  std::vector<float> times;
288  auto monSummaryTime = Monitored::Collection("SummaryTime", times);
289 
290  std::vector<float> triggerEnergies;
291  auto monTriggerSummaryEnergy = Monitored::Collection("SummaryEnergy", triggerEnergies);
292 
293  std::vector<float> triggerTimes;
294  auto monTriggerSummaryTime = Monitored::Collection("SummaryTime", triggerTimes);
295 
296  std::vector<int> energyHitCounters;
297  std::vector<int> triggerHitCounters;
298 
300  ATH_CHECK( mbtsContainer.isValid() );
301 
302  for (const TileCell* cell : *mbtsContainer) {
303 
304  Identifier id = cell->ID();
305 
306  // Calculate MBTS counter from "side", "tower" and "module"
307  // Counter goes 0-31.
308  // EBA-inner:0-7,EBA-outer:8-15,EBC-inner:16-23,EBC-outer:24-31
309  // tower is 1 for outer counter (lower eta) and 0 for inner counter (higher eta)
310  // module counts from 0-7 in increasing phi
311  // side is -1 for EBC 1 for EBA
312 
313  int counter = getMBTSCounter(id);
314  energyCounters.push_back(counter);
315 
316  double energy = cell->energy();
317  monEnergy = energy;
318  energies.push_back(energy);
319 
320  double time = cell->time();
321  monTime = time;
322 
323  float quality = cell->quality();
324 
325  ATH_MSG_VERBOSE("Counter: " << counter
326  << ", energy= " << energy << " pCb"
327  << ", time= " << time
328  << ", quality= " << quality);
329 
330 
332  fill(m_tools[m_energyGroups[counter]], monEnergy);
334  }
335 
336  if (m_useTrigger) {
337  auto monEfficiency = Monitored::Scalar<float>("Efficiency", 0.0F);
338  if (hasTBP[counter]) {
339  monEfficiency = 1.0F;
340  triggerHitCounters.push_back(counter);
341  triggerEnergies.push_back(energy);
342  triggerTimes.push_back(time);
343 
344  fill(m_tools[m_energyTrigGroups[counter]], monEnergy);
346  fill(m_tools[m_timeTrigGroups[counter]], monTime);
347  }
348  fill(m_tools[m_effTrigGroups[counter]], monEnergy, monEfficiency);
349  }
350 
351  if (energy > m_energyCut[counter]) {
352 
353  timeCounters.push_back(counter);
354  times.push_back(time);
355 
356  energyHitCounters.push_back(counter);
357 
359  fill(m_tools[m_timeGroups[counter]], monTime);
360  }
361 
362  if (std::abs(time) > 10e-4) {
363  if (counter < 16) { // MBTS A side
364  timeA += time;
365  ++nHitsA;
366  } else { // MBTS C side
367  timeC += time;
368  ++nHitsC;
369  }
370  }
371 
372  }
373  }
374 
375  auto monHitCounter = Monitored::Collection("HitCounter", energyHitCounters);
376  fill("TileOccupancyMBTS", monHitCounter);
377  fill("TileEnergySummaryMBTS", monEnergyCounter, monSummaryEnergy);
378 
379  fill("TileTimeSummaryMBTS", monTimeCounter, monSummaryTime);
380 
381  if (m_useTrigger) {
382  auto monTriggerHitCounter = Monitored::Collection("HitCounter", triggerHitCounters);
383  fill("TileTriggerOccupancyMBTS", monTriggerHitCounter);
384  fill("TileTriggerEnergySummaryMBTS", monTriggerHitCounter, monTriggerSummaryEnergy);
385  fill("TileTriggerTimeSummaryMBTS", monTriggerHitCounter, monTriggerSummaryTime);
386  }
387 
388  if (nHitsA > 0) {
389  timeA /= nHitsA;
390  auto monTimeA = Monitored::Scalar<float>("TimeA", timeA);
391  fill("TileTimeMBTSA", monTimeA);
392  }
393 
394  if (nHitsC > 0) {
395  timeC /= nHitsC;
396  auto monTimeC = Monitored::Scalar<float>("TimeC", timeC);
397  fill("TileTimeMBTSC", monTimeC);
398  }
399 
400  if (nHitsA > 0 && nHitsC > 0) {
401  double timeDifference = timeA - timeC;
402  auto monTimeDifference = Monitored::Scalar<float>("TimeDifference", timeDifference);
403  fill("TileTimeDifferenceMBTS", monTimeDifference);
404  fill("TileTimeDifferenceMBTSLB", lumiBlock, monTimeDifference);
405  }
406 
407 
408  std::vector<int> coincidentCounters1;
409  auto monCoincidentCounters1 = Monitored::Collection("CoincidentCounter1", coincidentCounters1);
410 
411  std::vector<int> coincidentCounters2;
412  auto monCoincidentCounters2 = Monitored::Collection("CoincidentCounter2", coincidentCounters2);
413 
414  for (int counter1 : energyHitCounters) {
415  for (int counter2 : energyHitCounters) {
416  coincidentCounters1.push_back(counter1);
417  coincidentCounters2.push_back(counter2);
418  }
419  }
420 
421  fill("TileCoincidentHitsMBTS", monCoincidentCounters1, monCoincidentCounters2);
422 
423  std::vector<int> errors;
424  auto monErrors = Monitored::Collection("Error", errors);
425 
426  std::vector<int> counters;
427  auto monErrorCounters = Monitored::Collection("ErrorCounter", counters);
428 
429  // Create instance of TileDQstatus used to check for readout errors in Tile
430  const TileDQstatus* dqStatus = SG::makeHandle (m_DQstatusKey, ctx).get();
431 
432  // Check only low gain (in physics runs low and high gain status should identical)
433  const int gain{0};
434  for (unsigned int ros = 3; ros < Tile::MAX_ROS; ++ros) {
435  for (unsigned int drawer = 0; drawer < Tile::MAX_DRAWER; ++drawer) {
436  int channel = m_MBTSchannels[ros - 3][drawer];
437  int counter = m_MBTScounters[ros - 3][drawer];
438 
439  if (channel > 0) {
440  // Fill Readout Error histogram
441  if (!(dqStatus->isChanDQgood(ros, drawer, channel))) {
442  setDigiError(counters, errors, counter, GENERAL);
443  }
444  if (dqStatus->checkGlobalCRCErr(ros, drawer, gain)) {
445  setDigiError(counters, errors, counter, GLOBAL_CRC);
446  }
447  if (dqStatus->checkROD_CRCErr(ros, drawer, MBTS_DMU, gain)) {
448  setDigiError(counters, errors, counter, ROD_CRC);
449  }
450  if (dqStatus->checkFE_CRCErr(ros, drawer, MBTS_DMU, gain)) {
452  }
453  if (dqStatus->checkBCIDErr(ros, drawer, MBTS_DMU, gain)) {
454  setDigiError(counters, errors, counter, BCID);
455  }
456  if (dqStatus->checkHeaderFormatErr(ros, drawer, MBTS_DMU, gain)) {
458  }
459  if (dqStatus->checkHeaderParityErr(ros, drawer, MBTS_DMU, gain)) {
461  }
462  if (dqStatus->checkSampleFormatErr(ros, drawer, MBTS_DMU, gain)) {
464  }
465  if (dqStatus->checkSampleParityErr(ros, drawer, MBTS_DMU, gain)) {
467  }
468  if (dqStatus->checkMemoryParityErr(ros, drawer, MBTS_DMU, gain)) {
470  }
471  }
472  }
473  }
474 
475  fill("TileErrorsMBTS", monErrorCounters, monErrors);
476 
477 
480  ATH_CHECK( digitsContainer.isValid() );
481 
482  auto monPedestal = Monitored::Scalar<float>("Pedestal", 0.0F);
483  auto monHFN = Monitored::Scalar<float>("HFN", 0.0F);
484 
485  for (const TileDigitsCollection* digitsCollection : *digitsContainer) {
486  if (digitsCollection->empty()) continue;
487  HWIdentifier adc_id = digitsCollection->front()->adc_HWID();
488  int ros = m_tileHWID->ros(adc_id);
489  if (ros > 2) { // Extended barrel
490  int drawer = m_tileHWID->drawer(adc_id);
491  int MBTSchannel = m_MBTSchannels[ros - 3][drawer];
492 
493  if (MBTSchannel >= 0) {
494  for (const TileDigits* tile_digits: *digitsCollection) {
495 
496  adc_id = tile_digits->adc_HWID();
497  int channel = m_tileHWID->channel(adc_id);
498  if (channel == MBTSchannel) { // MBTS channel found
499  int counter = m_MBTScounters[ros - 3][drawer];
500 
501  double sampleMean = 0;
502  double sampleRMS = 0;
503 
504  std::vector<float> samples = tile_digits->samples();
505  unsigned int nSamples = samples.size();
506  if (nSamples > 0) {
507 
508  for (float sample : samples) {
509  sampleMean += sample;
510  sampleRMS += sample * sample;
511  }
512 
513  auto min_max = std::minmax_element(samples.begin(), samples.end());
514  float minSample = *min_max.first;
515  float maxSample = *min_max.second;
516 
517  if ((maxSample - minSample) > 10) {
518 
519  auto monSamples = Monitored::Collection("Samples", samples);
520 
521  std::vector<int> sampleNumbers;
522  sampleNumbers.reserve(nSamples);
523  for (unsigned int i = 0; i < nSamples; ++i) sampleNumbers.push_back(i);
524  auto monSampleNumbers = Monitored::Collection("SampleNumbers", sampleNumbers);
525 
526  fill(m_tools[m_pulseGroups[counter]], monSampleNumbers, monSamples);
527  if (hasTBP[counter]) {
528  fill(m_tools[m_pulseTrigGroups[counter]], monSampleNumbers, monSamples);
529  }
530  }
531 
532  sampleMean /= nSamples;
533  sampleRMS = sampleRMS / nSamples - sampleMean * sampleMean;
534  sampleRMS = (sampleRMS > 0.0 && nSamples > 1u) ? sqrt(sampleRMS * nSamples / (nSamples - 1u)) : 0.0;
535 
536  monHFN = sampleRMS;
537  fill(m_tools[m_hfnGroups[counter]], monHFN);
538 
539  monPedestal = samples.front();
540  fill(m_tools[m_pedestalGroups[counter]], monPedestal);
541 
542  }
543  }
544  }
545  }
546  }
547  }
548  }
549 
550  return StatusCode::SUCCESS;
551 }
552 
553 
554 
556  int counter = m_tileTBID->phi(mbtsID) + 8 * m_tileTBID->eta(mbtsID);
557  if (m_tileTBID->side(mbtsID) < 0) counter += 16;// EBC side
558  return counter;
559 }
560 
561 
562 void TileMBTSMonitorAlgorithm::setDigiError(std::vector<int>& counters, std::vector<int>& errors,
563  int counter, int error) const {
564 
565  counters.push_back(counter);
566  errors.push_back(error);
567 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileCell
Definition: TileCell.h:57
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TileMBTSMonitorAlgorithm::HEADER_PARITY
@ HEADER_PARITY
Definition: TileMBTSMonitorAlgorithm.h:47
CTP_Decoder.h
TileDQstatus::checkBCIDErr
int checkBCIDErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has BCID mismatch between DMU and ROD Since BCID errors in the DQ fragment are det...
Definition: TileDQstatus.h:100
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
TileMBTSMonitorAlgorithm::m_timeTrigGroups
std::vector< int > m_timeTrigGroups
Definition: TileMBTSMonitorAlgorithm.h:112
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
TileMBTSMonitorAlgorithm::m_useTrigger
Gaudi::Property< bool > m_useTrigger
Definition: TileMBTSMonitorAlgorithm.h:56
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TileMBTSMonitorAlgorithm::m_coinTrigGroups
std::vector< int > m_coinTrigGroups
Definition: TileMBTSMonitorAlgorithm.h:125
TileMBTSMonitorAlgorithm::MEMORY_PARITY
@ MEMORY_PARITY
Definition: TileMBTSMonitorAlgorithm.h:47
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TileDQstatus::isChanDQgood
bool isChanDQgood(int partition, int drawer, int ch) const
returns status of single channel (if bigain, returns AND of ADCs' status
Definition: TileDQstatus.cxx:240
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TileMBTSMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: TileMBTSMonitorAlgorithm.cxx:133
TileMBTSMonitorAlgorithm.h
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TileMBTSMonitorAlgorithm::ROD_CRC
@ ROD_CRC
Definition: TileMBTSMonitorAlgorithm.h:46
TileMBTSMonitorAlgorithm::m_tileHWID
const TileHWID * m_tileHWID
Definition: TileMBTSMonitorAlgorithm.h:131
TileFragHash.h
TileMBTSMonitorAlgorithm::m_trigInWinGroups
std::vector< int > m_trigInWinGroups
Definition: TileMBTSMonitorAlgorithm.h:123
TileMBTSMonitorAlgorithm::HEADER_FORMAT
@ HEADER_FORMAT
Definition: TileMBTSMonitorAlgorithm.h:46
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TileMBTSMonitorAlgorithm::GLOBAL_CRC
@ GLOBAL_CRC
Definition: TileMBTSMonitorAlgorithm.h:46
HWIdentifier
Definition: HWIdentifier.h:13
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileMBTSMonitorAlgorithm::m_DQstatusKey
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
Definition: TileMBTSMonitorAlgorithm.h:71
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
CTP_Decoder
Definition: CTP_Decoder.h:141
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:86
TileDQstatus::checkGlobalCRCErr
int checkGlobalCRCErr(int partition, int drawer, int gain) const
returns 1 if adc channel has global CRC error
Definition: TileDQstatus.h:80
TileMBTSMonitorAlgorithm::m_L1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
Definition: TileMBTSMonitorAlgorithm.h:95
CTP_RDO::getNumberOfBunches
uint32_t getNumberOfBunches() const
Definition: CTP_RDO.cxx:89
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
TileDQstatus::checkROD_CRCErr
int checkROD_CRCErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has CRC error originating in ROD
Definition: TileDQstatus.h:84
TileCalibUtils::MAX_DRAWER
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
Definition: TileCalibUtils.h:139
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
TileMBTSMonitorAlgorithm::m_cabling
const TileCablingService * m_cabling
Definition: TileMBTSMonitorAlgorithm.h:104
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
TileMBTSMonitorAlgorithm::MAX_MBTS_COUNTER
static const unsigned int MAX_MBTS_COUNTER
Definition: TileMBTSMonitorAlgorithm.h:136
TileDQstatus
Class that holds Data Quality fragment information and provides functions to extract the data quality...
Definition: TileDQstatus.h:49
TileMBTSMonitorAlgorithm::m_hfnGroups
std::vector< int > m_hfnGroups
Definition: TileMBTSMonitorAlgorithm.h:114
TileTBID.h
TileMBTSMonitorAlgorithm::m_MBTScounters
int m_MBTScounters[Tile::MAX_ROS - 3][Tile::MAX_DRAWER]
Definition: TileMBTSMonitorAlgorithm.h:134
TileMBTSMonitorAlgorithm::getMBTSCounter
int getMBTSCounter(Identifier mbtsID) const
Definition: TileMBTSMonitorAlgorithm.cxx:555
TileMBTSMonitorAlgorithm::GENERAL
@ GENERAL
Definition: TileMBTSMonitorAlgorithm.h:46
TileHWID.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TileMBTSMonitorAlgorithm::SAMPLE_FORMAT
@ SAMPLE_FORMAT
Definition: TileMBTSMonitorAlgorithm.h:47
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
TileMBTSMonitorAlgorithm::SAMPLE_PARITY
@ SAMPLE_PARITY
Definition: TileMBTSMonitorAlgorithm.h:47
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
TileMBTSMonitorAlgorithm::setDigiError
void setDigiError(std::vector< int > &counters, std::vector< int > &errors, int counter, int error) const
Definition: TileMBTSMonitorAlgorithm.cxx:562
TileMBTSMonitorAlgorithm::m_bcidGroups
std::vector< std::vector< int > > m_bcidGroups
Definition: TileMBTSMonitorAlgorithm.h:128
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileMBTSMonitorAlgorithm::m_pulseGroups
std::vector< int > m_pulseGroups
Definition: TileMBTSMonitorAlgorithm.h:117
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TileCablingService::drawer2MBTS_id
Identifier drawer2MBTS_id(const HWIdentifier &id) const
Definition: TileCablingService.cxx:499
SG::ReadHandle::get
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TileMBTSMonitorAlgorithm::MBTS_DMU
static const unsigned int MBTS_DMU
Definition: TileMBTSMonitorAlgorithm.h:137
CTP_BC
Definition: CTP_Decoder.h:17
CTP_Decoder::setRDO
void setRDO(const CTP_RDO *rdo)
Set RDO and fill internal variables from the data object.
Definition: CTP_Decoder.cxx:20
TileMBTSMonitorAlgorithm::m_energyTrigLBGroups
std::vector< int > m_energyTrigLBGroups
Definition: TileMBTSMonitorAlgorithm.h:109
TileDQstatus::checkHeaderFormatErr
int checkHeaderFormatErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word format error
Definition: TileDQstatus.h:113
TileMBTSMonitorAlgorithm::m_pedestalGroups
std::vector< int > m_pedestalGroups
Definition: TileMBTSMonitorAlgorithm.h:115
RunTileCalibRec.triggerTypes
triggerTypes
Definition: RunTileCalibRec.py:411
TileMBTSMonitorAlgorithm::m_energyLBGroups
std::vector< int > m_energyLBGroups
Definition: TileMBTSMonitorAlgorithm.h:107
TrigConf::L1Item
L1 threshold configuration.
Definition: L1Item.h:18
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TileMBTSMonitorAlgorithm::m_ctpRdoKey
SG::ReadHandleKey< CTP_RDO > m_ctpRdoKey
Definition: TileMBTSMonitorAlgorithm.h:80
AthMonitorAlgorithm::fill
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TileCalibUtils::MAX_ROS
static const unsigned int MAX_ROS
Number of ROSs
Definition: TileCalibUtils.h:138
TileMBTSMonitorAlgorithm::m_trigGroups
std::vector< int > m_trigGroups
Definition: TileMBTSMonitorAlgorithm.h:122
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
AthMonitorAlgorithm::GetEventInfo
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
Definition: AthMonitorAlgorithm.cxx:107
TileMBTSMonitorAlgorithm::m_MBTSchannels
int m_MBTSchannels[Tile::MAX_ROS - 3][Tile::MAX_DRAWER]
Definition: TileMBTSMonitorAlgorithm.h:133
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TileMBTSMonitorAlgorithm::FRONTEND_CRC
@ FRONTEND_CRC
Definition: TileMBTSMonitorAlgorithm.h:46
TileMBTSMonitorAlgorithm::m_deltaBCIDGroups
std::vector< std::vector< int > > m_deltaBCIDGroups
Definition: TileMBTSMonitorAlgorithm.h:127
TileMBTSMonitorAlgorithm::m_digitsContainerKey
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
Definition: TileMBTSMonitorAlgorithm.h:74
mergePhysValFiles.errors
list errors
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:43
AthMonitorAlgorithm::m_tools
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
Definition: AthMonitorAlgorithm.h:338
TileDigitsCollection
Definition: TileDigitsCollection.h:18
TileHWID::drawer_id
HWIdentifier drawer_id(int frag) const
ROS HWIdentifer.
Definition: TileHWID.cxx:187
TileDQstatus::checkSampleParityErr
int checkSampleParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word parity error
Definition: TileDQstatus.h:125
TileMBTSMonitorAlgorithm::m_energyGroups
std::vector< int > m_energyGroups
Definition: TileMBTSMonitorAlgorithm.h:106
TileDigits
Definition: TileDigits.h:30
CTP_BC::getTBP
const std::bitset< 512 > & getTBP() const
get bitset of TBP words
Definition: CTP_Decoder.h:92
TileMBTSMonitorAlgorithm::m_mbtsCellContainerKey
SG::ReadHandleKey< TileCellContainer > m_mbtsCellContainerKey
Definition: TileMBTSMonitorAlgorithm.h:77
TileDQstatus::checkHeaderParityErr
int checkHeaderParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word parity error
Definition: TileDQstatus.h:117
TileMBTSMonitorAlgorithm::m_energyTrigGroups
std::vector< int > m_energyTrigGroups
Definition: TileMBTSMonitorAlgorithm.h:108
TileMBTSMonitorAlgorithm::m_energyCut
Gaudi::Property< std::vector< float > > m_energyCut
Definition: TileMBTSMonitorAlgorithm.h:59
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
CTP_BC::getBCID
uint32_t getBCID() const
Get BCID as unsigned integer.
Definition: CTP_Decoder.cxx:294
TileMBTSMonitorAlgorithm::m_timeGroups
std::vector< int > m_timeGroups
Definition: TileMBTSMonitorAlgorithm.h:111
item
Definition: ItemListSvc.h:43
TileDQstatus::checkSampleFormatErr
int checkSampleFormatErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word format error
Definition: TileDQstatus.h:121
TileMBTSMonitorAlgorithm::start
virtual StatusCode start() override
Definition: TileMBTSMonitorAlgorithm.cxx:109
CTP_RDO::getL1AcceptBunchPosition
uint32_t getL1AcceptBunchPosition() const
Definition: CTP_RDO.cxx:94
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
TileMBTSMonitorAlgorithm::m_tileTBID
const TileTBID * m_tileTBID
Definition: TileMBTSMonitorAlgorithm.h:130
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
TileMBTSMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: TileMBTSMonitorAlgorithm.cxx:16
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TileMBTSMonitorAlgorithm::m_ctpID
Gaudi::Property< std::vector< int > > m_ctpID
Definition: TileMBTSMonitorAlgorithm.h:83
TileMBTSMonitorAlgorithm::m_trigSumGroups
std::vector< int > m_trigSumGroups
Definition: TileMBTSMonitorAlgorithm.h:124
F
#define F(x, y, z)
Definition: MD5.cxx:112
TileMBTSMonitorAlgorithm::BCID
@ BCID
Definition: TileMBTSMonitorAlgorithm.h:46
xAOD::EventInfo_v1::level1TriggerType
uint16_t level1TriggerType() const
The Level-1 trigger type.
TileTBID::phi
int phi(const Identifier &id) const
extract phi field from MBTS identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:165
TileMBTSMonitorAlgorithm::m_effTrigGroups
std::vector< int > m_effTrigGroups
Definition: TileMBTSMonitorAlgorithm.h:120
LArDigits2NtupleDumper.nSamples
nSamples
Definition: LArDigits2NtupleDumper.py:70
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
ReadHandle.h
Handle class for reading from StoreGate.
TileTBID::eta
int eta(const Identifier &id) const
extract eta field from MBTS identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:169
TileDQstatus::checkMemoryParityErr
int checkMemoryParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has memory parity error
Definition: TileDQstatus.h:129
TileDQstatus::checkFE_CRCErr
int checkFE_CRCErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has CRC error originating in FE electronics
Definition: TileDQstatus.h:88
test_pyathena.counter
counter
Definition: test_pyathena.py:15
xAOD::lumiBlock
setTeId lumiBlock
Definition: L2StandAloneMuon_v1.cxx:327
error
Definition: IImpactPoint3dEstimator.h:70
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
TileMBTSMonitorAlgorithm::m_cablingSvc
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
Definition: TileMBTSMonitorAlgorithm.h:101
TileMBTSMonitorAlgorithm::m_deltaBCIDSumGroups
std::vector< int > m_deltaBCIDSumGroups
Definition: TileMBTSMonitorAlgorithm.h:126
CTP_Decoder::getBunchCrossings
const std::vector< CTP_BC > & getBunchCrossings()
Get vector reference of bunch-crossing data of the current event.
Definition: CTP_Decoder.h:180
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
AthMonitorAlgorithm::getGroup
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
Definition: AthMonitorAlgorithm.cxx:164
plot_times.times
def times(fn)
Definition: plot_times.py:11
TileTBID::side
int side(const Identifier &id) const
define synonyms for minimum bias scintillators
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:161
TileCablingService::s2h_channel_id
HWIdentifier s2h_channel_id(const Identifier &id) const
Definition: TileCablingService.cxx:1076
TileMBTSMonitorAlgorithm::m_pulseTrigGroups
std::vector< int > m_pulseTrigGroups
Definition: TileMBTSMonitorAlgorithm.h:118
TileMBTSMonitorAlgorithm::m_l1Triggers
Gaudi::Property< std::vector< std::string > > m_l1Triggers
Definition: TileMBTSMonitorAlgorithm.h:86
TileMBTSMonitorAlgorithm::m_fillHistogramsPerMBTS
Gaudi::Property< bool > m_fillHistogramsPerMBTS
Definition: TileMBTSMonitorAlgorithm.h:53
Identifier
Definition: IdentifierFieldParser.cxx:14