DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ProtoDUNEBSMWindow.hpp
Go to the documentation of this file.
1#ifndef TRIGGERALGS_PROTODUNEBSMWINDOW_HPP_
2#define TRIGGERALGS_PROTODUNEBSMWINDOW_HPP_
3
8
9#include <ostream>
10#include <vector>
11#include <numeric>
12
13namespace triggeralgs {
14
15// Class to hold data of TPs within a window in time.
16// Functions to move the window along in time by removing
17// old TPs and add in newer ones
18// Function to bin the TPs in the window as a function of
19// channel and time
21 public:
22 bool is_empty() const;
23 void add(TriggerPrimitive const &input_tp);
24 void clear();
25 void move(TriggerPrimitive const &input_tp, timestamp_t const &window_length);
26 void reset(TriggerPrimitive const &input_tp);
27
28 // Bins the TPs as a function of channel and time
29 // If running in PD-VD then effective channel ID is used
30 void bin_window(std::vector<float> &input, timestamp_t time_bin_width, channel_t chan_bin_width,
31 int num_time_bins, int num_chan_bins, channel_t first_channel,
32 std::unique_ptr<PDVDEffectiveChannelMap> const &effective_channel_mapper, bool use_pdvd_map);
33
34 void fill_entry_window(std::vector<Entry> &entry_input, std::vector<float> &input);
35
36 // Calculate average properties of TPs in a time window
37 float mean_sadc();
38 float mean_adc_peak();
39 float mean_tot();
40
41 friend std::ostream& operator<<(std::ostream& os, const ProtoDUNEBSMWindow& window);
42
44 uint32_t adc_integral;
45 uint64_t adc_peak_sum;
46 uint64_t tot_sum;
47 std::vector<TriggerPrimitive> tp_list;
48 };
49}
50#endif // TRIGGERALGS_PROTODUNEBSMWINDOW_HPP_
std::vector< TriggerPrimitive > tp_list
friend std::ostream & operator<<(std::ostream &os, const ProtoDUNEBSMWindow &window)
void add(TriggerPrimitive const &input_tp)
void reset(TriggerPrimitive const &input_tp)
void move(TriggerPrimitive const &input_tp, timestamp_t const &window_length)
void fill_entry_window(std::vector< Entry > &entry_input, std::vector< float > &input)
void bin_window(std::vector< float > &input, timestamp_t time_bin_width, channel_t chan_bin_width, int num_time_bins, int num_chan_bins, channel_t first_channel, std::unique_ptr< PDVDEffectiveChannelMap > const &effective_channel_mapper, bool use_pdvd_map)
dunedaq::trgdataformats::timestamp_t timestamp_t
Definition Types.hpp:16
dunedaq::trgdataformats::channel_t channel_t
Definition Types.hpp:20
A single energy deposition on a TPC or PDS channel.