DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TAMakerProtoDUNEBSMWindowAlgorithm.hpp
Go to the documentation of this file.
1
9#ifndef TRIGGERALGS_PROTODUNEBSMWINDOW_TRIGGERACTIVITYMAKERBSMWINDOW_HPP_
10#define TRIGGERALGS_PROTODUNEBSMWINDOW_TRIGGERACTIVITYMAKERBSMWINDOW_HPP_
11
14#include "triggeralgs/Types.hpp"
19
20#include <vector>
21#include <algorithm>
22
23namespace triggeralgs {
25{
26
27public:
28 void process(const TriggerPrimitive& input_tp, std::vector<TriggerActivity>& output_ta);
29 void configure(const nlohmann::json &config);
30
32
33private:
34 // Function to handle XGBoost classification
35 // Returns true for signal and false for cosmic
37
39
40 // The current time window of TPs
42
44 uint64_t m_primitive_count = 0;
45
46 // Possible to do batch predictions with XGBoost
47 // For now just keep at 1
48 const int nbatch = 1;
49 // XGBoost takes a row-major flat array
50 std::vector<float> flat_batched_inputs;
51 // row-major input for Entry objects used for compiled model
52 std::vector<Entry> flat_batched_Entries;
53
54 // Configurable parameters.
55 uint32_t m_adc_threshold = 200000;
56 float m_ratio_threshold = 0.65;
57 float m_bdt_threshold = 0.99;
59 std::string m_channel_map_name = "PD2VDTPCChannelMap";
60 // End of configurable parameters
61
62 // Define time binning
65 // Define channel binning
68
69 // Geometry information for binning
70 std::shared_ptr<dunedaq::detchannelmaps::TPCChannelMap> channelMap;
71 // First channel in each plane and number of channels
72 // in a plane not in channel map by default, so add
73 // a struct to access these values
75 // In PD-VD want to work with effective offline channel
76 // rather than the true offline channel. Have an object that helps
77 // to do this. It prevents gaps in channel vs time images
78 std::unique_ptr<PDVDEffectiveChannelMap> m_pdvd_eff_channel_mapper = nullptr;
79 // If in NP02 and using a PD-VD channel map, set this to true
80 bool m_pdvd_map = true;
81 // first and last channel on the plane
84
85 // Compiled treelite model interface
86 std::unique_ptr<CompiledModelInterface> m_compiled_model_interface;
87
88};
89} // namespace triggeralgs
90
91#endif // TRIGGERALGS_PROTODUNEBSMWINDOW_TRIGGERACTIVITYMAKERBSMWINDOW_HPP_
std::unique_ptr< PDVDEffectiveChannelMap > m_pdvd_eff_channel_mapper
void process(const TriggerPrimitive &input_tp, std::vector< TriggerActivity > &output_ta)
TP processing function that creates & fills TAs.
std::shared_ptr< dunedaq::detchannelmaps::TPCChannelMap > channelMap
std::unique_ptr< CompiledModelInterface > m_compiled_model_interface
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.