ATLAS Offline Software
Loading...
Searching...
No Matches
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
10
13
14
15using namespace std;
16using namespace LVL1;
17
18EnergyInputProvider::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
30
31StatusCode
33
34 CHECK(m_energyLocation.initialize());
35
36 if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
37
38 return StatusCode::SUCCESS;
39}
40
41StatusCode
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
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
ToolHandle< GenericMonitoringTool > m_monTool
virtual StatusCode fillTopoInputEvent(TCS::TopoInputEvent &) const
EnergyInputProvider(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadHandleKey< LVL1::EnergyTopoData > m_energyLocation
EnergyROI SG key.
virtual StatusCode initialize()
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode setMET(const MetTOB &met)
void setOverflowFromEnergyInput(bool v)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
STL namespace.