ATLAS Offline Software
Loading...
Searching...
No Matches
HyPERTtbarAllHadronicParser.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 HYPERANALYSISALGORITHMS_HYPERTTBARALLHADRONICPARSER_H
6#define HYPERANALYSISALGORITHMS_HYPERTTBARALLHADRONICPARSER_H
7
8#include <string>
9#include <vector>
10
13
14namespace EventReco {
16 public:
19
20 void buildONNXInputs(const HyPERGraph& hyperGraph,
21 HyPERModel& hyperModel) override;
22
23 void getONNXOutputs(HyPERModel& hyperModel) override;
24
25 void reconstructOutputs(const HyPERGraph& hyperGraph) override;
26
27 std::vector<std::string> getLabels() override { return m_reco_labels_out; }
28 std::vector<float> getScores() override { return m_reco_scores_out; }
29 std::vector<std::vector<int>> getIndices() override {
31 }
32 std::vector<std::vector<int>> getIds() override {
33 return {{1, 1, 1}, {1, 1, 1}};
34 }
35
36 float getClassificationScore() override {
37 throw std::runtime_error(
38 "HyPERTtbarAllHadronicModel:: There is no classification score for "
39 "the ttbar all-hadronic topology.");
40 }
41
42 void clear() override;
43 virtual void printOutputsForValidation() const override;
44
45 public:
46 // Outputs
47 std::vector<int64_t> m_edge_out_shape{};
48 std::vector<int64_t> m_hyperedge_out_shape{};
49 std::vector<std::vector<float>> m_edge_out{};
50 std::vector<std::vector<float>> m_hyperedge_out{};
51
52 std::vector<std::vector<int64_t>> m_reco_indices_out = {};
53 std::vector<float> m_reco_scores_out = {};
54 std::vector<std::string> m_reco_labels_out = {};
55
56 private:
57 // Input tensors for the ONNX model including shapes and names.
58 std::vector<int64_t> m_l_edge_index_ = {{}, {}};
59 std::vector<int64_t> m_l_edge_index_shape;
60 const std::string m_l_edge_index_name = "edge_index";
61 std::vector<float> m_l_edge_attr_s_ = {};
62 std::vector<int64_t> m_l_edge_attr_s_shape;
63 const std::string m_l_edge_attr_s_name = "edge_attr_s";
64 std::vector<float> m_l_x_s_ = {};
65 std::vector<int64_t> m_l_x_s_shape;
66 const std::string m_l_x_s_name = "x_s";
67 std::vector<int64_t> m_l_batch_ = {};
68 std::vector<int64_t> m_l_batch_shape;
69 const std::string m_l_batch_name = "batch";
70 std::vector<int64_t> m_l_edge_index_h_ = {};
71 std::vector<int64_t> m_l_edge_index_h_shape;
72 const std::string m_l_edge_index_h_name = "edge_index_h";
73 std::vector<int64_t> m_l_edge_index_h_batch_ = {};
74 std::vector<int64_t> m_l_edge_index_h_batch_shape;
75 const std::string m_l_edge_index_h_batch_name = "edge_index_h_batch";
76 std::vector<float> m_l_u_s_;
77 std::vector<int64_t> m_l_u_s_shape;
78 const std::string m_l_u_s_name = "u_s";
79};
80
81} // namespace EventReco
82
83#endif // HYPERANALYSISALGORITHMS_HYPERTTBARALLHADRONICPARSER_H
std::vector< std::vector< int64_t > > m_reco_indices_out
std::vector< std::string > getLabels() override
The following methods return the reconstruction labels, scores and related indices from the parser ob...
std::vector< std::vector< int > > getIds() override
std::vector< std::vector< float > > m_hyperedge_out
void getONNXOutputs(HyPERModel &hyperModel) override
This method takes the information from the onnxruntime object and builds the outputs on the parser ob...
std::vector< std::vector< float > > m_edge_out
void buildONNXInputs(const HyPERGraph &hyperGraph, HyPERModel &hyperModel) override
This method takes the information from the graph object and builds the inputs for the onnxruntime obj...
void clear() override
This method clears the parser object.
std::vector< std::vector< int > > getIndices() override
void reconstructOutputs(const HyPERGraph &hyperGraph) override
This method implements the reconstruction of the outputs from the parser object into physcally meanin...
std::vector< std::vector< T > > vector2DTypeConverter(const std::vector< std::vector< V > > &input)
Definition HyPERUtils.h:70