Belle II Software development
PXDDAQStatus Class Reference

The PXD DAQ Status class. More...

#include <PXDDAQStatus.h>

Inheritance diagram for PXDDAQStatus:

Public Member Functions

 PXDDAQStatus ()
 Default constructor for the ROOT IO.
 
 PXDDAQStatus (const PXDErrorFlags &mask)
 constructor setting the error mask.
 
virtual ~PXDDAQStatus ()
 destructor
 
const PXDDAQDHEStatusfindDHE (const VxdID &id) const
 Return pointer to PXDDAQDHEStatus for the DHE connected to sensor with VxdID id If id not found, it returns nullptr!
 
bool isUsable () const
 Return Usability of data.
 
void setUnfiltered (bool b)
 Set flag that data was recorded without ROI filtering.
 
bool isUnfiltered () const
 Return if data was recorded without ROI filtering.
 
void setGated (bool b)
 Set flag that data was while detector was gated.
 
bool isGated () const
 Return if data was recorded while detector was gated.
 
void setErrorMask (const PXDErrorFlags &mask)
 Set Error bit mask This should be the OR of error masks of all sub-objects (DHC, DHE)
 
void addErrorMask (const PXDErrorFlags &mask)
 Add (OR) Error bit mask This should be the OR of error masks of all sub-objects (DHC, DHE)
 
PXDErrorFlags getErrorMask (void) const
 Return Error bit mask This is the OR of error masks of all sub-objects (DHC, DHE)
 
void setCritErrorMask (const PXDErrorFlags &mask)
 Set Critical Error bit mask.
 
PXDErrorFlags getCritErrorMask (void) const
 Return Critical Error bit mask.
 
void Decide (void)
 Calculate the usability decision If any of the critical bits is set in the error mask, or the sensor was gated, the PXD data is not usable for analysis TODO Maybe this decision needs improvement.
 
void addPacket (PXDDAQPacketStatus &daqpktstat)
 Add Data packet information including its DHC/DHE tree.
 
template<class ... Args>
PXDDAQPacketStatusnewPacket (Args &&... params)
 Add new Packet information.
 
std::map< VxdID, bool > getUsable () const
 Return map of module usability.
 
std::vector< PXDDAQPacketStatus >::iterator begin ()
 iterator-based iteration for packets
 
std::vector< PXDDAQPacketStatus >::iterator end ()
 iterator-based iteration for packets
 
std::vector< PXDDAQPacketStatus >::const_iterator cbegin () const
 const iterator-based iteration for packets
 
std::vector< PXDDAQPacketStatus >::const_iterator cend () const
 const iterator-based iteration for packets
 
PXDDAQPacketStatuspkt_back ()
 Returns PXDDAQPacketStatus for last packet in this event

 
size_t pkt_size () const
 Returns number of packets in this event

 

Private Attributes

PXDErrorFlags m_errorMask
 errors found in any packet/DHC/DHE
 
PXDErrorFlags m_critErrorMask
 critical error mask
 
bool m_usable
 Data is useable.
 
bool m_gated
 Sensor was in gated mode.
 
bool m_unfiltered
 Data was not ROI filtered.
 
std::vector< PXDDAQPacketStatusm_pxdPacket
 Vector of packet informations beloning to this event.
 

Detailed Description

The PXD DAQ Status class.

This is a small class that records information about PXD DAQ status It will record if the data of PXD is useable. In a tree structure, additional information per packet, DHC and DHE is stored. This preserves information which would normally get lost during unpacking

Definition at line 33 of file PXDDAQStatus.h.

Constructor & Destructor Documentation

◆ PXDDAQStatus() [1/2]

PXDDAQStatus ( )
inline

Default constructor for the ROOT IO.

Definition at line 37 of file PXDDAQStatus.h.

37: m_errorMask(0), m_critErrorMask(0), m_usable(false), m_gated(false), m_unfiltered(false) {}
PXDErrorFlags m_critErrorMask
critical error mask
Definition: PXDDAQStatus.h:151
bool m_unfiltered
Data was not ROI filtered.
Definition: PXDDAQStatus.h:155
PXDErrorFlags m_errorMask
errors found in any packet/DHC/DHE
Definition: PXDDAQStatus.h:150
bool m_gated
Sensor was in gated mode.
Definition: PXDDAQStatus.h:154
bool m_usable
Data is useable.
Definition: PXDDAQStatus.h:153

◆ PXDDAQStatus() [2/2]

PXDDAQStatus ( const PXDErrorFlags &  mask)
inlineexplicit

constructor setting the error mask.

Parameters
maskError mask

Definition at line 42 of file PXDDAQStatus.h.

42 : m_errorMask(mask), m_critErrorMask(0), m_usable(false), m_gated(false),
43 m_unfiltered(false) {}

◆ ~PXDDAQStatus()

virtual ~PXDDAQStatus ( )
inlinevirtual

destructor

Definition at line 46 of file PXDDAQStatus.h.

46{};

Member Function Documentation

◆ addErrorMask()

void addErrorMask ( const PXDErrorFlags &  mask)
inline

Add (OR) Error bit mask This should be the OR of error masks of all sub-objects (DHC, DHE)

Parameters
maskBit Mask to add (or)

Definition at line 89 of file PXDDAQStatus.h.

89{ m_errorMask |= mask; }

◆ addPacket()

void addPacket ( PXDDAQPacketStatus daqpktstat)
inline

Add Data packet information including its DHC/DHE tree.

Parameters
daqpktstatPacket Status Object

Definition at line 117 of file PXDDAQStatus.h.

117{m_pxdPacket.push_back(daqpktstat);};
std::vector< PXDDAQPacketStatus > m_pxdPacket
Vector of packet informations beloning to this event.
Definition: PXDDAQStatus.h:158

◆ begin()

std::vector< PXDDAQPacketStatus >::iterator begin ( )
inline

iterator-based iteration for packets

Definition at line 136 of file PXDDAQStatus.h.

136{ return m_pxdPacket.begin(); };

◆ cbegin()

std::vector< PXDDAQPacketStatus >::const_iterator cbegin ( ) const
inline

const iterator-based iteration for packets

Definition at line 141 of file PXDDAQStatus.h.

141{ return m_pxdPacket.cbegin(); };

◆ cend()

std::vector< PXDDAQPacketStatus >::const_iterator cend ( ) const
inline

const iterator-based iteration for packets

Definition at line 143 of file PXDDAQStatus.h.

143{ return m_pxdPacket.cend(); };

◆ Decide()

void Decide ( void  )
inline

Calculate the usability decision If any of the critical bits is set in the error mask, or the sensor was gated, the PXD data is not usable for analysis TODO Maybe this decision needs improvement.

Definition at line 112 of file PXDDAQStatus.h.

112{m_usable = (m_errorMask & m_critErrorMask) == PXDErrorFlags(0) && !m_gated;}

◆ end()

std::vector< PXDDAQPacketStatus >::iterator end ( )
inline

iterator-based iteration for packets

Definition at line 138 of file PXDDAQStatus.h.

138{ return m_pxdPacket.end(); };

◆ findDHE()

const PXDDAQDHEStatus * findDHE ( const VxdID id) const

Return pointer to PXDDAQDHEStatus for the DHE connected to sensor with VxdID id If id not found, it returns nullptr!

Parameters
idVxdID for required DHE

Definition at line 15 of file PXDDAQStatus.cc.

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}

◆ getCritErrorMask()

PXDErrorFlags getCritErrorMask ( void  ) const
inline

Return Critical Error bit mask.

Returns
bit mask

Definition at line 105 of file PXDDAQStatus.h.

105{ return m_critErrorMask; }

◆ getErrorMask()

PXDErrorFlags getErrorMask ( void  ) const
inline

Return Error bit mask This is the OR of error masks of all sub-objects (DHC, DHE)

Returns
bit mask

Definition at line 95 of file PXDDAQStatus.h.

95{ return m_errorMask; }

◆ getUsable()

std::map< VxdID, bool > getUsable ( ) const

Return map of module usability.

Returns
map of VxdID with usable flags

Definition at line 29 of file PXDDAQStatus.cc.

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}

◆ isGated()

bool isGated ( ) const
inline

Return if data was recorded while detector was gated.

Returns
detector was gated

Definition at line 77 of file PXDDAQStatus.h.

77{ return m_gated; }

◆ isUnfiltered()

bool isUnfiltered ( ) const
inline

Return if data was recorded without ROI filtering.

Returns
data was not ROI filtered flag

Definition at line 67 of file PXDDAQStatus.h.

67{ return m_unfiltered; }

◆ isUsable()

bool isUsable ( ) const
inline

Return Usability of data.

Returns
conclusion if data is useable

Definition at line 57 of file PXDDAQStatus.h.

57{ return m_usable; }

◆ newPacket()

PXDDAQPacketStatus & newPacket ( Args &&...  params)
inline

Add new Packet information.

Parameters
paramsconstructor parameter
Returns
ref to new Packet Status Object

Definition at line 123 of file PXDDAQStatus.h.

124 {
125 /*return*/ m_pxdPacket.emplace_back(std::forward<Args>(params)...);
126 return m_pxdPacket.back();
127 }

◆ pkt_back()

PXDDAQPacketStatus & pkt_back ( )
inline

Returns PXDDAQPacketStatus for last packet in this event

Definition at line 145 of file PXDDAQStatus.h.

145{ return m_pxdPacket.back(); };

◆ pkt_size()

size_t pkt_size ( ) const
inline

Returns number of packets in this event

Definition at line 147 of file PXDDAQStatus.h.

147{ return m_pxdPacket.size(); };

◆ setCritErrorMask()

void setCritErrorMask ( const PXDErrorFlags &  mask)
inline

Set Critical Error bit mask.

Parameters
maskBit Mask to set

Definition at line 100 of file PXDDAQStatus.h.

100{ m_critErrorMask = mask; }

◆ setErrorMask()

void setErrorMask ( const PXDErrorFlags &  mask)
inline

Set Error bit mask This should be the OR of error masks of all sub-objects (DHC, DHE)

Parameters
maskBit Mask to set

Definition at line 83 of file PXDDAQStatus.h.

83{ m_errorMask = mask; }

◆ setGated()

void setGated ( bool  b)
inline

Set flag that data was while detector was gated.

Parameters
bgated

Definition at line 72 of file PXDDAQStatus.h.

72{ m_gated = b; }

◆ setUnfiltered()

void setUnfiltered ( bool  b)
inline

Set flag that data was recorded without ROI filtering.

Parameters
bunfiltered

Definition at line 62 of file PXDDAQStatus.h.

62{ m_unfiltered = b; }

Member Data Documentation

◆ m_critErrorMask

PXDErrorFlags m_critErrorMask
private

critical error mask

Definition at line 151 of file PXDDAQStatus.h.

◆ m_errorMask

PXDErrorFlags m_errorMask
private

errors found in any packet/DHC/DHE

Definition at line 150 of file PXDDAQStatus.h.

◆ m_gated

bool m_gated
private

Sensor was in gated mode.

Definition at line 154 of file PXDDAQStatus.h.

◆ m_pxdPacket

std::vector<PXDDAQPacketStatus> m_pxdPacket
private

Vector of packet informations beloning to this event.

Definition at line 158 of file PXDDAQStatus.h.

◆ m_unfiltered

bool m_unfiltered
private

Data was not ROI filtered.

Definition at line 155 of file PXDDAQStatus.h.

◆ m_usable

bool m_usable
private

Data is useable.

Definition at line 153 of file PXDDAQStatus.h.


The documentation for this class was generated from the following files: