DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
triggeralgs::TCMakerProtoDUNEBSMWindowAlgorithm Class Reference

#include <TCMakerProtoDUNEBSMWindowAlgorithm.hpp>

Inheritance diagram for triggeralgs::TCMakerProtoDUNEBSMWindowAlgorithm:
[legend]
Collaboration diagram for triggeralgs::TCMakerProtoDUNEBSMWindowAlgorithm:
[legend]

Public Member Functions

void process (const TriggerActivity &, std::vector< TriggerCandidate > &)
 The function that gets call when there is a new activity.
 
void configure (const nlohmann::json &config)
 
- Public Member Functions inherited from triggeralgs::TriggerCandidateMaker
virtual ~TriggerCandidateMaker ()=default
 
void operator() (const TriggerActivity &input_ta, std::vector< TriggerCandidate > &output_tc)
 
virtual bool preprocess (const TriggerActivity &)
 TA pre-processing/filtering.
 
virtual void postprocess (std::vector< TriggerCandidate > &output_tc)
 Post-processing/filtering of the TCs, e.g. prescale.
 
virtual void flush (timestamp_t, std::vector< TriggerCandidate > &)
 

Private Attributes

uint64_t m_activity_count = 0
 
TriggerCandidate::Type m_tc_type = TriggerCandidate::Type::kUnknown
 Configurable TC type to produce by this TC algorithm.
 

Additional Inherited Members

- Public Attributes inherited from triggeralgs::TriggerCandidateMaker
std::atomic< uint64_t > m_data_vs_system_time = 0
 
std::atomic< uint64_t > m_initial_offset = 0
 
uint64_t m_prescale = 1
 Configurable prescale factor.
 
uint64_t m_tc_count = 0
 TC made count for prescaling.
 
TriggerCandidate::Type m_tc_type_out = TriggerCandidate::Type::kUnknown
 Configurable TC type output.
 

Detailed Description

Definition at line 17 of file TCMakerProtoDUNEBSMWindowAlgorithm.hpp.

Member Function Documentation

◆ configure()

void TCMakerProtoDUNEBSMWindowAlgorithm::configure ( const nlohmann::json & config)
virtual

Reimplemented from triggeralgs::TriggerCandidateMaker.

Definition at line 49 of file TCMakerProtoDUNEBSMWindowAlgorithm.cpp.

50{
52 /*
53 // Don't configure if no configuration object
54 if (!config.is_object())
55 return;
56
57 // Set the TC name
58 if (config.contains("tc_type_name")){
59 m_tc_type = static_cast<triggeralgs::TriggerCandidate::Type>(
60 dunedaq::trgdataformats::string_to_fragment_type_value(config["tc_type_name"]));
61
62 // Set unknown to the default kAEAnomalyWindow
63 if (m_tc_type == triggeralgs::TriggerCandidate::Type::kUnknown) {
64 //m_tc_type = TriggerCandidate::Type::kAEAnomalyWindow;
65 m_tc_type = TriggerCandidate::Type::kUnknown;
66 }
67
68 TLOG() << "[TCM:ADCSW]: setting output TC type to "
69 << dunedaq::trgdataformats::get_trigger_candidate_type_names()[m_tc_type];
70 }
71 */
72}
virtual void configure(const nlohmann::json &config)

◆ process()

void TCMakerProtoDUNEBSMWindowAlgorithm::process ( const TriggerActivity & activity,
std::vector< TriggerCandidate > & cand )
virtual

The function that gets call when there is a new activity.

Implements triggeralgs::TriggerCandidateMaker.

Definition at line 20 of file TCMakerProtoDUNEBSMWindowAlgorithm.cpp.

22{
23
24 // For now, if there is any single activity from any one detector element, emit
25 // a trigger candidate.
27 std::vector<TriggerActivity::TriggerActivityData> ta_list = {static_cast<TriggerActivity::TriggerActivityData>(activity)};
28
29 TLOG_DEBUG(TLVL_DEBUG_LOW) << "[TCM:ADCSW] Emitting an "
31 << " TriggerCandidate with AEAnomalyWindow algorithm" << (m_activity_count-1);
32
34 tc.time_start = activity.time_start;
35 tc.time_end = activity.time_end;
36 tc.time_candidate = activity.time_activity;
37 tc.detid = activity.detid;
38 tc.type = m_tc_type;
39 //tc.algorithm = TriggerCandidate::Algorithm::kAEAnomalyWindow;
41
42 tc.inputs = ta_list;
43
44 cand.push_back(tc);
45
46}
TriggerCandidate::Type m_tc_type
Configurable TC type to produce by this TC algorithm.
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
std::map< TriggerCandidateData::Type, std::string > get_trigger_candidate_type_names()
std::vector< dunedaq::trgdataformats::TriggerActivityData > inputs

Member Data Documentation

◆ m_activity_count

uint64_t triggeralgs::TCMakerProtoDUNEBSMWindowAlgorithm::m_activity_count = 0
private

Definition at line 29 of file TCMakerProtoDUNEBSMWindowAlgorithm.hpp.

◆ m_tc_type

TriggerCandidate::Type triggeralgs::TCMakerProtoDUNEBSMWindowAlgorithm::m_tc_type = TriggerCandidate::Type::kUnknown
private

Configurable TC type to produce by this TC algorithm.

Definition at line 32 of file TCMakerProtoDUNEBSMWindowAlgorithm.hpp.


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