Belle II Software development
TrgBit::OutputBitPattern Class Reference

Output bit pattern class. More...

#include <TrgBit.h>

Public Member Functions

 OutputBitPattern ()
 Constructor.
 
virtual ~OutputBitPattern ()
 Destructor.
 
void set (unsigned pattern, unsigned wordPosition)
 reads/sets a bit.
 
bool isFired (unsigned bit) const
 get fired or not
 
int operator== (OutputBitPattern &)
 Comparison.
 
int operator[] (unsigned)
 Bit.
 

Private Attributes

unsigned _pattern [6]
 hit pattern
 

Detailed Description

Output bit pattern class.

Definition at line 76 of file TrgBit.h.

Constructor & Destructor Documentation

◆ OutputBitPattern()

OutputBitPattern ( )
inline

Constructor.

Definition at line 80 of file TrgBit.h.

80: _pattern{} {}; //TODO is it good default?
unsigned _pattern[6]
hit pattern
Definition: TrgBit.h:104

◆ ~OutputBitPattern()

virtual ~OutputBitPattern ( )
inlinevirtual

Destructor.

Definition at line 83 of file TrgBit.h.

83{};

Member Function Documentation

◆ isFired()

bool isFired ( unsigned  bit) const

get fired or not

Definition at line 207 of file TrgBit.cc.

208{
209 unsigned wd = bit / 32;
210 unsigned position = bit % 32;
211 return (_pattern[wd] >> position) & 1;
212}

◆ operator[]()

int operator[] ( unsigned  a)

Bit.

Definition at line 226 of file TrgBit.cc.

227{
228 if (a >= 32 * N_OUTPUT_ARRAY) return 0;
229 const unsigned i = a / 32;
230 const unsigned j = a % 32;
231
232 if ((_pattern[i] >> j) & 1) return 1;
233 return 0;
234}

◆ set()

void set ( unsigned  pattern,
unsigned  wordPosition 
)

reads/sets a bit.

Definition at line 193 of file TrgBit.cc.

194{
195 _pattern[b] = a;
196}

Member Data Documentation

◆ _pattern

unsigned _pattern[6]
private

hit pattern

Definition at line 104 of file TrgBit.h.


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