|
|
Go to the documentation of this file.
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() ||
89 throw cms::Exception(
"HGCalTriggerClusterIdentificationBDT|BadInitialization")
90 <<
"Inconsistent numbers of categories, BDT weight files and working points";
94 for (
unsigned cat = 0;
cat < categories_etamin.size();
cat++) {
96 categories_ptmin[
cat], categories_ptmax[
cat], categories_etamin[
cat], categories_etamax[
cat]);
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")
135 else if (
variable ==
"cl3d_srrmean")
141 std::map<std::string, float>
inputs;
145 float pt = cluster.
pt();
146 float eta = cluster.
eta();
152 float bdt_output =
value(cluster);
153 float pt = cluster.
pt();
154 float eta = cluster.
eta();
162 return static_cast<int>(
cat);
float clusterVariable(ClusterVariable, const l1t::HGCalMulticluster &) const
~HGCalTriggerClusterIdentificationBDT() override
void initialize(const edm::ParameterSet &conf) final
float sigmaEtaEtaTot() const
Category(float pt_min, float pt_max, float eta_min, float eta_max)
double pt() const final
transverse momentum
Log< level::Warning, false > LogWarning
float sigmaPhiPhiMax() const
float sigmaPhiPhiTot() const
std::vector< ClusterVariable > input_variables_id_
#define DEFINE_HGC_TPG_CLUSTER_ID(type, name)
std::vector< double > working_points_
std::vector< std::string > input_variables_
double eta() const final
momentum pseudorapidity
std::vector< std::unique_ptr< TMVAEvaluator > > bdts_
bool contains(EventRange const &lh, EventID const &rh)
int coreShowerLength() const
bool decision(const l1t::HGCalMulticluster &cluster) const final
std::vector< Category > categories_
int category(float pt, float eta) const
float sigmaRRMean() const
T getParameter(std::string const &) const
HGCalTriggerClusterIdentificationBDT()
Abs< T >::type abs(const T &t)
bool contains(float pt, float eta) const
float value(const l1t::HGCalMulticluster &cluster) const final
float sigmaEtaEtaMax() const