DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TAMakerADCSimpleWindowAlgorithm.hpp
Go to the documentation of this file.
1
9#ifndef TRIGGERALGS_ADCSIMPLEWINDOW_TRIGGERACTIVITYMAKERADCSIMPLEWINDOW_HPP_
10#define TRIGGERALGS_ADCSIMPLEWINDOW_TRIGGERACTIVITYMAKERADCSIMPLEWINDOW_HPP_
11
13#include "triggeralgs/Types.hpp"
14
15#include <deque>
16
17namespace triggeralgs {
19{
20
21public:
22 void process(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta);
23
24 void configure(const nlohmann::json &config);
25
26 class Window {
27 public:
28 friend std::ostream& operator<<(std::ostream& os, const Window& window);
29
30 bool is_empty() const{
31 return tp_list.empty();
32 };
33
34 void add(TriggerPrimitive const &input_tp);
35
36 void clear(){
37 tp_list.clear();
38 };
39
40 void move(TriggerPrimitive const &input_tp, timestamp_t const &window_length);
41
42 void reset(TriggerPrimitive const &input_tp);
43
45 uint32_t adc_integral;
46 std::deque<TriggerPrimitive> tp_list;
47 };
48
49private:
50
52
54 uint64_t m_primitive_count = 0;
55
56 // Configurable parameters.
57 uint32_t m_adc_threshold = 1200000;
59
60 // FIXME: should this be centrally defined?
61 // FIXME 2: assumes the same conversion for all TPC types, which is not the case (TPCE/BDE = 32, TDE=32.5)
62 const uint16_t k_sample_to_dts_ticks = 32;
63};
64
65
66} // namespace triggeralgs
67
68#endif // TRIGGERALGS_ADCSIMPLEWINDOW_TRIGGERACTIVITYMAKERADCSIMPLEWINDOW_HPP_
void move(TriggerPrimitive const &input_tp, timestamp_t const &window_length)
friend std::ostream & operator<<(std::ostream &os, const Window &window)
void process(const TriggerPrimitive &input_tp, std::vector< TriggerActivity > &output_ta)
TP processing function that creates & fills TAs.
dunedaq::trgdataformats::timestamp_t timestamp_t
Definition Types.hpp:16
A single energy deposition on a TPC or PDS channel.