Belle II Software development
SVDModeByte Class Reference

Class to store SVD mode information. More...

#include <SVDModeByte.h>

Public Types

enum  {
  TriggerBinBits = 3 ,
  DAQModeBits = 2 ,
  EventTypeBits = 1 ,
  RunTypeBits = 2 ,
  Bits = TriggerBinBits + DAQModeBits + EventTypeBits + RunTypeBits ,
  MaxTriggerTime = (1 << TriggerBinBits) - 1 ,
  MaxGoodTriggerBin = 3 ,
  MaxDAQMode = (1 << DAQModeBits) - 1 ,
  MaxEventType = (1 << EventTypeBits) - 1 ,
  MaxRunType = (1 << RunTypeBits) - 1 ,
  MaxID = (1 << Bits) - 1
}
 
typedef uint8_t baseType
 The base integer type for SVDModeByte.
 

Public Member Functions

 SVDModeByte (baseType id=c_DefaultID)
 Constructor using the unique id.
 
 SVDModeByte (baseType runType, baseType eventType, baseType daqMode, baseType triggerBin)
 Constructor using triggerBin, daqMode etc.
 
 SVDModeByte (const SVDModeByte &b)
 Copy constructor.
 
SVDModeByteoperator= (const SVDModeByte &b)
 Assignment operator.
 
SVDModeByteoperator= (baseType id)
 Assignment from baseType.
 
 operator baseType () const
 Convert to baseType.
 
 operator std::string () const
 Convert to string.
 
bool operator== (const SVDModeByte &b) const
 Check for equality.
 
baseType getID () const
 Get the unique id.
 
baseType getTriggerBin () const
 Get the triggerBin id.
 
baseType getDAQMode () const
 Get the daqMode id.
 
baseType getEventType () const
 Get the eventMode id.
 
baseType getRunType () const
 Get the runMode id.
 
bool hasTimeFit () const
 Do we have time fit information?
 
bool isZeroSuppressedRun () const
 Do we have useful run type? A useful run is.
 
void setID (baseType id)
 Set the unique id.
 
void setTriggerBin (baseType triggerBin)
 Set the triggerBin id.
 
void setDAQMode (baseType daqMode)
 Set the daqMode id.
 
void setEventType (baseType eventType)
 Set the eventType id.
 
void setRunType (baseType runType)
 Set the runType id.
 
std::string __str__ () const
 make this type printable in python with print(vxd_id)
 

Static Public Attributes

static const baseType c_DefaultID = 151
 Default / non-informative id 10010111 = 151 Run type: zero-suppressed, 2 Event type: global run, 0 DAQ mode: 6-samples, 2 Trigger invalid 111 = 7.
 

Private Attributes

union {
   baseType   id: Bits
 Unique id. More...
 
   struct {
      baseType   triggerBin: TriggerBinBits
 Trigger time id. More...
 
      baseType   daqMode: DAQModeBits
 DAQ mode id. More...
 
      baseType   eventType: EventTypeBits
 Event type id. More...
 
      baseType   runType: RunTypeBits
 Run type id. More...
 
   }   parts
 < Struct to contain all id components
 
m_id
 Union to store the ID and all components in one go.
 

Detailed Description

Class to store SVD mode information.

  • Mode : Zero suppressed 6- or 3- samples + unknown mode
  • Trigger time bin - 3 bits, correct values 0-3, other - error

Definition at line 69 of file SVDModeByte.h.

Member Typedef Documentation

◆ baseType

typedef uint8_t baseType

The base integer type for SVDModeByte.

Definition at line 72 of file SVDModeByte.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
TriggerBinBits 

Number of bits available to represent a triggerBin.

DAQModeBits 

Number of bits available to represent DAQ Mode.

EventTypeBits 

Number of bits available to represent event type.

RunTypeBits 

Number of bits available to represent run type.

Bits 

Total bit size of the SVDModeByte.

MaxTriggerTime 

Maximum available trigger time ID.

MaxGoodTriggerBin 

Maximum valid trigger time ID.

MaxDAQMode 

Maximum available DAQ mode ID.

MaxEventType 

Maximum available event type ID.

MaxRunType 

Maximum available run type ID.

MaxID 

Maximum value for ID.

Definition at line 73 of file SVDModeByte.h.

73 {
77 DAQModeBits = 2,
79 EventTypeBits = 1,
81 RunTypeBits = 2,
84
86 MaxTriggerTime = (1 << TriggerBinBits) - 1,
90 MaxDAQMode = (1 << DAQModeBits) - 1,
92 MaxEventType = (1 << EventTypeBits) - 1,
94 MaxRunType = (1 << RunTypeBits) - 1,
96 MaxID = (1 << Bits) - 1,
97
98 };
@ DAQModeBits
Number of bits available to represent DAQ Mode.
Definition: SVDModeByte.h:77
@ MaxEventType
Maximum available event type ID.
Definition: SVDModeByte.h:92
@ TriggerBinBits
Number of bits available to represent a triggerBin.
Definition: SVDModeByte.h:75
@ MaxID
Maximum value for ID.
Definition: SVDModeByte.h:96
@ MaxGoodTriggerBin
Maximum valid trigger time ID.
Definition: SVDModeByte.h:88
@ MaxDAQMode
Maximum available DAQ mode ID.
Definition: SVDModeByte.h:90
@ MaxTriggerTime
Maximum available trigger time ID.
Definition: SVDModeByte.h:86
@ EventTypeBits
Number of bits available to represent event type.
Definition: SVDModeByte.h:79
@ RunTypeBits
Number of bits available to represent run type.
Definition: SVDModeByte.h:81
@ Bits
Total bit size of the SVDModeByte.
Definition: SVDModeByte.h:83
@ MaxRunType
Maximum available run type ID.
Definition: SVDModeByte.h:94

Constructor & Destructor Documentation

◆ SVDModeByte() [1/3]

SVDModeByte ( baseType  id = c_DefaultID)
inline

Constructor using the unique id.


Definition at line 110 of file SVDModeByte.h.

111 {
112 m_id.id = id;
113 }
baseType id
Unique id.
Definition: SVDModeByte.h:189
union Belle2::SVDModeByte::@241 m_id
Union to store the ID and all components in one go.

◆ SVDModeByte() [2/3]

SVDModeByte ( baseType  runType,
baseType  eventType,
baseType  daqMode,
baseType  triggerBin 
)
inline

Constructor using triggerBin, daqMode etc.

Definition at line 115 of file SVDModeByte.h.

117 {
118 m_id.parts.triggerBin = triggerBin;
119 m_id.parts.daqMode = daqMode;
120 m_id.parts.eventType = eventType;
121 m_id.parts.runType = runType;
122 }
baseType triggerBin
Trigger time id.
Definition: SVDModeByte.h:192
baseType runType
Run type id.
Definition: SVDModeByte.h:198
baseType daqMode
DAQ mode id.
Definition: SVDModeByte.h:194
baseType eventType
Event type id.
Definition: SVDModeByte.h:196

◆ SVDModeByte() [3/3]

SVDModeByte ( const SVDModeByte b)
inline

Copy constructor.

Definition at line 124 of file SVDModeByte.h.

124: m_id(b.m_id) {}

Member Function Documentation

◆ __str__()

std::string __str__ ( ) const
inline

make this type printable in python with print(vxd_id)

Definition at line 182 of file SVDModeByte.h.

182{ return (std::string)(*this); }

◆ getDAQMode()

baseType getDAQMode ( ) const
inline

Get the daqMode id.

Definition at line 142 of file SVDModeByte.h.

142{ return m_id.parts.daqMode; }

◆ getEventType()

baseType getEventType ( ) const
inline

Get the eventMode id.

Definition at line 144 of file SVDModeByte.h.

144{ return m_id.parts.eventType; }

◆ getID()

baseType getID ( ) const
inline

Get the unique id.

Definition at line 138 of file SVDModeByte.h.

138{ return m_id.id; }

◆ getRunType()

baseType getRunType ( ) const
inline

Get the runMode id.

Definition at line 146 of file SVDModeByte.h.

146{ return m_id.parts.runType; }

◆ getTriggerBin()

baseType getTriggerBin ( ) const
inline

Get the triggerBin id.

Definition at line 140 of file SVDModeByte.h.

140{ return m_id.parts.triggerBin; }

◆ hasTimeFit()

bool hasTimeFit ( ) const
inline

Do we have time fit information?

Definition at line 150 of file SVDModeByte.h.

151 { return m_id.parts.runType == SVDRunType::zero_suppressed_timefit; }
constexpr uint8_t zero_suppressed_timefit
Definition: SVDModeByte.h:37

◆ isZeroSuppressedRun()

bool isZeroSuppressedRun ( ) const
inline

Do we have useful run type? A useful run is.

  • zero-suppressed (first bit set)
  • 3-sample or 6-sample mode (daq mode > 0)

Definition at line 157 of file SVDModeByte.h.

158 {
159 return (
160 (m_id.parts.runType == SVDRunType::zero_suppressed)
161 ||
163 );
164 }
constexpr uint8_t zero_suppressed
Definition: SVDModeByte.h:36

◆ operator baseType()

operator baseType ( ) const
inline

Convert to baseType.

Definition at line 131 of file SVDModeByte.h.

131{ return getID(); }
baseType getID() const
Get the unique id.
Definition: SVDModeByte.h:138

◆ operator=() [1/2]

SVDModeByte & operator= ( baseType  id)
inline

Assignment from baseType.

Definition at line 129 of file SVDModeByte.h.

129{ m_id.id = id; return *this; }

◆ operator=() [2/2]

SVDModeByte & operator= ( const SVDModeByte b)
inline

Assignment operator.

Definition at line 127 of file SVDModeByte.h.

127{ m_id = b.m_id; return *this; }

◆ operator==()

bool operator== ( const SVDModeByte b) const
inline

Check for equality.

Definition at line 135 of file SVDModeByte.h.

135{ return getID() == b.getID(); }

◆ setDAQMode()

void setDAQMode ( baseType  daqMode)
inline

Set the daqMode id.

Definition at line 172 of file SVDModeByte.h.

173 { m_id.parts.daqMode = daqMode; }

◆ setEventType()

void setEventType ( baseType  eventType)
inline

Set the eventType id.

Definition at line 175 of file SVDModeByte.h.

176 { m_id.parts.eventType = eventType; }

◆ setID()

void setID ( baseType  id)
inline

Set the unique id.

Definition at line 167 of file SVDModeByte.h.

167{ m_id.id = id; }

◆ setRunType()

void setRunType ( baseType  runType)
inline

Set the runType id.

Definition at line 178 of file SVDModeByte.h.

179 { m_id.parts.runType = runType; }

◆ setTriggerBin()

void setTriggerBin ( baseType  triggerBin)
inline

Set the triggerBin id.

Definition at line 169 of file SVDModeByte.h.

170 { m_id.parts.triggerBin = triggerBin; }

Member Data Documentation

◆ daqMode

baseType daqMode

DAQ mode id.

Definition at line 194 of file SVDModeByte.h.

◆ eventType

baseType eventType

Event type id.

Definition at line 196 of file SVDModeByte.h.

◆ id

Unique id.

Definition at line 189 of file SVDModeByte.h.

◆ runType

baseType runType

Run type id.

Definition at line 198 of file SVDModeByte.h.

◆ triggerBin

baseType triggerBin

Trigger time id.

Definition at line 192 of file SVDModeByte.h.


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