ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigEFMissingET
src
TCFex.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 TCFex.cxx
8
*
9
* Implementation of the topocluster fex class
10
* @author Jon Burr
11
*****************************************************************************/
12
13
#include "
TCFex.h
"
14
#include "
TrigEFMissingET/METComponent.h
"
15
#include <array>
16
17
namespace
{
18
bool
isBarrel
(
const
xAOD::CaloCluster
* iclus,
19
xAOD::CaloCluster::State
state) {
20
return
fabs(iclus->
eta
(state) ) < 1.5;
21
}
22
}
23
24
namespace
HLT
{
namespace
MET
{
25
TCFex::TCFex
(
const
std::string& name, ISvcLocator* pSvcLocator) :
26
FexBase
(name, pSvcLocator)
27
{}
28
29
StatusCode
TCFex::initialize
()
30
{
31
CHECK
(
m_clusterKey
.initialize() );
32
return
initializeBase
({
"TCB1"
,
"TCB2"
,
"TCE1"
,
"TCE2"
});
33
}
34
35
StatusCode
TCFex::fillMET
(
36
xAOD::TrigMissingET
&
met
,
37
const
EventContext& context,
38
MonGroupBuilder
&)
const
39
{
40
// Retrieve the inputs
41
auto
clusters =
SG::makeHandle
(
m_clusterKey
, context);
42
if
(!clusters.isValid())
43
{
44
ATH_MSG_ERROR
(
"Failed to retrieve "
<<
m_clusterKey
);
45
return
StatusCode::FAILURE;
46
}
47
48
auto
state =
m_useUncalibrated
?
49
xAOD::CaloCluster::UNCALIBRATED
:
50
xAOD::CaloCluster::CALIBRATED
;
51
52
// Prepare the output values
53
std::array<METComponent, 4> tcSums;
54
for
(
const
xAOD::CaloCluster
* iclus : *clusters) {
55
// Pick the right component
56
std::size_t componentIdx = 0;
57
if
(iclus->eta() < 0)
58
++componentIdx;
59
if
(!isBarrel(iclus, state) )
60
componentIdx += 2;
61
tcSums.at(componentIdx) +=
SignedKinematics::fromEnergyEtaPhiM
(
62
iclus->e(state), iclus->eta(state), iclus->phi(state),
63
m_useUncalibrated
? iclus->rawM() : iclus->calM() );
64
}
65
// Save the total
66
std::accumulate(tcSums.begin(), tcSums.end(),
METComponent
{}).fillMET(
met
);
67
68
// Save each component
69
for
(std::size_t ii = 0; ii < 4; ++ii)
70
tcSums.at(ii).fillMETComponent(ii,
met
);
71
72
return
StatusCode::SUCCESS;
73
}
74
} }
//> 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
TCFex.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::MonGroupBuilder
Definition
MonGroupBuilder.h:33
HLT::MET::SignedKinematics::fromEnergyEtaPhiM
static SignedKinematics fromEnergyEtaPhiM(double energy, double eta, double phi, double mass)
Factory function to construct from energy eta, phi and m.
Definition
SignedKinematics.cxx:32
HLT::MET::TCFex::m_useUncalibrated
Gaudi::Property< bool > m_useUncalibrated
Whether to use the uncalibrated clusters or not.
Definition
TCFex.h:50
HLT::MET::TCFex::TCFex
TCFex(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
TCFex.cxx:25
HLT::MET::TCFex::m_clusterKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterKey
Input clusters.
Definition
TCFex.h:41
HLT::MET::TCFex::fillMET
virtual StatusCode fillMET(xAOD::TrigMissingET &met, const EventContext &context, MonGroupBuilder &monitors) const override
Calculate and fill the output MET value.
Definition
TCFex.cxx:35
HLT::MET::TCFex::initialize
virtual StatusCode initialize() override
Initialize the fex.
Definition
TCFex.cxx:29
xAOD::CaloCluster_v1::State
State
enum of possible signal states.
Definition
CaloCluster_v1.h:307
xAOD::CaloCluster_v1::UNCALIBRATED
@ UNCALIBRATED
Definition
CaloCluster_v1.h:309
xAOD::CaloCluster_v1::CALIBRATED
@ CALIBRATED
Definition
CaloCluster_v1.h:310
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition
CaloCluster_v1.cxx:251
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
python.LArCondContChannels.isBarrel
isBarrel
Definition
LArCondContChannels.py:659
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
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