ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigEFMissingET
src
MHTFex.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/******************************************************************************
6
* @package Trigger/TrigAlgorithms/TrigEFMissingET
7
* @file MHTFex.cxx
8
*
9
* Implementation of the mht fex class
10
* @author Jon Burr
11
*****************************************************************************/
12
13
#include "
MHTFex.h
"
14
#include "
TrigEFMissingET/METComponent.h
"
15
#include <array>
16
17
namespace
HLT
{
namespace
MET
{
18
MHTFex::MHTFex
(
const
std::string& name, ISvcLocator* pSvcLocator) :
19
FexBase
(name, pSvcLocator)
20
{}
21
22
StatusCode
MHTFex::initialize
()
23
{
24
CHECK
(
m_jetKey
.initialize() );
25
return
initializeBase
({
"JETB1"
,
"JETB2"
,
"JETE1"
,
"JETE2"
});
26
}
27
28
StatusCode
MHTFex::fillMET
(
29
xAOD::TrigMissingET
&
met
,
30
const
EventContext& context,
31
MonGroupBuilder
&)
const
32
{
33
// Retrieve the inputs
34
auto
jets =
SG::makeHandle
(
m_jetKey
, context);
35
if
(!jets.isValid())
36
{
37
ATH_MSG_ERROR
(
"Failed to retrieve "
<<
m_jetKey
);
38
return
StatusCode::FAILURE;
39
}
40
41
// Prepare the output values
42
std::array<METComponent, 4> mhtSums;
43
for
(
const
xAOD::Jet
* ijet : *jets) {
44
// Apply the pT selection
45
if
(ijet->pt() < (
isCentral
(ijet) ?
m_centralPtCut
:
m_forwardPtCut
) )
46
continue
;
47
// Get the right MET component
48
std::size_t componentIdx = 0;
49
if
(ijet->eta() < 0)
50
++componentIdx;
51
if
(!
isCentral
(ijet) )
52
componentIdx += 2;
53
mhtSums.at(componentIdx) += ijet->p4();
54
}
55
56
// Save the full sum
57
std::accumulate(mhtSums.begin(), mhtSums.end(),
METComponent
{}).fillMET(
met
);
58
// Save each component
59
for
(std::size_t ii = 0; ii < 4; ++ii)
60
mhtSums.at(ii).fillMETComponent(ii,
met
);
61
62
return
StatusCode::SUCCESS;
63
}
64
} }
//> end class 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
MHTFex.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::MHTFex::m_jetKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetKey
Input jets.
Definition
MHTFex.h:41
HLT::MET::MHTFex::MHTFex
MHTFex(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
MHTFex.cxx:18
HLT::MET::MHTFex::fillMET
virtual StatusCode fillMET(xAOD::TrigMissingET &met, const EventContext &context, MonGroupBuilder &monitors) const override
Calculate and fill the output MET value.
Definition
MHTFex.cxx:28
HLT::MET::MHTFex::m_forwardPtCut
Gaudi::Property< float > m_forwardPtCut
Forward pT cut.
Definition
MHTFex.h:51
HLT::MET::MHTFex::isCentral
bool isCentral(const xAOD::Jet *ijet) const
Is a jet central or forward.
Definition
MHTFex.h:69
HLT::MET::MHTFex::initialize
virtual StatusCode initialize() override
Initialize the fex.
Definition
MHTFex.cxx:22
HLT::MET::MHTFex::m_centralPtCut
Gaudi::Property< float > m_centralPtCut
Central pT cut.
Definition
MHTFex.h:48
HLT::MET::MonGroupBuilder
Definition
MonGroupBuilder.h:33
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::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
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