DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
triggeralgs
include
triggeralgs
ProtoDUNEBSMWindow
TAMakerProtoDUNEBSMWindowAlgorithm.hpp
Go to the documentation of this file.
1
8
9
#ifndef TRIGGERALGS_PROTODUNEBSMWINDOW_TRIGGERACTIVITYMAKERBSMWINDOW_HPP_
10
#define TRIGGERALGS_PROTODUNEBSMWINDOW_TRIGGERACTIVITYMAKERBSMWINDOW_HPP_
11
12
#include "
detchannelmaps/TPCChannelMap.hpp
"
13
#include "
triggeralgs/TriggerActivityFactory.hpp
"
14
#include "
triggeralgs/Types.hpp
"
15
#include "
triggeralgs/ProtoDUNEBSMWindow/ProtoDUNEBSMWindow.hpp
"
16
#include "
triggeralgs/ProtoDUNEBSMWindow/CompiledModelInterface.hpp
"
17
#include "
triggeralgs/ProtoDUNEBSMWindow/DetectorPlaneMap.hpp
"
18
#include "
triggeralgs/ProtoDUNEBSMWindow/PDVDEffectiveChannelMap.hpp
"
19
20
#include <vector>
21
#include <algorithm>
22
23
namespace
triggeralgs
{
24
class
TAMakerProtoDUNEBSMWindowAlgorithm
:
public
TriggerActivityMaker
25
{
26
27
public
:
28
void
process
(
const
TriggerPrimitive
& input_tp, std::vector<TriggerActivity>& output_ta);
29
void
configure
(
const
nlohmann::json &config);
30
31
~TAMakerProtoDUNEBSMWindowAlgorithm
()
override
;
32
33
private
:
34
// Function to handle XGBoost classification
35
// Returns true for signal and false for cosmic
36
bool
compute_treelite_classification
();
37
38
TriggerActivity
construct_ta
()
const
;
39
40
// The current time window of TPs
41
ProtoDUNEBSMWindow
m_current_window
;
42
43
timestamp_t
m_last_pred_time
;
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;
58
timestamp_t
m_window_length
= 20000;
59
std::string
m_channel_map_name
=
"PD2VDTPCChannelMap"
;
60
// End of configurable parameters
61
62
// Define time binning
63
timestamp_t
m_bin_length
= 4000;
64
int
m_num_timebins
= 5;
65
// Define channel binning
66
channel_t
m_chan_bin_length
= 100;
67
int
m_num_chanbins
= 5;
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
74
DetectorPlaneMap
m_det_plane_map
;
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
82
channel_t
m_first_channel
;
83
channel_t
m_last_channel
;
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_
CompiledModelInterface.hpp
DetectorPlaneMap.hpp
PDVDEffectiveChannelMap.hpp
ProtoDUNEBSMWindow.hpp
TPCChannelMap.hpp
TriggerActivityFactory.hpp
triggeralgs::ProtoDUNEBSMWindow
Definition
ProtoDUNEBSMWindow.hpp:20
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:25
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_primitive_count
uint64_t m_primitive_count
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:44
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_current_window
ProtoDUNEBSMWindow m_current_window
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:41
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_ratio_threshold
float m_ratio_threshold
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:56
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::~TAMakerProtoDUNEBSMWindowAlgorithm
~TAMakerProtoDUNEBSMWindowAlgorithm() override
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.cpp:148
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_chan_bin_length
channel_t m_chan_bin_length
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:66
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::flat_batched_inputs
std::vector< float > flat_batched_inputs
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:50
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_bin_length
timestamp_t m_bin_length
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:63
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::flat_batched_Entries
std::vector< Entry > flat_batched_Entries
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:52
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_last_pred_time
timestamp_t m_last_pred_time
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:43
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_num_chanbins
int m_num_chanbins
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:67
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_pdvd_map
bool m_pdvd_map
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:80
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_num_timebins
int m_num_timebins
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:64
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::nbatch
const int nbatch
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:48
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_bdt_threshold
float m_bdt_threshold
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:57
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_window_length
timestamp_t m_window_length
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:58
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_channel_map_name
std::string m_channel_map_name
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:59
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::configure
void configure(const nlohmann::json &config)
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.cpp:93
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_first_channel
channel_t m_first_channel
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:82
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::construct_ta
TriggerActivity construct_ta() const
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.cpp:153
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::compute_treelite_classification
bool compute_treelite_classification()
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.cpp:177
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_pdvd_eff_channel_mapper
std::unique_ptr< PDVDEffectiveChannelMap > m_pdvd_eff_channel_mapper
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:78
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_adc_threshold
uint32_t m_adc_threshold
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:55
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::process
void process(const TriggerPrimitive &input_tp, std::vector< TriggerActivity > &output_ta)
TP processing function that creates & fills TAs.
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.cpp:24
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_det_plane_map
DetectorPlaneMap m_det_plane_map
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:74
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_last_channel
channel_t m_last_channel
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:83
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::channelMap
std::shared_ptr< dunedaq::detchannelmaps::TPCChannelMap > channelMap
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:70
triggeralgs::TAMakerProtoDUNEBSMWindowAlgorithm::m_compiled_model_interface
std::unique_ptr< CompiledModelInterface > m_compiled_model_interface
Definition
TAMakerProtoDUNEBSMWindowAlgorithm.hpp:86
triggeralgs::TriggerActivityMaker
Definition
TriggerActivityMaker.hpp:29
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
triggeralgs::DetectorPlaneMap
Definition
DetectorPlaneMap.hpp:18
triggeralgs::TriggerActivity
Definition
TriggerActivity.hpp:20
Types.hpp
Generated on
for DUNE-DAQ by
1.17.0