9#ifndef TRGBitStream_FLAG_
10#define TRGBitStream_FLAG_
14#include "trg/trg/Signal.h"
22#define TRGBSRecord_Comment 0xffff0000
23#define TRGBSRecord_BeginRun 0xffff00A0
24#define TRGBSRecord_EndRun 0xffff00A1
25#define TRGBSRecord_BeginEvent 0xffff00B0
26#define TRGBSRecord_EndEvent 0xffff00B1
27#define TRGBSRecord_Clock 0xffff00C0
28#define TRGBSRecord_SegmentSL0 0xffff00F0
29#define TRGBSRecord_SegmentSL1 0xffff00F1
30#define TRGBSRecord_SegmentSL2 0xffff00F2
31#define TRGBSRecord_SegmentSL3 0xffff00F3
32#define TRGBSRecord_SegmentSL4 0xffff00F4
33#define TRGBSRecord_SegmentSL5 0xffff00F5
34#define TRGBSRecord_SegmentSL6 0xffff00F6
35#define TRGBSRecord_SegmentSL7 0xffff00F7
36#define TRGBSRecord_SegmentSL8 0xffff00F8
67 const std::string&
name(
void)
const;
70 const std::string&
name(
const std::string& newName);
73 void dump(
const std::string& message =
"",
74 const std::string& pre =
"")
const;
77 unsigned size(
void)
const;
83 char c(
unsigned positionInChar)
const;
86 bool bit(
unsigned positionInBit)
const;
107 int initialClockPosition,
108 std::vector<TRGBitStream*> stream);
138 return _name = newName;
179 unsigned s =
_size / 8;
189 unsigned p = a /
sizeof(unsigned);
190 unsigned q = a %
sizeof(unsigned);
192 return (v >> (q * 8)) & 0xff;
199 unsigned p = a / (
sizeof(unsigned) * 8);
200 unsigned q = a % (
sizeof(unsigned) * 8);
202 return (v & (1 << q));
A class to represent a bit stream.
unsigned _size
Bit stream size.
unsigned _sizeMax
Bit stream max size.
std::vector< unsigned * > _stream
Bit stream storage.
A class to represent a digitized signal. Unit is nano second.
unsigned size(void) const
returns size of stream in unit of bit.
unsigned sizeInChar(void) const
returns size in char's.
bool bit(unsigned positionInBit) const
returns true if given position is active.
const std::string & name(void) const
returns name.
TRGBitStream()
Default constructor.
virtual ~TRGBitStream()
Destructor.
static std::vector< TRGSignal > TRGBitStream2TRGSignal(const TRGClock &clock, int initialClockPosition, std::vector< TRGBitStream * > stream)
Make trigger signals from bit stream.
char c(unsigned positionInChar) const
returns a pointer to char's.
void clear(void)
clears contents.
void append(bool)
appends a bit to a stream.
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...
Abstract base class for different kinds of events.