#include <EventDecoder.h>
Definition at line 25 of file EventDecoder.h.
EventDecoder::EventDecoder |
( |
size_t |
nch, |
|
|
size_t |
nsample |
|
) |
| |
Definition at line 27 of file EventDecoder_service.cc.
pthread_mutex_t m_data_mutex
static const size_t FileFootSz
std::vector< BYTE > m_EndFootBuf
static const size_t RunHeadSz
static const size_t EveHeadSz
static const short BitsADC
std::vector< BYTE > m_EveHeadBuf
std::vector< BYTE > m_RunHeadBuf
EventDecoder::~EventDecoder |
( |
| ) |
|
void EventDecoder::Close |
( |
| ) |
|
Definition at line 59 of file EventDecoder_service.cc.
pthread_mutex_t m_data_mutex
int lock(pthread_mutex_t &mutex)
int unlock(pthread_mutex_t &mutex)
bool dlardaq::EventDecoder::Compressed |
( |
| ) |
const |
|
inline |
Definition at line 261 of file EventDecoder_service.cc.
static constexpr double nb
static HuffDataCompressor & Instance()
void DecompressEventData(short nbadc, size_t nch, size_t seqlen, const char *buf, size_t bufsize, size_t &byteidx, std::vector< adc16_t > &adc)
void unpack12into16(const void *in, void *out, size_t n)
Definition at line 185 of file EventDecoder_service.cc.
189 if(!
m_file.is_open())
return -1;
202 while( curev <= evnum )
pthread_mutex_t m_data_mutex
std::vector< std::streampos > m_events
int lock(pthread_mutex_t &mutex)
void ReadEvent(std::vector< adc16_t > &adc, bool headonly=false)
int unlock(pthread_mutex_t &mutex)
Definition at line 229 of file EventDecoder_service.cc.
pthread_mutex_t m_data_mutex
int lock(pthread_mutex_t &mutex)
ssize_t GetEvent(size_t evnum, dlardaq::evheader_t &eh, std::vector< adc16_t > &adc)
int unlock(pthread_mutex_t &mutex)
std::vector< adc16_t > m_EveData
evheader_t dlardaq::EventDecoder::GetEventHeader |
( |
| ) |
|
|
inline |
footer_t dlardaq::EventDecoder::GetFileFooter |
( |
| ) |
|
|
inline |
size_t dlardaq::EventDecoder::GetNCh |
( |
| ) |
const |
|
inline |
size_t dlardaq::EventDecoder::GetNSample |
( |
| ) |
const |
|
inline |
size_t dlardaq::EventDecoder::GetTotEvents |
( |
| ) |
const |
|
inline |
bool EventDecoder::IsFirstPacket |
( |
const char * |
buf, |
|
|
size_t |
nb |
|
) |
| |
|
protected |
int dlardaq::EventDecoder::lock |
( |
pthread_mutex_t & |
mutex | ) |
|
|
inlineprotected |
Definition at line 78 of file EventDecoder_service.cc.
91 m_file.open(finname.c_str(), ios::in | ios::binary);
95 msg_err<<
"Could not open "<<finname<<
" for reading"<<
endl;
pthread_mutex_t m_data_mutex
static const size_t FileFootSz
std::vector< std::streampos > m_events
std::vector< BYTE > m_EndFootBuf
ssize_t decode_runhead(const char *buf, runheader_t &rh)
int lock(pthread_mutex_t &mutex)
ssize_t decode_filefoot(const char *buf, footer_t &rf)
void ReadBytes(std::vector< BYTE > &bytes)
int unlock(pthread_mutex_t &mutex)
static LogStream msg_err(std::cerr, _strerror)
std::vector< BYTE > m_RunHeadBuf
std::vector< adc16_t > m_EveData
QTextStream & endl(QTextStream &s)
void EventDecoder::ReadBuffer |
( |
const char * |
buf, |
|
|
size_t |
nb |
|
) |
| |
Definition at line 286 of file EventDecoder_service.cc.
290 msg_err<<
"Cannot use this function while reading data from a file"<<
endl;
308 const char *pdata = buf;
pthread_mutex_t m_data_mutex
static constexpr double nb
ssize_t decode_evehead(const char *buf, evheader_t &eh)
static Timer & GetTimer()
ssize_t decode_runhead(const char *buf, runheader_t &rh)
std::vector< BYTE > m_EveDataBuf
int lock(pthread_mutex_t &mutex)
static LogStream msg_info(std::cout, _strinfo)
int unlock(pthread_mutex_t &mutex)
ssize_t Decode(const char *buf, size_t nb, bool cflag, std::vector< adc16_t > &adc)
static LogStream msg_err(std::cerr, _strerror)
std::vector< adc16_t > m_EveData
bool IsFirstPacket(const char *buf, size_t nb)
QTextStream & endl(QTextStream &s)
Definition at line 148 of file EventDecoder_service.cc.
167 m_file.seekg(evsz, std::ios::cur);
ssize_t decode_evehead(const char *buf, evheader_t &eh)
std::vector< BYTE > m_EveDataBuf
void ReadBytes(std::vector< BYTE > &bytes)
std::vector< BYTE > m_EveHeadBuf
ssize_t Decode(const char *buf, size_t nb, bool cflag, std::vector< adc16_t > &adc)
void dlardaq::EventDecoder::SetNCh |
( |
size_t |
val | ) |
|
|
inline |
void dlardaq::EventDecoder::SetNSample |
( |
size_t |
val | ) |
|
|
inline |
int dlardaq::EventDecoder::trylock |
( |
pthread_mutex_t & |
mutex | ) |
|
|
inlineprotected |
int dlardaq::EventDecoder::unlock |
( |
pthread_mutex_t & |
mutex | ) |
|
|
inlineprotected |
ssize_t dlardaq::EventDecoder::m_bytes_left |
|
protected |
pthread_mutex_t dlardaq::EventDecoder::m_data_mutex |
|
protected |
bool dlardaq::EventDecoder::m_dcflag |
|
protected |
std::vector<std::streampos> dlardaq::EventDecoder::m_events |
|
protected |
std::ifstream dlardaq::EventDecoder::m_file |
short dlardaq::EventDecoder::m_nadc |
|
protected |
size_t dlardaq::EventDecoder::m_nch |
|
protected |
size_t dlardaq::EventDecoder::m_nsample |
|
protected |
std::streampos dlardaq::EventDecoder::m_pend |
|
protected |
std::streampos dlardaq::EventDecoder::m_pstart |
|
protected |
size_t dlardaq::EventDecoder::m_totev |
|
protected |
int dlardaq::EventDecoder::m_Verbosity |
|
protected |
The documentation for this class was generated from the following files: