ATLAS Offline Software
MetBuilderAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 //
10 // includes
11 //
12 
14 
17 
18 //
19 // method implementations
20 //
21 
22 namespace CP
23 {
24 
26  initialize ()
27  {
30  return StatusCode::SUCCESS;
31  }
32 
33 
34 
36  execute ()
37  {
38  for (const auto& sys : m_systematicsList.systematicsVector())
39  {
41  ANA_CHECK (m_metHandle.getCopy (met, sys));
42 
43  xAOD::MissingET *softTerm = (*met)[m_softTerm];
44  if (softTerm == nullptr)
45  {
46  ANA_MSG_ERROR ("could not find MET soft-term: " << m_softTerm);
47  return StatusCode::FAILURE;
48  }
50 
51  const static SG::AuxElement::Decorator<float> met_met_dec("met");
52  const static SG::AuxElement::Decorator<float> met_phi_dec("phi");
53  for (const xAOD::MissingET *metTerm : (*met))
54  {
55  if (!metTerm)
56  {
57  ANA_MSG_WARNING("failed to retrieve MET term to decorate met and phi aux vars!");
58  continue;
59  }
60  met_met_dec(*metTerm) = metTerm->met();
61  met_phi_dec(*metTerm) = metTerm->phi();
62  }
63  }
64 
65  return StatusCode::SUCCESS;
66  }
67 }
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
CP::MetBuilderAlg::m_softTerm
Gaudi::Property< std::string > m_softTerm
the key for the soft term
Definition: MetBuilderAlg.h:48
CP::MetBuilderAlg::m_finalKey
Gaudi::Property< std::string > m_finalKey
the key for the final met term
Definition: MetBuilderAlg.h:44
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
met::buildMETSum
StatusCode buildMETSum(const std::string &totalName, xAOD::MissingETContainer *metCont)
Definition: METHelpers.cxx:64
METHelpers.h
met
Definition: IMETSignificance.h:24
CP::SysListHandle::initialize
::StatusCode initialize()
intialize this property
Definition: SysListHandle.cxx:69
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:58
CP::MetBuilderAlg::execute
StatusCode execute() override
Definition: MetBuilderAlg.cxx:36
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MissingETAuxContainer.h
ANA_MSG_WARNING
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:292
MetBuilderAlg.h
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
CP::MetBuilderAlg::m_metHandle
SysCopyHandle< xAOD::MissingETContainer > m_metHandle
the met collection we run on
Definition: MetBuilderAlg.h:39
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
xAOD::MissingET_v1::source
MissingETBase::Types::bitmask_t source() const
MET object source tag.
CP::MetBuilderAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition: MetBuilderAlg.h:35
CP::MetBuilderAlg::initialize
StatusCode initialize() override
Definition: MetBuilderAlg.cxx:26