ATLAS Offline Software
METBuilderTool.cxx
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 // 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 
26 namespace met {
27 
28  using xAOD::MissingET;
31 
33  // Public methods:
35 
36  // Constructors
38  METBuilderTool::METBuilderTool(const std::string& name) :
39  AsgTool(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
50  m_useModClus = !m_mod_clus_key.empty();
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 }
xAOD::MissingETComponentMap_v1
Definition: MissingETComponentMap_v1.h:25
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
xAODP4Helpers.h
met::METBuilderTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: METBuilderTool.cxx:45
METBuilderTool.h
xAOD::MissingETComponent_v1::Weight::wet
double wet() const
Returns .
xAOD::MissingET
MissingET_v1 MissingET
Version control by type defintion.
Definition: Event/xAOD/xAODMissingET/xAODMissingET/MissingET.h:15
MissingETComposition
Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current MissingETComposition
Definition: RecTPCnv.cxx:86
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
xAOD::MissingET_v1::setName
void setName(const std::string &name)
Set the name of the MET object.
xAOD::MissingETComposition::insert
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.
Definition: Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx:42
met
Definition: IMETSignificance.h:24
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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::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
xAOD::MissingETComponent_v1::Weight::wpy
double wpy() const
Returns .
MissingETBase::UsageHandler::Policy
Policy
Policies on usage checks.
Definition: MissingETCompositionBase.h:182
xAOD::MissingET_v1::add
void add(const IParticle *particle)
Add particle kinematics to MET.
Definition: MissingET_v1.cxx:77
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
xAOD::MissingETComponent_v1::Weight::wpx
double wpx() const
Returns .
met::METBuilderTool::m_output_met_key
Gaudi::Property< std::string > m_output_met_key
Definition: METBuilderTool.h:62
MissingETComponentMap.h
xAOD::MissingETComponentMap
MissingETComponentMap_v1 MissingETComponentMap
Version control by type definition.
Definition: MissingETComponentMap.h:16
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
pickleTool.object
object
Definition: pickleTool.py:30
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
met::METBuilderTool::m_mod_clus_key
Gaudi::Property< std::string > m_mod_clus_key
Definition: METBuilderTool.h:63
MissingETComposition.h
MissingETContainer.h
met::METBuilderTool::METBuilderTool
METBuilderTool()
Default constructor: