5#ifndef TAURECTOOLS_TAUSRUSEVALUATOR_H
6#define TAURECTOOLS_TAUSRUSEVALUATOR_H
97 StatusCode
readModel(
const std::string& path);
104 std::span<const float> ptQuantiles,
105 std::span<const float> etaValues,
106 std::span<const float> phiValues,
112 std::span<const float>
scores,
113 const std::vector<const xAOD::Vertex*>& vertices)
const;
122 this,
"InferenceTool",
"",
"ONNX Runtime or Triton inference backend"};
125 this,
"Key_vertexInputContainer",
"PrimaryVertices",
"Input vertex container key"};
128 this,
"ModelFile",
"",
129 "ONNX model the input and output nodes are read from, also when inference runs on Triton"};
131 this,
"TauContainerName",
"",
132 "Name of the TauJetContainer, needed to declare the output data dependencies"};
134 this,
"TauTrackContainerName",
"",
135 "Name of the TauTrackContainer, needed to declare the per-track output data dependencies"};
137 this,
"MinTauPt", 15.,
"Skip taus below this pt to save CPU"};
169 std::vector<SG::WriteDecorHandleKey<xAOD::TauJetContainer>>
m_decorKeys;
Helper class to provide type-safe access to aux data.
Helper class to provide type-safe access to aux data.
std::vector< std::vector< float > > scores
Helper class to provide type-safe access to aux data.
Property holding a SG store/key/clid from which a ReadHandle is made.
static constexpr int TAU_TRACK_CLASS
Class for true-tau track from tau_track_class head.
void decorateTracks(xAOD::TauJet &tau, std::span< const float > scores) const
Decorate each track of tau with its slot of the per-track head.
static constexpr float DEFAULT_VALUE
initialized with these default values
virtual StatusCode initialize() override
Tool initializer.
Gaudi::Property< std::string > m_tauContainerName
std::unique_ptr< TausRUsDataLoader > m_loader
virtual ~TausRUsEvaluator()
std::vector< SG::Accessor< float > > FourMomDecorators
FourMomDecorators m_chargedPionP4
Gaudi::Property< std::string > m_modelFile
std::vector< SG::WriteDecorHandleKey< xAOD::TauTrackContainer > > m_trackDecorKeys
void decorateFourMomentum(xAOD::TauJet &tau, const FourMomDecorators &decorators, std::span< const float > ptQuantiles, std::span< const float > etaValues, std::span< const float > phiValues, float mass) const
Decorate the four floats of decorators from a pt, an eta and a phi head, taking the mass from mass.
size_t m_nDecayModes
Read off the metadata at initialize().
virtual StatusCode execute(xAOD::TauJet &tau) const override
Execute - called for each tau candidate.
FourMomDecorators m_neutralPionP4
Gaudi::Property< std::string > m_tauTrackContainerName
std::vector< SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_decorKeys
StatusCode readModel(const std::string &path)
Configure the data loader and build m_outputs from the metadata and node shapes of the model.
Gaudi::Property< float > m_minTauPt
SG::Accessor< float > m_decayMode
void decorateVertex(xAOD::TauJet &tau, std::span< const float > scores, const std::vector< const xAOD::Vertex * > &vertices) const
Decorate the position of the vertex that scores picks out of vertices, which must be the list the inp...
SG::Accessor< float > m_eleRejScore
SG::Accessor< float > m_tauIDScore
The decorators.
SG::Accessor< float > m_tauCharge
ToolHandle< AthInfer::IAthInferenceTool > m_inferenceTool
TausRUsEvaluator(const std::string &name="TausRUsEvaluator")
FourMomDecorators m_tauP4
void setDefaults(xAOD::TauJet &tau) const
std::vector< SG::Accessor< float > > m_vertexPosition
std::vector< std::string > trackDecorationNames() const
std::vector< std::string > tauDecorationNames() const
Every decoration written on the tau, and every one written on its tracks, which is what the output da...
std::vector< Output > m_outputs
The model's output nodes, from its metadata.
std::vector< SG::Accessor< float > > m_decayModeScores
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexInputContainer
SG::Decorator< int > m_trackClass
PrimaryClass
Class order of the 'primary' head, which is three raw logits.
PhiComponent
The two components of a phi head, which regresses the angle as a point on the unit circle: phi = atan...
static constexpr int DEFAULT_CLASS
std::vector< SG::Decorator< float > > m_trackScores
size_t m_ptMedianQuantile
The pt heads ('tes', 'charged_pion_pt', 'neutral_pion_pt') regress quantiles of the log response,...
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
TauJet_v3 TauJet
Definition of the current "tau version".
std::string type
head type from the metadata
size_t size
product of dims
std::string name
model output node name
std::vector< int64_t > dims