ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
FlavorTagInference
FlavorTagInference
ISaltModel.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef FLAVORTAGINFERENCE_ISALTMODEL_H
6
#define FLAVORTAGINFERENCE_ISALTMODEL_H
7
14
15
#include "
FlavorTagInference/SaltModelGraphConfig.h
"
16
#include "
FlavorTagInference/SaltModelOutput.h
"
17
#include "nlohmann/json.hpp"
18
#include <memory>
19
#include <map>
20
#include <vector>
21
#include <string>
22
#include <cstdint>
23
24
namespace
FlavorTagInference
{
25
26
enum class
SaltModelVersion
{
UNKNOWN
,
V0
,
V1
,
V2
};
27
28
NLOHMANN_JSON_SERIALIZE_ENUM
(
SaltModelVersion
, {
29
{
SaltModelVersion::UNKNOWN
,
""
},
30
{
SaltModelVersion::V0
,
"v0"
},
31
{
SaltModelVersion::V1
,
"v1"
},
32
{
SaltModelVersion::V2
,
"v2"
},
33
})
34
35
// Inputs: the first element is the input data, the second is the shape
36
using
Inputs = std::pair<std::vector<float>, std::vector<int64_t>>;
37
using
InputMap
= std::map<std::string, Inputs, std::less<>>;
38
using
OutputConfig
= std::vector<SaltModelOutput>;
39
40
struct
InferenceOutput
{
41
std::map<std::string, float>
singleFloat
;
42
std::map<std::string, std::vector<char>>
vecChar
;
43
std::map<std::string, std::vector<float>>
vecFloat
;
44
};
45
46
class
ISaltModel
47
{
48
public
:
49
virtual
InferenceOutput
runInference
(
InputMap
& gnn_inputs)
const
=0;
50
virtual
const
SaltModelGraphConfig::GraphConfig
getGraphConfig
()
const
= 0;
51
virtual
const
OutputConfig
&
getOutputConfig
()
const
= 0;
52
virtual
SaltModelVersion
getSaltModelVersion
()
const
= 0;
53
virtual
const
std::string&
getModelName
()
const
= 0;
54
};
55
56
using
ISaltModelPtr
= std::shared_ptr<const ISaltModel>;
57
58
}
// End namespace
59
60
#endif
SaltModelGraphConfig.h
SaltModelOutput.h
FlavorTagInference::ISaltModel
Definition
ISaltModel.h:47
FlavorTagInference::ISaltModel::getGraphConfig
virtual const SaltModelGraphConfig::GraphConfig getGraphConfig() const =0
FlavorTagInference::ISaltModel::getModelName
virtual const std::string & getModelName() const =0
FlavorTagInference::ISaltModel::getSaltModelVersion
virtual SaltModelVersion getSaltModelVersion() const =0
FlavorTagInference::ISaltModel::getOutputConfig
virtual const OutputConfig & getOutputConfig() const =0
FlavorTagInference::ISaltModel::runInference
virtual InferenceOutput runInference(InputMap &gnn_inputs) const =0
FlavorTagInference
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition
CaloClusterLoader.h:27
FlavorTagInference::OutputConfig
std::vector< SaltModelOutput > OutputConfig
Definition
ISaltModel.h:38
FlavorTagInference::ConstituentsType::UNKNOWN
@ UNKNOWN
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:58
FlavorTagInference::SaltModelVersion
SaltModelVersion
Definition
ISaltModel.h:26
FlavorTagInference::SaltModelVersion::V0
@ V0
Definition
ISaltModel.h:26
FlavorTagInference::SaltModelVersion::UNKNOWN
@ UNKNOWN
Definition
ISaltModel.h:26
FlavorTagInference::SaltModelVersion::V1
@ V1
Definition
ISaltModel.h:26
FlavorTagInference::SaltModelVersion::V2
@ V2
Definition
ISaltModel.h:26
FlavorTagInference::NLOHMANN_JSON_SERIALIZE_ENUM
NLOHMANN_JSON_SERIALIZE_ENUM(SaltModelVersion, { { SaltModelVersion::UNKNOWN, "" }, { SaltModelVersion::V0, "v0" }, { SaltModelVersion::V1, "v1" }, { SaltModelVersion::V2, "v2" }, }) using Inputs
FlavorTagInference::InputMap
std::map< std::string, Inputs, std::less<> > InputMap
Definition
ISaltModel.h:37
FlavorTagInference::ISaltModelPtr
std::shared_ptr< const ISaltModel > ISaltModelPtr
Definition
ISaltModel.h:56
FlavorTagInference::InferenceOutput
Definition
ISaltModel.h:40
FlavorTagInference::InferenceOutput::vecChar
std::map< std::string, std::vector< char > > vecChar
Definition
ISaltModel.h:42
FlavorTagInference::InferenceOutput::singleFloat
std::map< std::string, float > singleFloat
Definition
ISaltModel.h:41
FlavorTagInference::InferenceOutput::vecFloat
std::map< std::string, std::vector< float > > vecFloat
Definition
ISaltModel.h:43
FlavorTagInference::SaltModelGraphConfig::GraphConfig
Definition
SaltModelGraphConfig.h:36
Generated on
for ATLAS Offline Software by
1.17.0