ATLAS Offline Software
Loading...
Searching...
No Matches
PVNN.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
4 This class is used in conjunction with SaltModel to run inference on a transformer model.
5 Whereas SaltModel handles the interfacing with the ONNX runtime, this class handles
6 the interfacing with the ATLAS EDM. It is responsible for collecting all the inputs
7 needed for inference, running inference (via SaltModel), and decorating the results
8 back to ATLAS EDM.
9*/
10
11#ifndef PVNN_H
12#define PVNN_H
13
14// Tool includes
18
19// EDM includes
21
22#include <cstddef>
23#include <memory>
24#include <string>
25#include <map>
26
27
40namespace InDetPVNNSelection {
41
42 // Tool to classify hard scatter vertex using PVNN based taggers
43 class PVNN
44 {
45 public:
46 PVNN(const std::string& nnFile);
47 PVNN(PVNN&&) = delete;
48 PVNN(const PVNN&) = delete;
49 virtual ~PVNN();
50
51 virtual float decorate(const xAOD::Vertex& vertex) const;
52
53 private:
54 // type definitions for ONNX output decorators
56 using TrackLinks = std::vector<ElementLink<TPC>>;
57
58 template<typename T>
60
61 template<typename T>
62 using Decs = std::vector<std::pair<std::string, Dec<T>>>;
63
67
68 /* create all decorators */
69 std::set<std::string> createDecorators(const FlavorTagInference::OutputConfig& outConfig);
70
71 std::shared_ptr<const FlavorTagInference::SaltModel> m_saltModel;
72 std::string m_modelPath;
73 std::string m_input_node_name;
74 std::vector<internal::VarFromVertex> m_varsFromVertex;
75 std::vector<std::shared_ptr<IConstituentsLoader>> m_constituentsLoaders;
78 };
79} // end namespace InDetPVNNSelection
80#endif // PVNN_H
Decorators m_decorators
Definition PVNN.h:76
std::shared_ptr< const FlavorTagInference::SaltModel > m_saltModel
Definition PVNN.h:71
PVNN(PVNN &&)=delete
virtual float decorate(const xAOD::Vertex &vertex) const
Definition PVNN.cxx:106
std::string m_modelPath
Definition PVNN.h:72
std::vector< std::pair< std::string, Dec< T > > > Decs
Definition PVNN.h:62
std::vector< std::shared_ptr< IConstituentsLoader > > m_constituentsLoaders
Definition PVNN.h:75
std::string m_input_node_name
Definition PVNN.h:73
xAOD::TrackParticleContainer TPC
Definition PVNN.h:55
PVNN(const PVNN &)=delete
SG::Decorator< T > Dec
Definition PVNN.h:59
PVNN(const std::string &nnFile)
Definition PVNN.cxx:28
std::vector< ElementLink< TPC > > TrackLinks
Definition PVNN.h:56
std::vector< internal::VarFromVertex > m_varsFromVertex
Definition PVNN.h:74
std::set< std::string > createDecorators(const FlavorTagInference::OutputConfig &outConfig)
std::vector< SaltModelOutput > OutputConfig
Definition ISaltModel.h:38
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
Definition AuxElement.h:576
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".