ATLAS Offline Software
Loading...
Searching...
No Matches
METNet.h File Reference
Include dependency graph for METNet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

namespace ADD_CMODE (met)

Function Documentation

◆ ADD_CMODE()

namespace ADD_CMODE ( met )

METNet tool class used to create a missing transverse momentum estimate using a pre-trained neural network. The tool inherits from the same interface as METMaker and so it should be largely interchangable. However, it does not use every public method as METMaker, as it must ensure that the exact variables are constructed for the network's inputs. Uses an ONNX runtime environment for inference.

Definition at line 1 of file METNet.h.

34 {
35
42 class METNet final: public asg::AsgTool, virtual public IMETMaker {
43
44 // This macro defines the constructor with the interface declaration
45 ASG_TOOL_CLASS( METNet, IMETMaker )
46
47 public:
48
49 METNet( const std::string& name );
50
51 virtual ~METNet() = default;
52
53 virtual StatusCode initialize() override;
54
55 // Adds a collection of objects to the core MET container, must be done for photons, elections and muons.
56 virtual StatusCode rebuildMET( const std::string& metKey,
59 const xAOD::IParticleContainer* collection,
60 xAOD::MissingETAssociationHelper& helper,
61 MissingETBase::UsageHandler::Policy objScale ) const override;
62
63 // Adds multiple jet definitions to seperate MET containers and creates the collection of input features for the neural network
64 virtual StatusCode rebuildJetMET( const std::string& metJetKey,
65 const std::string& softTrkKey,
67 const xAOD::JetContainer* jets,
68 const xAOD::MissingETContainer* metCoreCont,
69 xAOD::MissingETAssociationHelper& helper,
70 bool doJetJVT = false) const override;
71
72 // Uses ONNX runtime to propagate the input features created in rebuildJetMET through the trained network
73 virtual StatusCode evaluateNNMET( const std::string& totalName,
74 xAOD::MissingETContainer* metCont ) const override;
75
76 // Unsupported method inherited from METMaker. Please do not use.
78 const xAOD::IParticleContainer* collection,
79 xAOD::MissingETAssociationHelper& helper,
80 MissingETBase::UsageHandler::Policy objScale ) const override;
81
82 // Unsupported method inherited from METMaker. Please do not use.
84 const xAOD::IParticleContainer* collection,
85 xAOD::MissingETAssociationHelper& helper,
87 bool removeOverlap,
88 MissingETBase::UsageHandler::Policy objScale ) const override;
89
90 // Unsupported method inherited from METMaker. Please do not use.
91 virtual StatusCode rebuildJetMET( const std::string& metJetKey,
92 const std::string& softClusKey,
93 const std::string& softTrkKey,
95 const xAOD::JetContainer* jets,
96 const xAOD::MissingETContainer* metCoreCont,
97 xAOD::MissingETAssociationHelper& helper,
98 bool doJetJVT ) const override;
99
100 // Unsupported method inherited from METMaker. Please do not use.
102 const xAOD::JetContainer* jets,
103 xAOD::MissingETAssociationHelper& helper,
104 xAOD::MissingET* metSoftClus,
105 const xAOD::MissingET* coreSoftClus,
106 xAOD::MissingET* metSoftTrk,
107 const xAOD::MissingET* coreSoftTrk,
108 bool doJetJVT,
109 bool tracksForHardJets = false,
110 std::vector<const xAOD::IParticle*>* softConst = 0 ) const override;
111
112 // Unsupported method inherited from METMaker. Please do not use.
113 virtual StatusCode rebuildTrackMET( const std::string& metJetKey,
114 const std::string& softTrkKey,
116 const xAOD::JetContainer* jets,
117 const xAOD::MissingETContainer* metCoreCont,
118 xAOD::MissingETAssociationHelper& helper,
119 bool doJetJVT ) const override;
120
121 // Unsupported method inherited from METMaker. Please do not use.
123 const xAOD::JetContainer* jets,
124 xAOD::MissingETAssociationHelper& helper,
125 xAOD::MissingET* metSoftTrk,
126 const xAOD::MissingET* coreSoftTrk,
127 bool doJetJVT ) const override;
128
129 // Unsupported method inherited from METMaker. Please do not use.
130 virtual StatusCode markInvisible( const xAOD::IParticleContainer* collection,
131 xAOD::MissingETAssociationHelper& helper,
132 xAOD::MissingETContainer* metCont ) const override;
133
134 private:
135
136 Gaudi::Property<std::string> m_netLocation{this, "NetworkFile", "", "Location of NN file to use"};
137
138 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "EventInfoKey", "EventInfo", "Event info key"};
139 SG::ReadHandleKey<xAOD::VertexContainer> m_pvContainerKey{this, "PVContainerKey", "PrimaryVertices", "Primary vertex container"};
140 SG::ReadHandleKey<xAOD::JetContainer> m_jetContainerKey{this, "JetContainer", "", "Name of input jet container"};
141
142 std::unique_ptr<const METNetHandler> m_metNetHandler;
143 // Users do not need to interact with these ToolHandles; they're managed by METNet
144 ToolHandle<IMETMaker> m_metmaker_loose{this, "METMakerLoose", "", "METMaker for Loose WP. Do not configure manually except for expert usage." };
145 ToolHandle<IMETMaker> m_metmaker_tight{this, "METMakerTight", "", "METMaker for Tight WP. Do not configure manually except for expert usage." };
146 ToolHandle<IMETMaker> m_metmaker_tghtr{this, "METMakerTighter", "", "METMaker for Tighter WP. Do not configure manually except for expert usage." };
147 ToolHandle<IMETMaker> m_metmaker_tenac{this, "METMakerTenacious", "", "METMaker for Tenacious WP. Do not configure manually except for expert usage." };
148
149 StatusCode addMETFinal( const std::string& WP_name, xAOD::MissingETContainer* met_container, std::vector<std::string>& name_vec, std::vector<float>& val_vec ) const;
150 StatusCode addMETTerm( const std::string& WP_name, xAOD::MissingET* met, std::vector<std::string>& name_vec, std::vector<float>& val_vec ) const;
151 StatusCode addInputValue( const std::string& var_name, float value,std::vector<std::string>& name_vec, std::vector<float>& val_vec ) const;
152 StatusCode copyMETContainer( xAOD::MissingETContainer* new_container, const xAOD::MissingETContainer* old_container) const;
153
154 };
155
156}
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
virtual StatusCode rebuildTrackMET(const std::string &metJetKey, const std::string &metSoftKey, xAOD::MissingETContainer *metCont, const xAOD::JetContainer *jets, const xAOD::MissingETContainer *metCoreCont, xAOD::MissingETAssociationHelper &helper, bool doJetJVT) const =0
virtual StatusCode rebuildMET(const std::string &metKey, xAOD::Type::ObjectType metType, xAOD::MissingETContainer *metCont, const xAOD::IParticleContainer *collection, xAOD::MissingETAssociationHelper &helper, MissingETBase::UsageHandler::Policy objScale=MissingETBase::UsageHandler::PhysicsObject) const =0
virtual StatusCode rebuildJetMET(const std::string &metJetKey, const std::string &metSoftKey, xAOD::MissingETContainer *metCont, const xAOD::JetContainer *jets, const xAOD::MissingETContainer *metCoreCont, xAOD::MissingETAssociationHelper &helper, bool doJetJVT) const =0
virtual StatusCode markInvisible(const xAOD::IParticleContainer *collection, xAOD::MissingETAssociationHelper &helper, xAOD::MissingETContainer *metCont) const =0
virtual StatusCode evaluateNNMET(const std::string &, xAOD::MissingETContainer *) const
Definition IMETMaker.h:115
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition AsgTool.h:133
::StatusCode StatusCode
StatusCode definition for legacy code.
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32
MissingET_v1 MissingET
Version control by type defintion.
Definition MissingET.h:15
MissingETContainer_v1 MissingETContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.