17#include "GaudiKernel/SystemOfUnits.h"
32 if (fullName.empty()){
34 return StatusCode::FAILURE;
36 std::ifstream inputNN(fullName);
38 if (
m_configNN.inputs.size() != 1)
return StatusCode::FAILURE;
46 const EventContext& context,
50 std::map<std::string, std::map<std::string, double> > inputs;
53 std::string name = key.key();
58 return StatusCode::FAILURE;
63 inputs[
"node_0"].insert(std::pair<std::string, double>(name+
".met",-1) );
64 inputs[
"node_0"].insert(std::pair<std::string, double>(name+
".sumet",-1) );
69 float mpx = metObj.
ex();
70 float mpy = metObj.
ey();
71 inputs[
"node_0"].insert(std::pair<std::string, double>(name+
".met",sqrt(mpx * mpx + mpy * mpy)/Gaudi::Units::GeV) );
72 inputs[
"node_0"].insert(std::pair<std::string, double>(name+
".sumet",metObj.
sumEt()/Gaudi::Units::GeV) );
76 std::map<std::string, double> outputNN =
m_graphNN->compute(inputs);
77 auto NN_MET=outputNN[
"out_0"]*Gaudi::Units::GeV;
82 return StatusCode::SUCCESS;
#define CHECK(...)
Evaluate an expression and check for errors.
FexBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
StatusCode initializeBase(const std::vector< std::string > &componentNames)
Initialize the base class.
virtual StatusCode initialize() override
Initialize the fex.
lwt::GraphConfig m_configNN
std::unique_ptr< lwt::LightweightGraph > m_graphNN
NNHLTFex(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Property< std::string > m_filename
virtual StatusCode fillMET(xAOD::TrigMissingET &met, const EventContext &context, MonGroupBuilder &monitors) const override
Calculate and fill the output MET value.
SG::ReadHandleKeyArray< xAOD::TrigMissingETContainer > m_triggerMETs
static std::string find_calib_file(const std::string &logical_file_name)
Property holding a SG store/key/clid from which a ReadHandle is made.
float ex() const
Get the x component of the missing energy.
float sumEt() const
Get the sum of the ET of the missing energy.
float ey() const
Get the y component of the missing energy.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
TrigMissingET_v1 TrigMissingET
Define the most recent version of the TrigMissingET class.