ATLAS Offline Software
METRebuilder.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // METRebuilder.h
8 // Header file for class METRebuilder
9 // Author: T.J.Khoo<khoo@cern.ch>
11 #ifndef METUTILITIES_MET_METREBUILDER_H
12 #define METUTILITIES_MET_METREBUILDER_H 1
13 
14 // STL includes
15 #include <string>
16 
17 // FrameWork includes
20 #include "AsgTools/AsgTool.h"
22 #include "AsgTools/ToolHandle.h"
23 
24 
25 // METInterface includes
27 
28 // Tracking Tool
30 
31 // MET EDM
36 
37 // EDM includes
41 #include "xAODTau/TauxAODHelpers.h"
42 #include "xAODMuon/MuonContainer.h"
43 #include "xAODJet/JetAttributes.h"
44 
45 #include "xAODJet/JetContainer.h"
46 #include "xAODTracking/VertexFwd.h"
48 
49 // Forward declaration
50 
51 namespace met {
52 
53  // typedefs
55 
57  : public asg::AsgTool,
58  virtual public IMETRebuilder
59 
60  {
61  // This macro defines the constructor with the interface declaration
63 
64 
65  // Public methods:
67  public:
68 
69  // Copy constructor:
70 
72  METRebuilder(const std::string& name);
73 
75  virtual ~METRebuilder() = default;
76 
77  // Athena algtool's Hooks
78  virtual StatusCode initialize() override;
79  virtual StatusCode execute() override;
80 
81  virtual StatusCode copyMET(const std::string& metKey,
82  xAOD::MissingETContainer* metCont,
83  const xAOD::MissingETComponentMap* metMap) override;
84 
85  virtual StatusCode rebuildMET(const std::string& metKey,
86  xAOD::MissingETContainer* metCont,
87  const xAOD::IParticleContainer* collection,
88  const xAOD::MissingETComponentMap* metMap,
89  bool doTracks=true) override;
90 
92  const xAOD::IParticleContainer* collection,
93  const xAOD::MissingETComponent* component,
94  bool doTracks=true) override;
95 
96  virtual StatusCode rebuildJetMET(const std::string& jetKey,
97  const std::string& softKey,
98  xAOD::MissingETContainer* metCont,
99  const xAOD::JetContainer* jets,
100  const xAOD::MissingETComponentMap* metMap,
101  bool doTracks=true) override
102  {
103  return rebuildJetMET(jetKey,softKey,metCont,jets,metMap,doTracks,
105  }
106 
107  virtual StatusCode rebuildJetMET(const std::string& jetKey,
108  const std::string& softKey,
109  xAOD::MissingETContainer* metCont,
110  const xAOD::JetContainer* jets,
111  const xAOD::MissingETComponentMap* metMap,
112  bool doTracks,
113  bool doJvfCut,
114  bool pureTrkSoft,
115  const std::string& softJetScale) override;
116 
117  virtual StatusCode rebuildJetMET(const std::string& jetKey,
118  const std::string& softKey,
119  xAOD::MissingETContainer* metCont,
120  const xAOD::JetContainer* jets,
121  const xAOD::MissingETComponentMap* metMap,
122  bool doTracks,
123  bool doJvfCut,
124  bool pureTrkSoft,
125  const std::string& softJetScale,
126  float& stvf) override;
127 
128  virtual StatusCode rebuildJetMET(xAOD::MissingET* metJet,
129  xAOD::MissingET* metSoft,
130  const xAOD::JetContainer* jets,
131  const xAOD::MissingETComponent* component,
132  bool doTracks,
133  bool doJvfCut,
134  bool pureTrkSoft,
135  const std::string& softJetScale,
136  float& stvf,
137  const xAOD::MissingETComponent* comp_softtrk=0) override;
138 
140  // Private data:
142  private:
143  bool acceptTrack(const xAOD::TrackParticle* trk,
144  const xAOD::Vertex* pv) const;
145  void associateTracks(const xAOD::IParticle* obj);
146 
149 
150  // ReadHandleKey(s)
151  SG::ReadHandleKey<xAOD::MissingETComponentMap> m_METMapKey{this, "InputMap", "METMap_RefFinal", ""};
152  SG::ReadHandleKey<xAOD::ElectronContainer> m_ElectronContainerKey{this, "EleColl", "ElectronCollection", ""};
153  SG::ReadHandleKey<xAOD::PhotonContainer> m_PhotonContainerKey{this, "GammaColl", "PhotonCollection", ""};
154  SG::ReadHandleKey<xAOD::TauJetContainer> m_TauJetContainerKey{this, "TauColl", "TauRecContainer", ""};
156  SG::ReadHandleKey<xAOD::JetContainer> m_JetContainerKey{this, "JetColl", "AntiKt4LCTopoJets", ""};
157  SG::ReadHandleKey<xAOD::VertexContainer> m_PVKey{this, "VertexColl", "PrimaryVertices", ""};
158  // WriteHandleKey(s)
159  SG::WriteHandleKey<xAOD::MissingETContainer> m_OutMETKey{this, "OutputContainer", "MET_MyRefFinal", ""};
160 
161  //
162  Gaudi::Property<std::string> m_eleTerm{this, "EleTerm", "RefEle", ""};
163  Gaudi::Property<std::string> m_gammaTerm{this, "GammaTerm", "RefGamma", ""};
164  Gaudi::Property<std::string> m_tauTerm{this, "TauTerm", "RefTau", ""};
165  Gaudi::Property<std::string> m_jetTerm{this, "JetTerm", "RefJet", ""};
166  Gaudi::Property<std::string> m_muonTerm{this, "MuonTerm", "Muons", ""};
167  Gaudi::Property<std::string> m_softTerm{this, "SoftTerm", "", ""};
168  Gaudi::Property<std::string> m_softTermType{this, "SoftTermType", "TrackSoftTerm", ""};
169  //
170  Gaudi::Property<std::string> m_outMETTerm{this, "OutputTotal", "Final", ""};
171 
172 
173  bool m_doEle{};
174  bool m_doGamma{};
175  bool m_doTau{};
176  bool m_doMuon{};
177 
178  bool m_rebuildEle{};
180  bool m_rebuildTau{};
182 
183  // For jet/soft term -- eventually break off into a separate tool
184  Gaudi::Property<double> m_jetPtCut{this, "CalibJetPtCut", 20e3, ""};
185  Gaudi::Property<bool> m_jetDoJvf{this, "DoJetJVFCut", true, ""};
186  Gaudi::Property<double> m_jetJvfCut{this, "CalibJetJvfCut", 0.25, ""};
187  Gaudi::Property<std::string> m_softJetScale{this, "SoftJetScale", "", ""};
188  bool m_doTracks{true};
189  bool m_pureTrkSoft{true};
190  Gaudi::Property<bool> m_doSTVF{this, "ComputeSTVF", false, ""};
191 
192  // Decorate tracks to state that they have been used for a MET calc
194 
195  Gaudi::Property<bool> m_trk_doPVsel{this, "DoTrackPVSel", true, ""};
196  ToolHandle<InDet::IInDetTrackSelectionTool> m_trkseltool;
197  };
198 
199 } //> end namespace met
200 #endif //> !METUTILITIES_MET_METREBUILDER_H
met::METRebuilder::m_PVKey
SG::ReadHandleKey< xAOD::VertexContainer > m_PVKey
Definition: METRebuilder.h:157
xAOD::MissingETComponentMap_v1
Definition: MissingETComponentMap_v1.h:25
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
IMETRebuilder.h
met::METRebuilder::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: METRebuilder.cxx:76
met::obj_link_t
ElementLink< xAOD::IParticleContainer > obj_link_t
Definition: METMaker.h:38
met::METRebuilder::m_gammaTerm
Gaudi::Property< std::string > m_gammaTerm
Definition: METRebuilder.h:163
met::METRebuilder::m_trkUsedDec
SG::AuxElement::Decorator< char > m_trkUsedDec
Definition: METRebuilder.h:193
met::METRebuilder::m_doTau
bool m_doTau
Definition: METRebuilder.h:175
met::METRebuilder::m_METMapKey
SG::ReadHandleKey< xAOD::MissingETComponentMap > m_METMapKey
Definition: METRebuilder.h:151
met::METRebuilder::m_doGamma
bool m_doGamma
Definition: METRebuilder.h:174
JetAttributes.h
met::METRebuilder::m_rebuildTau
bool m_rebuildTau
Definition: METRebuilder.h:180
met::METRebuilder
Definition: METRebuilder.h:60
met::METRebuilder::m_jetJvfCut
Gaudi::Property< double > m_jetJvfCut
Definition: METRebuilder.h:186
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
met::METRebuilder::m_TauJetContainerKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_TauJetContainerKey
Definition: METRebuilder.h:154
met::METRebuilder::m_softJetScale
Gaudi::Property< std::string > m_softJetScale
Definition: METRebuilder.h:187
met::METRebuilder::m_doEle
bool m_doEle
Definition: METRebuilder.h:173
met::METRebuilder::rebuildJetMET
virtual StatusCode rebuildJetMET(const std::string &jetKey, const std::string &softKey, xAOD::MissingETContainer *metCont, const xAOD::JetContainer *jets, const xAOD::MissingETComponentMap *metMap, bool doTracks=true) override
Definition: METRebuilder.h:96
met::METRebuilder::m_muonTerm
Gaudi::Property< std::string > m_muonTerm
Definition: METRebuilder.h:166
met
Definition: IMETSignificance.h:24
met::METRebuilder::m_jetDoJvf
Gaudi::Property< bool > m_jetDoJvf
Definition: METRebuilder.h:185
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
met::METRebuilder::m_softTerm
Gaudi::Property< std::string > m_softTerm
Definition: METRebuilder.h:167
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
ElectronContainer.h
met::METRebuilder::m_rebuildEle
bool m_rebuildEle
Definition: METRebuilder.h:178
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
TauxAODHelpers.h
MissingETAuxContainer.h
met::METRebuilder::m_MuonContainerKey
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
Definition: METRebuilder.h:155
met::METRebuilder::m_jetTerm
Gaudi::Property< std::string > m_jetTerm
Definition: METRebuilder.h:165
met::METRebuilder::m_JetContainerKey
SG::ReadHandleKey< xAOD::JetContainer > m_JetContainerKey
Definition: METRebuilder.h:156
met::METRebuilder::m_doTracks
bool m_doTracks
Definition: METRebuilder.h:188
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
met::METRebuilder::m_trk_doPVsel
Gaudi::Property< bool > m_trk_doPVsel
Definition: METRebuilder.h:195
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
TauJetContainer.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
IInDetTrackSelectionTool.h
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
met::METRebuilder::copyMET
virtual StatusCode copyMET(const std::string &metKey, xAOD::MissingETContainer *metCont, const xAOD::MissingETComponentMap *metMap) override
Definition: METRebuilder.cxx:276
met::METRebuilder::m_doSTVF
Gaudi::Property< bool > m_doSTVF
Definition: METRebuilder.h:190
met::METRebuilder::m_eleTerm
Gaudi::Property< std::string > m_eleTerm
Definition: METRebuilder.h:162
met::METRebuilder::m_doMuon
bool m_doMuon
Definition: METRebuilder.h:176
met::METRebuilder::rebuildMET
virtual StatusCode rebuildMET(const std::string &metKey, xAOD::MissingETContainer *metCont, const xAOD::IParticleContainer *collection, const xAOD::MissingETComponentMap *metMap, bool doTracks=true) override
Definition: METRebuilder.cxx:290
VertexFwd.h
MuonContainer.h
met::METRebuilder::m_jetPtCut
Gaudi::Property< double > m_jetPtCut
Definition: METRebuilder.h:184
met::METRebuilder::acceptTrack
bool acceptTrack(const xAOD::TrackParticle *trk, const xAOD::Vertex *pv) const
Definition: METRebuilder.cxx:615
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
JetContainer.h
MissingETComponentMap.h
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
TrackParticleFwd.h
met::METRebuilder::m_pureTrkSoft
bool m_pureTrkSoft
Definition: METRebuilder.h:189
python.changerun.pv
pv
Definition: changerun.py:81
met::METRebuilder::m_rebuildGamma
bool m_rebuildGamma
Definition: METRebuilder.h:179
met::METRebuilder::m_softTermType
Gaudi::Property< std::string > m_softTermType
Definition: METRebuilder.h:168
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
IMETRebuilder
Definition: IMETRebuilder.h:27
met::METRebuilder::m_ElectronContainerKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_ElectronContainerKey
Definition: METRebuilder.h:152
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
met::METRebuilder::~METRebuilder
virtual ~METRebuilder()=default
Destructor:
ToolHandle.h
met::METRebuilder::execute
virtual StatusCode execute() override
Definition: METRebuilder.cxx:191
AsgTool.h
met::METRebuilder::m_tauTerm
Gaudi::Property< std::string > m_tauTerm
Definition: METRebuilder.h:164
met::METRebuilder::m_rebuildMuon
bool m_rebuildMuon
Definition: METRebuilder.h:181
python.PyAthena.obj
obj
Definition: PyAthena.py:132
met::METRebuilder::m_OutMETKey
SG::WriteHandleKey< xAOD::MissingETContainer > m_OutMETKey
Definition: METRebuilder.h:159
PhotonContainer.h
MissingETComposition.h
met::METRebuilder::m_outMETTerm
Gaudi::Property< std::string > m_outMETTerm
Definition: METRebuilder.h:170
MissingETContainer.h
met::METRebuilder::m_trkseltool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkseltool
Definition: METRebuilder.h:196
met::METRebuilder::m_PhotonContainerKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_PhotonContainerKey
Definition: METRebuilder.h:153
met::METRebuilder::METRebuilder
METRebuilder()
Default constructor:
xAOD::MissingETComponent_v1
MET component descriptor contains object links and corresponding parameters.
Definition: MissingETComponent_v1.h:24
met::METRebuilder::associateTracks
void associateTracks(const xAOD::IParticle *obj)
Definition: METRebuilder.cxx:629