Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
OnnxEdgeClassifier.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file OnnxEdgeClassifier.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2023 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include "
Acts/Plugins/ExaTrkX/Stages.hpp
"
12
#include "
Acts/Utilities/Logger.hpp
"
13
14
#include <memory>
15
16
namespace
Ort {
17
class
Env;
18
class
Session;
19
class
Value
;
20
}
// namespace Ort
21
22
namespace
Acts {
23
24
class
OnnxEdgeClassifier
final :
public
Acts::EdgeClassificationBase
{
25
public
:
26
struct
Config
{
27
std::string
modelPath
;
28
float
cut
= 0.21;
29
};
30
31
OnnxEdgeClassifier
(
const
Config
&
cfg
, std::unique_ptr<const Logger>
logger
);
32
~OnnxEdgeClassifier
();
33
34
std::tuple<std::any, std::any, std::any>
operator()
(
35
std::any nodes, std::any
edges
,
int
deviceHint = -1)
override
;
36
37
Config
config
()
const
{
return
m_cfg
; }
38
39
private
:
40
std::unique_ptr<const Acts::Logger>
m_logger
;
41
const
auto
&
logger
()
const
{
return
*
m_logger
; }
42
43
Config
m_cfg
;
44
45
std::unique_ptr<Ort::Env>
m_env
;
46
std::unique_ptr<Ort::Session>
m_model
;
47
48
std::string
m_inputNameNodes
;
49
std::string
m_inputNameEdges
;
50
std::string
m_outputNameScores
;
51
};
52
53
}
// namespace Acts
acts
blob
sPHENIX
Plugins
ExaTrkX
include
Acts
Plugins
ExaTrkX
OnnxEdgeClassifier.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:41
using
1.8.2 with
sPHENIX GitHub integration