Belle II Software development
TrgBit::InputBitPattern Class Reference

Input bit pattern class. More...

#include <TrgBit.h>

Public Member Functions

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

Private Attributes

unsigned _pattern [6]
 hit pattern
 

Detailed Description

Input bit pattern class.

Definition at line 44 of file TrgBit.h.

Constructor & Destructor Documentation

◆ InputBitPattern()

InputBitPattern ( )
inline

Constructor.

Definition at line 48 of file TrgBit.h.

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

◆ ~InputBitPattern()

virtual ~InputBitPattern ( )
inlinevirtual

Destructor.

Definition at line 51 of file TrgBit.h.

51{};

Member Function Documentation

◆ isFired()

bool isFired ( unsigned  bit) const

get fired or not

Definition at line 199 of file TrgBit.cc.

200{
201 unsigned wd = bit / 32;
202 unsigned position = bit % 32;
203 return (_pattern[wd] >> position) & 1;
204}

◆ operator[]()

int operator[] ( unsigned  a)

Bit.

Definition at line 215 of file TrgBit.cc.

216{
217 if (a >= 32 * N_INPUT_ARRAY) return 0;
218 const unsigned i = a / 32;
219 const unsigned j = a % 32;
220
221 if ((_pattern[i] >> j) & 1) return 1;
222 return 0;
223}

◆ set()

void set ( unsigned  pattern,
unsigned  wordPosition 
)

reads/sets a bit.

Definition at line 187 of file TrgBit.cc.

188{
189 _pattern[b] = a;
190}

Member Data Documentation

◆ _pattern

unsigned _pattern[6]
private

hit pattern

Definition at line 71 of file TrgBit.h.


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