ATLAS Offline Software
Loading...
Searching...
No Matches
ColumnarMETMaker.h
Go to the documentation of this file.
2
3/*
4 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5*/
6
7// ColumnarMETMaker.h
8// Header file for class ColumnarMETMaker
9// Author: T.J.Khoo<khoo@cern.ch>
11#ifndef METUTILITIES_COLUMNAR_MET_METMAKER_H
12#define METUTILITIES_COLUMNAR_MET_METMAKER_H 1
13
14// STL includes
15#include <string>
16
17// FrameWork includes
19#include "AsgTools/ToolHandle.h"
20#include "AsgTools/AsgTool.h"
21
22// METInterface includes
24
25// EDM includes
28
29// Tracking Tool
31
37#include <ColumnarJet/JetDef.h>
41
42// Forward declaration
43
44namespace ADD_CMODE(met) {
45
46 // typedefs
48
49 class ColumnarMETMaker
50 : public asg::AsgTool, public columnar::ColumnarTool<>,
51 virtual public IMETMaker
52
53 {
54 // This macro defines the constructor with the interface declaration
55 ASG_TOOL_CLASS(ColumnarMETMaker, IMETMaker)
56
57
58 // Public methods:
60 public:
61
62 // Copy constructor:
63
65 ColumnarMETMaker(const std::string& name);
66
68 virtual ~ColumnarMETMaker();
69
70 // Athena algtool's Hooks
71 virtual StatusCode initialize() override final;
72
73 virtual StatusCode rebuildMET(
74 const std::string& metKey,
77 const xAOD::IParticleContainer* collection,
79 MissingETBase::UsageHandler::Policy objScale) const override final;
80 StatusCode rebuildMET(
81 const std::string& metKey,
84 columnar::ParticleRange collection,
87 //
88 virtual StatusCode rebuildMET(
90 const xAOD::IParticleContainer* collection,
92 MissingETBase::UsageHandler::Policy objScale) const override final;
93 StatusCode rebuildMET(
95 columnar::ParticleRange collection,
98 //
99 virtual StatusCode rebuildMET(
101 const xAOD::IParticleContainer* collection,
104 bool removeOverlap,
105 MissingETBase::UsageHandler::Policy objScale) const override final;
106 StatusCode rebuildMET(
108 columnar::ParticleRange collection,
111 bool removeOverlap,
113
114 virtual StatusCode rebuildJetMET(
115 const std::string& metJetKey,
116 const std::string& softClusKey,
117 const std::string& softTrkKey,
119 const xAOD::JetContainer* jets,
120 const xAOD::MissingETContainer* metCoreCont,
122 bool doJetJVT) const override final;
123 StatusCode rebuildJetMET(
124 const std::string& metJetKey,
125 const std::string& softClusKey,
126 const std::string& softTrkKey,
129 columnar::Met1Range metCoreCont,
131 bool doJetJVT) const;
132
133 virtual StatusCode rebuildJetMET(
134 const std::string& metJetKey,
135 const std::string& metSoftKey,
137 const xAOD::JetContainer* jets,
138 const xAOD::MissingETContainer* metCoreCont,
140 bool doJetJVT) const override final;
141 StatusCode rebuildJetMET(
142 const std::string& metJetKey,
143 const std::string& metSoftKey,
146 columnar::Met1Range metCoreCont,
148 bool doJetJVT) const;
149
150 virtual StatusCode rebuildJetMET(
151 xAOD::MissingET* metJet,
152 const xAOD::JetContainer* jets,
154 xAOD::MissingET* metSoftClus,
155 const xAOD::MissingET* coreSoftClus,
156 xAOD::MissingET* metSoftTrk,
157 const xAOD::MissingET* coreSoftTrk,
158 bool doJetJVT,
159 bool tracksForHardJets = false,
160 std::vector<const xAOD::IParticle*>* softConst = 0) const override final;
161 StatusCode rebuildJetMET(
166 columnar::OptMutableMetId metSoftClus,
167 columnar::OptMet1Id coreSoftClus,
168 columnar::OptMutableMetId metSoftTrk,
169 columnar::OptMet1Id coreSoftTrk,
170 bool doJetJVT,
171 bool tracksForHardJets = false,
172 std::vector<const xAOD::IParticle*>* softConst = 0) const;
173
174 virtual StatusCode rebuildTrackMET(
175 const std::string& metJetKey,
176 const std::string& softTrkKey,
178 const xAOD::JetContainer* jets,
179 const xAOD::MissingETContainer* metCoreCont,
181 bool doJetJVT) const override final;
182 StatusCode rebuildTrackMET(
183 const std::string& metJetKey,
184 const std::string& softTrkKey,
187 columnar::Met1Range metCoreCont,
189 bool doJetJVT) const;
190
191 virtual StatusCode rebuildTrackMET(xAOD::MissingET* metJet,
192 const xAOD::JetContainer* jets,
194 xAOD::MissingET* metSoftTrk,
195 const xAOD::MissingET* coreSoftTrk,
196 bool doJetJVT) const override final;
197 StatusCode rebuildTrackMET(columnar::MutableMetId metJet,
201 columnar::MutableMetId metSoftTrk,
202 columnar::Met1Id coreSoftTrk,
203 bool doJetJVT) const;
204
205 virtual StatusCode markInvisible(
206 const xAOD::IParticleContainer* collection,
208 xAOD::MissingETContainer* metCont) const override final;
209 StatusCode markInvisible(
210 columnar::ParticleRange collection,
212 columnar::MutableMetRange metCont) const;
213
215 // Private data:
217 private:
218
219 bool acceptTrack(const xAOD::TrackParticle* trk, const xAOD::Vertex* vx) const;
220 const xAOD::Vertex* getPV() const;
221
222
224
225 // pT threshold for suppressing warnings of objects missing in association map
226 float m_missObjWarningPtThreshold;
227
228 bool m_jetCorrectPhi{};
229 double m_jetMinEfrac{};
230 double m_jetMinWeightedPt{};
231 std::string m_jetConstitScaleMom;
232 std::string m_jetJvtMomentName;
233 std::string m_jetRejectionDec;
234
235 double m_CenJetPtCut{}, m_FwdJetPtCut{} ; // jet pt cut for central/forward jets
236 double m_JvtCut{}, m_JvtPtMax{}; // JVT cut and pt region of jets to apply a JVT selection
237 double m_JetEtaMax{};
238 double m_JetEtaForw{};
239
240 std::string m_jetSelection;
241 std::string m_JvtWP;
242
243 // Extra configurables for custom WP
244 double m_customCenJetPtCut{},m_customFwdJetPtCut{};
245 double m_customJvtPtMax{};
246 std::string m_customJvtWP;
247
248 bool m_doPFlow{};
249 bool m_doSoftTruth{};
250 bool m_doConstJet{};
251
252 bool m_useGhostMuons{};
253 bool m_doRemoveMuonJets{};
254 bool m_doRemoveElecTrks{};
255 bool m_doRemoveElecTrksEM{};
256 bool m_doSetMuonJetEMScale{};
257 bool m_skipSystematicJetSelection{};
258
259 bool m_muEloss{};
260 bool m_orCaloTaggedMuon{};
261 bool m_greedyPhotons{};
262 bool m_veryGreedyPhotons{};
263
264 // muon overlap variables
265 int m_jetTrkNMuOlap{};
266 double m_jetWidthMuOlap{};
267 double m_jetPsEMuOlap{};
268 double m_jetEmfMuOlap{};
269 double m_jetTrkPtMuPt{};
270 double m_muIDPTJetPtRatioMuOlap{};
271
272 ToolHandle<InDet::IInDetTrackSelectionTool> m_trkseltool;
273 ToolHandle<IAsgSelectionTool> m_JvtTool;
274
275 SG::ReadHandleKey<xAOD::JetContainer> m_jetContainer{this, "JetContainer", "", "Name of input jet container (required if JVT decisions computed by internal tool)"};
276
278 ColumnarMETMaker();
279
280 columnar::MutableMetAccessor<columnar::ObjectColumn> m_outputMetHandle {*this, "OutputMET"};
281 columnar::Met1Accessor<columnar::ObjectColumn> m_inputMetHandle {*this, "METCore", {.addMTDependency=true}};
282 columnar::ColumnAccessor<columnar::MetAssociationDef,columnar::ObjectColumn> m_metAssocHandle {*this, "MetAssoc", {.addMTDependency=true}};
283 columnar::ParticleAccessor<columnar::ObjectColumn> m_particlesHandle {*this, "Particles"};
284 columnar::JetAccessor<columnar::ObjectColumn> m_jetsHandle {*this, "Jets"};
285 columnar::ElectronAccessor<columnar::ObjectColumn> m_electronsHandle {*this, "Electrons"};
286 columnar::PhotonAccessor<columnar::ObjectColumn> m_photonsHandle {*this, "Photons"};
287 columnar::MuonAccessor<columnar::ObjectColumn> m_muonsHandle {*this, "Muons"};
288
289 columnar::MutableMetAccessor<std::string> m_outputMetNameAcc {*this, "name"};
292
293 columnar::Met1Accessor<std::string> m_inputMetNameAcc {*this, "name"};
296 columnar::Met1Accessor<MissingETBase::Types::bitmask_t> m_inputMetSourceAcc {*this, "source"};
297
298 columnar::MetAssocationAccessors<> m_assocAcc {*this};
299
301 Gaudi::Property<std::string> m_inputPreselectionName {this, "inputPreselection", ""};
302 std::optional<columnar::ParticleAccessor<char>> m_inputPreselectionAcc;
303 columnar::ParticleAccessor<columnar::RetypeColumn<xAOD::Muon::MuonType,std::uint16_t>> m_inputMuonTypeAcc {*this, "muonType", {.isOptional = true}};
304 columnar::MetHelpers::ObjectTypeAccessor<columnar::ParticleDef> m_inputObjTypeAcc {*this, "objectType"};
305
306 columnar::MetHelpers::ObjectWeightDecorator<> m_outputMetWeightDecRegular {*this, "", true};
307
309 columnar::JetAccessor<float> m_acc_emf {*this, "EMFrac"};
310 columnar::JetAccessor<float> m_acc_psf {*this, "PSFrac"};
311 columnar::JetAccessor<float> m_acc_width {*this, "Width"};
312 columnar::JetAccessor<std::vector<int>> m_acc_trkN {*this, "NumTrkPt500"};
313 columnar::JetAccessor<std::vector<float>> m_acc_trksumpt {*this, "SumPtTrkPt500"};
314 columnar::JetAccessor<std::vector<float>> m_acc_sampleE {*this, "EnergyPerSampling"};
315
316 std::optional<columnar::MetHelpers::InputMomentumAccessors<columnar::JetDef>> m_jetConstitScaleMomAcc;
317 std::optional<columnar::MetHelpers::InputMomentumAccessors<columnar::JetDef>> m_jetConstitScaleMomFixedAcc;
318 std::optional<columnar::JetAccessor<char>> m_acc_jetRejectionDec;
319
321 columnar::MetHelpers::ObjectWeightDecorator<columnar::MutableMetDef,columnar::JetDef> m_jetOutputMetWeightDecSoft {*this, "Soft", false};
322
324
325 Gaudi::Property<unsigned> m_columnarOperation {this, "columnarOperation", 0};
326 Gaudi::Property<std::string> m_columnarTermName {this, "columnarTermName", ""};
327 Gaudi::Property<unsigned> m_columnarParticleType {this, "columnarParticleType", 0};
328 Gaudi::Property<std::string> m_columnarJetKey {this, "columnarJetKey", ""};
329 Gaudi::Property<std::string> m_columnarSoftClusKey {this, "columnarSoftClusKey", ""};
330 Gaudi::Property<bool> m_columnarDoJetJVT {this, "columnarDoJetJVT", false};
331 void callEvents (columnar::EventContextRange events) const override;
332 };
333
334} //> end namespace ADD_CMODE(met)
335#endif //> !METUTILITIES_MET_METMAKER_H
#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
the base class for all columnar components
the accessors MetAssociationHelper needs to implement its operations
a columnar version of xAOD::MissingETAssociationHelper
a special "accessor" that allows to do the MET term lookup by name
Definition MetHelpers.h:38
a special "decorator" for decorating the weight an object contributes to a MET term
Definition MetOutput.h:31
ObjectRange< Met1Def > Met1Range
Definition MetDef.h:58
AccessorTemplate< CI, CT, ColumnAccessMode::input, CM > ColumnAccessor
ObjectRange< JetDef > JetRange
Definition JetDef.h:22
OptObjectId< Met1Def > OptMet1Id
Definition MetDef.h:60
AccessorTemplate< PhotonDef, CT, ColumnAccessMode::input, CM > PhotonAccessor
Definition EgammaDef.h:43
ObjectRange< EventContextDef > EventContextRange
AccessorTemplate< ParticleDef, CT, ColumnAccessMode::input, CM > ParticleAccessor
Definition ParticleDef.h:35
AccessorTemplate< MutableMetDef, CT, ColumnAccessMode::input, CM > MutableMetAccessor
Definition MetDef.h:67
AccessorTemplate< JetDef, CT, ColumnAccessMode::input, CM > JetAccessor
Definition JetDef.h:25
OptObjectId< MutableMetDef > OptMutableMetId
Definition MetDef.h:66
ObjectId< Met1Def > Met1Id
Definition MetDef.h:59
ObjectId< MutableMetDef > MutableMetId
Definition MetDef.h:65
ObjectRange< MutableMetDef > MutableMetRange
Definition MetDef.h:64
AccessorTemplate< ElectronDef, CT, ColumnAccessMode::input, CM > ElectronAccessor
Definition EgammaDef.h:37
ObjectRange< ParticleDef > ParticleRange
Definition ParticleDef.h:32
AccessorTemplate< MuonDef, CT, ColumnAccessMode::input, CM > MuonAccessor
Definition MuonDef.h:24
AccessorTemplate< Met1Def, CT, ColumnAccessMode::input, CM > Met1Accessor
Definition MetDef.h:61
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
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
MissingETContainer_v1 MissingETContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
void initialize()
a class that provides all the accessors needed to access object momentum variables
Definition MetInput.h:33
a special accessor for the MET momentum
Definition MetHelpers.h:168
an accessor that allows to access the xAOD object type of an input object
Definition MetInput.h:169