ATLAS Offline Software
Loading...
Searching...
No Matches
Model.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef RingerSelectorTools_tools_onnx_Model_h
6#define RingerSelectorTools_tools_onnx_Model_h
7
9#include <onnxruntime_cxx_api.h>
11#include <assert.h>
12#include <vector>
13
14
15
16
17namespace Ringer{
18
19 namespace onnx{
20
21 class Model
22 {
23 public:
24
26 Model( const std::string& modelPath, AthOnnx::IOnnxRuntimeSvc *svc,
27 float etmin, float etmax, float etamin, float etamax,
28 unsigned barcode);
29
31 ~Model()=default;
32
33 void compile();
34
36 float etMin() const { return m_etmin; };
37
39 float etMax() const { return m_etmax; };
40
42 float etaMin() const { return m_etamin; };
43
45 float etaMax() const { return m_etamax; };
46
48 float predict ( std::vector< std::vector<float> > & ) const;
49
50 unsigned barcode() const { return m_barcode; };
51
52 private:
53
54 // onnx session
55 std::shared_ptr<Ort::Session> m_session;
56 std::vector<std::vector<int64_t>> m_input_node_dims;
57 std::vector<int64_t> m_output_node_dims;
58 std::vector<const char*> m_input_node_names;
59 std::vector<const char*> m_output_node_names;
60
63 unsigned m_barcode;
64
65
66 };
67
68 } // namepace onnx
69
70}// namespace ringer
71
72#endif
Service used for managing global objects used by Onnx Runtime.
float etMax() const
Get the Et high edge.
Definition Model.h:39
float etaMin() const
Get the Eta lower edge.
Definition Model.h:42
std::vector< std::vector< int64_t > > m_input_node_dims
Definition Model.h:56
std::vector< const char * > m_input_node_names
Definition Model.h:58
std::vector< const char * > m_output_node_names
Definition Model.h:59
float etaMax() const
Get the Eta high edge.
Definition Model.h:45
unsigned barcode() const
Definition Model.h:50
float etMin() const
Get the Et lower edge.
Definition Model.h:36
~Model()=default
Destructor.
std::vector< int64_t > m_output_node_dims
Definition Model.h:57
unsigned m_barcode
Definition Model.h:63
Model(const std::string &modelPath, AthOnnx::IOnnxRuntimeSvc *svc, float etmin, float etmax, float etamin, float etamax, unsigned barcode)
Constructor.
Definition Model.cxx:14
std::shared_ptr< Ort::Session > m_session
Definition Model.h:55
float predict(std::vector< std::vector< float > > &) const
Calculate the disriminant.
Definition Model.cxx:65
Namespace dedicated for Ringer utilities.