![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <GNN.h>
Definition at line 39 of file GNN.h.
◆ Dec
Definition at line 74 of file GNN.h.
◆ Decs
Definition at line 77 of file GNN.h.
◆ TPC
Definition at line 70 of file GNN.h.
◆ TrackLinks
Definition at line 71 of file GNN.h.
◆ GNN() [1/6]
Definition at line 28 of file GNN.cxx.
29 GNN(getOnnxUtil(nn_file), o)
◆ GNN() [2/6]
◆ GNN() [3/6]
◆ GNN() [4/6]
FlavorTagDiscriminants::GNN::GNN |
( |
GNN && |
| ) |
|
|
default |
◆ GNN() [5/6]
FlavorTagDiscriminants::GNN::GNN |
( |
const GNN & |
| ) |
|
|
default |
◆ ~GNN()
FlavorTagDiscriminants::GNN::~GNN |
( |
| ) |
|
|
virtualdefault |
◆ GNN() [6/6]
Definition at line 38 of file GNN.cxx.
49 lwt_config, o.flip_config, o.variable_remapping, o.track_link_type);
50 for (
auto config : constituents_configs){
68 OnnxUtil::OutputConfig gnn_output_config =
m_onnxUtil->getOutputConfig();
77 rd.merge(loader->getUsedRemap());
◆ createDecorators()
Definition at line 231 of file GNN.cxx.
235 std::map<std::string, std::string>
remap =
options.remap_scalar;
236 std::set<std::string> usedRemap;
240 std::string context =
"building negative tag b-btagger";
242 for (
const auto& outNode : outConfig) {
244 std::string dec_name = outNode.name;
258 switch (outNode.type) {
269 throw std::logic_error(
"Unknown output data type");
281 return std::make_tuple(deps, usedRemap);
◆ decorate() [1/3]
Definition at line 94 of file GNN.cxx.
97 if (!jetLink.isValid()) {
98 throw std::runtime_error(
"invalid jetLink");
◆ decorate() [2/3]
void FlavorTagDiscriminants::GNN::decorate |
( |
const xAOD::Jet & |
jet | ) |
const |
|
virtual |
◆ decorate() [3/3]
Definition at line 128 of file GNN.cxx.
130 using namespace internal;
134 std::map<std::string, Inputs> gnn_inputs;
137 std::vector<float> jet_feat;
139 jet_feat.push_back(getter(btag).
second);
144 std::vector<int64_t> jet_feat_dim = {1,
static_cast<int64_t
>(jet_feat.size())};
145 Inputs jet_info(jet_feat, jet_feat_dim);
147 gnn_inputs.insert({
"jets", jet_info});
149 gnn_inputs.insert({
"jet_features", jet_info});
155 auto [input_name, input_data, input_objects] = loader->getData(
jet, btag);
157 input_name.pop_back();
158 input_name.append(
"_features");
160 gnn_inputs.insert({input_name, input_data});
165 for (
auto constituent : input_objects){
173 auto [out_f, out_vc, out_vf] =
m_onnxUtil->runInference(gnn_inputs);
181 if (out_vf.at(dec.first).size() != 1){
182 throw std::logic_error(
"expected vectors of length 1 for float decorators");
184 dec.second(btag) = out_vf.at(dec.first).at(0);
191 dec.second(btag) = out_f.at(dec.first);
195 dec.second(btag) = out_vc.at(dec.first);
198 dec.second(btag) = out_vf.at(dec.first);
205 TrackLinks::value_type link;
208 link.toIndexedElement(*itc,
it->index());
209 links.push_back(link);
211 dec.second(btag) =
links;
215 throw std::logic_error(
"unsupported ONNX metadata version");
◆ decorateWithDefaults()
Definition at line 109 of file GNN.cxx.
117 dec.second(
jet) = {};
120 dec.second(
jet) = {};
123 dec.second(
jet) = {};
◆ getAuxInputKeys()
std::set< std::string > FlavorTagDiscriminants::GNN::getAuxInputKeys |
( |
| ) |
const |
|
virtual |
◆ getConstituentAuxInputKeys()
std::set< std::string > FlavorTagDiscriminants::GNN::getConstituentAuxInputKeys |
( |
| ) |
const |
|
virtual |
◆ getDecoratorKeys()
std::set< std::string > FlavorTagDiscriminants::GNN::getDecoratorKeys |
( |
| ) |
const |
|
virtual |
◆ m_constituentsLoaders
std::vector<std::shared_ptr<IConstituentsLoader> > FlavorTagDiscriminants::GNN::m_constituentsLoaders |
|
private |
Definition at line 96 of file GNN.h.
◆ m_dataDependencyNames
◆ m_decorators
Decorators FlavorTagDiscriminants::GNN::m_decorators |
|
private |
Definition at line 98 of file GNN.h.
◆ m_defaultValue
float FlavorTagDiscriminants::GNN::m_defaultValue |
|
private |
Definition at line 99 of file GNN.h.
◆ m_input_node_name
std::string FlavorTagDiscriminants::GNN::m_input_node_name |
|
private |
Definition at line 93 of file GNN.h.
◆ m_jetLink
Definition at line 92 of file GNN.h.
◆ m_onnxUtil
std::shared_ptr<const OnnxUtil> FlavorTagDiscriminants::GNN::m_onnxUtil |
Definition at line 65 of file GNN.h.
◆ m_varsFromBTag
Definition at line 94 of file GNN.h.
◆ m_varsFromJet
Definition at line 95 of file GNN.h.
The documentation for this class was generated from the following files:
std::tuple< std::vector< FTagInputConfig >, std::vector< ConstituentsInputConfig >, FTagOptions > createGetterConfig(lwt::GraphConfig &graph_config, FlipTagConfig flip_config, std::map< std::string, std::string > remap_scalar, TrackLinkType track_link_type)
std::vector< ElementLink< TPC > > TrackLinks
GNN(const std::string &nnFile, const GNNOptions &opts)
std::vector< std::shared_ptr< IConstituentsLoader > > m_constituentsLoaders
std::pair< std::vector< float >, std::vector< int64_t > > Inputs
std::shared_ptr< const OnnxUtil > m_onnxUtil
std::vector< internal::VarFromJet > m_varsFromJet
FTagDataDependencyNames m_dataDependencyNames
std::set< std::string > bTagInputs
std::vector< internal::VarFromBTag > m_varsFromBTag
std::set< std::string > bTagOutputs
std::string sub_first(const StringRegexes &res, const std::string &var_name, const std::string &context)
Decs< std::vector< float > > jetVecFloat
Decs< TrackLinks > jetTrackLinks
void checkForUnusedRemaps(const std::map< std::string, std::string > &requested, const std::set< std::string > &used)
const std::string remapName(const std::string &name, std::map< std::string, std::string > &remap, std::set< std::string > &usedRemap)
SG::AuxElement::ConstAccessor< ElementLink< xAOD::JetContainer > > m_jetLink
std::set< std::string > trackInputs
std::map< std::string, std::string > remap
list of directories to be explicitly remapped
std::tuple< std::vector< internal::VarFromBTag >, std::vector< internal::VarFromJet >, FTagDataDependencyNames > createBvarGetters(const std::vector< FTagInputConfig > &inputs)
SG::AuxElement::Decorator< T > Dec
std::vector< const xAOD::TrackParticle * > Tracks
Class describing a TrackParticle.
StringRegexes getNameFlippers(const FlipTagConfig &flip_config)
Decs< std::vector< char > > jetVecChar
std::tuple< FTagDataDependencyNames, std::set< std::string > > createDecorators(const OnnxUtil::OutputConfig &outConfig, const FTagOptions &options)
virtual void decorate(const xAOD::BTagging &btag) const