4#ifndef MUONINFERENCETOOLS_DVINFERENCETOOLBASE_H
5#define MUONINFERENCETOOLS_DVINFERENCETOOLBASE_H
15#include "CaloEvent/CaloTowerContainer.h"
19#include <onnxruntime_cxx_api.h>
58 using base_class::base_class;
81 "r_pos",
"theta_pos",
"phi_pos",
"theta_dir",
"phi_dir",
"energy_like",
"nCells_or_DoF"};
83 "d_energy_like",
"d_phi",
"d_eta",
"cos_angle",
"same_sector"};
86 Ort::Session&
model()
const;
97 const std::vector<InputTensorSpec>& inputSpecs,
98 const std::vector<std::string>& outputNames)
const;
103 this,
"SegmentKey",
"MuonSegmentsFromR4",
"Input R4 muon segment container"};
105 this,
"SpacePointKeys", {
"MuonSpacePoints"},
106 "Default is MuonSpacePoints only, matching the training MuonBucketDump SegmentKey alignment."};
108 this,
"TowerContainerKey",
"CombinedTower",
"Input calorimeter tower container"};
111 this,
"MinTowerEnergyMeV", 1000.f,
"Minimum calo tower energy used as a DV graph node"};
113 this,
"MaxTowerSegmentDR", 0.4f,
"Maximum segment-calo deltaR used in the converter"};
115 this,
"CaloRMaxMm", 4250.f,
"Barrel radius used for the calo-envelope intersection in mm"};
117 this,
"CaloZMaxMm", 6500.f,
"Endcap |z| used for the calo-envelope intersection in mm"};
119 this,
"SectorModulo", 16,
"Number of sectors used by the calo phi->sector converter"};
121 this,
"RequireEdges",
false,
"Skip inference when the event graph has no segment-tower edges"};
123 this,
"UseBucketSegmentSelection",
true,
"Build muon nodes from segment-parent SpacePoint buckets"};
125 this,
"FallbackToAllSegments",
false,
"If bucket-segment matching fails, fall back to all SegmentKey segments."};
126 Gaudi::Property<int>
m_maxEdges{
this,
"MaxEdges", -1,
"Maximum number of directed segment-tower edges to create; negative means no cap"};
132 Gaudi::Property<std::string>
m_outputName{
this,
"OutputName",
"logits"};
135 this,
"SingleOutputMode",
"logit",
"How to interpret a one-value output: auto, logit, or prob"};
140 this,
"SanitizeNonFiniteInputs",
true,
"Replace non-finite input features with zero before creating ONNX tensors"};
142 this,
"SanitizeNonFinitePredictions",
false,
"Replace non-finite ONNX outputs with -100 and log a warning"};
149 this,
"ModelSession",
"",
"ONNX Runtime session tool for the DV classifier"};
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
Helper struct to ship the Graph from the space point buckets to ONNX.