ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigEFMissingET
src
PFSumFex.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/******************************************************************************
6
* @package Trigger/TrigAlgorithms/TrigEFMissingET
7
* @file PFSumFex.cxx
8
*
9
* Implementation of the PFlow fex class
10
* @author Jon Burr
11
*****************************************************************************/
12
13
#include "
PFSumFex.h
"
14
#include "
TrigEFMissingET/METComponent.h
"
15
#include <array>
16
17
namespace
HLT
{
namespace
MET
{
18
19
PFSumFex::PFSumFex
(
const
std::string& name, ISvcLocator* pSvcLocator) :
20
FexBase
(name, pSvcLocator)
21
{}
22
23
StatusCode
PFSumFex::initialize
()
24
{
25
CHECK
(
m_neutralPFOKey
.initialize() );
26
CHECK
(
m_chargedPFOKey
.initialize() );
27
return
initializeBase
({
"NeutralPFOs"
,
"ChargedHSPFOs"
,
"ChargedPUPFOs"
});
28
}
29
30
StatusCode
PFSumFex::fillMET
(
31
xAOD::TrigMissingET
&
met
,
32
const
EventContext& context,
33
MonGroupBuilder
&)
const
34
{
35
auto
charged =
SG::makeHandle
(
m_chargedPFOKey
, context);
36
if
(!charged.isValid())
37
{
38
ATH_MSG_ERROR
(
"Failed to retrieve "
<<
m_chargedPFOKey
);
39
return
StatusCode::FAILURE;
40
}
41
auto
neutral =
SG::makeHandle
(
m_neutralPFOKey
, context);
42
if
(!neutral.isValid())
43
{
44
ATH_MSG_ERROR
(
"Failed to retrieve "
<<
m_neutralPFOKey
);
45
return
StatusCode::FAILURE;
46
}
47
48
std::array<METComponent, 3> pfoSums;
49
for
(
const
xAOD::IParticle
* ipfo : *neutral)
50
// 0 is the 'NeutralPFOs' component
51
pfoSums.at(0) += *ipfo;
52
const
static
SG::AuxElement::ConstAccessor<char> PVMatchedAcc(
"matchedToPV"
);
53
for
(
const
xAOD::IParticle
* ipfo : *charged)
54
// 1 is the 'ChargedHSPFOs' component, 2 is the 'ChargedPUPFOs' component
55
(PVMatchedAcc(*ipfo) ? pfoSums.at(1) : pfoSums.at(2) ) += *ipfo;
56
57
// Sum together the components
58
METComponent
total = pfoSums.at(0) + pfoSums.at(1);
59
if
(!
m_chargedOnlyFromPV
)
60
total += pfoSums.at(2);
61
total.
fillMET
(
met
);
62
for
(std::size_t ii = 0; ii < 3; ++ii)
63
pfoSums.at(ii).fillMETComponent(ii,
met
);
64
return
StatusCode::SUCCESS;
65
}
66
} }
//> end namespace HLT::MET
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
METComponent.h
PFSumFex.h
HLT::MET::FexBase::FexBase
FexBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
FexBase.cxx:43
HLT::MET::FexBase::initializeBase
StatusCode initializeBase(const std::vector< std::string > &componentNames)
Initialize the base class.
Definition
FexBase.cxx:48
HLT::MET::METComponent
Helper struct to build up MET values before moving them into the EDM.
Definition
METComponent.h:28
HLT::MET::METComponent::fillMET
void fillMET(xAOD::TrigMissingET &met) const
Fill the main component of the MET with this.
Definition
METComponent.cxx:91
HLT::MET::MonGroupBuilder
Definition
MonGroupBuilder.h:33
HLT::MET::PFSumFex::initialize
virtual StatusCode initialize() override
Initialize the fex.
Definition
PFSumFex.cxx:23
HLT::MET::PFSumFex::fillMET
virtual StatusCode fillMET(xAOD::TrigMissingET &met, const EventContext &context, MonGroupBuilder &monitors) const override
Calculate and fill the output MET value.
Definition
PFSumFex.cxx:30
HLT::MET::PFSumFex::PFSumFex
PFSumFex(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
PFSumFex.cxx:19
HLT::MET::PFSumFex::m_chargedPFOKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_chargedPFOKey
Input charged PFOs.
Definition
PFSumFex.h:44
HLT::MET::PFSumFex::m_neutralPFOKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_neutralPFOKey
Input neutral PFOs.
Definition
PFSumFex.h:41
HLT::MET::PFSumFex::m_chargedOnlyFromPV
Gaudi::Property< bool > m_chargedOnlyFromPV
Whether to only include charged PFOs that are matched to the PV vertex.
Definition
PFSumFex.h:47
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
HLT::MET
Definition
METComponent.cxx:8
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition
HLTResultReader.h:26
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
met
Definition
IMETSignificance.h:24
xAOD::TrigMissingET
TrigMissingET_v1 TrigMissingET
Define the most recent version of the TrigMissingET class.
Definition
Event/xAOD/xAODTrigMissingET/xAODTrigMissingET/TrigMissingET.h:12
Generated on
for ATLAS Offline Software by
1.17.0