5#ifndef TRIGDFEMULATOR_EFINTERFACEEMULATOR_H
6#define TRIGDFEMULATOR_EFINTERFACEEMULATOR_H
12#include <unordered_map>
16#include "eformat/eformat.h"
17#include "eformat/index.h"
18#include "eformat/write/eformat.h"
19#include "eformat/SourceIdentifier.h"
20#include "eformat/FullEventFragmentNoTemplates.h"
22#include <boost/interprocess/shared_memory_object.hpp>
23#include "df_ef_interface/df_ef_interface.h"
47 virtual void open()
override;
51 virtual void close()
override;
55 virtual std::future<std::unique_ptr<uint32_t[]>>
getNext()
override;
59 virtual std::future<void>
accept(uint64_t l0id, std::unique_ptr<uint32_t[]> hltr)
override;
63 virtual std::future<void>
reject(uint64_t l0id)
override;
86 std::queue<std::promise<std::unique_ptr<uint32_t[]>>>
m_inputQueue;
91 std::queue<std::pair<uint64_t, std::unique_ptr<uint32_t[]>>>
m_outputQueue;
96 std::unordered_map<uint64_t, std::vector<std::unique_ptr<uint32_t[]>>>
m_events;
std::unordered_map< uint64_t, std::vector< std::unique_ptr< uint32_t[]> > > m_events
Map of events read from the input (stores duplicates per L1ID)
EFInterfaceEmulator(const boost::property_tree::ptree &args)
std::unique_ptr< HLT::LoopThread > m_outputThread
Output handling thread (triggers post-processing of finished events)
std::mutex m_iQMutex
queue mutex
unsigned int m_compLevel
Compression type of built event.
virtual std::future< void > accept(uint64_t l0id, std::unique_ptr< uint32_t[]> hltr) override
Marks the event as accepted by the High-Level Trigger.
void inputThreadCallback()
Compression level of built event.
std::queue< std::promise< std::unique_ptr< uint32_t[]> > > m_inputQueue
queue of promises for getNext() calls
void outputThreadCallback()
The method executed by the output handling thread.
std::unique_ptr< HLT::LoopThread > m_inputThread
Input handling thread (triggers reading new events)
virtual void open() override
Opens the Session.
std::mutex m_oQMutex
queue mutex
std::mutex m_mMutex
Map mutex.
std::unique_ptr< FileReaderWriter > m_file_rw
std::mutex m_RWMutex
ReadWrite mutex for the file reader/writer.
eformat::Compression m_comp
std::queue< std::pair< uint64_t, std::unique_ptr< uint32_t[]> > > m_outputQueue
queue of promises for accept() calls
virtual void close() override
Closes the Session.
virtual ~EFInterfaceEmulator()
virtual std::future< void > reject(uint64_t l0id) override
Marks the event as rejected by the High-Level Trigger.
virtual std::future< std::unique_ptr< uint32_t[]> > getNext() override
Returns a pointer to the next Event object to be processed.