ATLAS Offline Software
L1TopoOnlineMonitor.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Local includes
6 #include "L1TopoOnlineMonitor.h"
7 
8 // Trigger includes
11 #include "L1TopoRDO/Helpers.h"
12 #include "L1TopoRDO/L1TopoROD.h"
13 #include "L1TopoRDO/L1TopoFPGA.h"
14 #include "L1TopoRDO/L1TopoResult.h"
15 
16 // System includes
17 #include <utility>
18 
19 
20 // Local helper constants and functions
21 namespace {
23  template<size_t N>
24  std::vector<size_t> bitsetIndices(const std::bitset<N>& bits) {
25  std::vector<size_t> indices;
26  indices.reserve(bits.count());
27  for (size_t i=0; i<bits.size(); ++i) {
28  if (bits[i]) indices.push_back(i);
29  }
30  return indices;
31  }
32 }
33 
34 // =============================================================================
35 // Standard constructor
36 // =============================================================================
37 L1TopoOnlineMonitor::L1TopoOnlineMonitor(const std::string& name, ISvcLocator* svcLoc)
38  : AthMonitorAlgorithm(name, svcLoc),
39  m_ctpIds(0)
40 {}
41 
42 // =============================================================================
43 // Implementation of AthReentrantAlgorithm::initialize
44 // =============================================================================
46 
47  m_rateHdwNotSim.reset(new float[s_nTopoCTPOutputs]);
48  m_rateSimNotHdw.reset(new float[s_nTopoCTPOutputs]);
49  m_rateHdwAndSim.reset(new float[s_nTopoCTPOutputs]);
50  m_rateHdwSim.reset(new float[s_nTopoCTPOutputs]);
51  m_countHdwNotSim.reset(new float[s_nTopoCTPOutputs]);
52  m_countSimNotHdw.reset(new float[s_nTopoCTPOutputs]);
53  m_countHdwSim.reset(new float[s_nTopoCTPOutputs]);
54  m_countHdw.reset(new float[s_nTopoCTPOutputs]);
55  m_countSim.reset(new float[s_nTopoCTPOutputs]);
56  m_countAny.reset(new float[s_nTopoCTPOutputs]);
60  m_overflow_rateHdwSim.reset(new float[s_nTopoCTPOutputs]);
63  m_overflow_countHdwSim.reset(new float[s_nTopoCTPOutputs]);
64  m_overflow_countHdw.reset(new float[s_nTopoCTPOutputs]);
65  m_overflow_countSim.reset(new float[s_nTopoCTPOutputs]);
66  m_overflow_countAny.reset(new float[s_nTopoCTPOutputs]);
67 
68  for (size_t i=0;i<s_nTopoCTPOutputs;i++){
69  m_rateHdwNotSim[i] = 0;
70  m_rateSimNotHdw[i] = 0;
71  m_rateHdwAndSim[i] = 0;
72  m_rateHdwSim[i] = 0;
73  m_countHdwNotSim[i] = 0;
74  m_countSimNotHdw[i] = 0;
75  m_countHdwSim[i] = 0;
76  m_countHdw[i] = 0;
77  m_countSim[i] = 0;
78  m_countAny[i] = 0;
89  }
90 
91  ATH_CHECK(m_l1topoKey.initialize());
94  ATH_CHECK(m_monTool.retrieve(DisableTool{m_monTool.name().empty()}));
95  ATH_CHECK(m_errorFlagsKey.initialize());
96 
98 }
99 
101 
102  const TrigConf::L1Menu * l1menu = nullptr;
103  ATH_CHECK( m_detStore->retrieve(l1menu) );
104 
106 
108 
109  return StatusCode::SUCCESS;
110 }
111 
112 
113 StatusCode L1TopoOnlineMonitor::fillHistograms( const EventContext& ctx ) const {
114 
115  // Create and record the ErrorFlags container
117  ATH_CHECK(errorFlagsCont.record(std::make_unique<xAOD::TrigCompositeContainer>(),
118  std::make_unique<xAOD::TrigCompositeAuxContainer>()));
119  ATH_MSG_DEBUG("Recorded TrigCompositeContainer with key " << m_errorFlagsKey.key());
120 
121  // Create the ErrorFlags object
122  errorFlagsCont->push_back(new xAOD::TrigComposite);
123  xAOD::TrigComposite& errorFlags = *(errorFlagsCont->back());
124  resetFlags(errorFlags);
125 
126 
127  DecisionBits decisionBits{};
128  enum class MonFunction : uint8_t {doSimMon=0, doHwMonCTP, doHwMon, doComp, doMultComp};
129  std::vector<uint8_t> failedMonFunctions;
130  std::vector<std::vector<unsigned>> multWeightsSim;
131  std::vector<std::vector<unsigned>> multWeightsHdw;
132 
133 
134  if (m_doHwMon) {
135  StatusCode sc = doHwMon(decisionBits,multWeightsHdw,ctx);
136  ATH_MSG_DEBUG("Executed doHWMon: " << (sc.isFailure() ? "failed" : "ok"));
137  if (sc.isFailure()) {
138  failedMonFunctions.push_back(static_cast<uint8_t>(MonFunction::doHwMon));
139  }
140  }
141 
142  if (m_doHwMonCTP) {
143  StatusCode sc = doHwMonCTP(decisionBits,ctx);
144  ATH_MSG_DEBUG("Executed doHWMonCTP: " << (sc.isFailure() ? "failed" : "ok"));
145  if (sc.isFailure()) {
146  failedMonFunctions.push_back(static_cast<uint8_t>(MonFunction::doHwMonCTP));
147  }
148  }
149 
150  if (m_doSimMon) {
151  StatusCode sc = doSimMon(decisionBits,multWeightsSim,ctx);
152  ATH_MSG_DEBUG("Executed doSimMon: " << (sc.isFailure() ? "failed" : "ok"));
153  if (sc.isFailure()) {
154  failedMonFunctions.push_back(static_cast<uint8_t>(MonFunction::doSimMon));
155  }
156  }
157 
158  if (m_doComp) {
159  StatusCode sc = doComp(decisionBits);
160  ATH_MSG_DEBUG("Executed doComp: " << (sc.isFailure() ? "failed" : "ok"));
161  if (sc.isFailure()) {
162  failedMonFunctions.push_back(static_cast<uint8_t>(MonFunction::doComp));
163  }
164  }
165 
166  if (m_doMultComp) {
167  StatusCode sc = doMultComp(multWeightsSim,multWeightsHdw);
168  ATH_MSG_DEBUG("Executed doMultComp: " << (sc.isFailure() ? "failed" : "ok"));
169  if (sc.isFailure()) {
170  failedMonFunctions.push_back(static_cast<uint8_t>(MonFunction::doMultComp));
171  }
172  }
173 
174  auto monFailedMonFunctions = Monitored::Collection("MonitoringFailures", failedMonFunctions);
175  Monitored::Group(m_monTool, monFailedMonFunctions);
176 
177  return StatusCode::SUCCESS;
178 }
179 
180 
181 StatusCode L1TopoOnlineMonitor::doSimMon( DecisionBits& decisionBits, std::vector<std::vector<unsigned>> &multWeights, const EventContext& ctx ) const {
182 
183 
185  if(!cont.isValid()){
186  ATH_MSG_FATAL("Could not retrieve L1Topo EDM Container from the Simulation.");
187  return StatusCode::FAILURE;
188  }
189 
190  ATH_MSG_DEBUG("----got L1Topo container: " << cont.key());
191 
192  std::bitset<s_nTopoCTPOutputs>& triggerBitsSim = DecisionBits::createBits(decisionBits.triggerBitsSim);
193  std::bitset<s_nTopoCTPOutputs>& overflowBitsSim = DecisionBits::createBits(decisionBits.overflowBitsSim);
194  std::bitset<s_nTopoCTPOutputs>& ambiguityBitsSim = DecisionBits::createBits(decisionBits.ambiguityBitsSim);
195  std::unordered_map<unsigned,std::bitset<s_nTopoCTPOutputs>> multWeightsMap;
196  for(const auto l1topo_dec : * cont){
197  ATH_MSG_DEBUG( "Reading L1Topo EDM:: Connection ID: " << l1topo_dec->connectionId() << " Clock: " << l1topo_dec->clock() << " Bit-length: " << l1topo_dec->bitWidth() << " Word: " << l1topo_dec->topoWord() << " Word64: " << l1topo_dec->topoWord64() );
198 
199  if (l1topo_dec->bitWidth() == 32) {
200  std::vector<unsigned> topoword;
201  std::vector<unsigned> topowordOverflow;
202  for(unsigned int i=0; i<32; ++i) {
203  uint32_t mask = 0x1; mask <<= i;
204  if ((l1topo_dec->topoWord() & mask) !=0) {
205  if (l1topo_dec->connectionId()==2 || l1topo_dec->connectionId()==3) { // TOPO2EL and TOPO3EL (L1TopoCommon/Types.h)
206  topoword.push_back(32*l1topo_dec->clock()+i);
207  uint32_t pos = 32*(l1topo_dec->clock()+(l1topo_dec->connectionId()==2 ? 0 : 2))+i;
208  triggerBitsSim[pos] = ((!decisionBits.triggerBits.has_value() || m_forceCTPasHdw) && m_ctpIds[pos]>=512) ? false : true;
209  }
210  if (l1topo_dec->connectionId()==22 || l1topo_dec->connectionId()==23) { // AMBIGUITYTOPO2EL and AMBIGUITYTOPO3EL
211  uint32_t pos_ambiguity = 32*(l1topo_dec->clock()+(l1topo_dec->connectionId()==22 ? 0 : 2))+i;
212  ambiguityBitsSim[pos_ambiguity] = ((!decisionBits.ambiguityBitsSim.has_value() || m_forceCTPasHdw) && m_ctpIds[pos_ambiguity]>=512) ? false : true;
213  }
214  }
215  if ((l1topo_dec->topoWordOverflow() & mask) !=0) {
216  topowordOverflow.push_back(32*l1topo_dec->clock()+i);
217  uint32_t pus = 32*(l1topo_dec->clock()+(l1topo_dec->connectionId()==12 ? 0 : 2))+i;
218  overflowBitsSim[pus] = ((!decisionBits.overflowBitsSim.has_value() || m_forceCTPasHdw) && m_ctpIds[pus]>=512) ? false : true;
219  }
220  }
221  std::string name = "CableElec_";
222  name += std::to_string(l1topo_dec->connectionId());
223  auto monTopoDec = Monitored::Collection(name, topoword);
224  Monitored::Group(m_monTool,monTopoDec);
225  }
226  else if (l1topo_dec->bitWidth() == 64) {
227  for (size_t i=0;i<64;i++) {
228  unsigned index = i+l1topo_dec->clock()*64;
229  uint64_t mask = 0x1; mask <<= i;
230  if ((l1topo_dec->topoWord64() & mask) !=0) {
231  multWeightsMap[static_cast<unsigned>(l1topo_dec->connectionId() - 4)].set(index);
232  }
233  }
234  }
235  else {
236  ATH_MSG_DEBUG( "Unknown Bit-length: " << l1topo_dec->bitWidth() );
237  return StatusCode::FAILURE;
238  }
239  }
240 
241  for (unsigned key=0;key<4;key++) {
242  std::vector<unsigned> vecCount, vecIndices;
243  unsigned indices = 0;
244  for (auto startbit : m_startbit[key]) {
245  unsigned count = 0;
246  for (size_t i=0;i<startbit.second;i++){
247  if (multWeightsMap[key][startbit.first+i]) {
248  count += 1 * pow(2,i);
249  }
250  }
251  vecCount.push_back(count);
252  vecIndices.push_back(indices);
253  indices++;
254  }
255  multWeights.push_back(vecCount);
256  std::string name = "CableOpti_"+std::to_string(key);
257  auto monMult = Monitored::Collection(name, vecIndices);
258  auto monMultWeight = Monitored::Collection(name+"_weight", vecCount);
259  Monitored::Group(m_monTool,monMult,monMultWeight);
260  }
261 
262  std::vector<size_t> triggerBitIndicesSim = bitsetIndices(triggerBitsSim);
263  std::vector<size_t> overflowBitIndicesSim = bitsetIndices(overflowBitsSim);
264  std::vector<size_t> ambiguityBitIndicesSim = bitsetIndices(ambiguityBitsSim);
265  auto monTopoSim = Monitored::Collection("TopoSim", triggerBitIndicesSim);
266  auto monTopoSimOverflow = Monitored::Collection("TopoSim_overflows", overflowBitIndicesSim);
267  auto monTopoSimAmbiguity = Monitored::Collection("TopoSim_ambiguity", ambiguityBitIndicesSim);
268  Monitored::Group(m_monTool,monTopoSim);
269  Monitored::Group(m_monTool,monTopoSimOverflow);
270  Monitored::Group(m_monTool,monTopoSimAmbiguity);
271 
272  return StatusCode::SUCCESS;
273 }
274 
275 StatusCode L1TopoOnlineMonitor::doHwMonCTP( DecisionBits& decisionBits, const EventContext& ctx ) const {
276 
277  // Retrieve CTP DAQ data for comparison
279  if (!ctpRdo.isValid()) {
280  ATH_MSG_DEBUG("Failed to retrieve CTP_RDO object (converted from CTP DAQ ROB) with key \""
281  << m_ctpRdoKey.key() << "\". Skipping CTP hardware comparison");
282  return StatusCode::FAILURE;
283  }
284 
285  // CTP RDO contains 17 TBP words for a number of BCs, so use CTP_Decoder to access accepted BC
287  ctp.setRDO(ctpRdo.cptr());
288  const uint32_t l1aPos = ctpRdo->getL1AcceptBunchPosition();
289  if (l1aPos >= ctp.getBunchCrossings().size()) {
290  ATH_MSG_DEBUG("CTP_RDO gave invalid l1aPos. Skipping CTP hardware comparison");
291  return StatusCode::FAILURE;
292  }
293  ATH_MSG_DEBUG("CTP l1aPos, size: " << l1aPos << ", " << ctp.getBunchCrossings().size());
294  const CTP_BC& ctpL1a = ctp.getBunchCrossings().at(l1aPos);
295 
296  // Fill decision bits from CTP RDO
297  std::bitset<s_nTopoCTPOutputs>& triggerBitsCtp = DecisionBits::createBits(decisionBits.triggerBitsCtp);
298  static constexpr size_t ctpTBPSize{512};
299  const std::bitset<ctpTBPSize>& tbp = ctpL1a.getTBP();
300  ATH_MSG_VERBOSE("CTP TBP bits: " << tbp.to_string());
301 
302  for (size_t i=0; i<s_nTopoCTPOutputs; ++i) {
303  if (m_ctpIds[i] < 512)
304  {triggerBitsCtp[i] = tbp.test(m_ctpIds[i]);}
305  else
306  {triggerBitsCtp[i] = false;}
307  }
308 
309  std::vector<size_t> triggerBitIndicesCtp = bitsetIndices(triggerBitsCtp);
310  auto monTopoCtp = Monitored::Collection("TopoCTP", triggerBitIndicesCtp);
311  Monitored::Group(m_monTool,monTopoCtp);
312 
313  return StatusCode::SUCCESS;
314 }
315 
316 StatusCode L1TopoOnlineMonitor::doHwMon( DecisionBits& decisionBits, std::vector<std::vector<unsigned>> &multWeights, const EventContext& ctx ) const {
317 
319  if(!cont.isValid()){
320  ATH_MSG_WARNING("Could not retrieve L1Topo RAW Data Container from the BS data.");
321  return StatusCode::FAILURE;
322  }
323 
324  ATH_MSG_DEBUG("----got L1Topo Raw Data container: " << cont.key());
325 
326  std::bitset<s_nTopoCTPOutputs>& triggerBits = DecisionBits::createBits(decisionBits.triggerBits);
327  std::bitset<s_nTopoCTPOutputs>& overflowBits = DecisionBits::createBits(decisionBits.overflowBits);
328 
329  std::unique_ptr<L1Topo::L1TopoResult> l1topoResult = std::make_unique<L1Topo::L1TopoResult>(*cont);
330  if (!l1topoResult->getStatus()) {
331  ATH_MSG_WARNING("Decoding L1Topo results failed!!");
332  return StatusCode::FAILURE;
333  }
334 
335  if (m_doHwErrorMon){
336  // Error monitoring ---------------------------------------------------------
337  enum class MonFunction : uint8_t {doRODct, doRODpc, doRODhc, doRODpe, doRODlm, doRODhm, doRODpt};
338  std::vector<uint8_t> rodErrors;
339  if (l1topoResult->getROD(0)->ct() != 0) { rodErrors.push_back(static_cast<uint8_t>(MonFunction::doRODct)); }
340  if (l1topoResult->getROD(0)->pc() != 0) { rodErrors.push_back(static_cast<uint8_t>(MonFunction::doRODpc)); }
341  if (l1topoResult->getROD(0)->hc() != 0) { rodErrors.push_back(static_cast<uint8_t>(MonFunction::doRODhc)); }
342  if (l1topoResult->getROD(0)->pe() != 0) { rodErrors.push_back(static_cast<uint8_t>(MonFunction::doRODpe)); }
343  if (l1topoResult->getROD(0)->lm() != 0) { rodErrors.push_back(static_cast<uint8_t>(MonFunction::doRODlm)); }
344  if (l1topoResult->getROD(0)->hm() != 0) { rodErrors.push_back(static_cast<uint8_t>(MonFunction::doRODhm)); }
345  if (l1topoResult->getROD(0)->pt() != 0) { rodErrors.push_back(static_cast<uint8_t>(MonFunction::doRODpt)); }
346  auto monErrorsROD = Monitored::Collection("ROD_Errors", rodErrors);
347  Monitored::Group(m_monTool, monErrorsROD);
348  }
349 
350  for (unsigned i=0;i<l1topoResult->getFPGASize();i++) {
351  unsigned topoNumber = l1topoResult->getFPGA(i)->topoNumber();
352  unsigned fpgaNumber = l1topoResult->getFPGA(i)->fpgaNumber();
353 
354  auto mon_fpga_error = Monitored::Scalar<unsigned>("FPGA_Errors");
355  auto mon_fpga_labels = Monitored::Scalar("FPGA_Labels", (topoNumber*2)-fpgaNumber-1);
356 
357  if (l1topoResult->getFPGA(i)->ct() != 0) {
358  mon_fpga_error = 0;
359  Monitored::Group(m_monTool, mon_fpga_error, mon_fpga_labels);
360  }
361  if (l1topoResult->getFPGA(i)->sm() != 0) {
362  mon_fpga_error = 1;
363  Monitored::Group(m_monTool, mon_fpga_error, mon_fpga_labels);
364  }
365  if (l1topoResult->getFPGA(i)->pe() != 0) {
366  mon_fpga_error = 2;
367  Monitored::Group(m_monTool, mon_fpga_error, mon_fpga_labels);
368  }
369  if (l1topoResult->getFPGA(i)->lm() != 0) {
370  mon_fpga_error = 3;
371  Monitored::Group(m_monTool, mon_fpga_error, mon_fpga_labels);
372  }
373  if (l1topoResult->getFPGA(i)->hm() != 0) {
374  mon_fpga_error = 4;
375  Monitored::Group(m_monTool, mon_fpga_error, mon_fpga_labels);
376  }
377  if (l1topoResult->getFPGA(i)->pt() != 0) {
378  mon_fpga_error = 5;
379  Monitored::Group(m_monTool, mon_fpga_error, mon_fpga_labels);
380  }
381  }
382 
383  // Multiplicities ---------------------------------------------------------
384  std::vector<unsigned> topo1Opt0,topo1Opt1,topo1Opt2,topo1Opt3;
385  std::vector<unsigned> topo1Opt0Indices,topo1Opt1Indices,topo1Opt2Indices,topo1Opt3Indices;
386 
387  unsigned indices=0;
388  for (auto startbit : m_startbit[0]) {
389  unsigned count = 0;
390  for (size_t i=0;i<startbit.second;i++){
391  if (l1topoResult->getTopo1Opt0()[startbit.first+i]) {
392  count += 1 * pow(2,i);
393  }
394  }
395  topo1Opt0.push_back(count);
396  topo1Opt0Indices.push_back(indices);
397  indices++;
398  }
399  indices=0;
400  for (auto startbit : m_startbit[1]) {
401  unsigned count = 0;
402  for (size_t i=0;i<startbit.second;i++){
403  if (l1topoResult->getTopo1Opt1()[startbit.first+i]) {
404  count += 1 * pow(2,i);
405  }
406  }
407  topo1Opt1.push_back(count);
408  topo1Opt1Indices.push_back(indices);
409  indices++;
410  }
411  indices=0;
412  for (auto startbit : m_startbit[2]) {
413  unsigned count = 0;
414  for (size_t i=0;i<startbit.second;i++){
415  if (l1topoResult->getTopo1Opt2()[startbit.first+i]) {
416  count += 1 * pow(2,i);
417  }
418  }
419  topo1Opt2.push_back(count);
420  topo1Opt2Indices.push_back(indices);
421  indices++;
422  }
423  indices=0;
424  for (auto startbit : m_startbit[3]) {
425  unsigned count = 0;
426  for (size_t i=0;i<startbit.second;i++){
427  if (l1topoResult->getTopo1Opt3()[startbit.first+i]) {
428  count += 1 * pow(2,i);
429  }
430  }
431  topo1Opt3.push_back(count);
432  topo1Opt3Indices.push_back(indices);
433  indices++;
434  }
435 
436  auto monTopo1Opt0 = Monitored::Collection("HdwTopo1Opt0", topo1Opt0Indices);
437  auto monTopo1Opt0Weight = Monitored::Collection("HdwTopo1Opt0_weight", topo1Opt0);
438  Monitored::Group(m_monTool, monTopo1Opt0, monTopo1Opt0Weight);
439  multWeights.push_back(topo1Opt0);
440 
441  auto monTopo1Opt1 = Monitored::Collection("HdwTopo1Opt1", topo1Opt1Indices);
442  auto monTopo1Opt1Weight = Monitored::Collection("HdwTopo1Opt1_weight", topo1Opt1);
443  Monitored::Group(m_monTool, monTopo1Opt1, monTopo1Opt1Weight);
444  multWeights.push_back(topo1Opt1);
445 
446  auto monTopo1Opt2 = Monitored::Collection("HdwTopo1Opt2", topo1Opt2Indices);
447  auto monTopo1Opt2Weight = Monitored::Collection("HdwTopo1Opt2_weight", topo1Opt2);
448  Monitored::Group(m_monTool, monTopo1Opt2, monTopo1Opt2Weight);
449  multWeights.push_back(topo1Opt2);
450 
451  auto monTopo1Opt3 = Monitored::Collection("HdwTopo1Opt3", topo1Opt3Indices);
452  auto monTopo1Opt3Weight = Monitored::Collection("HdwTopo1Opt3_weight", topo1Opt3);
453  Monitored::Group(m_monTool, monTopo1Opt3, monTopo1Opt3Weight);
454  multWeights.push_back(topo1Opt3);
455 
456  // Decisions ---------------------------------------------------------------
457  triggerBits = l1topoResult->getDecisions();
458  overflowBits = l1topoResult->getOverflows();
459 
460  const std::vector<size_t> triggerBitIndicesHdw = bitsetIndices(triggerBits);
461  const std::vector<size_t> overflowBitIndicesHdw = bitsetIndices(overflowBits);
462 
463  ATH_MSG_VERBOSE("trigger bits: " << triggerBits.to_string() );
464  ATH_MSG_VERBOSE("overflow bits: " << overflowBits.to_string() );
465 
466  auto monHdw = Monitored::Collection("HdwResults", triggerBitIndicesHdw);
467  auto monOverflow = Monitored::Collection("OverflowResults", overflowBitIndicesHdw);
468 
469  Monitored::Group(m_monTool, monHdw, monOverflow);
470 
471  return StatusCode::SUCCESS;
472 }
473 
475  if (!decisionBits.triggerBitsSim.has_value()) {
476  ATH_MSG_DEBUG("Simulation bits not set. Skipping simulation to hardware comparison");
477  return StatusCode::FAILURE;
478  }
479 
480  std::bitset<s_nTopoCTPOutputs> triggerBitsSim = decisionBits.triggerBitsSim.value(); // Alias
481  std::bitset<s_nTopoCTPOutputs> triggerBitsHdw;
482 
483  if (decisionBits.triggerBits.has_value() && !m_forceCTPasHdw)
484  {triggerBitsHdw = decisionBits.triggerBits.value();}
485  else if (decisionBits.triggerBitsCtp.has_value())
486  {triggerBitsHdw = decisionBits.triggerBitsCtp.value();}
487  else {
488  ATH_MSG_DEBUG("Hardware bits not set. Skipping simulation to hardware comparison");
489  return StatusCode::FAILURE;
490  }
491 
492  std::bitset<s_nTopoCTPOutputs> triggerBitsSimNotHdw = triggerBitsSim & (~triggerBitsHdw);
493  std::bitset<s_nTopoCTPOutputs> triggerBitsHdwNotSim = triggerBitsHdw & (~triggerBitsSim);
494  std::bitset<s_nTopoCTPOutputs> triggerBitsHdwSim = triggerBitsHdw & triggerBitsSim;
495  std::bitset<s_nTopoCTPOutputs> triggerBitsAny = triggerBitsHdw | triggerBitsSim;
496 
497  std::bitset<s_nTopoCTPOutputs>& overflowBitsSim = decisionBits.overflowBitsSim.value();
498  std::bitset<s_nTopoCTPOutputs>& overflowBitsHdw = decisionBits.overflowBits.value();
499  std::bitset<s_nTopoCTPOutputs> overflowBitsSimNotHdw = overflowBitsSim & (~overflowBitsHdw);
500  std::bitset<s_nTopoCTPOutputs> overflowBitsHdwNotSim = overflowBitsHdw & (~overflowBitsSim);
501  std::bitset<s_nTopoCTPOutputs> overflowBitsHdwSim = overflowBitsHdw & overflowBitsSim;
502  std::bitset<s_nTopoCTPOutputs> overflowBitsAny = overflowBitsHdw | overflowBitsSim;
503 
504  std::bitset<s_nTopoCTPOutputs>& ambiguityBitsSim = decisionBits.ambiguityBitsSim.value();
505  std::bitset<s_nTopoCTPOutputs> ambiguitySimANDHdw = ambiguityBitsSim & triggerBitsHdwSim;
506  std::bitset<s_nTopoCTPOutputs> ambiguityMismatch = ambiguityBitsSim & (triggerBitsSimNotHdw | triggerBitsHdwNotSim);
507 
508  std::vector<size_t> triggerBitIndicesSimNotHdw = bitsetIndices(triggerBitsSimNotHdw);
509  std::vector<size_t> triggerBitIndicesHdwNotSim = bitsetIndices(triggerBitsHdwNotSim);
510  std::vector<size_t> ambiguitySimANDHdwBitIndices = bitsetIndices(ambiguitySimANDHdw);
511  std::vector<size_t> ambiguityMismatchBitIndices = bitsetIndices(ambiguityMismatch);
512  auto monSimNotHdw = Monitored::Collection("SimNotHdwL1TopoResult", triggerBitIndicesSimNotHdw);
513  auto monHdwNotSim = Monitored::Collection("HdwNotSimL1TopoResult", triggerBitIndicesHdwNotSim);
514  auto monAmbiguitySimANDHdw = Monitored::Collection("Ambiguity_SimANDHdwDecisions", ambiguitySimANDHdwBitIndices);
515  auto monAmbiguityMismatch = Monitored::Collection("Ambiguity_DecisionMismatches", ambiguityMismatchBitIndices);
516 
517  Monitored::Group(m_monTool, monSimNotHdw, monHdwNotSim, monAmbiguitySimANDHdw, monAmbiguityMismatch);
518 
519  float rate=0;
520  float rate_overflow=0;
521  for (size_t i=0;i<4;i++) {
522  auto mon_trig = Monitored::Scalar<unsigned>("Phase1TopoTrigger_"+std::to_string(i));
523  auto mon_match = Monitored::Scalar<unsigned>("Phase1TopoMissMatch_"+std::to_string(i));
524  auto mon_weight = Monitored::Scalar<float>("Phase1TopoWeight_"+std::to_string(i));
525  auto mon_OFweight = Monitored::Scalar<float>("Phase1TopoOFWeight_"+std::to_string(i));
526  for (size_t j=0;j<32;j++) {
527  if (ambiguityBitsSim[32*i+j] == 0) {
528  mon_trig = static_cast<unsigned>(j);
529  if (overflowBitsHdw[32*i+j] == 1 || overflowBitsSim[32*i+j] == 1) {
530  m_overflow_countHdwNotSim[32*i+j]+=overflowBitsHdwNotSim[32*i+j];
531  m_overflow_countSimNotHdw[32*i+j]+=overflowBitsSimNotHdw[32*i+j];
532  m_overflow_countHdwSim[32*i+j]+=overflowBitsHdwSim[32*i+j];
533  m_overflow_countHdw[32*i+j]+=overflowBitsHdw[32*i+j];
534  m_overflow_countSim[32*i+j]+=overflowBitsSim[32*i+j];
535  m_overflow_countAny[32*i+j]+=overflowBitsAny[32*i+j];
536  }
537  else {
538  m_countHdwNotSim[32*i+j]+=triggerBitsHdwNotSim[32*i+j];
539  m_countSimNotHdw[32*i+j]+=triggerBitsSimNotHdw[32*i+j];
540  m_countHdwSim[32*i+j]+=triggerBitsHdwSim[32*i+j];
541  m_countHdw[32*i+j]+=triggerBitsHdw[32*i+j];
542  m_countSim[32*i+j]+=triggerBitsSim[32*i+j];
543  m_countAny[32*i+j]+=triggerBitsAny[32*i+j];
544  }
545  rate = m_countHdw[32*i+j]>0 ? m_countHdwNotSim[32*i+j]/m_countHdw[32*i+j] : 0;
546  if (rate != m_rateHdwNotSim[32*i+j]) {
547  mon_match = 0;
548  mon_weight = rate-m_rateHdwNotSim[32*i+j];
549  m_rateHdwNotSim[32*i+j] = rate;
550  Monitored::Group(m_monTool, mon_trig, mon_match, mon_weight);
551  }
552  rate_overflow = m_overflow_countHdw[32*i+j]>0 ? m_overflow_countHdwNotSim[32*i+j]/m_overflow_countHdw[32*i+j] : 0;
553  if (rate_overflow != m_overflow_rateHdwNotSim[32*i+j]) {
554  mon_match = 0;
555  mon_OFweight = rate_overflow-m_overflow_rateHdwNotSim[32*i+j];
556  m_overflow_rateHdwNotSim[32*i+j] = rate_overflow;
557  Monitored::Group(m_monTool, mon_trig, mon_match, mon_OFweight);
558  }
559  rate = m_countSim[32*i+j]>0 ? m_countSimNotHdw[32*i+j]/m_countSim[32*i+j] : 0;
560  if (rate != m_rateSimNotHdw[32*i+j]) {
561  mon_match = 1;
562  mon_weight = rate-m_rateSimNotHdw[32*i+j];
563  m_rateSimNotHdw[32*i+j] = rate;
564  Monitored::Group(m_monTool, mon_trig, mon_match, mon_weight);
565  }
566  rate_overflow = m_overflow_countSim[32*i+j]>0 ? m_overflow_countSimNotHdw[32*i+j]/m_overflow_countSim[32*i+j] : 0;
567  if (rate_overflow != m_overflow_rateSimNotHdw[32*i+j]) {
568  mon_match = 1;
569  mon_OFweight = rate_overflow-m_overflow_rateSimNotHdw[32*i+j];
570  m_overflow_rateSimNotHdw[32*i+j] = rate_overflow;
571  Monitored::Group(m_monTool, mon_trig, mon_match, mon_OFweight);
572  }
573  rate = m_countAny[32*i+j]>0 ? m_countHdwSim[32*i+j]/m_countAny[32*i+j] : 0;
574  if (rate != m_rateHdwAndSim[32*i+j]) {
575  mon_match = 2;
576  mon_weight = rate-m_rateHdwAndSim[32*i+j];
577  m_rateHdwAndSim[32*i+j] = rate;
578  Monitored::Group(m_monTool, mon_trig, mon_match, mon_weight);
579  }
580  rate_overflow = m_overflow_countAny[32*i+j]>0 ? m_overflow_countHdwSim[32*i+j]/m_overflow_countAny[32*i+j] : 0;
581  if (rate_overflow != m_overflow_rateHdwAndSim[32*i+j]) {
582  mon_match = 2;
583  mon_OFweight = rate_overflow-m_overflow_rateHdwAndSim[32*i+j];
584  m_overflow_rateHdwAndSim[32*i+j] = rate_overflow;
585  Monitored::Group(m_monTool, mon_trig, mon_match, mon_OFweight);
586  }
587  rate = m_countSim[32*i+j]>0 ? m_countHdw[32*i+j]/m_countSim[32*i+j] : 0;
588  if (rate != m_rateHdwSim[32*i+j]) {
589  mon_match = 3;
590  mon_weight = rate-m_rateHdwSim[32*i+j];
591  m_rateHdwSim[32*i+j] = rate;
592  Monitored::Group(m_monTool, mon_trig, mon_match, mon_weight);
593  }
594  rate_overflow = m_overflow_countSim[32*i+j]>0 ? m_overflow_countHdw[32*i+j]/m_overflow_countSim[32*i+j] : 0;
595  if (rate_overflow != m_overflow_rateHdwSim[32*i+j]) {
596  mon_match = 3;
597  mon_OFweight = rate_overflow-m_overflow_rateHdwSim[32*i+j];
598  m_overflow_rateHdwSim[32*i+j] = rate_overflow;
599  Monitored::Group(m_monTool, mon_trig, mon_match, mon_OFweight);
600  }
601  }
602  }
603  }
604  return StatusCode::SUCCESS;
605 }
606 
607 StatusCode L1TopoOnlineMonitor::doMultComp( std::vector<std::vector<unsigned>> &multWeightsSim, std::vector<std::vector<unsigned>> &multWeightsHdw ) const {
608  if (multWeightsSim.size() == 0 or multWeightsHdw.size() == 0) {
609  ATH_MSG_DEBUG("Multiplicities not set, skipping multiplicities comparison");
610  return StatusCode::FAILURE;
611  }
612 
613  for (size_t i=0;i<multWeightsSim.size();i++) {
614  auto mon_multiplicity = Monitored::Scalar<unsigned>("MultiplicityTopo1Opt" + std::to_string(i));
615  auto mon_match = Monitored::Scalar<unsigned>("MultiplicityMatchTopo1Opt" + std::to_string(i));
616  for (size_t k=0;k<multWeightsSim[i].size();k++) {
617  std::string colName = "Topo1Opt" + std::to_string(i) + "_" + std::to_string(k);
618  auto monMultSim = Monitored::Scalar<unsigned>(colName+"_Sim", multWeightsSim[i][k]);
619  auto monMultHdw = Monitored::Scalar<unsigned>(colName+"_Hdw", multWeightsHdw[i][k]);
620  Monitored::Group(m_monTool, monMultSim, monMultHdw);
621  if (monMultSim < monMultHdw) mon_match = 0;
622  if (monMultSim > monMultHdw) mon_match = 1;
623  if (monMultSim == monMultHdw) mon_match = 2;
624  mon_multiplicity = static_cast<unsigned>(k);
625  Monitored::Group(m_monTool, mon_multiplicity, mon_match);
626  }
627  }
628  return StatusCode::SUCCESS;
629 }
630 
631 std::vector<std::vector<std::pair<unsigned,unsigned>>> L1TopoOnlineMonitor::getStartBits( const TrigConf::L1Menu& l1menu ) {
632 
633  std::vector<std::vector<std::pair<unsigned,unsigned>>> startbit_vec;
634  std::vector<std::string> connNames = l1menu.connectorNames();
635  for( const std::string connName : {"Topo1Opt0", "Topo1Opt1", "Topo1Opt2", "Topo1Opt3"}) {
636  if( find(connNames.begin(), connNames.end(), connName) == connNames.end() ) {
637  continue;
638  }
639  std::vector<std::pair<unsigned,unsigned>> startbit;
640  for(auto & t1 : l1menu.connector(connName).triggerLines()) {
641  startbit.push_back(std::make_pair(t1.startbit(),t1.nbits()));
642  }
643  startbit_vec.push_back(startbit);
644  }
645  return startbit_vec;
646 }
647 //
648 
649 std::vector<unsigned> L1TopoOnlineMonitor::getCtpIds( const TrigConf::L1Menu& l1menu ) {
650 
651  // Topo
652  std::vector<std::string> connNames = l1menu.connectorNames();
653  std::vector<std::string> labelsTopoEl(s_nTopoCTPOutputs);
654  for( const std::string connName : {"Topo2El", "Topo3El"}) {
655  if( find(connNames.begin(), connNames.end(), connName) == connNames.end() ) {
656  continue;
657  }
658  for(uint fpga : {0,1}) {
659  for(uint clock : {0,1}) {
660  for(auto & tl : l1menu.connector(connName).triggerLines(fpga,clock)) {
661  uint flatIndex = tl.flatindex() + 64 * (connName == "Topo3El");
662  labelsTopoEl[flatIndex] = tl.name();
663  }
664  }
665  }
666  }
667 
668  ATH_MSG_DEBUG("Obtaining CTPIds for Phase1 L1Topo Monitoring");
669  std::vector<unsigned> ctpIds(s_nTopoCTPOutputs,999);
670  for( const auto & item : l1menu ) {
671  std::string definition = item.definition();
672  if (definition.substr(0,5) == "TOPO_" &&
673  definition.find(' ') == std::string::npos) {
674  std::string trigger = definition.substr(0, definition.find('['));
675  auto pos = std::find(labelsTopoEl.begin(),labelsTopoEl.end(),trigger);
676  if (pos != labelsTopoEl.end()) {
677  ATH_MSG_DEBUG("Found one CTP; ,CTPId: " << item.ctpId() << " ,Name: " << item.name() << " ,Definition: " << definition);
678  unsigned index = std::distance(labelsTopoEl.begin(),pos);
679  ctpIds[index]=item.ctpId();
680  }
681  }
682  }
683 
684  return ctpIds;
685 }
686 
688  errorFlags.setDetail("hasTrivialFlag", true);
689 }
L1TopoOnlineMonitor::m_l1topoKey
SG::ReadHandleKey< xAOD::L1TopoSimResultsContainer > m_l1topoKey
Definition: L1TopoOnlineMonitor.h:117
L1TopoROD.h
CTP_Decoder.h
L1TopoOnlineMonitor::doHwMonCTP
StatusCode doHwMonCTP(DecisionBits &decisionBits, const EventContext &ctx) const
Monitor the Hw bits from CTP.
Definition: L1TopoOnlineMonitor.cxx:275
xAOD::TrigComposite_v1::setDetail
bool setDetail(const std::string &name, const TYPE &value)
Set an TYPE detail on the object.
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
L1TopoOnlineMonitor::m_overflow_rateHdwNotSim
std::unique_ptr< float[]> m_overflow_rateHdwNotSim
Definition: L1TopoOnlineMonitor.h:76
L1TopoOnlineMonitor::DecisionBits::overflowBits
std::optional< std::bitset< s_nTopoCTPOutputs > > overflowBits
Definition: L1TopoOnlineMonitor.h:54
L1TopoOnlineMonitor::m_countSimNotHdw
std::unique_ptr< float[]> m_countSimNotHdw
Definition: L1TopoOnlineMonitor.h:71
L1TopoOnlineMonitor::DecisionBits::createBits
static std::bitset< s_nTopoCTPOutputs > & createBits(std::optional< std::bitset< s_nTopoCTPOutputs >> &opt)
Helper method to create a new bitset and get a reference to it.
Definition: L1TopoOnlineMonitor.h:60
L1TopoOnlineMonitor::m_doHwMonCTP
Gaudi::Property< bool > m_doHwMonCTP
Definition: L1TopoOnlineMonitor.h:101
L1TopoOnlineMonitor::getStartBits
std::vector< std::vector< std::pair< unsigned, unsigned > > > getStartBits(const TrigConf::L1Menu &l1menu)
Definition: L1TopoOnlineMonitor.cxx:631
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
L1Topo::L1TopoResult::getFPGASize
unsigned getFPGASize()
Definition: L1Topo/L1TopoRDO/L1TopoRDO/L1TopoResult.h:53
L1TopoOnlineMonitor::start
virtual StatusCode start() override
Definition: L1TopoOnlineMonitor.cxx:100
L1TopoOnlineMonitor::resetFlags
void resetFlags(xAOD::TrigComposite &errorFlags) const
Definition: L1TopoOnlineMonitor.cxx:687
L1TopoOnlineMonitor::m_doHwErrorMon
Gaudi::Property< bool > m_doHwErrorMon
Definition: L1TopoOnlineMonitor.h:105
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
L1TopoSimResults.h
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
L1Topo::L1TopoResult::getTopo1Opt0
const std::bitset< s_nTopoOutputs > & getTopo1Opt0() const
Definition: L1Topo/L1TopoRDO/L1TopoRDO/L1TopoResult.h:47
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
L1TopoOnlineMonitor::m_overflow_countHdwNotSim
std::unique_ptr< float[]> m_overflow_countHdwNotSim
Definition: L1TopoOnlineMonitor.h:80
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
L1TopoOnlineMonitor::m_doSimMon
Gaudi::Property< bool > m_doSimMon
Definition: L1TopoOnlineMonitor.h:99
L1TopoOnlineMonitor::m_startbit
std::vector< std::vector< std::pair< unsigned, unsigned > > > m_startbit
Definition: L1TopoOnlineMonitor.h:89
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
L1TopoOnlineMonitor::m_overflow_countHdwSim
std::unique_ptr< float[]> m_overflow_countHdwSim
Definition: L1TopoOnlineMonitor.h:82
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
L1TopoOnlineMonitor::m_countSim
std::unique_ptr< float[]> m_countSim
Definition: L1TopoOnlineMonitor.h:74
CTP_Decoder
Definition: CTP_Decoder.h:142
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
L1TopoOnlineMonitor::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: L1TopoOnlineMonitor.h:93
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
L1TopoOnlineMonitor::m_overflow_countHdw
std::unique_ptr< float[]> m_overflow_countHdw
Definition: L1TopoOnlineMonitor.h:83
L1TopoOnlineMonitor::initialize
virtual StatusCode initialize() override
initialize
Definition: L1TopoOnlineMonitor.cxx:45
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
L1TopoOnlineMonitor::DecisionBits::triggerBits
std::optional< std::bitset< s_nTopoCTPOutputs > > triggerBits
Definition: L1TopoOnlineMonitor.h:53
L1TopoOnlineMonitor::m_rateHdwSim
std::unique_ptr< float[]> m_rateHdwSim
Definition: L1TopoOnlineMonitor.h:69
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
L1TopoOnlineMonitor::m_rateHdwAndSim
std::unique_ptr< float[]> m_rateHdwAndSim
Definition: L1TopoOnlineMonitor.h:68
L1TopoOnlineMonitor::m_countAny
std::unique_ptr< float[]> m_countAny
Definition: L1TopoOnlineMonitor.h:75
L1TopoOnlineMonitor::m_ctpIds
std::vector< unsigned > m_ctpIds
Definition: L1TopoOnlineMonitor.h:87
lumiFormat.i
int i
Definition: lumiFormat.py:85
L1Topo::L1TopoResult::getTopo1Opt2
const std::bitset< s_nTopoOutputs > & getTopo1Opt2() const
Definition: L1Topo/L1TopoRDO/L1TopoRDO/L1TopoResult.h:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
L1TopoOnlineMonitor::m_rateSimNotHdw
std::unique_ptr< float[]> m_rateSimNotHdw
Definition: L1TopoOnlineMonitor.h:67
CTP_BC
Definition: CTP_Decoder.h:17
L1TopoOnlineMonitor::s_nTopoCTPOutputs
static constexpr size_t s_nTopoCTPOutputs
Number of CTP outputs, used for histogram ranges and loops.
Definition: L1TopoOnlineMonitor.h:49
L1TopoOnlineMonitor::m_overflow_rateSimNotHdw
std::unique_ptr< float[]> m_overflow_rateSimNotHdw
Definition: L1TopoOnlineMonitor.h:77
L1TopoOnlineMonitor::DecisionBits::triggerBitsSim
std::optional< std::bitset< s_nTopoCTPOutputs > > triggerBitsSim
Definition: L1TopoOnlineMonitor.h:55
L1TopoFPGA.h
L1TopoOnlineMonitor::doHwMon
StatusCode doHwMon(DecisionBits &decisionBits, std::vector< std::vector< unsigned >> &multWeights, const EventContext &ctx) const
Monitor the Hw bits from RAW data.
Definition: L1TopoOnlineMonitor.cxx:316
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
L1TopoOnlineMonitor::m_doMultComp
Gaudi::Property< bool > m_doMultComp
Definition: L1TopoOnlineMonitor.h:109
L1TopoOnlineMonitor::m_rateHdwNotSim
std::unique_ptr< float[]> m_rateHdwNotSim
Definition: L1TopoOnlineMonitor.h:66
L1TopoOnlineMonitor::doSimMon
StatusCode doSimMon(DecisionBits &decisionBits, std::vector< std::vector< unsigned >> &multWeights, const EventContext &ctx) const
Monitor the simulated bits.
Definition: L1TopoOnlineMonitor.cxx:181
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
L1TopoOnlineMonitor::m_countHdwNotSim
std::unique_ptr< float[]> m_countHdwNotSim
Definition: L1TopoOnlineMonitor.h:70
L1TopoOnlineMonitor::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: L1TopoOnlineMonitor.h:114
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
L1Topo::L1TopoResult::getDecisions
const std::bitset< s_nTopoOutputs > & getDecisions() const
Definition: L1Topo/L1TopoRDO/L1TopoRDO/L1TopoResult.h:45
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
L1Topo::L1TopoResult::getOverflows
const std::bitset< s_nTopoOutputs > & getOverflows() const
Definition: L1Topo/L1TopoRDO/L1TopoRDO/L1TopoResult.h:46
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
L1Topo::L1TopoResult::getTopo1Opt1
const std::bitset< s_nTopoOutputs > & getTopo1Opt1() const
Definition: L1Topo/L1TopoRDO/L1TopoRDO/L1TopoResult.h:48
L1TopoOnlineMonitor::m_overflow_countSim
std::unique_ptr< float[]> m_overflow_countSim
Definition: L1TopoOnlineMonitor.h:84
L1TopoOnlineMonitor::m_overflow_countSimNotHdw
std::unique_ptr< float[]> m_overflow_countSimNotHdw
Definition: L1TopoOnlineMonitor.h:81
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
L1TopoOnlineMonitor::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: L1TopoOnlineMonitor.cxx:113
CTP_BC::getTBP
const std::bitset< 512 > & getTBP() const
get bitset of TBP words
Definition: CTP_Decoder.h:93
L1Topo::L1TopoResult::getFPGA
const std::shared_ptr< L1Topo::L1TopoFPGA > & getFPGA(unsigned index) const
Definition: L1Topo/L1TopoRDO/L1TopoRDO/L1TopoResult.h:44
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
item
Definition: ItemListSvc.h:43
L1TopoOnlineMonitor::m_overflow_rateHdwAndSim
std::unique_ptr< float[]> m_overflow_rateHdwAndSim
Definition: L1TopoOnlineMonitor.h:78
L1TopoOnlineMonitor::DecisionBits::ambiguityBitsSim
std::optional< std::bitset< s_nTopoCTPOutputs > > ambiguityBitsSim
Definition: L1TopoOnlineMonitor.h:57
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
L1TopoOnlineMonitor::m_forceCTPasHdw
Gaudi::Property< bool > m_forceCTPasHdw
Definition: L1TopoOnlineMonitor.h:111
TriggerTest.ctp
ctp
Retrieve trigger EDM objects.
Definition: TriggerTest.py:14
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
L1TopoOnlineMonitor::DecisionBits
Helper structure holding decision bitsets, passed between the monitoring methods.
Definition: L1TopoOnlineMonitor.h:52
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
L1TopoOnlineMonitor::m_doComp
Gaudi::Property< bool > m_doComp
Definition: L1TopoOnlineMonitor.h:107
L1TopoOnlineMonitor::DecisionBits::overflowBitsSim
std::optional< std::bitset< s_nTopoCTPOutputs > > overflowBitsSim
Definition: L1TopoOnlineMonitor.h:56
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
L1TopoOnlineMonitor::doMultComp
StatusCode doMultComp(std::vector< std::vector< unsigned >> &multWeightsSim, std::vector< std::vector< unsigned >> &multWeightsHdw) const
Compare hardware and simulation for the multiplicity algorithms.
Definition: L1TopoOnlineMonitor.cxx:607
DeMoScan.index
string index
Definition: DeMoScan.py:364
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
L1TopoOnlineMonitor::m_overflow_countAny
std::unique_ptr< float[]> m_overflow_countAny
Definition: L1TopoOnlineMonitor.h:85
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
L1TopoOnlineMonitor::L1TopoOnlineMonitor
L1TopoOnlineMonitor(const std::string &name, ISvcLocator *svcLoc)
Definition: L1TopoOnlineMonitor.cxx:37
L1Topo::L1TopoResult::getStatus
bool getStatus()
Definition: L1Topo/L1TopoRDO/L1TopoRDO/L1TopoResult.h:51
L1TopoOnlineMonitor::DecisionBits::triggerBitsCtp
std::optional< std::bitset< s_nTopoCTPOutputs > > triggerBitsCtp
Definition: L1TopoOnlineMonitor.h:58
L1TopoOnlineMonitor.h
L1Topo::L1TopoResult::getROD
const std::shared_ptr< L1Topo::L1TopoROD > & getROD(unsigned index) const
Definition: L1Topo/L1TopoRDO/L1TopoRDO/L1TopoResult.h:43
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
L1TopoOnlineMonitor::getCtpIds
std::vector< unsigned > getCtpIds(const TrigConf::L1Menu &l1menu)
Get CTP ids from menu.
Definition: L1TopoOnlineMonitor.cxx:649
L1TopoOnlineMonitor::m_ctpRdoKey
SG::ReadHandleKey< CTP_RDO > m_ctpRdoKey
Definition: L1TopoOnlineMonitor.h:124
L1TopoOnlineMonitor::m_l1topoRawDataKey
SG::ReadHandleKey< xAOD::L1TopoRawDataContainer > m_l1topoRawDataKey
Definition: L1TopoOnlineMonitor.h:120
L1TopoOnlineMonitor::doComp
StatusCode doComp(DecisionBits &decisionBits) const
Compare hardware and simulation.
Definition: L1TopoOnlineMonitor.cxx:474
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
L1TopoResult.h
L1TopoOnlineMonitor::m_countHdw
std::unique_ptr< float[]> m_countHdw
Definition: L1TopoOnlineMonitor.h:73
L1Topo::L1TopoResult::getTopo1Opt3
const std::bitset< s_nTopoOutputs > & getTopo1Opt3() const
Definition: L1Topo/L1TopoRDO/L1TopoRDO/L1TopoResult.h:50
Helpers.h
L1TopoOnlineMonitor::m_doHwMon
Gaudi::Property< bool > m_doHwMon
Definition: L1TopoOnlineMonitor.h:103
L1TopoOnlineMonitor::m_countHdwSim
std::unique_ptr< float[]> m_countHdwSim
Definition: L1TopoOnlineMonitor.h:72
fitman.k
k
Definition: fitman.py:528
L1TopoOnlineMonitor::m_overflow_rateHdwSim
std::unique_ptr< float[]> m_overflow_rateHdwSim
Definition: L1TopoOnlineMonitor.h:79
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
L1TopoOnlineMonitor::m_errorFlagsKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_errorFlagsKey
Definition: L1TopoOnlineMonitor.h:96