110 #pragma pack(push, 1)
152 inline uint32_t
Value(
const uint32_t *member)
const
154 return IsSwapped() ? ((*member & 0xFF) << 24) |
155 ((*member & 0xFF00) << 8) |
156 ((*member & 0xFF0000) >> 8) |
157 ((*member & 0xFF000000) >> 24) : *member;
166 inline void SetValue(uint32_t *member, uint32_t val)
168 *member =
IsSwapped() ? ((val & 0xFF) << 24) |
169 ((val & 0xFF00) << 8) |
170 ((val & 0xFF0000) >> 8) |
171 ((val & 0xFF000000) >> 24) : val;
187 uint32_t rest = hedsize % 8;
188 return (rest==0) ? hedsize : (hedsize + 8 - rest);
286 void Init(uint32_t trigger = 0)
294 return (uint32_t*) (
this) +
sizeof(
RawSubevent)/
sizeof(uint32_t) + indx;
302 case 4:
return datasize /
sizeof(uint32_t);
303 case 2:
return datasize /
sizeof(uint16_t);
305 return datasize /
sizeof(uint8_t);
309 uint32_t
Data(
unsigned idx)
const
315 return Value((uint32_t *) my + idx);
318 uint16_t tmp = ((uint16_t *) my)[idx];
320 if (
IsSwapped()) tmp = ((tmp >> 8) & 0xff) | ((tmp << 8) & 0xff00);
326 return ((uint8_t*) my)[idx];
337 while (datalen-- > 0) {
338 *((uint32_t*) buf) =
Data(indx++);
339 buf = ((uint32_t*) buf) + 1;
347 void Dump(
bool print_raw_data =
false);
350 void PrintRawData(
unsigned ix = 0,
unsigned len = 0xffffffff,
unsigned prefix = 6);
Support for HADAQ - HADES DAQ
@ EvtDecoding_AloneSubevt
@ EvtDecoding_64bitAligned
Intermediate hierarchy class as common base for event and subevent.
bool GetDataError() const
void SetDataError(bool on)
HADES transport unit header.
uint32_t Value(const uint32_t *member) const
void SetDecoding(uint32_t decod)
bool IsSwapped() const
msb of decode word is always non zero...?
void SetValue(uint32_t *member, uint32_t val)
swapsave method to set value stolen from hadtu.h
uint32_t GetDecoding() const
void SetSize(uint32_t bytes)
void SetDecodingDirect(uint32_t dec)
uint32_t GetPaddedSize() const
RawSubevent * NextSubevent(RawSubevent *prev=0)
void Init(uint32_t evnt, uint32_t run=0, uint32_t id=EvtId_DABC)
RawSubevent * FirstSubevent()
void SetRunNr(uint32_t n)
void InitHeader(uint32_t evid)
Method to set initial header value like decoding and date/time.
void SetSeqNr(uint32_t n)
uint32_t GetSeqNr() const
uint32_t AllSubeventsSize()
Hadaq subevent structure.
uint32_t Data(unsigned idx) const
swap-save access to any data.
unsigned GetNrOfDataWords() const
void Init(uint32_t trigger=0)
void Dump(bool print_raw_data=false)
Print subevent header and optionally raw data.
void * RawData() const
Return pointer where raw data should starts.
void CopyDataTo(void *buf, unsigned indx, unsigned datalen)
uint32_t * GetDataPtr(unsigned indx) const
Return pointer on data by index - user should care itself about swapping.
void SetTrigNr(uint32_t trigger)
unsigned Alignment() const
void SetTrigTypeTrb3(uint8_t typ)
void PrintRawData(unsigned ix=0, unsigned len=0xffffffff, unsigned prefix=6)
Print raw data, optionally one can position and portion to print.
uint32_t GetTrigNr() const
uint8_t GetTrigTypeTrb3() const