ICP
1
|
#include <event_store.h>
Public Member Functions | |
boost::signals2::connection | addGoodEventCallback (const EventCallbackSlotType &slot) |
boost::signals2::connection | addAllEventCallback (const EventCallbackSlotType &slot) |
boost::signals2::connection | addGoodFrameCallback (const FrameCallbackSlotType &slot) |
boost::signals2::connection | addAllFrameCallback (const FrameCallbackSlotType &slot) |
boost::signals2::connection | addNoFrameCallback (const NoFrameCallbackSlotType &slot) |
void | flushEvents (DAEstatus &status) |
void | checkAndHistogramEvents () |
void | run () |
void | stop (bool immediate) |
request stop after processing finished More... | |
EventStoreCard (EventStore *es, DAEEventSource *dc) | |
bool | endHeaderSeen () const |
void | setOutputFileName (int run_number, bool new_run, DAEstatus &status) |
void | clearOutputFile (DAEstatus &status) |
int | eventSourceID () const |
std::string | getFileName () |
void | closeFiles () |
uint64_t | numRawEvents () |
uint64_t | numGoodEvents () |
uint64_t | nNewEventWords (DAEstatus &status) |
void | invokeNoFrameCallbacks (NoFrameCallbackMode mode) |
~EventStoreCard () | |
Static Public Member Functions | |
static std::string | fileNameForDC (int run_number, int dc_number) |
static std::string | infoFileNameForDC (int run_number, int dc_number) |
static void | getInfoFileData (const std::string &file_name, InfoFileData &info) |
Private Member Functions | |
void | updateFilePosition (DAEstatus &status) |
bool | fixFrameHeader (DAEEventHeader &head) |
void | fixBadFrameHeader (DAEEventHeader &head) |
virtual std::string | loggingPrefix () const |
EventStoreCard () | |
void | operator= (const EventStoreCard &) |
EventStoreCard (const EventStoreCard &) | |
Private Attributes | |
InfoFileData | m_data |
bool | m_keep_going |
bool | m_immediate_stop |
int | m_run_number |
Poco::ThreadPool | m_threads |
EventStore * | m_store |
DAEEventSource * | m_dc |
isisU32_t * | m_buffer |
buffer containing new events from detector card More... | |
uint32_t | m_len_buffer |
number of words in m_buffer More... | |
SplitFile | m_file |
std::string | m_file_name |
std::string | m_info_file_name |
EventCallbackType | m_good_event_callbacks |
EventCallbackType | m_all_event_callbacks |
FrameCallbackType | m_good_frame_callbacks |
FrameCallbackType | m_all_frame_callbacks |
NoFrameCallbackType | m_no_frame_callbacks |
Additional Inherited Members | |
Protected Member Functions inherited from ISIS::Base | |
Base (const std::string &logger_name="UNKNOWN") | |
void | setLoggerName (const std::string &logger_name) |
virtual | ~Base () |
void | setThisLoggerLevel (int level) |
Static Protected Member Functions inherited from ISIS::Base | |
static void | setAllLoggerLevel (int level) |
Protected Attributes inherited from ISIS::Base | |
Poco::Logger * | m_logger |
Poco::LogStream * | m_logstr |
Poco::Mutex | m_logger_lock |
Definition at line 160 of file event_store.h.
EventStoreCard::EventStoreCard | ( | EventStore * | es, |
DAEEventSource * | dc | ||
) |
Definition at line 407 of file event_store.cpp.
References DAEEventSource::eventSourceID(), LOGSTR_DEBUG, m_data, m_dc, InfoFileData::newFile(), and ISIS::Base::setLoggerName().
EventStoreCard::~EventStoreCard | ( | ) |
Definition at line 740 of file event_store.cpp.
References closeFiles(), and LOGSTR_DEBUG.
|
inlineprivate |
Definition at line 227 of file event_store.h.
|
inlineprivate |
Definition at line 229 of file event_store.h.
boost::signals2::connection EventStoreCard::addAllEventCallback | ( | const EventCallbackSlotType & | slot | ) |
Definition at line 764 of file event_store.cpp.
References LOGSTR_DEBUG, and m_good_event_callbacks.
Referenced by EventStore::addAllEventCallback().
boost::signals2::connection EventStoreCard::addAllFrameCallback | ( | const FrameCallbackSlotType & | slot | ) |
Definition at line 776 of file event_store.cpp.
References LOGSTR_DEBUG, and m_all_frame_callbacks.
Referenced by EventStore::addAllFrameCallback().
boost::signals2::connection EventStoreCard::addGoodEventCallback | ( | const EventCallbackSlotType & | slot | ) |
Definition at line 758 of file event_store.cpp.
References LOGSTR_DEBUG, and m_good_event_callbacks.
Referenced by EventStore::addGoodEventCallback().
boost::signals2::connection EventStoreCard::addGoodFrameCallback | ( | const FrameCallbackSlotType & | slot | ) |
Definition at line 770 of file event_store.cpp.
References LOGSTR_DEBUG, and m_good_frame_callbacks.
Referenced by EventStore::addGoodFrameCallback().
boost::signals2::connection EventStoreCard::addNoFrameCallback | ( | const NoFrameCallbackSlotType & | slot | ) |
Definition at line 782 of file event_store.cpp.
References LOGSTR_DEBUG, and m_no_frame_callbacks.
Referenced by EventStore::addNoFrameCallback().
void EventStoreCard::checkAndHistogramEvents | ( | ) |
Definition at line 628 of file event_store.cpp.
References DAEEventHeaderInfo::bad_frame, DAEEventList::checkEventHeader(), DAE_EVENT_HEADER_WORDS, DAEEventHeaderFixedMarker, DAEEventSource::eventSourceID(), DAEEventList::findValidEventHeaderOffset(), fixBadFrameHeader(), fixFrameHeader(), DAEEventHeader::frame_number, DAEEventSource::getDAE2SpecMap(), InfoFileData::good_events, InfoFileData::good_frames, InfoFileData::header, InfoFileData::header_words, DAEEventHeader::info, DAEEventList::isEndRunHeader(), InfoFileData::last_frame, LOGSTR_DEBUG, LOGSTR_INFORMATION, LOGSTR_WARNING, m_all_event_callbacks, m_all_frame_callbacks, m_buffer, m_data, m_dc, m_file_name, m_good_event_callbacks, m_good_frame_callbacks, m_immediate_stop, m_len_buffer, ISIS::Base::m_logstr, DAEEventHeader::num_events, InfoFileData::num_events, DAEEventList::printEventHeader(), InfoFileData::raw_events, and InfoFileData::raw_frames.
Referenced by run().
void EventStoreCard::clearOutputFile | ( | DAEstatus & | status | ) |
Definition at line 448 of file event_store.cpp.
References SplitFile::discardContents(), DAEEventSource::eventSourceID(), LOGSTR_DEBUG, LOGSTR_WARNING, m_data, m_dc, m_file, m_keep_going, InfoFileData::newFile(), SplitFile::seek(), and updateFilePosition().
Referenced by EventStore::clearOutputFile(), and setOutputFileName().
void EventStoreCard::closeFiles | ( | ) |
Definition at line 746 of file event_store.cpp.
References SplitFile::close(), SplitFile::isOpen(), LOGSTR_DEBUG, and m_file.
Referenced by EventStore::closeOutputFile(), and ~EventStoreCard().
|
inline |
Definition at line 182 of file event_store.h.
References InfoFileData::end_header_present, and m_data.
Referenced by EventStore::endHeaderSeen().
|
inline |
Definition at line 185 of file event_store.h.
References DAEEventSource::eventSourceID(), and m_dc.
Referenced by EventStore::getEnabledEventSourceIDs(), EventStore::getEventSourceIDs(), loggingPrefix(), EventStore::setCardStatus(), and EventStore::start().
|
static |
Definition at line 416 of file event_store.cpp.
References EventStore::baseDir().
Referenced by FileEventSource::FileEventSource(), and setOutputFileName().
|
private |
Definition at line 621 of file event_store.cpp.
References DAEEventHeaderInfo::bad_frame, DAEEventHeader::info, and DAEEventHeader::period.
Referenced by checkAndHistogramEvents().
|
private |
This is a workaround for period card corruption with two crates we just fix the frame number here and fix protons, period, info.bad_frame etc. later return true if fix it, false otherwise
Definition at line 607 of file event_store.cpp.
References DAEEventHeader::frame_number, InfoFileData::last_frame, and m_data.
Referenced by checkAndHistogramEvents().
void EventStoreCard::flushEvents | ( | DAEstatus & | status | ) |
Definition at line 587 of file event_store.cpp.
References InfoFileData::file_words, SplitFile::flush(), SplitFile::isOpen(), LOGSTR_DEBUG, m_buffer, m_data, m_file, m_file_name, m_len_buffer, and SplitFile::write().
Referenced by run().
|
inline |
Definition at line 187 of file event_store.h.
References m_file_name.
Referenced by EventStore::findUnusedFileInputSources().
|
static |
Definition at line 434 of file event_store.cpp.
References atomic_read(), and InfoFileData::newFile().
Referenced by FileEventSource::FileEventSource(), and setOutputFileName().
|
static |
Definition at line 425 of file event_store.cpp.
References EventStore::baseDir().
Referenced by FileEventSource::FileEventSource(), and setOutputFileName().
void EventStoreCard::invokeNoFrameCallbacks | ( | NoFrameCallbackMode | mode | ) |
Definition at line 582 of file event_store.cpp.
References InfoFileData::end_header_present, DAEEventSource::eventSourceID(), m_data, m_dc, and m_no_frame_callbacks.
Referenced by EventStore::invokeNoFrameCallbacks(), and run().
|
inlineprivatevirtual |
Reimplemented from ISIS::Base.
Definition at line 225 of file event_store.h.
References eventSourceID().
uint64_t EventStoreCard::nNewEventWords | ( | DAEstatus & | status | ) |
Definition at line 577 of file event_store.cpp.
References m_dc, and DAEEventSource::nNewEventWords().
Referenced by EventStore::nNewEventWords().
|
inline |
Definition at line 193 of file event_store.h.
References InfoFileData::good_events, and m_data.
Referenced by EventStore::numGoodEvents().
|
inline |
Definition at line 192 of file event_store.h.
References m_data, and InfoFileData::raw_events.
Referenced by EventStore::numRawEvents().
|
inlineprivate |
Definition at line 228 of file event_store.h.
void EventStoreCard::run | ( | ) |
Definition at line 534 of file event_store.cpp.
References EventStore::bufferSize(), checkAndHistogramEvents(), InfoFileData::end_header_present, flushEvents(), EventStore::getBuffer(), DAEEventSource::getNewEvents(), invokeNoFrameCallbacks(), LOGSTR_DEBUG, LOGSTR_WARNING, m_buffer, m_data, m_dc, m_file_name, m_immediate_stop, m_keep_going, m_len_buffer, m_store, m_threads, DAEEventSource::nNewEventWords(), NoFrameRunning, NoFrameStop, EventStore::releaseBuffer(), and updateFilePosition().
void EventStoreCard::setOutputFileName | ( | int | run_number, |
bool | new_run, | ||
DAEstatus & | status | ||
) |
<
Definition at line 462 of file event_store.cpp.
References clearOutputFile(), SplitFile::close(), DAEEventSource::eventSourceID(), InfoFileData::file_words, fileNameForDC(), getInfoFileData(), DAEEventSource::getLastAddressRead(), InfoFileData::good_frames, infoFileNameForDC(), SplitFile::isOpen(), InfoFileData::last_address_read, InfoFileData::last_frame, LOGSTR_DEBUG, LOGSTR_ERROR, LOGSTR_INFORMATION, LOGSTR_WARNING, m_data, m_dc, m_file, m_file_name, m_info_file_name, m_run_number, InfoFileData::newFile(), SplitFile::open(), IFile::ReadWriteCreate, SplitFile::seek(), DAEEventSource::setLastAddressRead(), DAEEventSource::updateDAEEventLastRead(), and updateFilePosition().
Referenced by EventStore::setOutputFileName().
|
inline |
request stop after processing finished
Definition at line 178 of file event_store.h.
References m_immediate_stop, and m_keep_going.
Referenced by EventStore::stop().
|
private |
Definition at line 518 of file event_store.cpp.
References atomic_write(), InfoFileData::file_words, DAEEventSource::getLastAddressRead(), SplitFile::isOpen(), InfoFileData::last_address_read, LOGSTR_DEBUG, m_data, m_dc, m_file, m_file_name, m_info_file_name, and DAEEventSource::updateDAEEventLastRead().
Referenced by clearOutputFile(), run(), and setOutputFileName().
|
private |
Definition at line 218 of file event_store.h.
Referenced by checkAndHistogramEvents().
|
private |
Definition at line 220 of file event_store.h.
Referenced by addAllFrameCallback(), and checkAndHistogramEvents().
|
private |
buffer containing new events from detector card
Definition at line 212 of file event_store.h.
Referenced by checkAndHistogramEvents(), flushEvents(), and run().
|
private |
Definition at line 199 of file event_store.h.
Referenced by checkAndHistogramEvents(), clearOutputFile(), endHeaderSeen(), EventStoreCard(), fixFrameHeader(), flushEvents(), invokeNoFrameCallbacks(), numGoodEvents(), numRawEvents(), run(), setOutputFileName(), and updateFilePosition().
|
private |
Definition at line 211 of file event_store.h.
Referenced by checkAndHistogramEvents(), clearOutputFile(), eventSourceID(), EventStoreCard(), invokeNoFrameCallbacks(), nNewEventWords(), run(), setOutputFileName(), and updateFilePosition().
|
private |
Definition at line 214 of file event_store.h.
Referenced by clearOutputFile(), closeFiles(), flushEvents(), setOutputFileName(), and updateFilePosition().
|
private |
Definition at line 215 of file event_store.h.
Referenced by checkAndHistogramEvents(), flushEvents(), getFileName(), run(), setOutputFileName(), and updateFilePosition().
|
private |
Definition at line 217 of file event_store.h.
Referenced by addAllEventCallback(), addGoodEventCallback(), and checkAndHistogramEvents().
|
private |
Definition at line 219 of file event_store.h.
Referenced by addGoodFrameCallback(), and checkAndHistogramEvents().
|
private |
Definition at line 201 of file event_store.h.
Referenced by checkAndHistogramEvents(), run(), and stop().
|
private |
Definition at line 216 of file event_store.h.
Referenced by setOutputFileName(), and updateFilePosition().
|
private |
Definition at line 200 of file event_store.h.
Referenced by clearOutputFile(), run(), and stop().
|
private |
number of words in m_buffer
Definition at line 213 of file event_store.h.
Referenced by checkAndHistogramEvents(), flushEvents(), and run().
|
private |
Definition at line 221 of file event_store.h.
Referenced by addNoFrameCallback(), and invokeNoFrameCallbacks().
|
private |
Definition at line 208 of file event_store.h.
Referenced by setOutputFileName().
|
private |
Definition at line 210 of file event_store.h.
Referenced by run().
|
private |
Definition at line 209 of file event_store.h.
Referenced by run().