17 if (pt < pt_min_ || pt >=
pt_max_)
59 std::vector<std::unique_ptr<TMVAEvaluator>>
bdts_;
75 edm::LogWarning(
"HGCalTriggerClusterIdentificationBDT|Initialization") <<
"BDTs already initialized.";
79 std::vector<std::string> bdt_files = conf.
getParameter<std::vector<std::string>>(
"Weights");
80 std::vector<double> categories_etamin = conf.
getParameter<std::vector<double>>(
"CategoriesEtaMin");
81 std::vector<double> categories_etamax = conf.
getParameter<std::vector<double>>(
"CategoriesEtaMax");
82 std::vector<double> categories_ptmin = conf.
getParameter<std::vector<double>>(
"CategoriesPtMin");
83 std::vector<double> categories_ptmax = conf.
getParameter<std::vector<double>>(
"CategoriesPtMax");
86 if (bdt_files.size() != categories_etamin.size() || categories_etamin.size() != categories_etamax.size() ||
87 categories_etamax.size() != categories_ptmin.size() || categories_ptmin.size() != categories_ptmax.size() ||
88 categories_ptmax.size() != working_points_.size()) {
89 throw cms::Exception(
"HGCalTriggerClusterIdentificationBDT|BadInitialization")
90 <<
"Inconsistent numbers of categories, BDT weight files and working points";
93 bdts_.reserve(working_points_.size());
94 for (
unsigned cat = 0;
cat < categories_etamin.size();
cat++) {
96 categories_ptmin[
cat], categories_ptmax[cat], categories_etamin[cat], categories_etamax[cat]);
98 std::vector<std::string> spectators = {};
99 for (
const auto&
file : bdt_files) {
101 bdts_.back()->initialize(
"!Color:Silent:!Error",
113 if (variable ==
"cl3d_showerlength")
115 else if (variable ==
"cl3d_coreshowerlength")
117 else if (variable ==
"cl3d_firstlayer")
119 else if (variable ==
"cl3d_maxlayer")
121 else if (variable ==
"cl3d_seetot")
123 else if (variable ==
"cl3d_seemax")
125 else if (variable ==
"cl3d_spptot")
127 else if (variable ==
"cl3d_sppmax")
129 else if (variable ==
"cl3d_szz")
131 else if (variable ==
"cl3d_srrtot")
133 else if (variable ==
"cl3d_srrmax")
135 else if (variable ==
"cl3d_srrmean")
141 std::map<std::string, float>
inputs;
145 float pt = cluster.
pt();
146 float eta = cluster.
eta();
148 return (cat != -1 ?
bdts_.at(cat)->evaluate(inputs) : -999.);
152 float bdt_output =
value(cluster);
153 float pt = cluster.
pt();
154 float eta = cluster.
eta();
162 return static_cast<int>(
cat);
bool contains(EventRange const &lh, EventID const &rh)
double pt() const final
transverse momentum
float sigmaPhiPhiTot() const
float sigmaEtaEtaMax() const
std::vector< std::string > input_variables_
std::vector< Category > categories_
bool decision(const l1t::HGCalMulticluster &cluster) const final
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
int coreShowerLength() const
std::vector< std::unique_ptr< TMVAEvaluator > > bdts_
float sigmaRRMean() const
float value(const l1t::HGCalMulticluster &cluster) const final
bool contains(float pt, float eta) const
T getParameter(std::string const &) const
int category(float pt, float eta) const
~HGCalTriggerClusterIdentificationBDT() override
std::vector< ClusterVariable > input_variables_id_
Log< level::Warning, false > LogWarning
float sigmaPhiPhiMax() const
double eta() const final
momentum pseudorapidity