ATLAS Offline Software
IAthInferenceTool.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 #ifndef AthInfer_IAthInferenceTool_H
3 #define AthInfer_IAthInferenceTool_H
4 
5 #include "AsgTools/IAsgTool.h"
6 
7 #include <vector>
8 #include <string>
9 #include <variant>
10 #include <map>
11 
12 namespace AthInfer {
13 
14  using DataVariant = std::variant<std::vector<float>, std::vector<int64_t> >;
15  using InferenceData = std::pair<std::vector<int64_t>, DataVariant>;
16  using InputDataMap = std::map<std::string, InferenceData>;
17  using OutputDataMap = std::map<std::string, InferenceData>;
18 
19  // class asg::IAsgTool
20  // Interface class for running inferences in Athena.
21  // @author Xiangyang Ju <xju@cern.ch>
22 
23  class IAthInferenceTool : virtual public asg::IAsgTool
24  {
26  public:
27 
28  // Run inference with multiple inputs and multiple outputs
29  virtual StatusCode inference(InputDataMap& inputData, OutputDataMap& outputData) const = 0;
30  };
31 }
32 
33 #endif
AthInfer
Definition: IAthInferenceTool.h:12
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition: IAsgTool.h:41
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthInfer::OutputDataMap
std::map< std::string, InferenceData > OutputDataMap
Definition: IAthInferenceTool.h:17
ASG_TOOL_INTERFACE
#define ASG_TOOL_INTERFACE(CLASSNAME)
Definition: AsgToolMacros.h:40
IAsgTool.h
AthInfer::IAthInferenceTool::inference
virtual StatusCode inference(InputDataMap &inputData, OutputDataMap &outputData) const =0
AthInfer::InferenceData
std::pair< std::vector< int64_t >, DataVariant > InferenceData
Definition: IAthInferenceTool.h:15
AthInfer::InputDataMap
std::map< std::string, InferenceData > InputDataMap
Definition: IAthInferenceTool.h:16
AthInfer::DataVariant
std::variant< std::vector< float >, std::vector< int64_t > > DataVariant
Definition: IAthInferenceTool.h:14
AthInfer::IAthInferenceTool
Definition: IAthInferenceTool.h:24