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
16
17//
18// method implementations
19//
20
21namespace CP
22{
23 // accessors and decorators
24 // these are done at file-level to register types with output algorithms
25 const static SG::Decorator<float> met_met_dec("met");
26 const static SG::Decorator<float> met_phi_dec("phi");
27
28 StatusCode MetBuilderAlg ::
29 initialize ()
30 {
32 ANA_CHECK (m_systematicsList.initialize());
33 return StatusCode::SUCCESS;
34 }
35
36
37
38 StatusCode MetBuilderAlg ::
39 execute ()
40 {
41 for (const auto& sys : m_systematicsList.systematicsVector())
42 {
44 ANA_CHECK (m_metHandle.getCopy (met, sys));
45
46 xAOD::MissingET *softTerm = (*met)[m_softTerm];
47 if (softTerm == nullptr)
48 {
49 ANA_MSG_ERROR ("could not find MET soft-term: " << m_softTerm);
50 return StatusCode::FAILURE;
51 }
53
54 for (const xAOD::MissingET *metTerm : (*met))
55 {
56 if (!metTerm)
57 {
58 ANA_MSG_WARNING("failed to retrieve MET term to decorate met and phi aux vars!");
59 continue;
60 }
61 met_met_dec(*metTerm) = metTerm->met();
62 met_phi_dec(*metTerm) = metTerm->phi();
63 }
64 }
65
66 return StatusCode::SUCCESS;
67 }
68}
#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
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")
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
Definition AuxElement.h:576
StatusCode buildMETSum(const std::string &totalName, xAOD::MissingETContainer *metCont)
MissingET_v1 MissingET
Version control by type defintion.