ROOTANA
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
TMidasEvent Class Reference

MIDAS event. More...

#include <TMidasEvent.h>

Collaboration diagram for TMidasEvent:
Collaboration graph
[legend]

Public Member Functions

 TMidasEvent ()
 default constructor
 
 TMidasEvent (const TMidasEvent &)
 copy constructor
 
 ~TMidasEvent ()
 destructor
 
TMidasEventoperator= (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_HEADERGetEventHeader ()
 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TMidasEvent() [1/2]

TMidasEvent::TMidasEvent ( )

default constructor

Definition at line 15 of file TMidasEvent.cxx.

◆ TMidasEvent() [2/2]

TMidasEvent::TMidasEvent ( const TMidasEvent rhs)

copy constructor

Definition at line 44 of file TMidasEvent.cxx.

Here is the call graph for this function:

◆ ~TMidasEvent()

TMidasEvent::~TMidasEvent ( )

destructor

Definition at line 49 of file TMidasEvent.cxx.

Here is the call graph for this function:

Member Function Documentation

◆ AllocateData()

void TMidasEvent::AllocateData ( )

allocate data buffer using the existing event header

Definition at line 369 of file TMidasEvent.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Clear()

void TMidasEvent::Clear ( )

clear event for reuse

Definition at line 63 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ Copy()

void TMidasEvent::Copy ( const TMidasEvent rhs)

copy helper

Definition at line 30 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ FindBank()

int TMidasEvent::FindBank ( const char *  bankName,
int *  bankLength,
int *  bankType,
void **  bankPtr 
) const

Find a data bank.

Parameters
[in]nameName of the data bank to look for.
[out]bklenNumber of array elements in this bank.
[out]bktypeBank data type (MIDAS TID_xxx).
[out]pdataPointer to bank data, Returns NULL if bank not found.
Returns
1 if bank found, 0 otherwise.

Definition at line 165 of file TMidasEvent.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBankList()

const char * TMidasEvent::GetBankList ( ) const

return a list of data banks

Definition at line 378 of file TMidasEvent.cxx.

◆ GetData()

char * TMidasEvent::GetData ( )

return pointer to the data buffer

Definition at line 118 of file TMidasEvent.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDataSize()

uint32_t TMidasEvent::GetDataSize ( ) const

return the event size

Definition at line 113 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ GetEventHeader()

TMidas_EVENT_HEADER * TMidasEvent::GetEventHeader ( )

return pointer to the event header

Definition at line 125 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ GetEventId()

uint16_t TMidasEvent::GetEventId ( ) const

return the event id

Definition at line 93 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ GetSerialNumber()

uint32_t TMidasEvent::GetSerialNumber ( ) const

return the serial number

Definition at line 103 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ GetTimeStamp()

uint32_t TMidasEvent::GetTimeStamp ( ) const

return the time stamp (unix time in seconds)

Definition at line 108 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ GetTriggerMask()

uint16_t TMidasEvent::GetTriggerMask ( ) const

return the triger mask

Definition at line 98 of file TMidasEvent.cxx.

◆ IsBank32()

bool TMidasEvent::IsBank32 ( ) const

returns "true" if event uses bk_init32() banks

Definition at line 135 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ IsBank32a()

bool TMidasEvent::IsBank32a ( ) const

returns "true" if event uses bk_init32a() banks

Definition at line 140 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ IsGoodSize()

bool TMidasEvent::IsGoodSize ( ) const

validate the event length

Definition at line 130 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ IterateBank()

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.

Parameters
[in]pbkPointer to the bank header, must be NULL for the first call to this function. Returns NULL if no more banks
[in]pdataPointer to data area of bank. Returns NULL if no more banks
Returns
Size of bank in bytes or 0 if no more banks.

Definition at line 448 of file TMidasEvent.cxx.

Here is the caller graph for this function:

◆ IterateBank32()

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.

Here is the caller graph for this function:

◆ IterateBank32a()

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.

Here is the caller graph for this function:

◆ LocateBank()

int TMidasEvent::LocateBank ( const void *  unused,
const char *  bankName,
void **  bankPtr 
) const

See FindBank()

Definition at line 145 of file TMidasEvent.cxx.

Here is the call graph for this function:

◆ operator=()

TMidasEvent & TMidasEvent::operator= ( const TMidasEvent rhs)

assignement operator

Definition at line 54 of file TMidasEvent.cxx.

Here is the call graph for this function:

◆ Print()

void TMidasEvent::Print ( const char *  option = "") const

show all event information

Print data held in this class.

Parameters
[in]optionIf 'a' (for "all") then the raw data will be printed out too.

Definition at line 291 of file TMidasEvent.cxx.

Here is the call graph for this function:

◆ SetBankList()

int TMidasEvent::SetBankList ( )

create the list of data banks, return number of banks

Definition at line 383 of file TMidasEvent.cxx.

Here is the call graph for this function:

◆ SetData()

void TMidasEvent::SetData ( uint32_t  dataSize,
char *  dataBuffer 
)

set an externally allocated data buffer

Definition at line 83 of file TMidasEvent.cxx.

Here is the call graph for this function:

◆ SwapBytes()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SwapBytesEventHeader()

void TMidasEvent::SwapBytesEventHeader ( )

convert event header between little-endian (Linux-x86) and big endian (MacOS-PPC)

Definition at line 605 of file TMidasEvent.cxx.

Field Documentation

◆ fAllocatedByUs

bool TMidasEvent::fAllocatedByUs
protected

"true" if we own the data buffer

Definition at line 75 of file TMidasEvent.h.

◆ fBankList

char* TMidasEvent::fBankList
protected

list of bank names in this event

Definition at line 74 of file TMidasEvent.h.

◆ fBanksN

int TMidasEvent::fBanksN
protected

number of banks in this event

Definition at line 73 of file TMidasEvent.h.

◆ fData

char* TMidasEvent::fData
protected

event data buffer

Definition at line 72 of file TMidasEvent.h.

◆ fEventHeader

TMidas_EVENT_HEADER TMidasEvent::fEventHeader
protected

event header

Definition at line 71 of file TMidasEvent.h.


The documentation for this class was generated from the following files: