ATLAS Offline Software
MultifoldGNNTool.h
Go to the documentation of this file.
1 /*
2 + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MULTIFOLD_GNN_TOOL_H
6 #define MULTIFOLD_GNN_TOOL_H
7 
8 // Tool includes
9 #include "AsgTools/AsgTool.h"
14 
16 
17 // EDM includes
19 #include "xAODJet/JetFwd.h"
20 
21 #include <memory>
22 #include <string>
23 #include <map>
24 
25 // needed for map<string,<map<string,float>>
26 #include "Gaudi/Parsers/Factory.h"
27 
28 
29 namespace FlavorTagDiscriminants {
30 
31  class MultifoldGNN;
32 
33  //
34  // Tool to to flavor tag jet/btagging object
35  // using GNN based taggers
37  virtual public IBTagConditionalDecorator,
38  virtual public IJetTagConditionalDecorator
39  {
40 
45  public:
46  MultifoldGNNTool(const std::string& name);
48 
49  StatusCode initialize() override;
50 
51  virtual void decorate(const xAOD::BTagging& btag) const override;
52  virtual void decorate(const xAOD::Jet& jet) const override;
53  virtual void decorateWithDefaults(const SG::AuxElement& jet) const override;
54  virtual void decorateWithDefaults(const xAOD::BTagging& btag) const override;
55 
56  virtual std::set<std::string> getDecoratorKeys() const override;
57  virtual std::set<std::string> getAuxInputKeys() const override;
58  virtual std::set<std::string> getConstituentAuxInputKeys() const override;
59 
60  private:
61 
62  using MMD = std::map<std::string, std::map<std::string, float>>;
63 
65  this, "nnSharingService", "", "NN sharing service"};
66  std::vector<std::string> m_nn_files;
67  std::string m_fold_hash_name;
69  std::shared_ptr<const MultifoldGNN> m_gnn;
70  Gaudi::Property<MMD> m_defaults {
71  this, "perFoldDefaultOutputValues", {}, "per-fold defaults"};
72  };
73 }
74 #endif
IJetTagConditionalDecorator
Definition: IJetTagConditionalDecorator.h:27
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
FlavorTagDiscriminants
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: AssociationEnums.h:11
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:483
FlavorTagDiscriminants::MultifoldGNNTool::m_gnn
std::shared_ptr< const MultifoldGNN > m_gnn
Definition: MultifoldGNNTool.h:69
FlavorTagDiscriminants::MultifoldGNNTool::getConstituentAuxInputKeys
virtual std::set< std::string > getConstituentAuxInputKeys() const override
Definition: MultifoldGNNTool.cxx:70
FlavorTagDiscriminants::MultifoldGNNTool::decorate
virtual void decorate(const xAOD::BTagging &btag) const override
Method to decorate a jet.
Definition: MultifoldGNNTool.cxx:50
IJetTagConditionalDecorator.h
FlavorTagDiscriminants::MultifoldGNNTool
Definition: MultifoldGNNTool.h:39
FlavorTagDiscriminants::MultifoldGNNTool::m_nn_files
std::vector< std::string > m_nn_files
Definition: MultifoldGNNTool.h:66
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
FlavorTagDiscriminants::GNNToolProperties
Definition: GNNToolifiers.h:22
FlavorTagDiscriminants::MultifoldGNNTool::getDecoratorKeys
virtual std::set< std::string > getDecoratorKeys() const override
Definition: MultifoldGNNTool.cxx:64
FlavorTagDiscriminants::MultifoldGNNTool::m_fold_hash_name
std::string m_fold_hash_name
Definition: MultifoldGNNTool.h:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FlavorTagDiscriminants::MultifoldGNNTool::m_nnsvc
ServiceHandle< INNSharingSvc > m_nnsvc
Definition: MultifoldGNNTool.h:64
FlavorTagDiscriminants::MultifoldGNNTool::initialize
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: MultifoldGNNTool.cxx:24
IBTagConditionalDecorator
Definition: IBTagConditionalDecorator.h:27
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ServiceHandle.h
FlavorTagDiscriminants::MultifoldGNNTool::m_defaults
Gaudi::Property< MMD > m_defaults
Definition: MultifoldGNNTool.h:70
IBTagConditionalDecorator.h
JetFwd.h
FlavorTagDiscriminants::MultifoldGNNTool::decorateWithDefaults
virtual void decorateWithDefaults(const SG::AuxElement &jet) const override
Method to decorate a jet with defaults.
Definition: MultifoldGNNTool.cxx:56
INNSharingSvc.h
FlavorTagDiscriminants::MultifoldGNNTool::MMD
std::map< std::string, std::map< std::string, float > > MMD
Definition: MultifoldGNNTool.h:62
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
GNNToolifiers.h
FlavorTagDiscriminants::MultifoldGNNTool::getAuxInputKeys
virtual std::set< std::string > getAuxInputKeys() const override
Definition: MultifoldGNNTool.cxx:67
FlavorTagDiscriminants::MultifoldGNNTool::m_props
GNNToolProperties m_props
Definition: MultifoldGNNTool.h:68
AsgTool.h
BTaggingFwd.h
ServiceHandle
Definition: ClusterMakerTool.h:37