Belle II Software  release-05-01-25
PXDDAQStatus.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2013 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Benjamin Schwenker *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <pxd/dataobjects/PXDDAQStatus.h>
12 
13 using namespace std;
14 using namespace Belle2;
15 
16 
17 const PXDDAQDHEStatus* PXDDAQStatus::findDHE(const VxdID& id) const
18 {
19  for (auto& pkt : m_pxdPacket) {
20  for (auto it_dhc = pkt.cbegin(); it_dhc != pkt.cend(); ++it_dhc) {
21  for (auto it_dhe = it_dhc->cbegin(); it_dhe != it_dhc->cend(); ++it_dhe) {
22  if (it_dhe->getSensorID() == id) {
23  return &(*it_dhe);
24  }
25  }
26  }
27  }
28  return nullptr;
29 }
30 
31 std::map <VxdID , bool> PXDDAQStatus::getUsable() const
32 {
33  // This function assumes that each DHE is only present ONCE
34  // The check for that must be done before!
35  std::map <VxdID , bool> usemap;
36  for (auto& pkt : m_pxdPacket) {
37  for (auto it_dhc = pkt.cbegin(); it_dhc != pkt.cend(); ++it_dhc) {
38  for (auto it_dhe = it_dhc->cbegin(); it_dhe != it_dhc->cend(); ++it_dhe) {
39  usemap[it_dhe->getSensorID()] = it_dhe->isUsable();
40  }
41  }
42  }
43  return usemap;
44 }
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PXDDAQDHEStatus
The PXD DAQ DHE Status class.
Definition: PXDDAQDHEStatus.h:46