12 #include "TMVA/Factory.h"
13 #include "TMVA/Reader.h"
48 preselection_(iConfig.getParameter<
std::
string>(
"preselection")),
49 method_(iConfig.getParameter<
std::
string>(
"method")),
50 weightsFile_(iConfig.getParameter<
std::
string>(
"weightsFile")),
51 reader_(new TMVA::Reader()),
52 wp_(iConfig.getParameter<
std::
string>(
"wp")) {
54 for (
const auto &psvar : iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"variables")) {
66 produces<l1t::HGCalMulticlusterBxCollection>();
67 produces<l1t::HGCalMulticlusterBxCollection>(
"fail");
71 std::unique_ptr<l1t::HGCalMulticlusterBxCollection>
out = std::make_unique<l1t::HGCalMulticlusterBxCollection>();
72 std::unique_ptr<l1t::HGCalMulticlusterBxCollection> fail = std::make_unique<l1t::HGCalMulticlusterBxCollection>();
75 iEvent.getByToken(src_, multiclusters);
78 for (
auto it = multiclusters->
begin(
bx), ed = multiclusters->
end(
bx); it != ed; ++it) {
80 if (preselection_(
c)) {
81 for (
auto &
var : variables_)
83 float mvaOut = reader_->EvaluateMVA(method_);
84 if (mvaOut > wp_(
c)) {
87 fail->push_back(
bx,
c);