It does not properly swap the multi-event chunk returned by the ET system for ET versions > 15.
Buffer size grows rapidly if #define ET_CHUNK_SIZE is set to any value other than 1, resulting in assert(bpi * evbuffer.size() >= (size_t)nbytes) failing.
It returns the entire multi-event chunk to the user instead of individual events. Returning single events is the expected behavior.
Fix
Bryan Moffit's example utilizes two additional structures:
all of which were brought into THaEtClient as private members. These members abstract away the core functionality of THaEtClient::codaRead(...). They correctly obtain multi-event chunks from the ET system, return single events to the user (analogous behavior to the THaCodaFile class), and return the multi-event chunk once all events have been used.
Testing
This port was tested with japan-MOLLER, using a simple software-based CODA setup. A Hall A analyzer test setup is not available for a direct testing, but japan-MOLLER and Podd should be identical in their use of THaEtClient as a wrapper to the ET library.
Fix for the THaETClass by porting Bryan Moffit's et_consumer example into the class.
Issue
The current THaEtClient class is non-functional.
#define ET_CHUNK_SIZE
is set to any value other than 1, resulting inassert(bpi * evbuffer.size() >= (size_t)nbytes)
failing.Fix
Bryan Moffit's example utilizes two additional structures:
struct etChunkStat
struct evetHandle
and five additional supporting member functions:
int32_t evetOpen(et_sys_id etSysId, int32_t chunk, evetHandle_t &evh)
int32_t evetClose(evetHandle_t &evh)
int32_t evetReadNoCopy(evetHandle_t &evh, const uint32_t **outputBuffer, uint32_t *length)
int32_t evetGetEtChunks(evetHandle_t &evh)
int32_t evetGetChunk(evetHandle_t &evh)
all of which were brought into THaEtClient as private members. These members abstract away the core functionality of
THaEtClient::codaRead(...)
. They correctly obtain multi-event chunks from the ET system, return single events to the user (analogous behavior to the THaCodaFile class), and return the multi-event chunk once all events have been used.Testing
This port was tested with japan-MOLLER, using a simple software-based CODA setup. A Hall A analyzer test setup is not available for a direct testing, but japan-MOLLER and Podd should be identical in their use of THaEtClient as a wrapper to the ET library.
@hansenjo