Belle II Software  release-08-01-10
PXDDAQStatus.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <pxd/dataobjects/PXDDAQStatus.h>
10 
11 using namespace std;
12 using namespace Belle2;
13 
14 
15 const PXDDAQDHEStatus* PXDDAQStatus::findDHE(const VxdID& id) const
16 {
17  for (auto& pkt : m_pxdPacket) {
18  for (auto it_dhc = pkt.cbegin(); it_dhc != pkt.cend(); ++it_dhc) {
19  for (auto it_dhe = it_dhc->cbegin(); it_dhe != it_dhc->cend(); ++it_dhe) {
20  if (it_dhe->getSensorID() == id) {
21  return &(*it_dhe);
22  }
23  }
24  }
25  }
26  return nullptr;
27 }
28 
29 std::map <VxdID, bool> PXDDAQStatus::getUsable() const
30 {
31  // This function assumes that each DHE is only present ONCE
32  // The check for that must be done before!
33  std::map <VxdID, bool> usemap;
34  for (auto& pkt : m_pxdPacket) {
35  for (auto it_dhc = pkt.cbegin(); it_dhc != pkt.cend(); ++it_dhc) {
36  for (auto it_dhe = it_dhc->cbegin(); it_dhe != it_dhc->cend(); ++it_dhe) {
37  usemap[it_dhe->getSensorID()] = it_dhe->isUsable();
38  }
39  }
40  }
41  return usemap;
42 }
The PXD DAQ DHE Status class.
bool isUsable() const
Return Usability of data.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.