28namespace fdreadoutlibs {
33 TLOG() <<
"Looking for TP sink...";
36 TLOG() <<
"On outputs... (" << output->UID() <<
"," << output->get_data_type() <<
")";
38 if (output->get_data_type() ==
"TriggerPrimitiveVector") {
39 TLOG() <<
"Found TP sink.";
40 m_tp_sink = get_iom_sender<std::vector<trigger::TriggerPrimitiveTypeAdapter>>(output->UID());
41 TLOG() <<
" SINK INITIALIZED for TriggerPrimitives with UID : " << output->UID();
44 ers::error(datahandlinglibs::ResourceQueueError(
ERS_HERE,
"tp",
"DefaultRequestHandlerModel", excpt));
48 TLOG() <<
"Registering processing tasks...";
53 TLOG() <<
" PDS Data processor does not exist.";
56 if (proc_conf ==
nullptr) {
57 TLOG() <<
"PDS RawDataProcessor does not exist.";
62 if (geo_id !=
nullptr) {
63 m_det_id = geo_id->get_detector_id();
69 m_channel_map = dunedaq::detchannelmaps::make_pds_map(proc_conf->get_channel_map());
70 const std::vector<unsigned int> channel_mask_vec = proc_conf->get_channel_mask();
72 for (
int chan = 0; chan < 48; chan++) {
76 if (std::find(channel_mask_vec.begin(), channel_mask_vec.end(), off_channel) != channel_mask_vec.end())
88 TLOG() <<
"Calling parent conf.";
102 m_t0 = std::chrono::high_resolution_clock::now();
133 uint64_t k_clock_frequency = 62500000;
135 << std::fixed << std::setprecision(8)
136 << (
static_cast<double>(
m_current_ts % (k_clock_frequency * 1000)) /
137 static_cast<double>(k_clock_frequency))
142 std::cout <<
"*** Data Integrity ERROR *** Timestamp continuity is completely broken! "
143 <<
"Something is wrong with the FE source or with the configuration!\n";
165 if (!fp || fp ==
nullptr) {
225 auto now = std::chrono::high_resolution_clock::now();
227 int num_new_tps_suppressed_too_long = 0;
229 double seconds = std::chrono::duration_cast<std::chrono::microseconds>(now -
m_t0).count() / 1000000.;
#define DUNE_DAQ_TYPESTRING(Type, typestring)
Declare the datatype_to_string method for the given type.
const dunedaq::appmodel::DataProcessor * get_data_processor() const
Get "data_processor" relationship value.
const dunedaq::appmodel::DataHandlerConf * get_module_configuration() const
Get "module_configuration" relationship value.
const dunedaq::confmodel::GeoId * get_geo_id() const
Get "geo_id" relationship value.
const std::vector< const dunedaq::confmodel::Connection * > & get_outputs() const
Get "outputs" relationship value. Output connections from this module.
void start(const appfwk::DAQModule::CommandData_t &) override
void add_preprocess_task(Task &&task)
void conf(const appmodel::DataHandlerModule *conf) override
bool m_post_processing_enabled
void stop(const appfwk::DAQModule::CommandData_t &) override
virtual void generate_opmon_data() override
std::atomic< uint64_t > m_last_processed_daq_ts
void set_num_tps_send_failed(::uint64_t value)
void set_num_tps_suppressed_too_long(::uint64_t value)
void set_num_tps_sent(::uint64_t value)
void set_rate_tp_hits(float value)
virtual void generate_opmon_data() override
std::atomic< int > m_ts_error_ctr
void timestamp_check(frameptr)
const types::DAPHNEEthTypeAdapter * constframeptr
std::atomic< uint64_t > m_tps_send_failed
std::atomic< uint64_t > m_num_new_tps
std::chrono::time_point< std::chrono::high_resolution_clock > m_t0
void frame_error_check(frameptr)
std::shared_ptr< detchannelmaps::PDSChannelMap > m_channel_map
std::shared_ptr< iomanager::SenderConcept< std::vector< trigger::TriggerPrimitiveTypeAdapter > > > m_tp_sink
uint32_t m_def_adc_intg_thresh
types::DAPHNEEthTypeAdapter * frameptr
std::set< unsigned int > m_channel_mask_set
void extract_tps(constframeptr fp)
void stop(const appfwk::DAQModule::CommandData_t &args) override
Stop operation.
timestamp_t m_previous_ts
bool m_first_ts_missmatch
void start(const appfwk::DAQModule::CommandData_t &args) override
Start operation.
void conf(const appmodel::DataHandlerModule *conf) override
Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
void publish(google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
Base class for any user define issue.
#define TLOG_DEBUG(lvl,...)
void error(const Issue &issue)
uint64_t get_timestamp() const