ATLAS Offline Software
Loading...
Searching...
No Matches
METNet.h
Go to the documentation of this file.
1
2/*
3 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4*/
5// Author: Bill Balunas <balunas@cern.ch>, based on earlier implementation by M. Leigh
7
8#ifndef METUTILITIES_MET_METNET_H
9#define METUTILITIES_MET_METNET_H
10
11// STL includes
12#include <string>
13
14// Asg tool includes
15#include "AsgTools/AsgTool.h"
16#include "AsgTools/ToolHandle.h"
19
20// EDM includes
23
24// METInterface includes
26
27// Network handler
28#include "METNetHandler.h"
29
30// Forward declarations
31class IMETMaker;
32class METNetHandler;
33
34namespace met {
35
42 class METNet final: public asg::AsgTool, virtual public IMETMaker {
43
44 // This macro defines the constructor with the interface declaration
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,
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,
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.
77 virtual StatusCode rebuildMET( xAOD::MissingET* met,
78 const xAOD::IParticleContainer* collection,
80 MissingETBase::UsageHandler::Policy objScale ) const override;
81
82 // Unsupported method inherited from METMaker. Please do not use.
83 virtual StatusCode rebuildMET( xAOD::MissingET* met,
84 const xAOD::IParticleContainer* collection,
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,
98 bool doJetJVT ) const override;
99
100 // Unsupported method inherited from METMaker. Please do not use.
101 virtual StatusCode rebuildJetMET( xAOD::MissingET* metJet,
102 const xAOD::JetContainer* jets,
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,
119 bool doJetJVT ) const override;
120
121 // Unsupported method inherited from METMaker. Please do not use.
122 virtual StatusCode rebuildTrackMET( xAOD::MissingET* metJet,
123 const xAOD::JetContainer* jets,
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,
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}
157
158#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
StatusCode addMETFinal(const std::string &WP_name, xAOD::MissingETContainer *met_container, std::vector< std::string > &name_vec, std::vector< float > &val_vec) const
Definition METNet.cxx:264
std::unique_ptr< const METNetHandler > m_metNetHandler
Definition METNet.h:142
virtual ~METNet()=default
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) const override
Definition METNet.cxx:104
ToolHandle< IMETMaker > m_metmaker_tenac
Definition METNet.h:147
ToolHandle< IMETMaker > m_metmaker_tghtr
Definition METNet.h:146
StatusCode copyMETContainer(xAOD::MissingETContainer *new_container, const xAOD::MissingETContainer *old_container) const
Definition METNet.cxx:310
virtual StatusCode markInvisible(const xAOD::IParticleContainer *collection, xAOD::MissingETAssociationHelper &helper, xAOD::MissingETContainer *metCont) const override
Definition METNet.cxx:421
Gaudi::Property< std::string > m_netLocation
Definition METNet.h:136
ToolHandle< IMETMaker > m_metmaker_loose
Definition METNet.h:144
METNet(const std::string &name)
Definition METNet.cxx:42
virtual StatusCode rebuildTrackMET(const std::string &metJetKey, const std::string &softTrkKey, xAOD::MissingETContainer *metCont, const xAOD::JetContainer *jets, const xAOD::MissingETContainer *metCoreCont, xAOD::MissingETAssociationHelper &helper, bool doJetJVT) const override
Definition METNet.cxx:399
virtual StatusCode rebuildJetMET(const std::string &metJetKey, const std::string &softTrkKey, xAOD::MissingETContainer *metCont, const xAOD::JetContainer *jets, const xAOD::MissingETContainer *metCoreCont, xAOD::MissingETAssociationHelper &helper, bool doJetJVT=false) const override
Definition METNet.cxx:364
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition METNet.h:138
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerKey
Definition METNet.h:140
ToolHandle< IMETMaker > m_metmaker_tight
Definition METNet.h:145
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition METNet.cxx:45
StatusCode addMETTerm(const std::string &WP_name, xAOD::MissingET *met, std::vector< std::string > &name_vec, std::vector< float > &val_vec) const
Definition METNet.cxx:277
StatusCode addInputValue(const std::string &var_name, float value, std::vector< std::string > &name_vec, std::vector< float > &val_vec) const
Definition METNet.cxx:298
virtual StatusCode evaluateNNMET(const std::string &totalName, xAOD::MissingETContainer *metCont) const override
Definition METNet.cxx:228
SG::ReadHandleKey< xAOD::VertexContainer > m_pvContainerKey
Definition METNet.h:139
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32
MissingET_v1 MissingET
Version control by type defintion.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.