Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
PhysicsAnalysis
JetTagging
FlavorTagInference
Root
NNSharingSvc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
FlavorTagInference/NNSharingSvc.h
"
6
7
#include "
src/hash.h
"
8
9
namespace
FlavorTagInference
{
10
11
namespace
detail
{
12
std::size_t
NNKey::hash
()
const
{
13
return
combine
(
getHash
(
path
),
getHash
(
opts
));
14
}
15
16
// allow NNKey to be used as unordered map key
17
bool
NNKey::operator==
(
const
NNKey
&
key
)
const
{
18
return
path
==
key
.path &&
opts
==
key
.opts;
19
}
20
}
21
22
std::shared_ptr<const GNN>
NNSharingSvc::get
(
23
const
std::string& nn_name,
24
const
GNNOptions
&
opts
) {
25
detail::NNKey
key
{nn_name,
opts
};
26
if
(
m_gnns
.count(
key
)) {
27
ATH_MSG_INFO
(
"getting "
<< nn_name <<
" from cached NNs"
);
28
return
m_gnns
.at(
key
);
29
}
else
if
(
m_base_gnns
.count(nn_name) ) {
30
ATH_MSG_INFO
(
"adapting "
<< nn_name <<
" from cached NNs, new opts"
);
31
auto
nn = std::make_shared<const GNN>(*
m_base_gnns
.at(nn_name),
opts
);
32
m_gnns
[
key
] = nn;
33
return
nn;
34
}
35
ATH_MSG_INFO
(
"building "
<< nn_name <<
" from onnx file"
);
36
auto
nn = std::make_shared<const GNN>(nn_name,
opts
);
37
m_base_gnns
[nn_name] = nn;
38
m_gnns
[
key
] = nn;
39
return
nn;
40
}
41
42
43
}
FlavorTagInference
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition:
AssociationEnums.h:11
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition:
AthMsgStreamMacros.h:31
NNSharingSvc.h
detail
Definition:
extract_histogram_tag.cxx:14
FlavorTagInference::NNSharingSvc::m_gnns
std::unordered_map< detail::NNKey, val_t, detail::NNHasher > m_gnns
Definition:
NNSharingSvc.h:41
FlavorTagInference::detail::NNKey::operator==
bool operator==(const NNKey &) const
Definition:
NNSharingSvc.cxx:17
FlavorTagInference::GNNOptions
Definition:
GNNOptions.h:16
FlavorTagInference::NNSharingSvc::get
virtual std::shared_ptr< const GNN > get(const std::string &nn_name, const GNNOptions &opts) override
Definition:
NNSharingSvc.cxx:22
FlavorTagInference::detail::NNKey
Definition:
NNSharingSvc.h:18
FlavorTagInference::detail::NNKey::hash
std::size_t hash() const
Definition:
NNSharingSvc.cxx:12
FlavorTagInference::detail::NNKey::opts
GNNOptions opts
Definition:
NNSharingSvc.h:20
hash.h
FlavorTagInference::getHash
std::size_t getHash(const T &obj)
Definition:
hash.h:13
FlavorTagInference::detail::NNKey::path
std::string path
Definition:
NNSharingSvc.h:19
FlavorTagInference::NNSharingSvc::m_base_gnns
std::unordered_map< std::string, val_t > m_base_gnns
Definition:
NNSharingSvc.h:42
athena.opts
opts
Definition:
athena.py:88
FlavorTagInference::combine
size_t combine(size_t lhs, size_t rhs)
Definition:
hash.h:21
mapkey::key
key
Definition:
TElectronEfficiencyCorrectionTool.cxx:37
Generated on Fri May 9 2025 21:15:40 for ATLAS Offline Software by
1.8.18