Hall-D Software
alpha
|
#include <HDET.h>
Public Types | |
enum | { HDET_OK =0, HDET_ERROR, HDET_NO_ET_SUPPORT, HDET_TIMEOUT, HDET_ET_SYSTEM_DEAD, HDET_ALLOC_FAILED, HDET_BAD_FORMAT } |
Public Member Functions | |
HDET (string source_name, int ET_STATION_NEVENTS=10, bool ET_STATION_CREATE_BLOCKING=false) | |
virtual | ~HDET () |
bool | read (uint32_t *&buff, uint32_t &buff_len, bool allow_swap) |
void | PrintEVIOBlockHeader (uint32_t *buff) |
void | PrintStats (void) |
void | DumpBinary (const uint32_t *iptr, const uint32_t *iend, uint32_t MaxWords=0, const uint32_t *imark=NULL) |
string | HexStr (uint32_t v) |
string | HexStr (uint16_t v) |
string | HexStr (uint8_t v) |
Public Attributes | |
enum HDET:: { ... } | ERRORCODE_t |
string | source_name |
bool | is_connected |
stringstream | err_mess |
uint32_t | err_code |
int | ET_STATION_NEVENTS |
bool | ET_STATION_CREATE_BLOCKING |
uint64_t | Net_events |
uint64_t | Nevio_blocks |
uint64_t | Nevio_events |
uint64_t | Net_timeouts |
int | VERBOSE |
bool | swap_needed |
list< pair< uint32_t *, uint32_t > > | et_buffs |
list< pair< uint32_t *, uint32_t > > | et_buff_pool |
Protected Member Functions | |
void | ClearErrorMessage (void) |
void | SetErrorMessage (string mess) |
anonymous enum |
HDET::HDET | ( | string | source_name, |
int | ET_STATION_NEVENTS = 10 , |
||
bool | ET_STATION_CREATE_BLOCKING = false |
||
) |
Definition at line 22 of file HDET.cc.
References err_code, HDET_OK, is_connected, Net_events, Net_timeouts, Nevents, Nevio_blocks, Nevio_events, source_name, str, string, swap_needed, and VERBOSE.
|
virtual |
Definition at line 209 of file HDET.cc.
References et_buff_pool, and is_connected.
void HDET::DumpBinary | ( | const uint32_t * | iptr, |
const uint32_t * | iend, | ||
uint32_t | MaxWords = 0 , |
||
const uint32_t * | imark = NULL |
||
) |
This is used for debugging. It will print to the screen the words starting at the address given by iptr and ending just before iend or for MaxWords words, whichever comes first. If iend is NULL, then MaxWords will be printed. If MaxWords is zero then it is ignored and only iend is checked. If both iend==NULL and MaxWords==0, then only the word at iptr is printed.
Definition at line 469 of file HDET.cc.
Referenced by read().
|
inline |
|
inline |
|
inline |
void HDET::PrintEVIOBlockHeader | ( | uint32_t * | buff | ) |
void HDET::PrintStats | ( | void | ) |
Definition at line 454 of file HDET.cc.
References Net_events, Net_timeouts, Nevio_blocks, Nevio_events, and source_name.
Referenced by JEventSource_EVIOpp::~JEventSource_EVIOpp().
bool HDET::read | ( | uint32_t *& | buff, |
uint32_t & | buff_len, | ||
bool | allow_swap | ||
) |
Read an event from the connected ET system. One ET event may contain multiple EVIO events. This method needs to return a single event in the given buffer (or a non-zero error code). To accomodate this, a single ET event is placed into multiple buffers so subsequent calls to this method can return one of those until another ET read is needed.
Note that the buff and bufflen parameters passed in here are references to the buffer in the worker thread that will be assigned to this event. In order to save time, we swap that buffer with one from our pool. Pool buffers are grown in size as needed to hold events as they are copied from the ET event.
Definition at line 223 of file HDET.cc.
References DumpBinary(), err_code, err_mess, et_buff_pool, et_buffs, HDET_ALLOC_FAILED, HDET_BAD_FORMAT, HDET_ERROR, HDET_NO_ET_SUPPORT, HDET_OK, HDET_TIMEOUT, Net_events, Net_timeouts, Nevio_blocks, Nevio_events, PrintEVIOBlockHeader(), swap32, swap_bank(), swap_needed, and VERBOSE.
Referenced by JEventSource_EVIOpp::Dispatcher().
uint32_t HDET::err_code |
Definition at line 51 of file HDET.h.
Referenced by JEventSource_EVIOpp::Dispatcher(), HDET(), and read().
stringstream HDET::err_mess |
Definition at line 50 of file HDET.h.
Referenced by JEventSource_EVIOpp::Dispatcher(), JEventSource_EVIOpp::JEventSource_EVIOpp(), and read().
enum { ... } HDET::ERRORCODE_t |
list<pair<uint32_t*, uint32_t> > HDET::et_buff_pool |
list<pair<uint32_t*, uint32_t> > HDET::et_buffs |
bool HDET::is_connected |
Definition at line 49 of file HDET.h.
Referenced by HDET(), JEventSource_EVIOpp::JEventSource_EVIOpp(), and ~HDET().
uint64_t HDET::Net_events |
Definition at line 55 of file HDET.h.
Referenced by HDET(), PrintStats(), and read().
uint64_t HDET::Net_timeouts |
Definition at line 58 of file HDET.h.
Referenced by HDET(), PrintStats(), and read().
uint64_t HDET::Nevio_blocks |
Definition at line 56 of file HDET.h.
Referenced by HDET(), PrintStats(), and read().
uint64_t HDET::Nevio_events |
Definition at line 57 of file HDET.h.
Referenced by HDET(), PrintStats(), and read().
string HDET::source_name |
Definition at line 48 of file HDET.h.
Referenced by HDET(), and PrintStats().
bool HDET::swap_needed |
Definition at line 68 of file HDET.h.
Referenced by JEventSource_EVIOpp::Dispatcher(), HDET(), PrintEVIOBlockHeader(), and read().
int HDET::VERBOSE |
Definition at line 67 of file HDET.h.
Referenced by HDET(), JEventSource_EVIOpp::JEventSource_EVIOpp(), and read().