DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TAMakerSWIFTAlgorithm.hpp
Go to the documentation of this file.
1/*
2 * @File TAMakerSWIFTAlgorithm.hpp
3 *
4 * This is part of the DUNE DAQ Application Framework, copyright 2021.
5 * Licensing/copyright details are in the COPYING file that you should have
6 * received with this code.
7 */
8
9#ifndef TRIGGERALGS_SWIFT_TRIGGERACTIVITYMAKERSWIFT_HPP_
10#define TRIGGERALGS_SWIFT_TRIGGERACTIVITYMAKERSWIFT_HPP_
11
13#include <algorithm>
14
15namespace triggeralgs {
16
18 public:
19 //void operator()(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_tas);
20 void process(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_tas) override;
21 void configure(const nlohmann::json& config);
22 void set_ta_attributes();
23 void flush(timestamp_t until, std::vector<TriggerActivity>& output_tas) override;
24 bool preprocess( const TriggerPrimitive& input_tp);
25
26 private:
28
29 // -- Algortihm configuration --
30 // static variables which get set once at run start & kept fixed afterwards
31
32 //Window settings
36
37 //TP pre-processing
40
41 //Clustering settings
45 float m_db_eps;
47
48
49 // Dynamic vaiables which get updated during running to keep track of alg state. These are non-configurable
50
51 //window state
52 bool m_initialised = false;
53 uint64_t m_window_start = 0;
55 uint16_t m_tp_count = 0;
56
57 //Additional SWIFT-specific functions and classes
59 void close_window(std::vector<TriggerActivity>& output_tas);
60 void reset_window_state(uint64_t new_window_start);
61 uint64_t extract_dominant_cluster_energy(const std::vector<TriggerPrimitive>& tps, float eps, int min_samples);
62 };
63
64} // namespace triggeralgs
65
66#endif // TRIGGERALGS_SWIFT_TRIGGERACTIVITYMAKERSWIFT_HPP_
bool preprocess(const TriggerPrimitive &input_tp)
TP pre-processing/filtering.
uint64_t extract_dominant_cluster_energy(const std::vector< TriggerPrimitive > &tps, float eps, int min_samples)
void reset_window_state(uint64_t new_window_start)
void configure(const nlohmann::json &config)
void close_window(std::vector< TriggerActivity > &output_tas)
void flush(timestamp_t until, std::vector< TriggerActivity > &output_tas) override
void process(const TriggerPrimitive &input_tp, std::vector< TriggerActivity > &output_tas) override
TP processing function that creates & fills TAs.
dunedaq::trgdataformats::timestamp_t timestamp_t
Definition Types.hpp:16
dunedaq::trgdataformats::TriggerPrimitive TriggerPrimitive