8#ifndef EVENTPROC_ECALPNETVETOPROCESSOR_H_
9#define EVENTPROC_ECALPNETVETOPROCESSOR_H_
13#include "Ecal/Event/EcalHit.h"
14#include "Framework/Configure/Parameters.h"
16#include "Tools/ONNXRuntime.h"
38 const std::vector<ldmx::EcalHit>& ecalRecHits,
39 std::array<double, 3> etraj, std::array<double, 3> enorm);
46 std::vector<float>
logSoftmax(
const std::vector<float>& logits);
53 constexpr static unsigned int N_COORDINATE_DIM = 3;
54 constexpr static unsigned int COORDINATE_X_OFFSET = 0;
55 constexpr static unsigned int COORDINATE_Y_OFFSET =
MAX_NUM_HITS;
56 constexpr static unsigned int COORDINATE_Z_OFFSET = 2 *
MAX_NUM_HITS;
58 constexpr static unsigned int N_FEATURE_DIM = 5;
59 constexpr static unsigned int FEATURE_X_OFFSET = 0;
60 constexpr static unsigned int FEATURE_Y_OFFSET =
MAX_NUM_HITS;
61 constexpr static unsigned int FEATURE_Z_OFFSET = 2 *
MAX_NUM_HITS;
62 constexpr static unsigned int FEATURE_ENERGY_OFFSET = 3 *
MAX_NUM_HITS;
63 constexpr static unsigned int FEATURE_LAYER_ID_OFFSET = 4 *
MAX_NUM_HITS;
65 const static std::vector<std::string> INPUT_NAMES;
66 const static std::vector<unsigned int> INPUT_SIZES;
70 std::vector<std::vector<float>> data_;
71 std::unique_ptr<ldmx::ort::ONNXRuntime> rt_;
76 std::string rec_coll_name_;
77 std::string ecal_rec_hits_passname_;
78 std::string ecal_sp_coll_name_;
79 std::string ecal_sp_hits_passname_;
80 std::string track_pass_name_;
81 std::string track_collection_;
82 bool recoil_from_tracking_;
Class that translates raw positions of ECal module hits into cells in a hexagonal readout.
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.
std::string collection_name_
Name of the collection which will containt the results.
std::vector< float > logSoftmax(const std::vector< float > &logits)
Transform logits to a probability.
void configure(framework::config::Parameters ¶meters) override
Callback for the EventProcessor to configure itself from the given set of parameters.
static constexpr unsigned int MAX_NUM_HITS
Maximum number of hits allowed in ECAL.
void makeInputs(const ldmx::EcalGeometry &geom, const std::vector< ldmx::EcalHit > &ecalRecHits, std::array< double, 3 > etraj, std::array< double, 3 > enorm)
Make inputs to the DNN from ECAL RecHits.
double disc_cut_logit_
disc_cut as a logit difference, the probability saturates in float
Implements an event buffer system for storing event data.
Class which represents the process under execution.
Base class for a module which produces a data product.
virtual void process(Event &event) final
Processing an event for a Producer is calling produce.
Class encapsulating parameters for configuring a processor.
Translation between real-space positions and cell IDs within the ECal.