DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::hsilibs::HSIFrameProcessor Class Reference

#include <HSIFrameProcessor.hpp>

Inheritance diagram for dunedaq::hsilibs::HSIFrameProcessor:
[legend]
Collaboration diagram for dunedaq::hsilibs::HSIFrameProcessor:
[legend]

Public Types

using inherited = datahandlinglibs::TaskRawDataProcessorModel<hsilibs::HSI_FRAME_STRUCT>
 
using frameptr = hsilibs::HSI_FRAME_STRUCT*
 
using timestamp_t = std::uint64_t
 
- Public Types inherited from dunedaq::opmonlib::MonitorableObject
using NodePtr = std::weak_ptr<MonitorableObject>
 
using NewNodePtr = std::shared_ptr<MonitorableObject>
 
using ElementId = std::string
 

Public Member Functions

 HSIFrameProcessor (std::unique_ptr< datahandlinglibs::FrameErrorRegistry > &error_registry, bool)
 
void conf (const appmodel::DataHandlerModule *conf) override
 Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
 
- Public Member Functions inherited from dunedaq::datahandlinglibs::TaskRawDataProcessorModel< hsilibs::HSI_FRAME_STRUCT >
 TaskRawDataProcessorModel (std::unique_ptr< FrameErrorRegistry > &error_registry, bool post_processing_enabled)
 
 ~TaskRawDataProcessorModel ()
 
void conf (const appmodel::DataHandlerModule *conf) override
 Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
 
void scrap (const nlohmann::json &) override
 Unconfigure.
 
void start (const nlohmann::json &) override
 Start operation.
 
void stop (const nlohmann::json &) override
 Stop operation.
 
void reset_last_daq_time ()
 
std::uint64_t get_last_daq_time () override
 Get newest timestamp of last seen packet.
 
void preprocess_item (hsilibs::HSI_FRAME_STRUCT *item) override
 Preprocess one element.
 
void postprocess_item (const hsilibs::HSI_FRAME_STRUCT *item) override
 Postprocess one element.
 
void add_preprocess_task (Task &&task)
 
void add_postprocess_task (Task &&task)
 
void invoke_all_preprocess_functions (hsilibs::HSI_FRAME_STRUCT *item)
 
void launch_all_preprocess_functions (hsilibs::HSI_FRAME_STRUCT *item)
 
- Public Member Functions inherited from dunedaq::datahandlinglibs::RawDataProcessorConcept< hsilibs::HSI_FRAME_STRUCT >
 RawDataProcessorConcept ()
 
 RawDataProcessorConcept (const RawDataProcessorConcept &)=delete
 RawDataProcessorConcept is not copy-constructible.
 
 RawDataProcessorConcept (RawDataProcessorConcept &&)=delete
 RawDataProcessorConcept is not move-constructible.
 
virtual ~RawDataProcessorConcept ()
 
RawDataProcessorConceptoperator= (const RawDataProcessorConcept &)=delete
 RawDataProcessorConcept is not copy-assginable.
 
RawDataProcessorConceptoperator= (RawDataProcessorConcept &&)=delete
 RawDataProcessorConcept is not move-assignable.
 
- Public Member Functions inherited from dunedaq::opmonlib::MonitorableObject
 MonitorableObject (const MonitorableObject &)=delete
 
MonitorableObjectoperator= (const MonitorableObject &)=delete
 
 MonitorableObject (MonitorableObject &&)=delete
 
MonitorableObjectoperator= (MonitorableObject &&)=delete
 
virtual ~MonitorableObject ()=default
 
auto get_opmon_id () const noexcept
 
auto get_opmon_level () const noexcept
 

Protected Member Functions

void timestamp_check (frameptr)
 
void frame_error_check (frameptr)
 
- Protected Member Functions inherited from dunedaq::datahandlinglibs::TaskRawDataProcessorModel< hsilibs::HSI_FRAME_STRUCT >
virtual void generate_opmon_data () override
 
void run_post_processing_thread (std::function< void(const hsilibs::HSI_FRAME_STRUCT *)> &function, folly::ProducerConsumerQueue< const hsilibs::HSI_FRAME_STRUCT * > &queue)
 
- Protected Member Functions inherited from dunedaq::opmonlib::MonitorableObject
 MonitorableObject ()=default
 
void register_node (ElementId name, NewNodePtr)
 
void publish (google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
 

Protected Attributes

timestamp_t m_previous_ts
 
- Protected Attributes inherited from dunedaq::datahandlinglibs::TaskRawDataProcessorModel< hsilibs::HSI_FRAME_STRUCT >
std::vector< std::function< void(hsilibs::HSI_FRAME_STRUCT *)> > m_preprocess_functions
 
std::unique_ptr< FrameErrorRegistry > & m_error_registry
 
bool m_post_processing_enabled
 
std::atomic< bool > m_run_marker
 
std::vector< std::function< void(const hsilibs::HSI_FRAME_STRUCT *)> > m_post_process_functions
 
std::vector< std::unique_ptr< folly::ProducerConsumerQueue< const hsilibs::HSI_FRAME_STRUCT * > > > m_items_to_postprocess_queues
 
std::vector< std::unique_ptr< utilities::ReusableThread > > m_post_process_threads
 
size_t m_postprocess_queue_sizes
 
daqdataformats::SourceID m_sourceid
 
std::atomic< uint64_t > m_last_processed_daq_ts
 

Additional Inherited Members

- Static Public Member Functions inherited from dunedaq::opmonlib::MonitorableObject
static bool publishable_metric (OpMonLevel entry, OpMonLevel system) noexcept
 

Detailed Description

Definition at line 27 of file HSIFrameProcessor.hpp.

Member Typedef Documentation

◆ frameptr

◆ inherited

◆ timestamp_t

Definition at line 33 of file HSIFrameProcessor.hpp.

Constructor & Destructor Documentation

◆ HSIFrameProcessor()

dunedaq::hsilibs::HSIFrameProcessor::HSIFrameProcessor ( std::unique_ptr< datahandlinglibs::FrameErrorRegistry > & error_registry,
bool  )
inlineexplicit

Definition at line 36 of file HSIFrameProcessor.hpp.

37 : TaskRawDataProcessorModel<hsilibs::HSI_FRAME_STRUCT>(error_registry, false)
38 , m_previous_ts(0)
39 {}

Member Function Documentation

◆ conf()

void dunedaq::hsilibs::HSIFrameProcessor::conf ( const appmodel::DataHandlerModule * conf)
overridevirtual

Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.

Implements dunedaq::datahandlinglibs::RawDataProcessorConcept< hsilibs::HSI_FRAME_STRUCT >.

Definition at line 23 of file HSIFrameProcessor.cpp.

24{
26 std::bind(&HSIFrameProcessor::timestamp_check, this, std::placeholders::_1));
27 // m_tasklist.push_back( std::bind(&HSIFrameProcessor::frame_error_check, this, std::placeholders::_1) );
29}
void conf(const appmodel::DataHandlerModule *conf) override
Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.

◆ frame_error_check()

void dunedaq::hsilibs::HSIFrameProcessor::frame_error_check ( frameptr )
protected

Pipeline Stage 2.: Check for error

Pipeline Stage 2.: Check for errors

Definition at line 56 of file HSIFrameProcessor.cpp.

57{
58 // check error fields
59}

◆ timestamp_check()

void dunedaq::hsilibs::HSIFrameProcessor::timestamp_check ( frameptr fp)
protected

Pipeline Stage 1.: Check proper timestamp increments in HSI frame

Definition at line 32 of file HSIFrameProcessor.cpp.

33{
34 // Acquire timestamp
35 timestamp_t current_ts = fp->get_timestamp();
36 uint64_t k_clock_frequency = 62500000; // NOLINT(build/unsigned)
37 TLOG_DEBUG(TLVL_FRAME_RECEIVED) << "Received HSI frame timestamp value of " << current_ts << " ticks (..."
38 << std::fixed << std::setprecision(8) << (static_cast<double>(current_ts % (k_clock_frequency*1000)) / static_cast<double>(k_clock_frequency)) << " sec)"; // NOLINT
39
40 if (current_ts < m_previous_ts) {
41 TLOG() << "*** Data Integrity ERROR *** Current HSIFrame timestamp " << current_ts << " is before previous timestamp " << m_previous_ts;
42 }
43
44 if (current_ts == 0) {
45 TLOG() << "*** Data Integrity ERROR *** Current HSIFrame timestamp " << current_ts << " is 0";
46 }
47
48 m_previous_ts = current_ts;
49 m_last_processed_daq_ts = current_ts;
50}
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
#define TLOG(...)
Definition macro.hpp:22

Member Data Documentation

◆ m_previous_ts

timestamp_t dunedaq::hsilibs::HSIFrameProcessor::m_previous_ts
protected

Definition at line 57 of file HSIFrameProcessor.hpp.


The documentation for this class was generated from the following files: