14 typedef boost::signals2::signal< void(const DAEEventHeader*, const DetectorEvent32*, int, int, const int*) >
EventCallbackType;
46 template<
typename SLOT>
47 std::list<boost::signals2::connection>
addCallback(boost::signals2::connection (
EventStoreCard::*func)(
const SLOT&),
const SLOT& slot);
84 void addCards(
const std::vector<DAEEventSource*>& det_list);
91 void clearCallbacks(
const std::list<boost::signals2::connection>& callback_list)
93 std::for_each(callback_list.begin(), callback_list.end(), boost::bind(&boost::signals2::connection::disconnect, _1));
96 void stop(
bool immediate);
113 m_base_dir = Poco::Util::Application::instance().config().getString(
"isisicp.eventdir",
"c:\\data\\events");
120 Poco::Path the_dir(
baseDir(),
"");
121 the_dir.pushDirectory(Poco::format(
"run_%d", run_number));
188 static std::string
fileNameForDC(
int run_number,
int dc_number);
void flushEvents(DAEstatus &status)
const int * getDAE2SpecMap()
EventStoreCard(const EventStoreCard &)
void setLastAddressRead(isisU32_t addr)
static std::string fileNameForDC(int run_number, int dc_number)
boost::signals2::signal< void(bool, NoFrameCallbackMode, int) > NoFrameCallbackType
NoFrameCallbackType m_no_frame_callbacks
boost::signals2::connection addAllEventCallback(const EventCallbackSlotType &slot)
std::list< boost::signals2::connection > addGoodFrameCallback(const FrameCallbackSlotType &slot)
static std::string infoFileNameForDC(int run_number, int dc_number)
boost::signals2::connection addAllFrameCallback(const FrameCallbackSlotType &slot)
uint32_t raw_frames
total number of raw frames in file
static int eventSourceIDFromFileInputSource(const std::string &file)
uint32_t m_pos_sent
number of events sent from pos
Poco::MemoryPool m_mempool
virtual int eventSourceID() const =0
std::list< boost::signals2::connection > m_callbacks
uint64_t nNewEventWords(DAEstatus &status)
int eventSourceID() const
isisU32_t * m_buffer
buffer containing new events from detector card
NoFrameCallbackType::slot_type NoFrameCallbackSlotType
uint32_t m_events_sent
events sent to date
void operator=(const EventStoreCard &)
Poco::ThreadPool m_threads
std::vector< FileEventSourceBase * > m_sources
std::string getFileName()
virtual std::string loggingPrefix() const
void releaseBuffer(isisU32_t *buffer)
void readInfo(EventStore::FileEventSourceInfo &info)
std::string m_info_file_name
uint32_t getNewEvents(isisU32_t *buffer, uint32_t maxlen, uint64_t &num_unread, bool &run_ended, DAEstatus &status)
void getEnabledEventSourceIDs(std::vector< int > &ids)
void setOutputFileName(int run_number, bool new_run, DAEstatus &status)
static Poco::Path baseRunDir(int run_number)
std::string loggingPrefix() const
void setCardStatus(int id, bool enable)
uint32_t last_frame
offset to start of last frame in words
void addCard(DAEEventSource *det_card, bool enable=false)
std::string loggingPrefix() const
uint32_t last_address_read
detector card address read which corresponds to file_words
virtual ~ISISRAWEventSource()
int eventSourceID() const
ISISRAWEventSource(ISISRAW *iraw, int source_id, time_t run_start)
boost::signals2::connection addNoFrameCallback(const NoFrameCallbackSlotType &slot)
void invokeNoFrameCallbacks(NoFrameCallbackMode mode)
void closeOutputFile(DAEstatus &status)
void stop(bool immediate)
std::vector< EventStoreCardHolder > m_stores
uint64_t raw_events
total number of raw events in file
void add(const FileEventSourceInfo &f)
static const int m_mempool_size
void clearCallbacks(const std::list< boost::signals2::connection > &callback_list)
uint64_t nNewEventWords(DAEstatus &status)
uint64_t good_events
total number of good events in file
void checkAndHistogramEvents()
void fixBadFrameHeader(DAEEventHeader &head)
DAEEventHeader header
header of current frame being processed
std::list< boost::signals2::connection > addAllFrameCallback(const FrameCallbackSlotType &slot)
int sendHeader(isisU32_t *buffer, int current_frame)
std::list< boost::signals2::connection > addGoodEventCallback(const EventCallbackSlotType &slot)
EventStoreCardHolder(EventStoreCard *card_, bool enable_)
void invokeNoFrameCallbacks(NoFrameCallbackMode mode)
FrameCallbackType m_good_frame_callbacks
int readEvents(isisU32_t *buffer, uint32_t max_num_to_read, uint64_t &num_unread)
void stop(bool immediate)
request stop after processing finished
const int * getDAE2SpecMap()
uint64_t nNewEventWords(DAEstatus &status)
uint32_t m_len_buffer
number of words in m_buffer
isisU32_t getLastAddressRead()
void operator=(const FileEventSource &)
virtual ~FileEventSource()
void setLastAddressRead(isisU32_t addr)
bool fixFrameHeader(DAEEventHeader &head)
void closeAndDeleteOutputFile(int run_number, DAEstatus &status)
static void deleteOutputFile(int run_number, DAEstatus &status)
std::string m_info_file_name
int getFrame(uint32_t event_count)
find out what frame to put event number event_count into - first frame is 0
std::list< boost::signals2::connection > addCallback(boost::signals2::connection(EventStoreCard::*func)(const SLOT &), const SLOT &slot)
uint32_t m_events
total events to send
void setOutputFileName(int run_number, bool new_run, DAEstatus &status)
void updateFilePosition(DAEstatus &status)
virtual ~FileEventSourceBase()
int eventSourceID() const
uint32_t good_frames
total number of good frames in file
boost::signals2::connection addGoodEventCallback(const EventCallbackSlotType &slot)
void findUnusedFileInputSources(int run_number, std::set< std::string > &files)
static void getInfoFileData(const std::string &file_name, InfoFileData &info)
Poco::ThreadPool m_threads
EventCallbackType m_all_event_callbacks
static const Poco::Path & baseDir()
uint64_t file_words
size of all data in file in words
void clearOutputFile(DAEstatus &status)
std::list< boost::signals2::connection > addNoFrameCallback(const NoFrameCallbackSlotType &slot)
boost::signals2::signal< void(const DAEEventHeader *, const DetectorEvent32 *, int, int, const int *) > EventCallbackType
static int maxNumCallbackEvents()
boost::signals2::connection addGoodFrameCallback(const FrameCallbackSlotType &slot)
FrameCallbackType::slot_type FrameCallbackSlotType
static Poco::Path m_base_dir
FrameCallbackType m_all_frame_callbacks
void addCards(const std::vector< DAEEventSource * > &det_list)
uint32_t m_pos
current location in raw data
static void findFileInputSources(int run_number, std::set< std::string > &files)
uint64_t nNewEventWords(DAEstatus &status)
void updateDAEEventLastRead(DAEstatus &status)
uint32_t getNewEvents(isisU32_t *buffer, uint32_t maxlen, uint64_t &num_unread, bool &run_ended, DAEstatus &status)
void addRawFileInputSource(ISISRAW *iraw, int source_id, time_t run_start)
void updateDAEEventLastRead(DAEstatus &status)
std::vector< int > m_frame_events
uint32_t num_events
total number of events read in frame m_header
FileEventSource(const FileEventSource &)
EventCallbackType::slot_type EventCallbackSlotType
EventCallbackType m_good_event_callbacks
void addFileInputSource(int run_number, FileEventSourceInfo &info)
void getEventSourceIDs(std::vector< int > &ids)
std::list< boost::signals2::connection > addAllEventCallback(const EventCallbackSlotType &slot)
bool endHeaderSeen() const
uint32_t header_words
number of words of header read, if < DAE_EVENT_HEADER_WORDS then we have a partial header ...
void clearOutputFile(DAEstatus &status)
isisU32_t getLastAddressRead()
boost::signals2::signal< void(const DAEEventHeader *, int) > FrameCallbackType
void readInfo(EventStore::FileEventSourceInfo &info)