39 static const char *tbl[] = {
"tracedata",
"tracehead",
"info",
"data",
"INVALID"};
40 return tbl[type < 4 ? type : 4];
130 inline void set(uint64_t timestamp_, uint32_t adc_, uint32_t chi_,
131 bool veto_,
bool fail_)
137 veto = veto_ ? 1 : 0;
138 fail = fail_ ? 1 : 0;
139 itemtype =
static_cast<uint32_t
>(itemtype_e::data);
148 std::snprintf(s, len,
"%2" PRIu32
" %09" PRIu32
" %02" PRIu32
" %05" PRIu32
149 " %02" PRIu32
" %01" PRIu32
" %03" PRIu32
" %01" PRIu32
" %01" PRIu32,
204 inline void set(uint64_t timestamp_, uint32_t code_, uint32_t info_, uint32_t module_)
211 itemtype =
static_cast<uint32_t
>(itemtype_e::info);
220 std::snprintf(s, len,
"%2" PRIu32
" %09" PRIu32
" %02" PRIu32
" %07" PRIu32
" %02" PRIu32
" %02" PRIu32,
274 std::snprintf(s, len,
"%2" PRIu32
" %09" PRIu32
" %02" PRIu32
" %05" PRIu32
275 " %02" PRIu32
" %01" PRIu32
" %03" PRIu32
" %01" PRIu32,
316 inline void set(
const uint16_t *samples)
330 uint32_t rectype =
static_cast<uint32_t
>(itemtype_e::tracedata);
331 std::snprintf(s, len,
"%2" PRIu32
" %05" PRIu16
" %05" PRIu16
" %05" PRIu16
" %05" PRIu16,
399 case itemtype_e::tracedata:
402 case itemtype_e::tracehead:
405 case itemtype_e::info:
408 case itemtype_e::data:
Definition: mainpage.dox:6
const char * rectypeToString(uint64_t type)
Function to get a static string corresponding to dataitemtypes.
Definition: dataitem.hpp:37
infocode_e
Enum to describe all possible types of infovalue.
Definition: dataitem.hpp:48
itemtype_e
Enum to describe all possible types of a raw dataitem.
Definition: dataitem.hpp:24
Dataitem used to read the dataitem of type itemtype_e::DATA.
Definition: dataitem.hpp:87
uint32_t itemtype
Type of the item. One of itemtype_e enum.
Definition: dataitem.hpp:111
uint32_t getChannelIdent_adc() const
ADC number in a module. Calculated from the field chi.
Definition: dataitem.hpp:114
uint32_t timestamp
Lowest 28 bits of the timestamp.
Definition: dataitem.hpp:90
uint32_t fail
Flag to mark that the event is fail.
Definition: dataitem.hpp:108
void toCStringFull(char *s, uint32_t len) const
Get the content as a c string.
Definition: dataitem.hpp:146
uint32_t getChannelIdent_flag() const
Flag in the field chi.
Definition: dataitem.hpp:121
uint32_t getChannelIdent_module() const
Module number. Calculated from the field chi.
Definition: dataitem.hpp:124
void set(uint64_t timestamp_, uint32_t adc_, uint32_t chi_, bool veto_, bool fail_)
Sets the fields.
Definition: dataitem.hpp:130
uint32_t res0
Empty 4 bits. Can be used for word order guessing.
Definition: dataitem.hpp:93
uint32_t chi
Channel ident. Can be used as a DAQ channel number.
Definition: dataitem.hpp:99
uint32_t adc
ADC value. Maximum 16 bits, typically 14 bits.
Definition: dataitem.hpp:96
uint32_t veto
Flag to mark that the event is vetoed.
Definition: dataitem.hpp:105
Dataitem used to read the dataitem of type itemtype_e::INFO.
Definition: dataitem.hpp:162
uint32_t getChannelIdent() const
Returns channel ident for pileup and adc over/under range/flow.
Definition: dataitem.hpp:195
void set(uint64_t timestamp_, uint32_t code_, uint32_t info_, uint32_t module_)
Sets the fields.
Definition: dataitem.hpp:204
infocode_e getCode() const
Returns the infocode as class enum.
Definition: dataitem.hpp:189
uint32_t timestamp
Lowest 28 bits of the timestamp.
Definition: dataitem.hpp:165
uint32_t code
infocode, one of enum infocode_e.
Definition: dataitem.hpp:177
uint32_t res0
Empty 4 bits. Can be used for word order guessing.
Definition: dataitem.hpp:168
uint32_t module
Module number who has sent this info.
Definition: dataitem.hpp:180
void toCStringFull(char *s, uint32_t len) const
Get the content as a c string.
Definition: dataitem.hpp:218
uint32_t itemtype
Type of the item. One of itemtype_e.
Definition: dataitem.hpp:183
uint32_t info
Value of the info. TODO describe the types of value possible...
Definition: dataitem.hpp:171
Dataitem used to read the dataitem of type itemtype_e::tracedata.
Definition: dataitem.hpp:288
uint16_t sample1
Definition: dataitem.hpp:301
void set(const uint16_t *samples)
Sets the fields.
Definition: dataitem.hpp:316
uint16_t sample3
Definition: dataitem.hpp:291
void toCStringFull(char *s, uint32_t len) const
Get the content as a c string.
Definition: dataitem.hpp:328
uint16_t sample0
Definition: dataitem.hpp:306
uint16_t res0
Definition: dataitem.hpp:308
uint16_t res2
Definition: dataitem.hpp:298
uint16_t res1
Definition: dataitem.hpp:303
uint16_t sample2
Definition: dataitem.hpp:296
uint16_t res3
Definition: dataitem.hpp:293
Dataitem used to read the dataitem of type itemtype_e::TRACEHEAD.
Definition: dataitem.hpp:231
uint32_t chi
Channel ident. Can be used as a DAQ channel number.
Definition: dataitem.hpp:247
uint32_t itemtype
Type of the item. One of itemtype_e.
Definition: dataitem.hpp:256
uint32_t res0
Empty 4 bits. Can be used for word order guessing.
Definition: dataitem.hpp:237
void toCStringFull(char *s, uint32_t len) const
Get the content as a c string.
Definition: dataitem.hpp:272
uint32_t getChannelIdent_adc() const
ADC number in a module. Calculated from the field chi.
Definition: dataitem.hpp:250
uint32_t getChannelIdent_flag() const
Flag in the field chi.
Definition: dataitem.hpp:263
uint32_t samplelength
Number of samples following.
Definition: dataitem.hpp:244
uint32_t res1
Not used by this struct.
Definition: dataitem.hpp:253
uint32_t getChannelIdent_module() const
Module number. Calculated from the field chi.
Definition: dataitem.hpp:266
uint32_t timestamp
Lowest 28 bits of the timestamp.
Definition: dataitem.hpp:234
Raw dataitem with full timestamp.
Definition: dataitem.hpp:419
Dataitem used to read the itemtype_e.
Definition: dataitem.hpp:72
uint32_t itemtype
Type of the item. One of itemtype_e.
Definition: dataitem.hpp:78
uint64_t res0
Not used by this struct.
Definition: dataitem.hpp:75
Raw dataitem in tdr binary data.
Definition: dataitem.hpp:343
dataitem_t asSwapped() const
Returns a new dataitem having 16 bit words swapped.
Definition: dataitem.hpp:382
itemtype_e getType() const
Returns the type of the item.
Definition: dataitem.hpp:376
dataitem_tracehead_t tracehead
Field to access the content of datatype DATATYPE_TRACEHEAD.
Definition: dataitem.hpp:356
dataitem_type_t type
Field to access the type. One can use also method getType().
Definition: dataitem.hpp:347
dataitem_info_t info
Field to access the content of datatype DATATYPE_INFO.
Definition: dataitem.hpp:353
uint64_t rawdata
Field to access the raw memory at once.
Definition: dataitem.hpp:362
void toCStringFull(char *s, uint32_t len) const
Get the content as a c string.
Definition: dataitem.hpp:395
dataitem_data_t data
Field to access the content of datatype DATATYPE_DATA.
Definition: dataitem.hpp:350
static dataitem_t create(uint64_t v)
Creates and returns a new dataitem from a raw data.
Definition: dataitem.hpp:365
void clear()
Sets the all bits to zero.
Definition: dataitem.hpp:388
dataitem_tracedata_t tracedata
Field to access the content of datatype DATATYPE_tracedata.
Definition: dataitem.hpp:359