ATLAS Offline Software
Loading...
Searching...
No Matches
METAssociator.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5*/
6
7// METAssociator.h
8// Header file for class METAssociator
9//
10// This is the base class for tools that construct MET terms
11// from other object collections.
12//
13// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
14//
15// Author: P Loch, S Resconi, TJ Khoo, AS Mete
17#ifndef METRECONSTRUCTION_METASSOCIATOR_H
18#define METRECONSTRUCTION_METASSOCIATOR_H
19
20// STL includes
21#include <string>
22
23// FrameWork includes
24#include "AsgTools/AsgTool.h"
25#include "AsgTools/ToolHandle.h"
26
27// METRecoInterface includes
29
35
37#include "xAODTracking/Vertex.h"
39#include "xAODPFlow/PFO.h"
41
42// Tool interface headers
46
47namespace met {
49 : virtual public asg::AsgTool,
50 virtual public IMETAssocToolBase
51 {
52
54 // Public methods:
56 public:
57
60 // Use IParticleContainer for flexibility e.g. if combining clusters & towers
64 const xAOD::Vertex* pv = 0;
65 };
66
67 // Constructor w/ name
68 METAssociator(const std::string& name);
69 // Default Destructor
70 virtual ~METAssociator();
71
72 // AsgTool Handles
73 virtual StatusCode initialize() override;
74 virtual StatusCode execute (xAOD::MissingETContainer* metCont, xAOD::MissingETAssociationMap* metMap, const EventContext& ctx) const override;
75
77 // Protected methods:
79 protected:
80
81 ToolHandle<InDet::IInDetTrackSelectionTool> m_trkseltool{this, "TrackSelectorTool", ""};
82 ToolHandle<xAOD::ITrackIsolationTool> m_trkIsolationTool{this, "TrackIsolationTool", ""};
83 ToolHandle<xAOD::ICaloTopoClusterIsolationTool> m_caloIsolationTool{this, "CaloIsolationTool", ""};
84
85 Gaudi::Property<std::string> m_neutralFELinksKey{this, "NeutralFELinksKey", "neutralGlobalFELinks"};
86 Gaudi::Property<std::string> m_chargedFELinksKey{this, "ChargedFELinksKey", "chargedGlobalFELinks"};
87 Gaudi::Property<std::string> m_neutralPFOLinksKey{this, "NeutralPFOLinksKey", "neutralpfoLinks"};
88 Gaudi::Property<std::string> m_chargedPFOLinksKey{this, "ChargedPFOLinksKey", "chargedpfoLinks"};
89 Gaudi::Property<bool> m_usePFOLinks{this, "UsePFOLinks", false};
90 Gaudi::Property<bool> m_useFELinks{this, "UseFELinks", false};
91
92 SG::ReadHandleKey<xAOD::VertexContainer> m_pvcollKey{this,"PrimVxColl","PrimaryVertices","Primary Vertex Collection"};
93 SG::ReadHandleKey<xAOD::IParticleContainer> m_clcollKey{this,"ClusColl","CaloCalTopoClusters","Topo cluster Collection"};
94 SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trkcollKey{this,"TrkColl","InDetTrackParticles","Track particle Collection"};
95 SG::ReadHandleKey<xAOD::PFOContainer> m_pfcollKey{this,"PFlowColl","","PFO Collection"};
96 SG::ReadHandleKey<xAOD::FlowElementContainer> m_fecollKey{this,"FlowElementCollection","","FlowElement Collection (overrides PFO if not empty)"};
97 SG::ReadHandleKey<xAOD::IParticleContainer> m_hybridContKey{this,"HybridKey","","Hybrid Collection"};
98
99 SG::WriteDecorHandleKey<xAOD::IParticleContainer> m_UEcorrPtDecorKey{this, "UEcorrPtDecorKey", "", "UE correction for each lepton"};
100
101 //for HR implementation migrated from release 21.2
102 Gaudi::Property<bool> m_recoil{this, "HRecoil", false, ""};
103
104 Gaudi::Property<bool> m_pflow{this, "PFlow", false};
105 Gaudi::Property<bool> m_useTracks{this, "UseTracks", true};
106 Gaudi::Property<bool> m_useRapidity{this, "UseRapidity", false};
107 Gaudi::Property<bool> m_useModifiedClus{this, "UseModifiedClus", false};
108 Gaudi::Property<bool> m_cleanChargedPFO{this, "CleanCPFO", true};
109
110 Gaudi::Property<bool> m_skipconst{this, "IgnoreJetConst", false};
111 Gaudi::Property<std::string> m_forcoll{this, "ForwardColl", ""};
112 Gaudi::Property<double> m_foreta{this, "ForwardDef", 2.5};
113
114 Gaudi::Property<double> m_cenTrackPtThr{this, "CentralTrackPtThr", 30e+3};
115 Gaudi::Property<double> m_forTrackPtThr{this, "ForwardTrackPtThr", 30e+3};
116
117
118
119 // reconstruction process to be defined in the individual tools
120 // pure virtual -- we have no default
121 virtual StatusCode executeTool(xAOD::MissingETContainer* metCont, xAOD::MissingETAssociationMap* metMap, const EventContext& ctx) const = 0;
122 StatusCode retrieveConstituents(met::METAssociator::ConstitHolder& constits, const EventContext& ctx) const;
123
124 bool acceptTrack (const xAOD::TrackParticle* trk, const xAOD::Vertex* pv) const;
125 bool isGoodEoverP(const xAOD::TrackParticle* trk) const;
126
127 virtual StatusCode fillAssocMap(xAOD::MissingETAssociationMap* metMap,
128 const xAOD::IParticleContainer* hardObjs, const EventContext& ctx) const;
129 virtual StatusCode extractPFO(const xAOD::IParticle* obj,
130 std::vector<const xAOD::IParticle*>& pfolist,
131 const met::METAssociator::ConstitHolder& constits,
132 std::map<const xAOD::IParticle*,MissingETBase::Types::constvec_t> &momenta, const EventContext& ctx) const = 0;
133
134 //Get UE correction for HR implementation using METMaker
135 StatusCode GetUEcorr(const met::METAssociator::ConstitHolder& constits,
136 std::vector<TLorentzVector>& v_clus,
137 TLorentzVector& clus,
138 TLorentzVector& HR,
139 const float Drcone,
140 const float MinDistCone,
141 float& UEcorr) const;
142
143 virtual StatusCode extractFE(const xAOD::IParticle* obj,
144 std::vector<const xAOD::IParticle*>& felist,
145 const met::METAssociator::ConstitHolder& constits,
146 std::map<const xAOD::IParticle*,MissingETBase::Types::constvec_t> &momenta, const EventContext& ctx) const = 0;
147
148 //HR implementation dealing with FEs instead of PFOs
149 virtual StatusCode extractFEHR(const xAOD::IParticle* /*obj*/,
150 std::vector<const xAOD::IParticle*> /*hardObjs*/,
151 std::vector<const xAOD::IParticle*>& /*pfolist*/,
152 const met::METAssociator::ConstitHolder& /*constits*/,
153 std::map<const xAOD::IParticle*,MissingETBase::Types::constvec_t> &/*momenta*/,
154 float& /*UEcorr*/) const
155 {return StatusCode::FAILURE;}
156
157 virtual StatusCode extractTracks(const xAOD::IParticle* obj,
158 std::vector<const xAOD::IParticle*>& constlist,
159 const met::METAssociator::ConstitHolder& constits) const = 0;
160 virtual StatusCode extractTopoClusters(const xAOD::IParticle* obj,
161 std::vector<const xAOD::IParticle*>& tclist,
162 const met::METAssociator::ConstitHolder& constits, const EventContext& ctx) const = 0;
163 static inline bool greaterPt(const xAOD::IParticle* part1, const xAOD::IParticle* part2) {
164 return part1->pt()>part2->pt();
165 }
166 static inline bool greaterPtPFO(const xAOD::PFO* part1, const xAOD::PFO* part2) {
167 if (part1->charge()==0 && part2->charge()!=0) return false;
168 if (part1->charge()!=0 && part2->charge()==0) return true;
169 if (part1->charge()==0 && part2->charge()==0) return part1->ptEM()>part2->ptEM();
170 return part1->pt()>part2->pt();
171 }
172 static inline bool greaterPtFE(const xAOD::FlowElement* part1, const xAOD::FlowElement* part2) {
173 if (!(part1->isCharged()) && part2->isCharged()) return false;
174 if (part1->isCharged() && !(part2->isCharged())) return true;
175 return part1->pt() > part2->pt();
176 }
177
178 // Private methods:
180 private:
181
182 // Default Constructor
184 };
185}
186
187#endif // METRECONSTRUCTION_METASSOCBUILDERTOOL_H
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Gaudi::Property< std::string > m_neutralPFOLinksKey
virtual StatusCode execute(xAOD::MissingETContainer *metCont, xAOD::MissingETAssociationMap *metMap, const EventContext &ctx) const override
SG::ReadHandleKey< xAOD::PFOContainer > m_pfcollKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trkcollKey
Gaudi::Property< double > m_forTrackPtThr
Gaudi::Property< bool > m_pflow
virtual StatusCode executeTool(xAOD::MissingETContainer *metCont, xAOD::MissingETAssociationMap *metMap, const EventContext &ctx) const =0
SG::ReadHandleKey< xAOD::VertexContainer > m_pvcollKey
StatusCode retrieveConstituents(met::METAssociator::ConstitHolder &constits, const EventContext &ctx) const
Gaudi::Property< std::string > m_chargedFELinksKey
Gaudi::Property< bool > m_useFELinks
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Gaudi::Property< std::string > m_forcoll
virtual StatusCode extractPFO(const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &pfolist, const met::METAssociator::ConstitHolder &constits, std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > &momenta, const EventContext &ctx) const =0
virtual StatusCode extractFEHR(const xAOD::IParticle *, std::vector< const xAOD::IParticle * >, std::vector< const xAOD::IParticle * > &, const met::METAssociator::ConstitHolder &, std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > &, float &) const
Gaudi::Property< double > m_cenTrackPtThr
ToolHandle< xAOD::ICaloTopoClusterIsolationTool > m_caloIsolationTool
Gaudi::Property< bool > m_useModifiedClus
Gaudi::Property< std::string > m_neutralFELinksKey
Gaudi::Property< bool > m_skipconst
Gaudi::Property< double > m_foreta
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkseltool
Gaudi::Property< bool > m_usePFOLinks
Gaudi::Property< bool > m_useTracks
static bool greaterPtPFO(const xAOD::PFO *part1, const xAOD::PFO *part2)
static bool greaterPtFE(const xAOD::FlowElement *part1, const xAOD::FlowElement *part2)
Gaudi::Property< bool > m_useRapidity
Gaudi::Property< bool > m_cleanChargedPFO
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_UEcorrPtDecorKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_hybridContKey
static bool greaterPt(const xAOD::IParticle *part1, const xAOD::IParticle *part2)
virtual ~METAssociator()
virtual StatusCode extractTracks(const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &constlist, const met::METAssociator::ConstitHolder &constits) const =0
virtual StatusCode extractTopoClusters(const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &tclist, const met::METAssociator::ConstitHolder &constits, const EventContext &ctx) const =0
ToolHandle< xAOD::ITrackIsolationTool > m_trkIsolationTool
virtual StatusCode fillAssocMap(xAOD::MissingETAssociationMap *metMap, const xAOD::IParticleContainer *hardObjs, const EventContext &ctx) const
Gaudi::Property< bool > m_recoil
Gaudi::Property< std::string > m_chargedPFOLinksKey
METAssociator(const std::string &name)
virtual StatusCode extractFE(const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &felist, const met::METAssociator::ConstitHolder &constits, std::map< const xAOD::IParticle *, MissingETBase::Types::constvec_t > &momenta, const EventContext &ctx) const =0
bool isGoodEoverP(const xAOD::TrackParticle *trk) const
SG::ReadHandleKey< xAOD::IParticleContainer > m_clcollKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_fecollKey
StatusCode GetUEcorr(const met::METAssociator::ConstitHolder &constits, std::vector< TLorentzVector > &v_clus, TLorentzVector &clus, TLorentzVector &HR, const float Drcone, const float MinDistCone, float &UEcorr) const
bool acceptTrack(const xAOD::TrackParticle *trk, const xAOD::Vertex *pv) const
Class providing the definition of the 4-vector interface.
Definition part1.py:1
Definition part2.py:1
FlowElementContainer_v1 FlowElementContainer
Definition of the current "pfo container version".
PFO_v1 PFO
Definition of the current "pfo version".
Definition PFO.h:17
PFOContainer_v1 PFOContainer
Definition of the current "pfo container version".
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition FlowElement.h:16
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
MissingETAssociationMap_v1 MissingETAssociationMap
Version control by type defintion.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
const xAOD::IParticleContainer * tcCont
const xAOD::FlowElementContainer * feCont
const xAOD::PFOContainer * pfoCont
const xAOD::TrackParticleContainer * trkCont