 |
Belle II Software
release-05-02-19
|
14 #ifndef TRGBitStream_FLAG_
15 #define TRGBitStream_FLAG_
19 #include "trg/trg/Signal.h"
27 #define TRGBSRecord_Comment 0xffff0000
28 #define TRGBSRecord_BeginRun 0xffff00A0
29 #define TRGBSRecord_EndRun 0xffff00A1
30 #define TRGBSRecord_BeginEvent 0xffff00B0
31 #define TRGBSRecord_EndEvent 0xffff00B1
32 #define TRGBSRecord_Clock 0xffff00C0
33 #define TRGBSRecord_SegmentSL0 0xffff00F0
34 #define TRGBSRecord_SegmentSL1 0xffff00F1
35 #define TRGBSRecord_SegmentSL2 0xffff00F2
36 #define TRGBSRecord_SegmentSL3 0xffff00F3
37 #define TRGBSRecord_SegmentSL4 0xffff00F4
38 #define TRGBSRecord_SegmentSL5 0xffff00F5
39 #define TRGBSRecord_SegmentSL6 0xffff00F6
40 #define TRGBSRecord_SegmentSL7 0xffff00F7
41 #define TRGBSRecord_SegmentSL8 0xffff00F8
72 const std::string&
name(
void)
const;
75 const std::string&
name(
const std::string& newName);
78 void dump(
const std::string& message =
"",
79 const std::string& pre =
"")
const;
82 unsigned size(
void)
const;
88 char c(
unsigned positionInChar)
const;
91 bool bit(
unsigned positionInBit)
const;
111 const TRGClock& clock,
112 int initialClockPosition,
113 std::vector<TRGBitStream*> stream);
143 return _name = newName;
184 unsigned s =
_size / 8;
194 unsigned p = a /
sizeof(unsigned);
195 unsigned q = a %
sizeof(unsigned);
197 return (v >> (q * 8)) & 0xff;
204 unsigned p = a / (
sizeof(unsigned) * 8);
205 unsigned q = a % (
sizeof(unsigned) * 8);
207 return (v & (1 << q));
static std::vector< TRGSignal > TRGBitStream2TRGSignal(const TRGClock &clock, int initialClockPosition, std::vector< TRGBitStream * > stream)
Make trigger signals from bit stream.
unsigned _size
Bit stream size.
const std::string & name(void) const
returns name.
void dump(const std::string &message="", const std::string &pre="") const
dumps contents. "message" is to select information to dump. "pre" will be printed in head of each lin...
char c(unsigned positionInChar) const
returns a pointer to char's.
Abstract base class for different kinds of events.
bool bit(unsigned positionInBit) const
returns true if given position is active.
unsigned size(void) const
returns size of stream in unit of bit.
TRGBitStream()
Default constructor.
virtual ~TRGBitStream()
Destructor.
void append(bool)
appends a bit to a stream.
unsigned _sizeMax
Bit stream max size.
void clear(void)
clears contents.
std::vector< unsigned * > _stream
Bit stream storage.
unsigned sizeInChar(void) const
returns size in char's.