ATLAS Offline Software
Loading...
Searching...
No Matches
METNetSigHandler.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7// METNetSigHandler.h
8// Header file for class METNetSigHandler
9// Author: Alberto Plebani <alberto.plebani@cern.ch>, based on previous implementation by M.Leigh<mleigh@cern.ch>
11
12#ifndef METUTILITIES_MET_METNetSigHandler_H
13#define METUTILITIES_MET_METNetSigHandler_H
14
15// STL includes
16#include <string>
17
18
19// ONNX Library
20#include <onnxruntime_cxx_api.h>
21
22namespace met {
23
25
26 public:
27
28 // Constructor with parameters
29 METNetSigHandler(const std::string& modelName);
30
31 // Destructor
32 virtual ~METNetSigHandler();
33
34 // Public methods
35 int initialize();
36 int getReqSize() const;
37 std::vector<float> predict(std::vector<float> inputs) const;
38
39 private:
40
41 // Default constructor
43
44 // Class properties
45 std::string m_modelName; // Path to the onnx file
46 std::string m_modelPath; // Output of the path resolver
47
48 // Features of the network structure
51 std::vector<int64_t> m_inputDims;
52 std::vector<int64_t> m_outputDims;
53 std::vector<const char *> m_graphInputNames;
54 std::vector<const char *> m_graphOutputNames;
55
56 // ONNX session objects
57 Ort::Env m_onnxEnv;
58 Ort::SessionOptions m_onnxSessionOptions;
59 Ort::AllocatorWithDefaultOptions m_onnxAllocator;
60 std::unique_ptr<Ort::Session> m_onnxSession;
61 };
62
63}
64
65#endif
std::vector< const char * > m_graphInputNames
METNetSigHandler(const std::string &modelName)
std::vector< int64_t > m_outputDims
Ort::SessionOptions m_onnxSessionOptions
std::vector< float > predict(std::vector< float > inputs) const
Ort::AllocatorWithDefaultOptions m_onnxAllocator
std::unique_ptr< Ort::Session > m_onnxSession
std::vector< int64_t > m_inputDims
std::vector< const char * > m_graphOutputNames