26 if(pt<pt_min_ || pt>=
pt_max_) output =
false;
55 cl3d_coreshowerlength,
68 std::vector<std::unique_ptr<TMVAEvaluator>>
bdts_;
94 <<
"BDTs already initialized.";
98 std::vector<std::string> bdt_files = conf.
getParameter< std::vector<std::string> >(
"Weights");
99 std::vector<double> categories_etamin = conf.
getParameter<std::vector<double>>(
"CategoriesEtaMin");
100 std::vector<double> categories_etamax = conf.
getParameter<std::vector<double>>(
"CategoriesEtaMax");
101 std::vector<double> categories_ptmin = conf.
getParameter<std::vector<double>>(
"CategoriesPtMin");
102 std::vector<double> categories_ptmax = conf.
getParameter<std::vector<double>>(
"CategoriesPtMax");
105 if(bdt_files.size()!=categories_etamin.size() ||
106 categories_etamin.size()!=categories_etamax.size() ||
107 categories_etamax.size()!=categories_ptmin.size() ||
108 categories_ptmin.size()!=categories_ptmax.size() ||
109 categories_ptmax.size()!=working_points_.size()
112 throw cms::Exception(
"HGCalTriggerClusterIdentificationBDT|BadInitialization")
113 <<
"Inconsistent numbers of categories, BDT weight files and working points";
116 bdts_.reserve(working_points_.size());
117 for(
unsigned cat=0;
cat<categories_etamin.size();
cat++)
120 categories_ptmin[
cat],
121 categories_ptmax[cat],
122 categories_etamin[cat],
123 categories_etamax[cat]);
126 for (
const auto&
file : bdt_files)
129 bdts_.back()->initialize(
130 "!Color:Silent:!Error",
161 std::map<std::string, float>
inputs;
166 float pt = cluster.
pt();
167 float eta = cluster.
eta();
169 return (cat!=-1 ?
bdts_.at(cat)->evaluate(inputs) : -999.);
177 float bdt_output =
value(cluster);
178 float pt = cluster.
pt();
179 float eta = cluster.
eta();
T getParameter(std::string const &) const
double eta() const final
momentum pseudorapidity
bool contains(EventRange const &lh, EventID const &rh)
float sigmaPhiPhiTot() const
float sigmaEtaEtaMax() const
double pt() const final
transverse momentum
std::vector< std::string > input_variables_
std::vector< Category > categories_
HGCalTriggerClusterIdentificationBDT()
Abs< T >::type abs(const T &t)
#define DEFINE_HGC_TPG_CLUSTER_ID(type, name)
std::vector< double > working_points_
void initialize(const edm::ParameterSet &conf) final
Category(float pt_min, float pt_max, float eta_min, float eta_max)
float clusterVariable(ClusterVariable, const l1t::HGCalMulticluster &) const
float sigmaEtaEtaTot() const
float value(const l1t::HGCalMulticluster &cluster) const final
int coreShowerLength() const
std::vector< std::unique_ptr< TMVAEvaluator > > bdts_
float sigmaRRMean() const
bool contains(float pt, float eta) const
int category(float pt, float eta) const
~HGCalTriggerClusterIdentificationBDT() override
bool decision(const l1t::HGCalMulticluster &cluster) const final
std::vector< ClusterVariable > input_variables_id_
float sigmaPhiPhiMax() const