DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TAMakerPlaneCoincidenceAlgorithm.hpp
Go to the documentation of this file.
1
9#ifndef TRIGGERALGS_PLANECOINCIDENCE_TRIGGERACTIVITYMAKERPLANECOINCIDENCE_HPP_
10#define TRIGGERALGS_PLANECOINCIDENCE_TRIGGERACTIVITYMAKERPLANECOINCIDENCE_HPP_
11
15#include <fstream>
16#include <vector>
17
18#include <chrono>
19#include <map>
20#include <memory>
21#include <string>
22#include <unordered_set>
23#include <utility>
24
25namespace triggeralgs {
27{
28public:
29 void process(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta);
30 void configure(const nlohmann::json& config);
31
32private:
34 uint16_t check_adjacency(TPWindow window) const; // Returns longest string of adjacent collection hits in window
35
36 TPWindow m_current_window; // Possibly redundant for this alg?
37 uint64_t m_primitive_count = 0;
39 //void clearWindows(TriggerPrimitive const input_tp); // Function to clear or reset all windows, according to TP channel
40
41 // Make 3 instances of the Window class. One for each view plane.
45
46 // Configurable parameters.
47 std::string m_channel_map_name = "VDColdboxTPCChannelMap"; // Default is coldbox
48 uint16_t m_adjacency_threshold = 15; // Default is 15 wire track for testing
49 int m_max_adjacency = 0; // The maximum adjacency seen so far in any window
50 uint32_t m_sot_threshold = 2000; // Work out good values for this
51 uint32_t m_adc_threshold = 300000; // AbsRunningSum HF Alg Finds Induction ADC ~10x higher
52 uint16_t m_adj_tolerance = 5; // Adjacency tolerance - default is 3 from coldbox testing.
53 int index = 0;
54 uint16_t ta_adc = 0;
55 uint16_t ta_channels = 0;
56 timestamp_t m_window_length = 3000; // Shouldn't exceed the max drift
57
58 // Channel map object, for separating TPs by the plane view they come from
59 std::shared_ptr<dunedaq::detchannelmaps::TPCChannelMap> channelMap = dunedaq::detchannelmaps::make_tpc_map(m_channel_map_name);
60
61 // For debugging and performance study purposes.
62 void add_window_to_record(TPWindow window);
63 void dump_window_record();
64 void dump_tp(TriggerPrimitive const& input_tp);
65 std::vector<TPWindow> m_window_record;
66};
67} // namespace triggeralgs
68#endif // TRIGGERALGS_PLANECOINCIDENCE_TRIGGERACTIVITYMAKERPLANECOINCIDENCE_HPP_
std::shared_ptr< dunedaq::detchannelmaps::TPCChannelMap > channelMap
TriggerActivity construct_ta(TPWindow m_current_window) const
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.