33 void Print(
const char* option =
"")
const;
46 int FindBank(
const char* bankName,
int* bankLength,
int* bankType,
void **bankPtr)
const;
47 int LocateBank(
const void *unused,
const char* bankName,
void **bankPtr)
const;
61 void SetData(uint32_t dataSize,
char* dataBuffer);
bool TMWriteEvent(TMWriterInterface *writer, TMidasEvent *event)
bool TMReadEvent(TMReaderInterface *reader, TMidasEvent *event)
int FindBank(const char *bankName, int *bankLength, int *bankType, void **bankPtr) const
int SwapBytes(bool)
convert event data between little-endian (Linux-x86) and big endian (MacOS-PPC)
bool IsBank32() const
returns "true" if event uses bk_init32() banks
int IterateBank32(TMidas_BANK32 **, char **pdata) const
iterate through 32-bit data banks
TMidas_EVENT_HEADER * GetEventHeader()
return pointer to the event header
void Clear()
clear event for reuse
uint32_t GetDataSize() const
return the event size
int fBanksN
number of banks in this event
int SetBankList()
create the list of data banks, return number of banks
int IterateBank32a(TMidas_BANK32a **, char **pdata) const
iterate through 32-bit data banks
void AllocateData()
allocate data buffer using the existing event header
const char * GetBankList() const
return a list of data banks
int IterateBank(TMidas_BANK **, char **pdata) const
iterate through 16-bit data banks
uint16_t GetEventId() const
return the event id
int LocateBank(const void *unused, const char *bankName, void **bankPtr) const
bool IsBank32a() const
returns "true" if event uses bk_init32a() banks
uint32_t GetTimeStamp() const
return the time stamp (unix time in seconds)
TMidasEvent()
default constructor
TMidasEvent & operator=(const TMidasEvent &)
assignement operator
void SetData(uint32_t dataSize, char *dataBuffer)
set an externally allocated data buffer
bool fAllocatedByUs
"true" if we own the data buffer
char * fData
event data buffer
void Print(const char *option="") const
show all event information
uint32_t GetSerialNumber() const
return the serial number
uint16_t GetTriggerMask() const
return the triger mask
TMidas_EVENT_HEADER fEventHeader
event header
bool IsGoodSize() const
validate the event length
void Copy(const TMidasEvent &)
copy helper
char * GetData()
return pointer to the data buffer
char * fBankList
list of bank names in this event
void SwapBytesEventHeader()
convert event header between little-endian (Linux-x86) and big endian (MacOS-PPC)