ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoSimulation
src
EnergyInputProvider.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
#include <math.h>
/* atan2 */
6
7
#include "
EnergyInputProvider.h
"
8
#include "
TrigT1CaloEvent/EnergyRoI_ClassDEF.h
"
9
#include "
TrigT1Interfaces/TrigT1CaloDefs.h
"
10
11
#include "
L1TopoEvent/ClusterTOB.h
"
12
#include "
L1TopoEvent/TopoInputEvent.h
"
13
14
15
using namespace
std
;
16
using namespace
LVL1
;
17
18
EnergyInputProvider::EnergyInputProvider
(
const
std::string&
type
,
const
std::string&
name
,
19
const
IInterface* parent) :
20
base_class(
type
,
name
, parent),
21
m_energyLocation
(
TrigT1CaloDefs
::EnergyTopoDataLocation)
22
{
23
declareInterface<LVL1::IInputTOBConverter>(
this
);
24
declareProperty(
"EnergyROILocation"
,
m_energyLocation
,
"Storegate key for reading the Topo Energy ROI"
);
25
26
}
27
28
EnergyInputProvider::~EnergyInputProvider
()
29
{}
30
31
StatusCode
32
EnergyInputProvider::initialize
() {
33
34
CHECK
(
m_energyLocation
.initialize());
35
36
if
(!
m_monTool
.empty())
ATH_CHECK
(
m_monTool
.retrieve());
37
38
return
StatusCode::SUCCESS;
39
}
40
41
StatusCode
42
EnergyInputProvider::fillTopoInputEvent
(
TCS::TopoInputEvent
& inputEvent)
const
{
43
52
53
// EnergyRoI * energyROI = 0;
54
// if( ! evtStore()->retrieve(energyROI, m_energyLocation).isSuccess()) {
55
// ATH_MSG_ERROR("No EnergyROI with key '" << m_energyLocation << "' found in the event. Configuration issue.");
56
// return StatusCode::FAILURE;
57
// }
58
59
// ATH_MSG_DEBUG("Not filling the input event from EnergyROI. There is not enough information.");
60
// ATH_MSG_DEBUG("EnergyROI: word0 = " << hex << energyROI->roiWord0()
61
// << ", word1 = " << hex << energyROI->roiWord1()
62
// << ", word2 = " << hex << energyROI->roiWord2());
63
64
65
SG::ReadHandle< EnergyTopoData >
topoData (
m_energyLocation
);
66
67
if
( !topoData.
isValid
()){
68
ATH_MSG_WARNING
(
"No EnergyTopoData with SG key '"
<<
m_energyLocation
.key() <<
"' found in the event. No MET input for the L1Topo simulation."
);
69
return
StatusCode::RECOVERABLE;
70
}
71
72
ATH_MSG_DEBUG
(
"EnergyTopoData"
<< dec
73
<<
": Ex = "
<< topoData->Ex()
74
<<
", Ey = "
<< topoData->Ey()
75
<<
", Et = "
<< topoData->Et()
76
<<
", ExTC = "
<< topoData->ExTC()
77
<<
", EyTC = "
<< topoData->EyTC()
78
);
79
80
81
TCS::MetTOB
met
( -(topoData->Ex()), -(topoData->Ey()), topoData->Et() );
82
inputEvent.
setMET
(
met
);
83
const
bool
has_overflow = (topoData->ExOverflow() or
84
topoData->EyOverflow() or
85
topoData->EtOverflow());
86
if
(has_overflow) {
87
inputEvent.
setOverflowFromEnergyInput
(
true
);
88
ATH_MSG_DEBUG
(
"setOverflowFromEnergyInput : true"
);
89
}
90
auto
mon_hPt =
Monitored::Scalar
(
"MET"
,
met
.Et());
91
auto
mon_hPhi =
Monitored::Scalar
(
"METPhi"
, atan2(
met
.Ey(),
met
.Ex()));
92
Monitored::Group
(
m_monTool
, mon_hPt, mon_hPhi);
93
94
return
StatusCode::SUCCESS;
95
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ClusterTOB.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
EnergyInputProvider.h
EnergyRoI_ClassDEF.h
TopoInputEvent.h
TrigT1CaloDefs.h
LVL1::EnergyInputProvider::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition
EnergyInputProvider.h:29
LVL1::EnergyInputProvider::fillTopoInputEvent
virtual StatusCode fillTopoInputEvent(TCS::TopoInputEvent &) const
Definition
EnergyInputProvider.cxx:42
LVL1::EnergyInputProvider::~EnergyInputProvider
virtual ~EnergyInputProvider()
Definition
EnergyInputProvider.cxx:28
LVL1::EnergyInputProvider::EnergyInputProvider
EnergyInputProvider(const std::string &type, const std::string &name, const IInterface *parent)
Definition
EnergyInputProvider.cxx:18
LVL1::EnergyInputProvider::m_energyLocation
SG::ReadHandleKey< LVL1::EnergyTopoData > m_energyLocation
EnergyROI SG key.
Definition
EnergyInputProvider.h:31
LVL1::EnergyInputProvider::initialize
virtual StatusCode initialize()
Definition
EnergyInputProvider.cxx:32
LVL1::TrigT1CaloDefs
Definition
TrigT1CaloDefs.h:24
Monitored::Group
Group of local monitoring quantities and retain correlation when filling histograms
Definition
MonitoredGroup.h:53
Monitored::Scalar
Declare a monitored scalar variable.
Definition
MonitoredScalar.h:34
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TCS::MetTOB
Definition
MetTOB.h:13
TCS::TopoInputEvent
Definition
TopoInputEvent.h:42
TCS::TopoInputEvent::setMET
StatusCode setMET(const MetTOB &met)
Definition
TopoInputEvent.cxx:140
TCS::TopoInputEvent::setOverflowFromEnergyInput
void setOverflowFromEnergyInput(bool v)
Definition
TopoInputEvent.cxx:300
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition
IZdcDataAccess.h:13
met
Definition
IMETSignificance.h:24
std
STL namespace.
type
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0