|
LDMX Software
|
Scores each event with the ECal trigger MLP and stores the output. More...
#include <TrigClusterNNProducer.h>
Public Member Functions | |
| TrigClusterNNProducer (const std::string &name, framework::Process &process) | |
| void | configure (framework::config::Parameters &ps) override |
| Callback for the EventProcessor to configure itself from the given set of parameters. | |
| void | produce (framework::Event &event) override |
| Process the event and put new data products into it. | |
| void | onProcessEnd () override |
| Callback for the EventProcessor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities. | |
Public Member Functions inherited from framework::Producer | |
| Producer (const std::string &name, Process &process) | |
| Class constructor. | |
| virtual void | process (Event &event) final |
| Processing an event for a Producer is calling produce. | |
Public Member Functions inherited from framework::EventProcessor | |
| DECLARE_FACTORY (EventProcessor, EventProcessor *, const std::string &, Process &) | |
| declare that we have a factory for this class | |
| EventProcessor (const std::string &name, Process &process) | |
| Class constructor. | |
| virtual | ~EventProcessor ()=default |
| Class destructor. | |
| virtual void | beforeNewRun (ldmx::RunHeader &run_header) |
| Callback for Producers to add parameters to the run header before conditions are initialized. | |
| virtual void | onNewRun (const ldmx::RunHeader &run_header) |
| Callback for the EventProcessor to take any necessary action when the run being processed changes. | |
| virtual void | onFileOpen (EventFile &event_file) |
| Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened. | |
| virtual void | onFileClose (EventFile &event_file) |
| Callback for the EventProcessor to take any necessary action when a event input ROOT file is closed. | |
| virtual void | onProcessStart () |
| Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms. | |
| template<class T > | |
| const T & | getCondition (const std::string &condition_name) |
| Access a conditions object for the current event. | |
| TDirectory * | getHistoDirectory () |
| Access/create a directory in the histogram file for this event processor to create histograms and analysis tuples. | |
| void | setStorageHint (framework::StorageControl::Hint hint) |
| Mark the current event as having the given storage control hint from this module_. | |
| void | setStorageHint (framework::StorageControl::Hint hint, const std::string &purposeString) |
| Mark the current event as having the given storage control hint from this module and the given purpose string. | |
| int | getLogFrequency () const |
| Get the current logging frequency from the process. | |
| int | getRunNumber () const |
| Get the run number from the process. | |
| std::string | getName () const |
| Get the processor name. | |
| void | createHistograms (const std::vector< framework::config::Parameters > &histos) |
| Internal function which is used to create histograms passed from the python configuration @parma histos vector of Parameters that configure histograms to create. | |
Static Public Member Functions | |
| static void | fillInputs (const TrigCaloClusterCollection &clusters, const TrigEnergySumCollection &ecal_sums, const TrigEnergySumCollection &hcal_sums, std::vector< float > &inputs) |
| Fill flattened (MAX_CLUSTERS, N_FEATURES) model input, (index = slot * N_FEATURES + feature). | |
Static Public Attributes | |
| static constexpr std::size_t | MAX_CLUSTERS = 3 |
| static constexpr std::size_t | N_FEATURES = 9 |
| static constexpr std::size_t | N_CLASSES = 9 |
| static constexpr std::size_t | FEAT_X = 0 |
| feature index within one cluster slot of the model input | |
| static constexpr std::size_t | FEAT_Y = 1 |
| static constexpr std::size_t | FEAT_Z = 2 |
| static constexpr std::size_t | FEAT_E = 3 |
| static constexpr std::size_t | FEAT_DEPTH = 4 |
| static constexpr std::size_t | FEAT_N_TP = 5 |
| static constexpr std::size_t | FEAT_N_CLUSTERS = 6 |
| static constexpr std::size_t | FEAT_ECAL_SUM_E = 7 |
| static constexpr std::size_t | FEAT_HCAL_SUM_ADC = 8 |
| static constexpr std::size_t | BKG_CLASS = 0 |
| class index of the single-electron background in the model output | |
Private Attributes | |
| std::string | cluster_coll_name_ |
| std::string | ecal_sum_coll_name_ |
| std::string | hcal_sum_coll_name_ |
| std::string | input_pass_ |
| pass name shared by all three input collections | |
| std::string | score_coll_name_ |
| ldmx::ort::FloatArrays | data_ |
| model input buffer, reused every event | |
| std::unique_ptr< ldmx::ort::ONNXRuntime > | rt_ |
| int | nevents_ {0} |
| double | processing_time_ {0.} |
| double | inference_time_ {0.} |
Additional Inherited Members | |
Protected Member Functions inherited from framework::EventProcessor | |
| void | abortEvent () |
| Abort the event immediately. | |
Protected Attributes inherited from framework::EventProcessor | |
| HistogramPool | histograms_ |
| helper object for making and filling histograms | |
| NtupleManager & | ntuple_ {NtupleManager::getInstance()} |
| Manager for any ntuples. | |
| logging::logger | the_log_ |
| The logger for this EventProcessor. | |
Scores each event with the ECal trigger MLP and stores the output.
The model input is the top-3 (energy-sorted) ECal trigger clusters times 9 features: x, y, z, e, depth, n_tp of the cluster, then the event-level n_clusters (before truncation), the sum of the ECal trigger sums (MeV) and the sum of the HCal back-layer trigger sums (ADC), repeated in every slot.
Required upstream sequence with default parameters: EcalTrigPrimDigiProducer, HcalTrigPrimDigiProducer, EcalTPSelector, TrigHcalEnergySum and TrigEcalClusterProducer.
Output: a TrigClusterNNScore with the raw logits and P(bkg).
Definition at line 40 of file TrigClusterNNProducer.h.
| trigger::TrigClusterNNProducer::TrigClusterNNProducer | ( | const std::string & | name, |
| framework::Process & | process ) |
Definition at line 36 of file TrigClusterNNProducer.cxx.
|
overridevirtual |
Callback for the EventProcessor to configure itself from the given set of parameters.
The parameters a processor has access to are the member variables of the python class in the sequence that has class_name equal to the EventProcessor class name.
For an example, look at MyProcessor.
| parameters | Parameters for configuration. |
Reimplemented from framework::EventProcessor.
Definition at line 41 of file TrigClusterNNProducer.cxx.
References framework::config::Parameters::get().
|
static |
Fill flattened (MAX_CLUSTERS, N_FEATURES) model input, (index = slot * N_FEATURES + feature).
Unused cluster slots are zero.
| [in] | clusters | ECal trigger clusters, in collection order |
| [in] | ecal_sums | ECal trigger energy sums (energy() is used) |
| [in] | hcal_sums | HCal back-layer trigger sums (hwEnergy() is used) |
| [out] | inputs | resized to MAX_CLUSTERS * N_FEATURES and filled |
Definition at line 113 of file TrigClusterNNProducer.cxx.
|
overridevirtual |
Callback for the EventProcessor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities.
Reimplemented from framework::EventProcessor.
Definition at line 106 of file TrigClusterNNProducer.cxx.
|
overridevirtual |
Process the event and put new data products into it.
| event | The Event to process. |
Implements framework::Producer.
Definition at line 69 of file TrigClusterNNProducer.cxx.
|
staticconstexpr |
class index of the single-electron background in the model output
Definition at line 79 of file TrigClusterNNProducer.h.
|
private |
Definition at line 82 of file TrigClusterNNProducer.h.
|
private |
model input buffer, reused every event
Definition at line 90 of file TrigClusterNNProducer.h.
|
private |
Definition at line 83 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 71 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 70 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 74 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 75 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 73 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 72 of file TrigClusterNNProducer.h.
|
staticconstexpr |
feature index within one cluster slot of the model input
Definition at line 67 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 68 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 69 of file TrigClusterNNProducer.h.
|
private |
Definition at line 84 of file TrigClusterNNProducer.h.
|
private |
Definition at line 95 of file TrigClusterNNProducer.h.
|
private |
pass name shared by all three input collections
Definition at line 86 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 62 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 64 of file TrigClusterNNProducer.h.
|
staticconstexpr |
Definition at line 63 of file TrigClusterNNProducer.h.
|
private |
Definition at line 93 of file TrigClusterNNProducer.h.
|
private |
Definition at line 94 of file TrigClusterNNProducer.h.
|
private |
Definition at line 91 of file TrigClusterNNProducer.h.
|
private |
Definition at line 87 of file TrigClusterNNProducer.h.