LDMX Software
DNNEcalVetoProcessor.h
1
8#ifndef EVENTPROC_DNNECALVETOPROCESSOR_H_
9#define EVENTPROC_DNNECALVETOPROCESSOR_H_
10
11// LDMX
13#include "Ecal/Event/EcalHit.h"
15#include "Framework/Configure/Parameters.h"
17#include "Tools/ONNXRuntime.h"
18
19namespace ecal {
20
27 public:
28 DNNEcalVetoProcessor(const std::string& name, framework::Process& process);
29 virtual ~DNNEcalVetoProcessor() {}
30 void configure(framework::config::Parameters& parameters) override;
31 void produce(framework::Event& event) override;
32
33 private:
38 void make_inputs(const ldmx::EcalGeometry& geom,
39 const std::vector<ldmx::EcalHit>& ecalRecHits);
40
41 private:
44 constexpr static unsigned int max_num_hits_ = 50;
45
46 constexpr static unsigned int n_coordinate_dim_ = 3;
47 constexpr static unsigned int coordinate_x_offset_ = 0;
48 constexpr static unsigned int coordinate_y_offset_ = max_num_hits_;
49 constexpr static unsigned int coordinate_z_offset_ = 2 * max_num_hits_;
50
51 constexpr static unsigned int n_feature_dim_ = 5;
52 constexpr static unsigned int feature_x_offset_ = 0;
53 constexpr static unsigned int feature_y_offset_ = max_num_hits_;
54 constexpr static unsigned int feature_z_offset_ = 2 * max_num_hits_;
55 constexpr static unsigned int feature_layerid_offset_ = 3 * max_num_hits_;
56 constexpr static unsigned int feature_energy_offset_ = 4 * max_num_hits_;
57
58 const static std::vector<std::string> input_names_;
59 const static std::vector<unsigned int> input_sizes_;
60
61 float disc_cut_ = -99;
62 std::vector<std::vector<float>> data_;
63 std::unique_ptr<ldmx::Ort::ONNXRuntime> rt_;
64
66 std::string collectionName_{"DNNEcalVeto"};
67
68 bool debug_ = false;
69};
70
71} // namespace ecal
72
73#endif
Class that translates raw positions of ECal module hits into cells in a hexagonal readout.
Class used to encapsulate the results obtained from EcalVetoProcessor.
Base classes for all user event processing components to extend.
Determines if event is vetoable using ECAL hit information w/ a deep neural network.
void produce(framework::Event &event) override
Process the event and put new data products into it.
static constexpr unsigned int max_num_hits_
Maximum number of hits allowed in ECAL.
void make_inputs(const ldmx::EcalGeometry &geom, const std::vector< ldmx::EcalHit > &ecalRecHits)
Make inputs to the DNN from ECAL RecHits.
void configure(framework::config::Parameters &parameters) override
Callback for the EventProcessor to configure itself from the given set of parameters.
std::string collectionName_
Name of the collection which will containt the results.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class which represents the process under execution.
Definition Process.h:36
Base class for a module which produces a data product.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Translation between real-space positions and cell IDs within the ECal.