ATLAS Offline Software
ISaltModel.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef FLAVORTAGINFERENCE_ISALTMODEL_H
6 #define FLAVORTAGINFERENCE_ISALTMODEL_H
7 
17 #include <memory>
18 
19 namespace FlavorTagInference {
20 
21  // Inputs: the first element is the input data, the second is the shape
22  using Inputs = std::pair<std::vector<float>, std::vector<int64_t>>;
23  using OutputConfig = std::vector<SaltModelOutput>;
24 
25  enum class SaltModelVersion{UNKNOWN, V0, V1, V2};
26 
27  struct InferenceOutput {
28  std::map<std::string, float> singleFloat;
29  std::map<std::string, std::vector<char>> vecChar;
30  std::map<std::string, std::vector<float>> vecFloat;
31  };
32 
33  class ISaltModel
34  {
35  public:
36  virtual InferenceOutput runInference(std::map<std::string, Inputs>& gnn_inputs) const =0;
38  virtual const OutputConfig& getOutputConfig() const = 0;
40  virtual const std::string& getModelName() const = 0;
41  };
42 
43  using ISaltModelPtr = std::shared_ptr<const ISaltModel>;
44 
45 } // End namespace
46 
47 #endif
FlavorTagInference
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:27
FlavorTagInference::SaltModelVersion::V0
@ V0
FlavorTagInference::ISaltModel::getOutputConfig
virtual const OutputConfig & getOutputConfig() const =0
FlavorTagInference::ISaltModel::getSaltModelVersion
virtual SaltModelVersion getSaltModelVersion() const =0
FlavorTagInference::ISaltModel
Definition: ISaltModel.h:34
FlavorTagInference::ISaltModel::runInference
virtual InferenceOutput runInference(std::map< std::string, Inputs > &gnn_inputs) const =0
FlavorTagInference::SaltModelVersion::V1
@ V1
FlavorTagInference::InferenceOutput::vecFloat
std::map< std::string, std::vector< float > > vecFloat
Definition: ISaltModel.h:30
SaltModelOutput.h
FlavorTagInference::SaltModelVersion::V2
@ V2
FlavorTagInference::SaltModelVersion::UNKNOWN
@ UNKNOWN
FlavorTagInference::InferenceOutput
Definition: ISaltModel.h:27
FlavorTagInference::ISaltModel::getModelName
virtual const std::string & getModelName() const =0
FlavorTagInference::InferenceOutput::singleFloat
std::map< std::string, float > singleFloat
Definition: ISaltModel.h:28
FlavorTagInference::OutputConfig
std::vector< SaltModelOutput > OutputConfig
Definition: ISaltModel.h:23
FlavorTagInference::SaltModelVersion
SaltModelVersion
Definition: ISaltModel.h:25
FlavorTagInference::ISaltModelPtr
std::shared_ptr< const ISaltModel > ISaltModelPtr
Definition: ISaltModel.h:43
FlavorTagInference::InferenceOutput::vecChar
std::map< std::string, std::vector< char > > vecChar
Definition: ISaltModel.h:29
FlavorTagInference::Inputs
std::pair< std::vector< float >, std::vector< int64_t > > Inputs
Definition: ISaltModel.h:22
FlavorTagInference::SaltModelGraphConfig::GraphConfig
Definition: SaltModelGraphConfig.h:36
FlavorTagInference::ISaltModel::getGraphConfig
virtual const SaltModelGraphConfig::GraphConfig getGraphConfig() const =0
SaltModelGraphConfig.h