ATLAS Offline Software
METBuilderTool.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 // 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
31 namespace xAOD {
32  class IParticle;
33 }
34 
35 namespace 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
xAOD::MissingETComponentMap_v1
Definition: MissingETComponentMap_v1.h:25
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
met::METBuilderTool
Definition: METBuilderTool.h:39
met::METBuilderTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: METBuilderTool.cxx:45
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
IMETToolBase
Definition: IMETToolBase.h:25
met
Definition: IMETSignificance.h:24
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
met::METBuilderTool::addToMET
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
Definition: METBuilderTool.cxx:77
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
met::METBuilderTool::~METBuilderTool
virtual ~METBuilderTool()=default
met::METBuilderTool::resolveOverlap
virtual bool resolveOverlap(const xAOD::IParticle *object, xAOD::MissingETComponentMap *metMap, std::vector< const xAOD::IParticle * > &acceptedSignals, MissingETBase::Types::weight_t &objWeight) const =0
met::METBuilderTool::execute
virtual StatusCode execute(xAOD::MissingET *metTerm, xAOD::MissingETComponentMap *metMap) const override
Definition: METBuilderTool.cxx:55
met::METBuilderTool::m_useModClus
bool m_useModClus
Definition: METBuilderTool.h:65
MissingETBase::UsageHandler::TrackCluster
@ TrackCluster
Both cluster and track based.
Definition: MissingETCompositionBase.h:186
MissingETBase::UsageHandler::Policy
Policy
Policies on usage checks.
Definition: MissingETCompositionBase.h:182
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
met::METBuilderTool::m_output_met_key
Gaudi::Property< std::string > m_output_met_key
Definition: METBuilderTool.h:62
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
met::METBuilderTool::m_useRapidity
Gaudi::Property< bool > m_useRapidity
Definition: METBuilderTool.h:64
met::METBuilderTool::executeTool
virtual StatusCode executeTool(xAOD::MissingET *metTerm, xAOD::MissingETComponentMap *metMap) const =0
xAOD::MissingETComponent_v1::Weight
Kinematic weight descriptor.
Definition: MissingETComponent_v1.h:28
ToolHandle.h
IMETToolBase.h
AsgTool.h
IParticle
Definition: Event/EventKernel/EventKernel/IParticle.h:43
met::METBuilderTool::m_mod_clus_key
Gaudi::Property< std::string > m_mod_clus_key
Definition: METBuilderTool.h:63
met::METBuilderTool::METBuilderTool
METBuilderTool()
Default constructor:
met::METBuilderTool::accept
virtual bool accept(const xAOD::IParticle *object) const =0