133 float eid_rho = -999.;
134 float eid_sc_eta = -999.;
135 float eid_shape_full5x5_r9 = -999.;
136 float eid_sc_etaWidth = -999.;
137 float eid_sc_phiWidth = -999.;
138 float eid_shape_full5x5_HoverE = -999.;
139 float eid_trk_nhits = -999.;
140 float eid_trk_chi2red = -999.;
141 float eid_gsf_chi2red = -999.;
142 float eid_brem_frac = -999.;
143 float eid_gsf_nhits = -999.;
144 float eid_match_SC_EoverP = -999.;
145 float eid_match_eclu_EoverP = -999.;
146 float eid_match_SC_dEta = -999.;
147 float eid_match_SC_dPhi = -999.;
148 float eid_match_seed_dEta = -999.;
149 float eid_sc_E = -999.;
150 float eid_trk_p = -999.;
151 float gsf_mode_p = -999.;
152 float core_shFracHits = -999.;
153 float gsf_bdtout1 = -999.;
154 float gsf_dr = -999.;
155 float trk_dr = -999.;
156 float sc_Nclus = -999.;
157 float sc_clus1_nxtal = -999.;
158 float sc_clus1_dphi = -999.;
159 float sc_clus2_dphi = -999.;
160 float sc_clus1_deta = -999.;
161 float sc_clus2_deta = -999.;
162 float sc_clus1_E = -999.;
163 float sc_clus2_E = -999.;
164 float sc_clus1_E_ov_p = -999.;
165 float sc_clus2_E_ov_p = -999.;
170 if (trk.isNonnull()) {
171 eid_trk_p = (
float)trk->p();
172 eid_trk_nhits = (
float)trk->found();
173 eid_trk_chi2red = (
float)trk->normalizedChi2();
174 TVector3 trkTV3(0, 0, 0);
175 trkTV3.SetPtEtaPhi(trk->pt(), trk->eta(), trk->phi());
176 TVector3 eleTV3(0, 0, 0);
177 eleTV3.SetPtEtaPhi(ele->
pt(), ele->
eta(), ele->
phi());
178 trk_dr = eleTV3.DeltaR(trkTV3);
184 const auto&
gsf = ele->
core()->gsfTrack();
185 if (
gsf.isNonnull()) {
186 gsf_mode_p =
gsf->pMode();
187 eid_gsf_nhits = (
float)
gsf->found();
188 eid_gsf_chi2red =
gsf->normalizedChi2();
189 TVector3 gsfTV3(0, 0, 0);
190 gsfTV3.SetPtEtaPhi(
gsf->ptMode(),
gsf->etaMode(),
gsf->phiMode());
191 TVector3 eleTV3(0, 0, 0);
192 eleTV3.SetPtEtaPhi(ele->
pt(), ele->
eta(), ele->
phi());
193 gsf_dr = eleTV3.DeltaR(gsfTV3);
199 const auto& sc = ele->
core()->superCluster();
200 if (sc.isNonnull()) {
201 eid_sc_E = sc->energy();
202 eid_sc_eta = sc->eta();
203 eid_sc_etaWidth = sc->etaWidth();
204 eid_sc_phiWidth = sc->phiWidth();
205 sc_Nclus = (
float)sc->clustersSize();
212 eid_match_eclu_EoverP = (1. / ele->
ecalEnergy()) - (1. / ele->
p());
228 eid_brem_frac = ele->
fbrem();
233 gsf_bdtout1 = unbiased;
237 const auto&
gsf = ele->
core()->gsfTrack();
238 if (
gsf.isNonnull()) {
239 const auto& sc = ele->
core()->superCluster();
240 if (sc.isNonnull()) {
242 double mass_ = 0.000511 * 0.000511;
249 mypart.propagateToEcalEntrance(
true);
250 bool reach_ECAL = mypart.getSuccess();
254 mypart.particle().vertex().x(), mypart.particle().vertex().y(), mypart.particle().vertex().z());
263 if (sc->clustersSize() > 0 && sc->clustersBegin() != sc->clustersEnd()) {
264 for (
const auto& cluster : sc->clusters()) {
265 if (cluster->energy() > maxEne1) {
266 maxEne1 = cluster->energy();
271 if (sc->clustersSize() > 1) {
273 for (
const auto& cluster : sc->clusters()) {
275 if (cluster->energy() > maxEne2) {
276 maxEne2 = cluster->energy();
285 edm::LogError(
"SuperClusters") <<
"Problem accessing SC constituent clusters:"
286 <<
" clusNum=" << clusNum <<
" clustersSize=" << sc->clustersSize()
287 <<
" energy=" << sc->energy() << std::endl;
291 sc_clus1_nxtal = -999.;
292 sc_clus1_dphi = -999.;
293 sc_clus2_dphi = -999.;
294 sc_clus1_deta = -999.;
295 sc_clus2_deta = -999.;
298 sc_clus1_E_ov_p = -999.;
299 sc_clus2_E_ov_p = -999.;
304 if (sc->clustersSize() > 0 && sc->clustersBegin() != sc->clustersEnd()) {
305 for (
const auto& cluster : sc->clusters()) {
306 float deta = std::fabs(ecal_pos.eta() - cluster->eta());
307 float dphi = std::fabs(ecal_pos.phi() - cluster->phi());
310 if (ecal_pos.phi() - cluster->phi() < 0)
312 if (ecal_pos.eta() - cluster->eta() < 0)
316 sc_clus1_E = cluster->energy();
317 if (
gsf->pMode() > 0)
318 sc_clus1_E_ov_p = cluster->energy() /
gsf->pMode();
319 sc_clus1_nxtal = (
float)cluster->size();
320 if (reach_ECAL > 0) {
321 sc_clus1_deta = deta;
322 sc_clus1_dphi = dphi;
324 }
else if (clusNum ==
i2) {
325 sc_clus2_E = cluster->energy();
326 if (
gsf->pMode() > 0)
327 sc_clus2_E_ov_p = cluster->energy() /
gsf->pMode();
328 if (reach_ECAL > 0) {
329 sc_clus2_deta = deta;
330 sc_clus2_dphi = dphi;
337 edm::LogError(
"SuperClusters") <<
"Problem with track-cluster matching" << std::endl;
352 if (eid_shape_full5x5_r9 < 0)
353 eid_shape_full5x5_r9 = 0;
354 if (eid_shape_full5x5_r9 > 2)
355 eid_shape_full5x5_r9 = 2;
356 if (eid_sc_etaWidth < 0)
358 if (eid_sc_etaWidth > 3.14)
359 eid_sc_etaWidth = 3.14;
360 if (eid_sc_phiWidth < 0)
362 if (eid_sc_phiWidth > 3.14)
363 eid_sc_phiWidth = 3.14;
364 if (eid_shape_full5x5_HoverE < 0)
365 eid_shape_full5x5_HoverE = 0;
366 if (eid_shape_full5x5_HoverE > 50)
367 eid_shape_full5x5_HoverE = 50;
368 if (eid_trk_nhits < -1)
370 if (eid_trk_nhits > 50)
372 if (eid_trk_chi2red < -1)
373 eid_trk_chi2red = -1;
374 if (eid_trk_chi2red > 50)
375 eid_trk_chi2red = 50;
376 if (eid_gsf_chi2red < -1)
377 eid_gsf_chi2red = -1;
378 if (eid_gsf_chi2red > 100)
379 eid_gsf_chi2red = 100;
380 if (eid_brem_frac < 0)
382 if (eid_brem_frac > 1)
384 if (eid_gsf_nhits < -1)
386 if (eid_gsf_nhits > 50)
388 if (eid_match_SC_EoverP < 0)
389 eid_match_SC_EoverP = 0;
390 if (eid_match_SC_EoverP > 100)
391 eid_match_SC_EoverP = 100;
392 if (eid_match_eclu_EoverP < -1.)
393 eid_match_eclu_EoverP = -1.;
394 if (eid_match_eclu_EoverP > 1.)
395 eid_match_eclu_EoverP = 1.;
396 if (eid_match_SC_dEta < -10)
397 eid_match_SC_dEta = -10;
398 if (eid_match_SC_dEta > 10)
399 eid_match_SC_dEta = 10;
400 if (eid_match_SC_dPhi < -3.14)
401 eid_match_SC_dPhi = -3.14;
402 if (eid_match_SC_dPhi > 3.14)
403 eid_match_SC_dPhi = 3.14;
404 if (eid_match_seed_dEta < -10)
405 eid_match_seed_dEta = -10;
406 if (eid_match_seed_dEta > 10)
407 eid_match_seed_dEta = 10;
414 if (eid_trk_p > 1000)
418 if (gsf_mode_p > 1000)
420 if (core_shFracHits < 0)
422 if (core_shFracHits > 1)
424 if (gsf_bdtout1 < -20)
426 if (gsf_bdtout1 > 20)
440 if (sc_clus1_nxtal < 0)
442 if (sc_clus1_nxtal > 100)
443 sc_clus1_nxtal = 100;
444 if (sc_clus1_dphi < -3.14)
446 if (sc_clus1_dphi > 3.14)
448 if (sc_clus2_dphi < -3.14)
450 if (sc_clus2_dphi > 3.14)
452 if (sc_clus1_deta < -5)
454 if (sc_clus1_deta > 5)
456 if (sc_clus2_deta < -5)
458 if (sc_clus2_deta > 5)
462 if (sc_clus1_E > 1000)
466 if (sc_clus2_E > 1000)
468 if (sc_clus1_E_ov_p < 0)
469 sc_clus1_E_ov_p = -1;
470 if (sc_clus2_E_ov_p < 0)
471 sc_clus2_E_ov_p = -1;
474 std::vector<float>
output = {eid_rho,
476 eid_shape_full5x5_r9,
479 eid_shape_full5x5_HoverE,
486 eid_match_eclu_EoverP,