ROOTANA
|
MIDAS event. More...
#include <TMidasEvent.h>
Public Member Functions | |
TMidasEvent () | |
default constructor | |
TMidasEvent (const TMidasEvent &) | |
copy constructor | |
~TMidasEvent () | |
destructor | |
TMidasEvent & | operator= (const TMidasEvent &) |
assignement operator | |
void | Clear () |
clear event for reuse | |
void | Copy (const TMidasEvent &) |
copy helper | |
void | Print (const char *option="") const |
show all event information | |
uint16_t | GetEventId () const |
return the event id | |
uint16_t | GetTriggerMask () const |
return the triger mask | |
uint32_t | GetSerialNumber () const |
return the serial number | |
uint32_t | GetTimeStamp () const |
return the time stamp (unix time in seconds) | |
uint32_t | GetDataSize () const |
return the event size | |
const char * | GetBankList () const |
return a list of data banks | |
int | FindBank (const char *bankName, int *bankLength, int *bankType, void **bankPtr) const |
int | LocateBank (const void *unused, const char *bankName, void **bankPtr) const |
bool | IsBank32 () const |
returns "true" if event uses bk_init32() banks | |
bool | IsBank32a () const |
returns "true" if event uses bk_init32a() banks | |
int | IterateBank (TMidas_BANK **, char **pdata) const |
iterate through 16-bit data banks | |
int | IterateBank32 (TMidas_BANK32 **, char **pdata) const |
iterate through 32-bit data banks | |
int | IterateBank32a (TMidas_BANK32a **, char **pdata) const |
iterate through 32-bit data banks | |
TMidas_EVENT_HEADER * | GetEventHeader () |
return pointer to the event header | |
char * | GetData () |
return pointer to the data buffer | |
void | AllocateData () |
allocate data buffer using the existing event header | |
void | SetData (uint32_t dataSize, char *dataBuffer) |
set an externally allocated data buffer | |
int | SetBankList () |
create the list of data banks, return number of banks | |
bool | IsGoodSize () const |
validate the event length | |
void | SwapBytesEventHeader () |
convert event header between little-endian (Linux-x86) and big endian (MacOS-PPC) | |
int | SwapBytes (bool) |
convert event data between little-endian (Linux-x86) and big endian (MacOS-PPC) | |
Protected Attributes | |
TMidas_EVENT_HEADER | fEventHeader |
event header | |
char * | fData |
event data buffer | |
int | fBanksN |
number of banks in this event | |
char * | fBankList |
list of bank names in this event | |
bool | fAllocatedByUs |
"true" if we own the data buffer | |
MIDAS event.
C++ class representing one midas event.
Objects of this class are created by reading midas events from a file, by reading them from a midas shared memory buffer or by receiving them through the mserver
Definition at line 21 of file TMidasEvent.h.
TMidasEvent::TMidasEvent | ( | ) |
default constructor
Definition at line 15 of file TMidasEvent.cxx.
TMidasEvent::TMidasEvent | ( | const TMidasEvent & | rhs | ) |
copy constructor
Definition at line 44 of file TMidasEvent.cxx.
TMidasEvent::~TMidasEvent | ( | ) |
void TMidasEvent::AllocateData | ( | ) |
allocate data buffer using the existing event header
Definition at line 369 of file TMidasEvent.cxx.
void TMidasEvent::Clear | ( | ) |
clear event for reuse
Definition at line 63 of file TMidasEvent.cxx.
void TMidasEvent::Copy | ( | const TMidasEvent & | rhs | ) |
copy helper
Definition at line 30 of file TMidasEvent.cxx.
int TMidasEvent::FindBank | ( | const char * | bankName, |
int * | bankLength, | ||
int * | bankType, | ||
void ** | bankPtr | ||
) | const |
Find a data bank.
[in] | name | Name of the data bank to look for. |
[out] | bklen | Number of array elements in this bank. |
[out] | bktype | Bank data type (MIDAS TID_xxx). |
[out] | pdata | Pointer to bank data, Returns NULL if bank not found. |
Definition at line 165 of file TMidasEvent.cxx.
const char * TMidasEvent::GetBankList | ( | ) | const |
return a list of data banks
Definition at line 378 of file TMidasEvent.cxx.
char * TMidasEvent::GetData | ( | ) |
return pointer to the data buffer
Definition at line 118 of file TMidasEvent.cxx.
uint32_t TMidasEvent::GetDataSize | ( | ) | const |
return the event size
Definition at line 113 of file TMidasEvent.cxx.
TMidas_EVENT_HEADER * TMidasEvent::GetEventHeader | ( | ) |
return pointer to the event header
Definition at line 125 of file TMidasEvent.cxx.
uint16_t TMidasEvent::GetEventId | ( | ) | const |
return the event id
Definition at line 93 of file TMidasEvent.cxx.
uint32_t TMidasEvent::GetSerialNumber | ( | ) | const |
return the serial number
Definition at line 103 of file TMidasEvent.cxx.
uint32_t TMidasEvent::GetTimeStamp | ( | ) | const |
return the time stamp (unix time in seconds)
Definition at line 108 of file TMidasEvent.cxx.
uint16_t TMidasEvent::GetTriggerMask | ( | ) | const |
return the triger mask
Definition at line 98 of file TMidasEvent.cxx.
bool TMidasEvent::IsBank32 | ( | ) | const |
returns "true" if event uses bk_init32() banks
Definition at line 135 of file TMidasEvent.cxx.
bool TMidasEvent::IsBank32a | ( | ) | const |
returns "true" if event uses bk_init32a() banks
Definition at line 140 of file TMidasEvent.cxx.
bool TMidasEvent::IsGoodSize | ( | ) | const |
validate the event length
Definition at line 130 of file TMidasEvent.cxx.
int TMidasEvent::IterateBank | ( | TMidas_BANK ** | pbk, |
char ** | pdata | ||
) | const |
iterate through 16-bit data banks
Iterates through banks inside an event. The function can be used to enumerate all banks of an event.
[in] | pbk | Pointer to the bank header, must be NULL for the first call to this function. Returns NULL if no more banks |
[in] | pdata | Pointer to data area of bank. Returns NULL if no more banks |
Definition at line 448 of file TMidasEvent.cxx.
int TMidasEvent::IterateBank32 | ( | TMidas_BANK32 ** | pbk, |
char ** | pdata | ||
) | const |
iterate through 32-bit data banks
See IterateBank()
Definition at line 476 of file TMidasEvent.cxx.
int TMidasEvent::IterateBank32a | ( | TMidas_BANK32a ** | pbk, |
char ** | pdata | ||
) | const |
iterate through 32-bit data banks
See IterateBank()
Definition at line 523 of file TMidasEvent.cxx.
int TMidasEvent::LocateBank | ( | const void * | unused, |
const char * | bankName, | ||
void ** | bankPtr | ||
) | const |
See FindBank()
Definition at line 145 of file TMidasEvent.cxx.
TMidasEvent & TMidasEvent::operator= | ( | const TMidasEvent & | rhs | ) |
assignement operator
Definition at line 54 of file TMidasEvent.cxx.
void TMidasEvent::Print | ( | const char * | option = "" | ) | const |
show all event information
Print data held in this class.
[in] | option | If 'a' (for "all") then the raw data will be printed out too. |
Definition at line 291 of file TMidasEvent.cxx.
int TMidasEvent::SetBankList | ( | ) |
create the list of data banks, return number of banks
Definition at line 383 of file TMidasEvent.cxx.
void TMidasEvent::SetData | ( | uint32_t | dataSize, |
char * | dataBuffer | ||
) |
set an externally allocated data buffer
Definition at line 83 of file TMidasEvent.cxx.
int TMidasEvent::SwapBytes | ( | bool | force | ) |
convert event data between little-endian (Linux-x86) and big endian (MacOS-PPC)
Definition at line 614 of file TMidasEvent.cxx.
void TMidasEvent::SwapBytesEventHeader | ( | ) |
convert event header between little-endian (Linux-x86) and big endian (MacOS-PPC)
Definition at line 605 of file TMidasEvent.cxx.
|
protected |
"true" if we own the data buffer
Definition at line 75 of file TMidasEvent.h.
|
protected |
list of bank names in this event
Definition at line 74 of file TMidasEvent.h.
|
protected |
number of banks in this event
Definition at line 73 of file TMidasEvent.h.
|
protected |
event data buffer
Definition at line 72 of file TMidasEvent.h.
|
protected |
event header
Definition at line 71 of file TMidasEvent.h.