ATLAS Offline Software
Loading...
Searching...
No Matches
METBuilderTool.cxx
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// METBuilderTool.cxx
8// Implementation file for class METBuilderTool
9//
10// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
11//
12// Author: P Loch, S Resconi, TJ Khoo
14
15// METReconstruction includes
17
18// MET EDM
22
23// For DeltaR
25
26namespace met {
27
28 using xAOD::MissingET;
31
33 // Public methods:
35
36 // Constructors
38 METBuilderTool::METBuilderTool(const std::string& name) :
40 {
41 }
42
43 // Athena algtool's Hooks
46 {
47 ATH_MSG_DEBUG ("Initializing " << name() << "...");
48
49 // Determine if modified clusters are used for jet inputs
51
52 return StatusCode::SUCCESS;
53 }
54
56 {
57 ATH_MSG_DEBUG ("In execute: " << name() << "...");
58
59 if( metTerm==nullptr ) {
60 ATH_MSG_ERROR("Invalid input MissingET pointer provided!");
61 return StatusCode::FAILURE;
62 }
63 if( metMap==nullptr ) {
64 ATH_MSG_ERROR("Invalid input MissingETComponentMap pointer provided!");
65 return StatusCode::FAILURE;
66 }
67
68 metTerm->setName(m_output_met_key);
69 return this->executeTool(metTerm,metMap);
70 }
71
72
74 // Protected methods:
76
78 const std::vector<const xAOD::IParticle*>& acceptedSignals,
79 xAOD::MissingET* metTerm,
83 {
84
85 metTerm->add(object->pt()*cos(object->phi())*objWeight.wpx(),
86 object->pt()*sin(object->phi())*objWeight.wpy(),
87 object->pt()*objWeight.wet()); // or actually ET?)
88
89 return MissingETComposition::insert(metMap,metTerm,object,acceptedSignals,objWeight,p);
90 }
91
92
93}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
Gaudi::Property< std::string > m_mod_clus_key
Gaudi::Property< std::string > m_output_met_key
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
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 StatusCode execute(xAOD::MissingET *metTerm, xAOD::MissingETComponentMap *metMap) const override
Class providing the definition of the 4-vector interface.
double wpx() const
Returns .
double wpy() const
Returns .
double wet() const
Returns .
void add(const IParticle *particle)
Add particle kinematics to MET.
void setName(const std::string &name)
Set the name of the MET object.
xAOD::MissingETComponent_v1::Weight weight_t
Type for kinematic weight.
MissingETComponentMap_v1 MissingETComponentMap
Version control by type definition.
MissingET_v1 MissingET
Version control by type defintion.
static bool insert(MissingETComponentMap *pMap, const MissingET *pMET, const IParticle *pPart, MissingETBase::Types::weight_t weight=MissingETBase::Types::weight_t())
Insert contributing signal or physics object by pointer, with optional kinematic weight object.
Collection of functions managing the MET composition map and association map.