24 float trk_nhits = -1.;
25 float trk_chi2red = -1.;
27 float gsf_nhits = -1.;
28 float gsf_chi2red = -1.;
32 float sc_etaWidth = -1.;
33 float sc_phiWidth = -1.;
35 float match_seed_dEta = -1.;
36 float match_eclu_EoverP = -1.;
37 float match_SC_EoverP = -1.;
38 float match_SC_dEta = -1.;
39 float match_SC_dPhi = -1.;
41 float shape_full5x5_sigmaIetaIeta = -1.;
42 float shape_full5x5_sigmaIphiIphi = -1.;
43 float shape_full5x5_HoverE = -1.;
44 float shape_full5x5_r9 = -1.;
45 float shape_full5x5_circularity = -1.;
47 float brem_frac = -1.;
54 trk_p =
float(trk->p());
55 trk_nhits =
float(trk->found());
56 trk_chi2red =
float(trk->normalizedChi2());
63 if (
gsf.isNonnull()) {
64 gsf_nhits =
gsf->found();
65 gsf_chi2red =
gsf->normalizedChi2();
75 sc_etaWidth = sc->etaWidth();
76 sc_phiWidth = sc->phiWidth();
82 match_seed_dEta = ele->deltaEtaSeedClusterTrackAtCalo();
83 match_eclu_EoverP = (1. / ele->ecalEnergy()) - (1. / ele->p());
84 match_SC_EoverP = ele->eSuperClusterOverP();
85 match_SC_dEta = ele->deltaEtaSuperClusterTrackAtVtx();
86 match_SC_dPhi = ele->deltaPhiSuperClusterTrackAtVtx();
91 shape_full5x5_sigmaIetaIeta = ele->full5x5_sigmaIetaIeta();
92 shape_full5x5_sigmaIphiIphi = ele->full5x5_sigmaIphiIphi();
93 shape_full5x5_HoverE = ele->full5x5_hcalOverEcal();
94 shape_full5x5_r9 = ele->full5x5_r9();
95 shape_full5x5_circularity = 1. - ele->full5x5_e1x5() / ele->full5x5_e5x5();
100 brem_frac = ele->fbrem();
108 shape_full5x5_sigmaIetaIeta,
109 shape_full5x5_sigmaIphiIphi,
110 shape_full5x5_circularity,
114 shape_full5x5_HoverE,
149 std::vector<std::unique_ptr<const GBRForest> >
models_;
157 rho_(consumes<double>(conf.getParameter<
edm::
InputTag>(
"rho"))),
158 names_(conf.getParameter<
std::vector<
std::
string> >(
"ModelNames")),
159 passThrough_(conf.getParameter<
bool>(
"PassThrough")),
160 minPtThreshold_(conf.getParameter<double>(
"MinPtThreshold")),
161 maxPtThreshold_(conf.getParameter<double>(
"MaxPtThreshold")),
162 thresholds_(conf.getParameter<
std::vector<double> >(
"ModelThresholds")) {
168 <<
"'ModelNames' size (" <<
names_.size() <<
") != 'ModelWeights' size (" <<
models_.size() <<
").\n";
172 <<
"'ModelWeights' size (" <<
models_.size() <<
") != 'ModelThresholds' size (" <<
thresholds_.size() <<
").\n";
175 produces<edm::ValueMap<float> >(
name);
185 if (!
rho.isValid()) {
197 std::vector<std::vector<float> >
output;
198 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
201 for (
unsigned int iele = 0; iele <
gsfElectrons->size(); iele++) {
204 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
210 for (
unsigned int iname = 0; iname <
names_.size(); ++iname) {
222 if (iter !=
names_.end()) {
224 std::vector<float>
inputs = getFeatures(ele,
rho);
227 throw cms::Exception(
"Unknown model name") <<
"'Name given: '" <<
name <<
"'. Check against configuration file.\n";
238 desc.
add<std::vector<std::string> >(
"ModelNames", {
""});
239 desc.
add<std::vector<std::string> >(
241 {
"RecoEgamma/ElectronIdentification/data/LowPtElectrons/RunII_Autumn18_LowPtElectrons_mva_id.xml.gz"});
242 desc.
add<std::vector<double> >(
"ModelThresholds", {-10.});
243 desc.
add<
bool>(
"PassThrough",
false);
244 desc.
add<
double>(
"MinPtThreshold", 0.5);
245 desc.
add<
double>(
"MaxPtThreshold", 15.);
246 descriptions.
add(
"lowPtGsfElectronID", desc);