ATLAS Offline Software
METAssociator.h
Go to the documentation of this file.
1 
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 
30 #include "xAODJet/JetContainer.h"
31 #include "xAODMuon/MuonContainer.h"
35 
37 #include "xAODTracking/Vertex.h"
38 #include "xAODPFlow/PFOContainer.h"
39 #include "xAODPFlow/PFO.h"
41 
42 namespace InDet {
43  class IInDetTrackSelectionTool;
44 }
45 
46 namespace xAOD {
47  class ITrackIsolationTool;
48  class ICaloTopoClusterIsolationTool;
49 }
50 
51 namespace met {
53  : virtual public asg::AsgTool,
54  virtual public IMETAssocToolBase
55  {
56 
58  // Public methods:
60  public:
61 
62  struct ConstitHolder {
64  // Use IParticleContainer for flexibility e.g. if combining clusters & towers
68  const xAOD::Vertex* pv = 0;
69  };
70 
71  // Constructor w/ name
72  METAssociator(const std::string& name);
73  // Default Destructor
74  virtual ~METAssociator();
75 
76  // AsgTool Handles
77  virtual StatusCode initialize() override;
78  virtual StatusCode execute (xAOD::MissingETContainer* metCont, xAOD::MissingETAssociationMap* metMap) const override;
79 
81  // Protected methods:
83  protected:
84 
85  ToolHandle<InDet::IInDetTrackSelectionTool> m_trkseltool;
86  ToolHandle<xAOD::ITrackIsolationTool> m_trkIsolationTool;
87  ToolHandle<xAOD::ICaloTopoClusterIsolationTool> m_caloIsolationTool;
88 
89  std::string m_neutralFELinksKey;
90  std::string m_chargedFELinksKey;
91  std::string m_neutralPFOLinksKey;
92  std::string m_chargedPFOLinksKey;
94  bool m_useFELinks;
95 
96  SG::ReadHandleKey<xAOD::VertexContainer> m_pvcollKey{this,"PrimVxColl","PrimaryVertices","Primary Vertex Collection"};
97  SG::ReadHandleKey<xAOD::IParticleContainer> m_clcollKey{this,"ClusColl","CaloCalTopoClusters","Topo cluster Collection"};
98  SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trkcollKey{this,"TrkColl","InDetTrackParticles","Track particle Collection"};
99  SG::ReadHandleKey<xAOD::PFOContainer> m_pfcollKey{this,"PFlowColl","","PFO Collection"};
100  SG::ReadHandleKey<xAOD::FlowElementContainer> m_fecollKey{this,"FlowElementCollection","","FlowElement Collection (overrides PFO if not empty)"};
101  SG::ReadHandleKey<xAOD::IParticleContainer> m_hybridContKey{this,"HybridKey","","Hybrid Collection"};
102 
103  bool m_pflow;
106  bool m_useIsolationTools = false;
108  bool m_weight_charged_pfo = false;
110 
112  std::string m_forcoll;
113  double m_foreta;
114 
117 
118 
119 
120  // reconstruction process to be defined in the individual tools
121  // pure virtual -- we have no default
124 
125  bool acceptTrack (const xAOD::TrackParticle* trk, const xAOD::Vertex* pv) const;
126  bool isGoodEoverP(const xAOD::TrackParticle* trk) const;
127 
129  const xAOD::IParticleContainer* hardObjs) const;
131  std::vector<const xAOD::IParticle*>& pfolist,
132  const met::METAssociator::ConstitHolder& constits,
133  std::map<const xAOD::IParticle*,MissingETBase::Types::constvec_t> &momenta) const = 0;
135  std::vector<const xAOD::IParticle*>& felist,
136  const met::METAssociator::ConstitHolder& constits,
137  std::map<const xAOD::IParticle*,MissingETBase::Types::constvec_t> &momenta) const = 0;
139  std::vector<const xAOD::IParticle*>& constlist,
140  const met::METAssociator::ConstitHolder& constits) const = 0;
142  std::vector<const xAOD::IParticle*>& tclist,
143  const met::METAssociator::ConstitHolder& constits) const = 0;
144  static inline bool greaterPt(const xAOD::IParticle* part1, const xAOD::IParticle* part2) {
145  return part1->pt()>part2->pt();
146  }
147  static inline bool greaterPtPFO(const xAOD::PFO* part1, const xAOD::PFO* part2) {
148  if (part1->charge()==0 && part2->charge()!=0) return false;
149  if (part1->charge()!=0 && part2->charge()==0) return true;
150  if (part1->charge()==0 && part2->charge()==0) return part1->ptEM()>part2->ptEM();
151  return part1->pt()>part2->pt();
152  }
153  static inline bool greaterPtFE(const xAOD::FlowElement* part1, const xAOD::FlowElement* part2) {
154  if (!(part1->isCharged()) && part2->isCharged()) return false;
155  if (part1->isCharged() && !(part2->isCharged())) return true;
156  return part1->pt() > part2->pt();
157  }
159  // Private methods:
161  private:
162 
163  // Default Constructor
165  };
166 }
167 
168 #endif // METRECONSTRUCTION_METASSOCBUILDERTOOL_H
met::METAssociator::m_forcoll
std::string m_forcoll
Definition: METAssociator.h:112
met::METAssociator::greaterPt
static bool greaterPt(const xAOD::IParticle *part1, const xAOD::IParticle *part2)
Definition: METAssociator.h:144
met::METAssociator::m_neutralPFOLinksKey
std::string m_neutralPFOLinksKey
Definition: METAssociator.h:91
met::METAssociator::m_useModifiedClus
bool m_useModifiedClus
Definition: METAssociator.h:107
met::METAssociator::m_foreta
double m_foreta
Definition: METAssociator.h:113
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
FlowElementContainer.h
met::METAssociator::extractFE
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 =0
met::METAssociator::m_useFELinks
bool m_useFELinks
Definition: METAssociator.h:94
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
met::METAssociator::m_weight_charged_pfo
bool m_weight_charged_pfo
Definition: METAssociator.h:108
met::METAssociator::m_forTrackPtThr
double m_forTrackPtThr
Definition: METAssociator.h:116
met::METAssociator::retrieveConstituents
StatusCode retrieveConstituents(met::METAssociator::ConstitHolder &constits) const
Definition: METAssociator.cxx:161
met::METAssociator::m_trkcollKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trkcollKey
Definition: METAssociator.h:98
IMETAssocToolBase
Definition: IMETAssocToolBase.h:25
met::METAssociator::m_trkseltool
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkseltool
Definition: METAssociator.h:85
PFOContainer.h
met::METAssociator::m_clcollKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_clcollKey
Definition: METAssociator.h:97
met::METAssociator::ConstitHolder::pfoCont
const xAOD::PFOContainer * pfoCont
Definition: METAssociator.h:66
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
met::METAssociator::ConstitHolder::feCont
const xAOD::FlowElementContainer * feCont
Definition: METAssociator.h:67
met::METAssociator::m_pfcollKey
SG::ReadHandleKey< xAOD::PFOContainer > m_pfcollKey
Definition: METAssociator.h:99
met::METAssociator::m_chargedPFOLinksKey
std::string m_chargedPFOLinksKey
Definition: METAssociator.h:92
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:40
met::METAssociator::m_useRapidity
bool m_useRapidity
Definition: METAssociator.h:105
met::METAssociator::extractTracks
virtual StatusCode extractTracks(const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &constlist, const met::METAssociator::ConstitHolder &constits) const =0
met::METAssociator::m_fecollKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_fecollKey
Definition: METAssociator.h:100
xAOD::MissingETAssociationMap_v1
Definition: MissingETAssociationMap_v1.h:29
met::METAssociator::METAssociator
METAssociator()
met::METAssociator::m_useTracks
bool m_useTracks
Definition: METAssociator.h:104
met::METAssociator::m_pvcollKey
SG::ReadHandleKey< xAOD::VertexContainer > m_pvcollKey
Definition: METAssociator.h:96
met::METAssociator::m_cenTrackPtThr
double m_cenTrackPtThr
Definition: METAssociator.h:115
met::METAssociator::ConstitHolder::pv
const xAOD::Vertex * pv
Definition: METAssociator.h:68
PFO.h
part1
Definition: part1.py:1
met::METAssociator::ConstitHolder::tcCont
const xAOD::IParticleContainer * tcCont
Definition: METAssociator.h:65
met
Definition: IMETSignificance.h:24
met::METAssociator::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: METAssociator.cxx:85
met::METAssociator::m_trkIsolationTool
ToolHandle< xAOD::ITrackIsolationTool > m_trkIsolationTool
Definition: METAssociator.h:86
ElectronContainer.h
met::METAssociator::greaterPtPFO
static bool greaterPtPFO(const xAOD::PFO *part1, const xAOD::PFO *part2)
Definition: METAssociator.h:147
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IMETAssocToolBase.h
met::METAssociator::m_neutralFELinksKey
std::string m_neutralFELinksKey
Definition: METAssociator.h:89
met::METAssociator::~METAssociator
virtual ~METAssociator()
met::METAssociator::extractPFO
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 =0
met::METAssociator::m_chargedFELinksKey
std::string m_chargedFELinksKey
Definition: METAssociator.h:90
met::METAssociator::m_useIsolationTools
bool m_useIsolationTools
Definition: METAssociator.h:106
TauJetContainer.h
DataVector< xAOD::TrackParticle_v1 >
Vertex.h
part2
Definition: part2.py:1
met::METAssociator
Definition: METAssociator.h:55
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
xAOD::PFO_v1
Class describing a particle flow object.
Definition: PFO_v1.h:35
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
met::METAssociator::isGoodEoverP
bool isGoodEoverP(const xAOD::TrackParticle *trk) const
Definition: METAssociator.cxx:367
met::METAssociator::acceptTrack
bool acceptTrack(const xAOD::TrackParticle *trk, const xAOD::Vertex *pv) const
Definition: METAssociator.cxx:359
MuonContainer.h
met::METAssociator::fillAssocMap
virtual StatusCode fillAssocMap(xAOD::MissingETAssociationMap *metMap, const xAOD::IParticleContainer *hardObjs) const
Definition: METAssociator.cxx:295
met::METAssociator::executeTool
virtual StatusCode executeTool(xAOD::MissingETContainer *metCont, xAOD::MissingETAssociationMap *metMap) const =0
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
met::METAssociator::m_hybridContKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_hybridContKey
Definition: METAssociator.h:101
JetContainer.h
met::METAssociator::m_pflow
bool m_pflow
Definition: METAssociator.h:103
python.changerun.pv
pv
Definition: changerun.py:81
met::METAssociator::m_usePFOLinks
bool m_usePFOLinks
Definition: METAssociator.h:93
met::METAssociator::execute
virtual StatusCode execute(xAOD::MissingETContainer *metCont, xAOD::MissingETAssociationMap *metMap) const override
Definition: METAssociator.cxx:141
met::METAssociator::m_skipconst
bool m_skipconst
Definition: METAssociator.h:111
met::METAssociator::ConstitHolder::trkCont
const xAOD::TrackParticleContainer * trkCont
Definition: METAssociator.h:63
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
ToolHandle.h
met::METAssociator::greaterPtFE
static bool greaterPtFE(const xAOD::FlowElement *part1, const xAOD::FlowElement *part2)
Definition: METAssociator.h:153
AsgTool.h
python.PyAthena.obj
obj
Definition: PyAthena.py:135
met::METAssociator::m_cleanChargedPFO
bool m_cleanChargedPFO
Definition: METAssociator.h:109
PhotonContainer.h
TrackParticleContainer.h
met::METAssociator::extractTopoClusters
virtual StatusCode extractTopoClusters(const xAOD::IParticle *obj, std::vector< const xAOD::IParticle * > &tclist, const met::METAssociator::ConstitHolder &constits) const =0
met::METAssociator::ConstitHolder
Definition: METAssociator.h:62
met::METAssociator::m_caloIsolationTool
ToolHandle< xAOD::ICaloTopoClusterIsolationTool > m_caloIsolationTool
Definition: METAssociator.h:87
xAOD::FlowElement_v1
A detector object made of other lower level object(s)
Definition: FlowElement_v1.h:25