DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
triggeralgs
include
triggeralgs
ProtoDUNEBSMWindow
ProtoDUNEBSMWindow.hpp
Go to the documentation of this file.
1
#ifndef TRIGGERALGS_PROTODUNEBSMWINDOW_HPP_
2
#define TRIGGERALGS_PROTODUNEBSMWINDOW_HPP_
3
4
#include "
triggeralgs/TriggerPrimitive.hpp
"
5
#include "
triggeralgs/Types.hpp
"
6
#include "
triggeralgs/ProtoDUNEBSMWindow/treelitemodel.hpp
"
7
#include "
triggeralgs/ProtoDUNEBSMWindow/PDVDEffectiveChannelMap.hpp
"
8
9
#include <ostream>
10
#include <vector>
11
#include <numeric>
12
13
namespace
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
20
class
ProtoDUNEBSMWindow
{
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
43
timestamp_t
time_start
;
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_
PDVDEffectiveChannelMap.hpp
triggeralgs::ProtoDUNEBSMWindow
Definition
ProtoDUNEBSMWindow.hpp:20
triggeralgs::ProtoDUNEBSMWindow::adc_peak_sum
uint64_t adc_peak_sum
Definition
ProtoDUNEBSMWindow.hpp:45
triggeralgs::ProtoDUNEBSMWindow::time_start
timestamp_t time_start
Definition
ProtoDUNEBSMWindow.hpp:43
triggeralgs::ProtoDUNEBSMWindow::tp_list
std::vector< TriggerPrimitive > tp_list
Definition
ProtoDUNEBSMWindow.hpp:47
triggeralgs::ProtoDUNEBSMWindow::mean_tot
float mean_tot()
Definition
ProtoDUNEBSMWindow.cpp:104
triggeralgs::ProtoDUNEBSMWindow::mean_sadc
float mean_sadc()
Definition
ProtoDUNEBSMWindow.cpp:98
triggeralgs::ProtoDUNEBSMWindow::operator<<
friend std::ostream & operator<<(std::ostream &os, const ProtoDUNEBSMWindow &window)
Definition
ProtoDUNEBSMWindow.cpp:108
triggeralgs::ProtoDUNEBSMWindow::clear
void clear()
Definition
ProtoDUNEBSMWindow.cpp:23
triggeralgs::ProtoDUNEBSMWindow::add
void add(TriggerPrimitive const &input_tp)
Definition
ProtoDUNEBSMWindow.cpp:13
triggeralgs::ProtoDUNEBSMWindow::reset
void reset(TriggerPrimitive const &input_tp)
Definition
ProtoDUNEBSMWindow.cpp:53
triggeralgs::ProtoDUNEBSMWindow::is_empty
bool is_empty() const
Definition
ProtoDUNEBSMWindow.cpp:9
triggeralgs::ProtoDUNEBSMWindow::adc_integral
uint32_t adc_integral
Definition
ProtoDUNEBSMWindow.hpp:44
triggeralgs::ProtoDUNEBSMWindow::move
void move(TriggerPrimitive const &input_tp, timestamp_t const &window_length)
Definition
ProtoDUNEBSMWindow.cpp:27
triggeralgs::ProtoDUNEBSMWindow::mean_adc_peak
float mean_adc_peak()
Definition
ProtoDUNEBSMWindow.cpp:101
triggeralgs::ProtoDUNEBSMWindow::tot_sum
uint64_t tot_sum
Definition
ProtoDUNEBSMWindow.hpp:46
triggeralgs::ProtoDUNEBSMWindow::fill_entry_window
void fill_entry_window(std::vector< Entry > &entry_input, std::vector< float > &input)
Definition
ProtoDUNEBSMWindow.cpp:92
triggeralgs::ProtoDUNEBSMWindow::bin_window
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)
Definition
ProtoDUNEBSMWindow.cpp:65
triggeralgs
Definition
AbstractFactory.hpp:18
triggeralgs::timestamp_t
dunedaq::trgdataformats::timestamp_t timestamp_t
Definition
Types.hpp:16
triggeralgs::TriggerPrimitive
dunedaq::trgdataformats::TriggerPrimitive TriggerPrimitive
Definition
TriggerPrimitive.hpp:22
triggeralgs::channel_t
dunedaq::trgdataformats::channel_t channel_t
Definition
Types.hpp:20
treelitemodel.hpp
TriggerPrimitive.hpp
Types.hpp
Generated on
for DUNE-DAQ by
1.17.0