Belle II Software development
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
11using namespace std;
12using namespace Belle2;
13
14
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
29std::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.
std::vector< PXDDAQPacketStatus > m_pxdPacket
Vector of packet informations beloning to this event.
Definition: PXDDAQStatus.h:158
std::map< VxdID, bool > getUsable() const
Return map of module usability.
Definition: PXDDAQStatus.cc:29
const PXDDAQDHEStatus * findDHE(const VxdID &id) const
Return pointer to PXDDAQDHEStatus for the DHE connected to sensor with VxdID id If id not found,...
Definition: PXDDAQStatus.cc:15
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.
STL namespace.