8#include "GaudiKernel/SystemOfUnits.h"
55 ATH_MSG_ERROR(
"Incorrect number of algorithm parameter values given number of sumEt thresholds");
56 return StatusCode::FAILURE;
58 return StatusCode::SUCCESS;
62 const EventContext &ctx,
66 if (!gblocks.isValid())
69 return StatusCode::FAILURE;
71 std::vector<float> rhos;
75 if (!rhoCont.isValid())
78 return StatusCode::FAILURE;
80 rhos = accRho(*rhoCont);
97 return StatusCode::FAILURE;
99 float seedEt = seed->et();
110 float rho = rhos.at(
static_cast<std::size_t
>(fpga));
111 seedEt -= rho * accArea(*seed);
115 HTx += seedEt * std::cos(seed->phi());
116 HTy += seedEt * std::sin(seed->phi());
121 STx += seedEt * std::cos(seed->phi());
122 STy += seedEt * std::sin(seed->phi());
146 float energyX = ax * HTx + bx * STx + cx;
147 float energyY = ay * HTy + by * STy + cy;
148 met.setEnergyX(energyX);
149 met.setEnergyY(energyY);
150 met.setEnergyT(sumEt);
152 auto mht = std::make_unique<xAOD::EnergySumRoI>();
153 auto mhtAux = std::make_unique<xAOD::EnergySumRoIAuxInfo>();
154 mht->setStore(mhtAux.get());
155 mht->setEnergyX(HTx);
156 mht->setEnergyY(HTy);
157 mht->setEnergyT(sumHT);
159 ATH_CHECK(mhtHandle.record(std::move(mht), std::move(mhtAux)));
161 auto mst = std::make_unique<xAOD::EnergySumRoI>();
162 auto mstAux = std::make_unique<xAOD::EnergySumRoIAuxInfo>();
163 mst->setStore(mstAux.get());
164 mst->setEnergyX(STx);
165 mst->setEnergyY(STy);
166 mst->setEnergyT(sumST);
168 ATH_CHECK(mstHandle.record(std::move(mst), std::move(mstAux)));
170 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< float > m_bxValues
std::vector< float > m_sumEtThresholds
std::vector< float > m_axValues
virtual StatusCode runFex(const EventContext &ctx, xAOD::EnergySumRoI &met) const override
virtual StatusCode initialize() override
std::vector< float > m_cyValues
SG::ReadHandleKey< xAOD::GBlockContainer > m_gblocksKey
SG::WriteHandleKey< xAOD::EnergySumRoI > m_mhtKey
std::vector< float > m_ayValues
virtual ~METJWoJPerfFex() override
METJWoJPerfFex(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< float > m_byValues
SG::WriteHandleKey< xAOD::EnergySumRoI > m_mstKey
std::vector< float > m_cxValues
SG::ReadHandleKey< xAOD::EnergySumRoI > m_rhoKey
METPerfFexBase(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
SG::ConstAccessor< T, ALLOC > ConstAccessor
FPGA getFPGA(float eta)
Get the FPGA code from the tower eta.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
JGTower_v1 JGTower
Define the latest version of the JGTower class.
GBlock_v1 GBlock
Define the latest version of the GBlock class.
EnergySumRoI_v2 EnergySumRoI