DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TAWindow.hpp
Go to the documentation of this file.
1/* @file: TAWindow.hpp
2 *
3 * This is party of the DUNE DAQ Application Framework, copyright 2021.
4 * Licensing/copyright details are in the COPYING file that you should have
5 * received with this code.
6 */
7
8#ifndef TRIGGERALGS_TAWINDOW_HPP_
9#define TRIGGERALGS_TAWINDOW_HPP_
10
12#include "triggeralgs/Types.hpp"
13
14#include <ostream>
15#include <unordered_map>
16
17namespace triggeralgs {
18
20{
21public:
22 bool is_empty() const { return inputs.empty(); };
23
29 void add(const TriggerActivity& input_ta);
30
32 void clear();
33
34 uint16_t n_channels_hit() { return channel_states.size(); };
35
44 void move(TriggerActivity const& input_ta, timestamp_t const& window_length);
45
48 void reset(TriggerActivity const& input_ta);
49
50 friend std::ostream& operator<<(std::ostream& os, const TAWindow& window);
51
53 uint64_t adc_integral = 0;
54 std::unordered_map<channel_t, uint16_t> channel_states;
55 std::vector<TriggerActivity> inputs;
56};
57
58} // namespace triggeralgs
59
60#endif // TRIGGERALGS_TAWINDOW_HPP_
timestamp_t time_start
Definition TAWindow.hpp:52
void clear()
Clear all inputs.
Definition TAWindow.cpp:35
void add(const TriggerActivity &input_ta)
Add the input TA's contribution to the total ADC, increase the hit count of all of the channels which...
Definition TAWindow.cpp:16
std::vector< TriggerActivity > inputs
Definition TAWindow.hpp:55
std::unordered_map< channel_t, uint16_t > channel_states
Definition TAWindow.hpp:54
bool is_empty() const
Definition TAWindow.hpp:22
void reset(TriggerActivity const &input_ta)
Reset window content on the input.
Definition TAWindow.cpp:79
uint16_t n_channels_hit()
Definition TAWindow.hpp:34
friend std::ostream & operator<<(std::ostream &os, const TAWindow &window)
Definition TAWindow.cpp:98
void move(TriggerActivity const &input_ta, timestamp_t const &window_length)
Find all of the TAs in the window that need to be removed if the input_ta is to be added and the size...
Definition TAWindow.cpp:45
dunedaq::trgdataformats::timestamp_t timestamp_t
Definition Types.hpp:16