Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HDET Class Reference

#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)
 

Detailed Description

Definition at line 25 of file HDET.h.

Member Enumeration Documentation

anonymous enum
Enumerator
HDET_OK 
HDET_ERROR 
HDET_NO_ET_SUPPORT 
HDET_TIMEOUT 
HDET_ET_SYSTEM_DEAD 
HDET_ALLOC_FAILED 
HDET_BAD_FORMAT 

Definition at line 28 of file HDET.h.

Constructor & Destructor Documentation

HDET::HDET ( string  source_name,
int  ET_STATION_NEVENTS = 10,
bool  ET_STATION_CREATE_BLOCKING = false 
)
HDET::~HDET ( )
virtual

Definition at line 209 of file HDET.cc.

References et_buff_pool, and is_connected.

Member Function Documentation

void HDET::ClearErrorMessage ( void  )
inlineprotected

Definition at line 75 of file HDET.h.

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.

References Ncols, and string.

Referenced by read().

string HDET::HexStr ( uint32_t  v)
inline

Definition at line 83 of file HDET.h.

References sprintf(), str, and string.

Referenced by PrintEVIOBlockHeader().

string HDET::HexStr ( uint16_t  v)
inline

Definition at line 94 of file HDET.h.

References sprintf(), str, and string.

string HDET::HexStr ( uint8_t  v)
inline

Definition at line 105 of file HDET.h.

References sprintf(), str, and string.

void HDET::PrintEVIOBlockHeader ( uint32_t *  buff)

Definition at line 417 of file HDET.cc.

References HexStr(), swap32, and swap_needed.

Referenced by read().

void HDET::PrintStats ( void  )
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().

void HDET::SetErrorMessage ( string  mess)
inlineprotected

Definition at line 76 of file HDET.h.

Member Data Documentation

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
enum { ... } HDET::ERRORCODE_t
list<pair<uint32_t*, uint32_t> > HDET::et_buff_pool

Definition at line 71 of file HDET.h.

Referenced by read(), and ~HDET().

list<pair<uint32_t*, uint32_t> > HDET::et_buffs

Definition at line 70 of file HDET.h.

Referenced by read().

bool HDET::ET_STATION_CREATE_BLOCKING

Definition at line 53 of file HDET.h.

int HDET::ET_STATION_NEVENTS

Definition at line 52 of file HDET.h.

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().


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