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 // accessors and decorators
25 // these are done at file-level to register types with output algorithms
26 const static SG::Decorator<float> met_met_dec("met");
27 const static SG::Decorator<float> met_phi_dec("phi");
28
29 StatusCode MetBuilderAlg ::
30 initialize ()
31 {
33 ANA_CHECK (m_systematicsList.initialize());
34 return StatusCode::SUCCESS;
35 }
36
37
38
39 StatusCode MetBuilderAlg ::
40 execute ()
41 {
42 for (const auto& sys : m_systematicsList.systematicsVector())
43 {
45 ANA_CHECK (m_metHandle.getCopy (met, sys));
46
47 xAOD::MissingET *softTerm = (*met)[m_softTerm];
48 if (softTerm == nullptr)
49 {
50 ANA_MSG_ERROR ("could not find MET soft-term: " << m_softTerm);
51 return StatusCode::FAILURE;
52 }
54
55 for (const xAOD::MissingET *metTerm : (*met))
56 {
57 if (!metTerm)
58 {
59 ANA_MSG_WARNING("failed to retrieve MET term to decorate met and phi aux vars!");
60 continue;
61 }
62 met_met_dec(*metTerm) = metTerm->met();
63 met_phi_dec(*metTerm) = metTerm->phi();
64 }
65 }
66
67 return StatusCode::SUCCESS;
68 }
69}
#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.
static const SG::Decorator< float > met_phi_dec("phi")
static const SG::Decorator< float > met_met_dec("met")
StatusCode buildMETSum(const std::string &totalName, xAOD::MissingETContainer *metCont)
MissingET_v1 MissingET
Version control by type defintion.