ATLAS Offline Software
Loading...
Searching...
No Matches
MetBuilderAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
22namespace CP
23{
24
25 StatusCode MetBuilderAlg ::
26 initialize ()
27 {
29 ANA_CHECK (m_systematicsList.initialize());
30 return StatusCode::SUCCESS;
31 }
32
33
34
35 StatusCode MetBuilderAlg ::
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::Decorator<float> met_met_dec("met");
52 const static SG::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}
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
Gaudi::Property< std::string > m_finalKey
the key for the final met term
Gaudi::Property< std::string > m_softTerm
the key for the soft term
SysCopyHandle< xAOD::MissingETContainer > m_metHandle
the met collection we run on
SysListHandle m_systematicsList
the systematics list we run
Helper class to provide type-safe access to aux data.
Definition Decorator.h:59
MissingETBase::Types::bitmask_t source() const
MET object source tag.
Select isolated Photons, Electrons and Muons.
StatusCode buildMETSum(const std::string &totalName, xAOD::MissingETContainer *metCont)
MissingET_v1 MissingET
Version control by type defintion.