ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1CaloFEX
TrigT1CaloFexPerf
src
METNoiseCutPerfFex.cxx
Go to the documentation of this file.
1
4
5
#include "
METNoiseCutPerfFex.h
"
6
#include "
StoreGate/ReadHandle.h
"
7
8
namespace
LVL1
9
{
10
METNoiseCutPerfFex::METNoiseCutPerfFex
(
const
std::string &
name
, ISvcLocator *pSvcLocator)
11
:
METPerfFexBase
(
name
, pSvcLocator)
12
{
13
declareProperty
(
"InputTowers"
,
m_towersKey
,
"Input JG towers"
);
14
declareProperty
(
"InputTowerNoise"
,
m_noiseName
=
""
,
"Input JG tower noise values (if used)"
);
15
declareProperty
(
"UseNegativeTowers"
,
m_useNegativeTowers
=
true
,
"Whether to use negative towers"
);
16
}
17
18
METNoiseCutPerfFex::~METNoiseCutPerfFex
()
19
{
20
}
21
22
StatusCode
METNoiseCutPerfFex::initialize
()
23
{
24
ATH_CHECK
(
METPerfFexBase::initialize
());
25
ATH_CHECK
(
m_towersKey
.initialize());
26
if
(!
m_noiseName
.empty())
27
m_noiseAcc
= std::make_unique<SG::AuxElement::ConstAccessor<float>>(
m_noiseName
);
28
return
StatusCode::SUCCESS;
29
}
30
31
StatusCode
METNoiseCutPerfFex::runFex
(
32
const
EventContext &ctx,
33
xAOD::EnergySumRoI
&
met
)
const
34
{
35
auto
towers =
SG::makeHandle
(
m_towersKey
, ctx);
36
if
(!towers.isValid())
37
{
38
ATH_MSG_ERROR
(
"Failed to retrieve "
<< towers);
39
return
StatusCode::FAILURE;
40
}
41
float
mpx = 0;
42
float
mpy = 0;
43
float
sumEt = 0;
44
for
(
const
xAOD::JGTower
*tower : *towers)
45
{
46
// Negative tower selection
47
if
(!
m_useNegativeTowers
&& tower->et() < 0)
48
continue
;
49
50
// Tower noise selection
51
if
(
m_noiseAcc
)
52
{
53
if
(tower->sampling() == 0)
54
{
55
if
(std::abs(tower->eta()) < 3.2 && std::abs(tower->et()) < 4.5 * (*
m_noiseAcc
)(*tower))
56
continue
;
57
}
58
else
if
(tower->et() < 5 * (*
m_noiseAcc
)(*tower))
59
continue
;
60
}
61
sumEt += tower->et();
62
mpx -= tower->et() * std::cos(tower->phi());
63
mpy -= tower->et() * std::sin(tower->phi());
64
}
65
66
// Technically the energy X value should be the negative of mpx but I think
67
// that this is how it's done in the current code
68
met
.setEnergyX(mpx);
69
met
.setEnergyY(mpy);
70
met
.setEnergyT(sumEt);
71
return
StatusCode::SUCCESS;
72
}
73
}
// namespace LVL1
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
METNoiseCutPerfFex.h
ReadHandle.h
Handle class for reading from StoreGate.
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
LVL1::METNoiseCutPerfFex::METNoiseCutPerfFex
METNoiseCutPerfFex(const std::string &name, ISvcLocator *pSvcLocator)
Definition
METNoiseCutPerfFex.cxx:10
LVL1::METNoiseCutPerfFex::m_noiseName
std::string m_noiseName
Definition
METNoiseCutPerfFex.h:29
LVL1::METNoiseCutPerfFex::runFex
virtual StatusCode runFex(const EventContext &ctx, xAOD::EnergySumRoI &met) const override
Definition
METNoiseCutPerfFex.cxx:31
LVL1::METNoiseCutPerfFex::m_towersKey
SG::ReadHandleKey< xAOD::JGTowerContainer > m_towersKey
Definition
METNoiseCutPerfFex.h:28
LVL1::METNoiseCutPerfFex::~METNoiseCutPerfFex
virtual ~METNoiseCutPerfFex() override
Definition
METNoiseCutPerfFex.cxx:18
LVL1::METNoiseCutPerfFex::initialize
virtual StatusCode initialize() override
Definition
METNoiseCutPerfFex.cxx:22
LVL1::METNoiseCutPerfFex::m_useNegativeTowers
bool m_useNegativeTowers
Definition
METNoiseCutPerfFex.h:30
LVL1::METNoiseCutPerfFex::m_noiseAcc
std::unique_ptr< SG::AuxElement::ConstAccessor< float > > m_noiseAcc
Definition
METNoiseCutPerfFex.h:32
LVL1::METPerfFexBase::METPerfFexBase
METPerfFexBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition
METPerfFexBase.cxx:13
LVL1::METPerfFexBase::initialize
virtual StatusCode initialize() override
Definition
METPerfFexBase.cxx:21
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition
IZdcDataAccess.h:13
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::JGTower
JGTower_v1 JGTower
Define the latest version of the JGTower class.
Definition
JGTower.h:15
xAOD::EnergySumRoI
EnergySumRoI_v2 EnergySumRoI
Definition
EnergySumRoI.h:16
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0