ATLAS Offline Software
Loading...
Searching...
No Matches
METBuilderTool.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7// METBuilderTool.h
8// Header file for class METBuilderTool
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
17#ifndef METRECONSTRUCTION_METBUILDERTOOL_H
18#define METRECONSTRUCTION_METBUILDERTOOL_H 1
19
20// STL includes
21#include <string>
22
23// FrameWork includes
24#include "AsgTools/ToolHandle.h"
25#include "AsgTools/AsgTool.h"
26
27// METRecoInterface includes
29
30// Forward declaration
31namespace xAOD {
32 class IParticle;
33}
34
35namespace met {
37 : virtual public asg::AsgTool,
38 virtual public IMETToolBase
39 {
40 // This macro defines the constructor with the interface declaration
42
43
44 // Public methods:
46 public:
47
48 // Constructor with name (does this have to be a non-const
49 // std::string and not a const reference?)
50 METBuilderTool(const std::string& name);
51 virtual ~METBuilderTool() = default;
52
53 // AsgTool Hooks
54 virtual StatusCode initialize() override;
55 virtual StatusCode execute(xAOD::MissingET* metTerm, xAOD::MissingETComponentMap* metMap) const override;
56
57
59 // Private data:
61 protected:
62 Gaudi::Property<std::string> m_output_met_key{this, "MissingETKey", "", "output MET key"};
63 Gaudi::Property<std::string> m_mod_clus_key{this, "ModifiedClusKey", "", "modified clusters key"};
64 Gaudi::Property<bool> m_useRapidity{this, "UseRapidity", false, }; // by default, use pseudorapidity for matching
65 bool m_useModClus{}; // use modified e.g. origin-corrected clusters
66
67 // reconstruction process to be defined in the individual tools
68 // pure virtual -- we have no default
69 virtual StatusCode executeTool(xAOD::MissingET* metTerm, xAOD::MissingETComponentMap* metMap) const = 0;
70
71 // decision about whether an input object should be considered for inclusion in the MET sum
72 virtual bool accept(const xAOD::IParticle* object) const = 0;
73
74 // returns true if no overlapping clusters found, false otherwise
75 // acceptedSignals will be filled with the constituents that are not already in the composition map
76 // an object weight can also optionally be set
77 //
78 // make this a pure virtual for now -- needs specialisation for all classes
79 // could create a default implementation if we are provided with a common accessor for constituents
80 virtual bool resolveOverlap(const xAOD::IParticle* object,
82 std::vector<const xAOD::IParticle*>& acceptedSignals,
83 MissingETBase::Types::weight_t& objWeight) const = 0;
84
85 // after overlap resolution, add the object with its list of constituents to the composition map
86 // weight and status can be set if they need to be different from the default
87 virtual bool addToMET(const xAOD::IParticle* object,
88 const std::vector<const xAOD::IParticle*>& acceptedSignals,
89 xAOD::MissingET* metTerm,
93
94 // uses metMap->insert(metTerm, particle, weight, status, acceptedSignals)
95 //
96 // Usage example:
97 //
98 // METJetTool::executeTool(xAOD::MissingET* pmetObj,xAOD::MissingETComponentMap* pMap)
99 // {
100 // // get input from StoreGate
101 // const xAOD::xAOD::IParticleContainer* pCont = 0;
102 // if ( /* get input container */ )...
103 //
104 // // loop on input container
105 // xAOD::xAOD::IParticleContainer::const_iterator fCont(pCont->begin());
106 // xAOD::xAOD::IParticleContainer::const_iterator lCont(pCont->end());
107 // std::vector<const xAOD::IParticle*> signalList;
108 // for ( ; fCont != lCont; ++fCont )
109 // { if ( this->accept(*fCont) ) {
110 // signalList.clear();
111 // weight_t weight;
112 // if ( this->resolveOverlap(*fCont,pMap,signalList,weight) ) {
113 // if ( weight.wet() > m_minimumWeight ) this->addMET(*fCont,signalList,pmetObj,weight,statusWord);
114 // }
115 // }
116 // }
117 // }
118 //
119 // bool METElectronTool::resolveOverlap(....)
120 // {
121 // // measure overlap
122 // return ( this->getOverlapClusters(particle,clusterList) ) ... // this function needs to return the list of TopoClusters associated with the electron
123 // }
124 //
125 //
126
127 private:
130
131 };
132
133}
134
135
136#endif //> !METRECONSTRUCTION_METBUILDERTOOL_H
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
METBuilderTool(const std::string &name)
Gaudi::Property< std::string > m_mod_clus_key
virtual bool accept(const xAOD::IParticle *object) const =0
Gaudi::Property< std::string > m_output_met_key
Gaudi::Property< bool > m_useRapidity
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
virtual ~METBuilderTool()=default
METBuilderTool()
Default constructor:
virtual bool addToMET(const xAOD::IParticle *object, const std::vector< const xAOD::IParticle * > &acceptedSignals, xAOD::MissingET *metTerm, xAOD::MissingETComponentMap *metMap, MissingETBase::Types::weight_t &objWeight, MissingETBase::UsageHandler::Policy p=MissingETBase::UsageHandler::TrackCluster) const
virtual StatusCode executeTool(xAOD::MissingET *metTerm, xAOD::MissingETComponentMap *metMap) const =0
virtual bool resolveOverlap(const xAOD::IParticle *object, xAOD::MissingETComponentMap *metMap, std::vector< const xAOD::IParticle * > &acceptedSignals, MissingETBase::Types::weight_t &objWeight) const =0
virtual StatusCode execute(xAOD::MissingET *metTerm, xAOD::MissingETComponentMap *metMap) const override
Class providing the definition of the 4-vector interface.
xAOD::MissingETComponent_v1::Weight weight_t
Type for kinematic weight.
@ TrackCluster
Both cluster and track based.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
MissingETComponentMap_v1 MissingETComponentMap
Version control by type definition.
MissingET_v1 MissingET
Version control by type defintion.