CMS 3D CMS Logo

Functions
lowptgsfeleid Namespace Reference

Functions

std::vector< float > features_V0 (reco::GsfElectron const &ele, float rho, float unbiased)
 
std::vector< float > features_V1 (reco::GsfElectron const &ele, float rho, float unbiased, float field_z)
 
void findEnergeticClusters (reco::SuperCluster const &, int &, float &, float &, int &, int &)
 
void trackClusterMatching (reco::SuperCluster const &, reco::GsfTrack const &, bool const &, GlobalPoint const &, float &, float &, float &, float &, float &, float &, float &, float &, float &)
 

Function Documentation

◆ features_V0()

std::vector< float > lowptgsfeleid::features_V0 ( reco::GsfElectron const &  ele,
float  rho,
float  unbiased 
)

Definition at line 364 of file LowPtGsfElectronFeatures.cc.

364  {
365  float eid_rho = -999.;
366  float eid_sc_eta = -999.;
367  float eid_shape_full5x5_r9 = -999.;
368  float eid_sc_etaWidth = -999.;
369  float eid_sc_phiWidth = -999.;
370  float eid_shape_full5x5_HoverE = -999.;
371  float eid_trk_nhits = -999.;
372  float eid_trk_chi2red = -999.;
373  float eid_gsf_chi2red = -999.;
374  float eid_brem_frac = -999.;
375  float eid_gsf_nhits = -999.;
376  float eid_match_SC_EoverP = -999.;
377  float eid_match_eclu_EoverP = -999.;
378  float eid_match_SC_dEta = -999.;
379  float eid_match_SC_dPhi = -999.;
380  float eid_match_seed_dEta = -999.;
381  float eid_sc_E = -999.;
382  float eid_trk_p = -999.;
383  float gsf_mode_p = -999.;
384  float core_shFracHits = -999.;
385  float gsf_bdtout1 = -999.;
386  float gsf_dr = -999.;
387  float trk_dr = -999.;
388  float sc_Nclus = -999.;
389  float sc_clus1_nxtal = -999.;
390  float sc_clus1_dphi = -999.;
391  float sc_clus2_dphi = -999.;
392  float sc_clus1_deta = -999.;
393  float sc_clus2_deta = -999.;
394  float sc_clus1_E = -999.;
395  float sc_clus2_E = -999.;
396  float sc_clus1_E_ov_p = -999.;
397  float sc_clus2_E_ov_p = -999.;
398 
399  // KF tracks
400  if (ele.core().isNonnull()) {
401  const auto& trk = ele.closestCtfTrackRef(); // reco::TrackRef
402  if (trk.isNonnull()) {
403  eid_trk_p = (float)trk->p();
404  eid_trk_nhits = (float)trk->found();
405  eid_trk_chi2red = (float)trk->normalizedChi2();
406  TVector3 trkTV3(0, 0, 0);
407  trkTV3.SetPtEtaPhi(trk->pt(), trk->eta(), trk->phi());
408  TVector3 eleTV3(0, 0, 0);
409  eleTV3.SetPtEtaPhi(ele.pt(), ele.eta(), ele.phi());
410  trk_dr = eleTV3.DeltaR(trkTV3);
411  }
412  }
413 
414  // GSF tracks
415  if (ele.core().isNonnull()) {
416  const auto& gsf = ele.core()->gsfTrack(); // reco::GsfTrackRef
417  if (gsf.isNonnull()) {
418  gsf_mode_p = gsf->pMode();
419  eid_gsf_nhits = (float)gsf->found();
420  eid_gsf_chi2red = gsf->normalizedChi2();
421  TVector3 gsfTV3(0, 0, 0);
422  gsfTV3.SetPtEtaPhi(gsf->ptMode(), gsf->etaMode(), gsf->phiMode());
423  TVector3 eleTV3(0, 0, 0);
424  eleTV3.SetPtEtaPhi(ele.pt(), ele.eta(), ele.phi());
425  gsf_dr = eleTV3.DeltaR(gsfTV3);
426  }
427  }
428 
429  // Super clusters
430  if (ele.core().isNonnull()) {
431  const auto& sc = ele.core()->superCluster(); // reco::SuperClusterRef
432  if (sc.isNonnull()) {
433  eid_sc_E = sc->energy();
434  eid_sc_eta = sc->eta();
435  eid_sc_etaWidth = sc->etaWidth();
436  eid_sc_phiWidth = sc->phiWidth();
437  sc_Nclus = (float)sc->clustersSize();
438  }
439  }
440 
441  // Track-cluster matching
442  eid_match_seed_dEta = ele.deltaEtaSeedClusterTrackAtCalo();
443  eid_match_eclu_EoverP = (1. / ele.ecalEnergy()) - (1. / ele.p());
444  eid_match_SC_EoverP = ele.eSuperClusterOverP();
445  eid_match_SC_dEta = ele.deltaEtaSuperClusterTrackAtVtx();
446  eid_match_SC_dPhi = ele.deltaPhiSuperClusterTrackAtVtx();
447 
448  // Shower shape vars
449  eid_shape_full5x5_HoverE = ele.full5x5_hcalOverEcal();
450  eid_shape_full5x5_r9 = ele.full5x5_r9();
451 
452  // Misc
453  eid_rho = rho;
454 
455  eid_brem_frac = ele.fbrem();
456  core_shFracHits = (float)ele.shFracInnerHits();
457 
458  // Unbiased BDT from ElectronSeed
459  gsf_bdtout1 = unbiased;
460 
461  // Clusters
462  if (ele.core().isNonnull()) {
463  const auto& gsf = ele.core()->gsfTrack(); // reco::GsfTrackRef
464  if (gsf.isNonnull()) {
465  const auto& sc = ele.core()->superCluster(); // reco::SuperClusterRef
466  if (sc.isNonnull()) {
467  // Propagate electron track to ECAL surface
468  double mass2 = 0.000511 * 0.000511;
469  float p2 = pow(gsf->p(), 2);
470  float energy = sqrt(mass2 + p2);
471  math::XYZTLorentzVector mom = math::XYZTLorentzVector(gsf->px(), gsf->py(), gsf->pz(), energy);
472  math::XYZTLorentzVector pos = math::XYZTLorentzVector(gsf->vx(), gsf->vy(), gsf->vz(), 0.);
473  float field_z = 3.8;
474  BaseParticlePropagator mypart(RawParticle(mom, pos, gsf->charge()), 0, 0, field_z);
475  mypart.propagateToEcalEntrance(true); // true only first half loop , false more than one loop
476  bool reach_ECAL = mypart.getSuccess(); // 0 does not reach ECAL, 1 yes barrel, 2 yes endcaps
477 
478  // ECAL entry point for track
479  GlobalPoint ecal_pos(
480  mypart.particle().vertex().x(), mypart.particle().vertex().y(), mypart.particle().vertex().z());
481 
482  // Track-cluster matching for most energetic clusters
483  sc_clus1_nxtal = -999.;
484  sc_clus1_dphi = -999.;
485  sc_clus2_dphi = -999.;
486  sc_clus1_deta = -999.;
487  sc_clus2_deta = -999.;
488  sc_clus1_E = -999.;
489  sc_clus2_E = -999.;
490  sc_clus1_E_ov_p = -999.;
491  sc_clus2_E_ov_p = -999.;
493  *gsf,
494  reach_ECAL,
495  ecal_pos,
496  sc_clus1_nxtal,
497  sc_clus1_dphi,
498  sc_clus2_dphi,
499  sc_clus1_deta,
500  sc_clus2_deta,
501  sc_clus1_E,
502  sc_clus2_E,
503  sc_clus1_E_ov_p,
504  sc_clus2_E_ov_p);
505 
506  } // sc.isNonnull()
507  } // gsf.isNonnull()
508  } // clusters
509 
510  // Out-of-range
511  eid_sc_eta = std::clamp(eid_sc_eta, -5.f, 5.f);
512  eid_shape_full5x5_r9 = std::clamp(eid_shape_full5x5_r9, 0.f, 2.f);
513  eid_sc_etaWidth = std::clamp(eid_sc_etaWidth, 0.f, 3.14f);
514  eid_sc_phiWidth = std::clamp(eid_sc_phiWidth, 0.f, 3.14f);
515  eid_shape_full5x5_HoverE = std::clamp(eid_shape_full5x5_HoverE, 0.f, 50.f);
516  eid_trk_nhits = std::clamp(eid_trk_nhits, -1.f, 50.f);
517  eid_trk_chi2red = std::clamp(eid_trk_chi2red, -1.f, 50.f);
518  eid_gsf_chi2red = std::clamp(eid_gsf_chi2red, -1.f, 100.f);
519  if (eid_brem_frac < 0.)
520  eid_brem_frac = -1.; //
521  if (eid_brem_frac > 1.)
522  eid_brem_frac = 1.; //
523  eid_gsf_nhits = std::clamp(eid_gsf_nhits, -1.f, 50.f);
524  eid_match_SC_EoverP = std::clamp(eid_match_SC_EoverP, 0.f, 100.f);
525  eid_match_eclu_EoverP = std::clamp(eid_match_eclu_EoverP, -1.f, 1.f);
526  eid_match_SC_dEta = std::clamp(eid_match_SC_dEta, -10.f, 10.f);
527  eid_match_SC_dPhi = std::clamp(eid_match_SC_dPhi, -3.14f, 3.14f);
528  eid_match_seed_dEta = std::clamp(eid_match_seed_dEta, -10.f, 10.f);
529  eid_sc_E = std::clamp(eid_sc_E, 0.f, 1000.f);
530  eid_trk_p = std::clamp(eid_trk_p, -1.f, 1000.f);
531  gsf_mode_p = std::clamp(gsf_mode_p, 0.f, 1000.f);
532  core_shFracHits = std::clamp(core_shFracHits, 0.f, 1.f);
533  gsf_bdtout1 = std::clamp(gsf_bdtout1, -20.f, 20.f);
534  if (gsf_dr < 0.)
535  gsf_dr = 5.; //
536  if (gsf_dr > 5.)
537  gsf_dr = 5.; //
538  if (trk_dr < 0.)
539  trk_dr = 5.; //
540  if (trk_dr > 5.)
541  trk_dr = 5.; //
542  sc_Nclus = std::clamp(sc_Nclus, 0.f, 20.f);
543  sc_clus1_nxtal = std::clamp(sc_clus1_nxtal, 0.f, 100.f);
544  if (sc_clus1_dphi < -3.14)
545  sc_clus1_dphi = -5.; //
546  if (sc_clus1_dphi > 3.14)
547  sc_clus1_dphi = 5.; //
548  if (sc_clus2_dphi < -3.14)
549  sc_clus2_dphi = -5.; //
550  if (sc_clus2_dphi > 3.14)
551  sc_clus2_dphi = 5.; //
552  sc_clus1_deta = std::clamp(sc_clus1_deta, -5.f, 5.f);
553  sc_clus2_deta = std::clamp(sc_clus2_deta, -5.f, 5.f);
554  sc_clus1_E = std::clamp(sc_clus1_E, 0.f, 1000.f);
555  sc_clus2_E = std::clamp(sc_clus2_E, 0.f, 1000.f);
556  if (sc_clus1_E_ov_p < 0.)
557  sc_clus1_E_ov_p = -1.; //
558  if (sc_clus2_E_ov_p < 0.)
559  sc_clus2_E_ov_p = -1.; //
560 
561  // Set contents of vector
562  std::vector<float> output = {eid_rho,
563  eid_sc_eta,
564  eid_shape_full5x5_r9,
565  eid_sc_etaWidth,
566  eid_sc_phiWidth,
567  eid_shape_full5x5_HoverE,
568  eid_trk_nhits,
569  eid_trk_chi2red,
570  eid_gsf_chi2red,
571  eid_brem_frac,
572  eid_gsf_nhits,
573  eid_match_SC_EoverP,
574  eid_match_eclu_EoverP,
575  eid_match_SC_dEta,
576  eid_match_SC_dPhi,
577  eid_match_seed_dEta,
578  eid_sc_E,
579  eid_trk_p,
580  gsf_mode_p,
581  core_shFracHits,
582  gsf_bdtout1,
583  gsf_dr,
584  trk_dr,
585  sc_Nclus,
586  sc_clus1_nxtal,
587  sc_clus1_dphi,
588  sc_clus2_dphi,
589  sc_clus1_deta,
590  sc_clus2_deta,
591  sc_clus1_E,
592  sc_clus2_E,
593  sc_clus1_E_ov_p,
594  sc_clus2_E_ov_p};
595  return output;
596  }

References reco::GsfElectron::closestCtfTrackRef(), reco::GsfElectron::core(), reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::GsfElectron::ecalEnergy(), HCALHighEnergyHPDFilter_cfi::energy, reco::GsfElectron::eSuperClusterOverP(), reco::LeafCandidate::eta(), f, reco::GsfElectron::fbrem(), dqmMemoryStats::float, reco::GsfElectron::full5x5_hcalOverEcal(), reco::GsfElectron::full5x5_r9(), BaseParticlePropagator::getSuccess(), ntupleEnum::gsf, edm::Ref< C, T, F >::isNonnull(), convertSQLitetoXML_cfg::output, reco::LeafCandidate::p(), p2, BaseParticlePropagator::particle(), reco::LeafCandidate::phi(), funct::pow(), BaseParticlePropagator::propagateToEcalEntrance(), reco::LeafCandidate::pt(), reco::GsfElectron::shFracInnerHits(), mathSSE::sqrt(), trackClusterMatching(), lowPtElectrons_cff::unbiased, and RawParticle::vertex().

Referenced by LowPtGsfElectronIDProducer::eval().

◆ features_V1()

std::vector< float > lowptgsfeleid::features_V1 ( reco::GsfElectron const &  ele,
float  rho,
float  unbiased,
float  field_z 
)

Definition at line 135 of file LowPtGsfElectronFeatures.cc.

135  {
136  float eid_rho = -999.;
137  float eid_sc_eta = -999.;
138  float eid_shape_full5x5_r9 = -999.;
139  float eid_sc_etaWidth = -999.;
140  float eid_sc_phiWidth = -999.;
141  float eid_shape_full5x5_HoverE = -999.;
142  float eid_trk_nhits = -999.;
143  float eid_trk_chi2red = -999.;
144  float eid_gsf_chi2red = -999.;
145  float eid_brem_frac = -999.;
146  float eid_gsf_nhits = -999.;
147  float eid_match_SC_EoverP = -999.;
148  float eid_match_eclu_EoverP = -999.;
149  float eid_match_SC_dEta = -999.;
150  float eid_match_SC_dPhi = -999.;
151  float eid_match_seed_dEta = -999.;
152  float eid_sc_E = -999.;
153  float eid_trk_p = -999.;
154  float gsf_mode_p = -999.;
155  float core_shFracHits = -999.;
156  float gsf_bdtout1 = -999.;
157  float gsf_dr = -999.;
158  float trk_dr = -999.;
159  float sc_Nclus = -999.;
160  float sc_clus1_nxtal = -999.;
161  float sc_clus1_dphi = -999.;
162  float sc_clus2_dphi = -999.;
163  float sc_clus1_deta = -999.;
164  float sc_clus2_deta = -999.;
165  float sc_clus1_E = -999.;
166  float sc_clus2_E = -999.;
167  float sc_clus1_E_ov_p = -999.;
168  float sc_clus2_E_ov_p = -999.;
169 
170  // KF tracks
171  if (ele.core().isNonnull()) {
172  reco::TrackRef trk = ele.closestCtfTrackRef();
173  if (trk.isNonnull()) {
174  eid_trk_p = (float)trk->p();
175  eid_trk_nhits = (float)trk->found();
176  eid_trk_chi2red = (float)trk->normalizedChi2();
177  TVector3 trkTV3(0, 0, 0);
178  trkTV3.SetPtEtaPhi(trk->pt(), trk->eta(), trk->phi());
179  TVector3 eleTV3(0, 0, 0);
180  eleTV3.SetPtEtaPhi(ele.pt(), ele.eta(), ele.phi());
181  trk_dr = eleTV3.DeltaR(trkTV3);
182  }
183  }
184 
185  // GSF tracks
186  if (ele.core().isNonnull()) {
187  reco::GsfTrackRef gsf = ele.gsfTrack();
188  if (gsf.isNonnull()) {
189  gsf_mode_p = gsf->pMode();
190  eid_gsf_nhits = (float)gsf->found();
191  eid_gsf_chi2red = gsf->normalizedChi2();
192  TVector3 gsfTV3(0, 0, 0);
193  gsfTV3.SetPtEtaPhi(gsf->ptMode(), gsf->etaMode(), gsf->phiMode());
194  TVector3 eleTV3(0, 0, 0);
195  eleTV3.SetPtEtaPhi(ele.pt(), ele.eta(), ele.phi());
196  gsf_dr = eleTV3.DeltaR(gsfTV3);
197  }
198  }
199 
200  // Super clusters
201  if (ele.core().isNonnull()) {
202  reco::SuperClusterRef sc = ele.superCluster();
203  if (sc.isNonnull()) {
204  eid_sc_E = sc->energy();
205  eid_sc_eta = sc->eta();
206  eid_sc_etaWidth = sc->etaWidth();
207  eid_sc_phiWidth = sc->phiWidth();
208  sc_Nclus = sc->clustersSize();
209  }
210  }
211 
212  // Track-cluster matching
213  eid_match_seed_dEta = ele.deltaEtaSeedClusterTrackAtCalo();
214  eid_match_eclu_EoverP = (1. / ele.ecalEnergy()) - (1. / ele.p());
215  eid_match_SC_EoverP = ele.eSuperClusterOverP();
216  eid_match_SC_dEta = ele.deltaEtaSuperClusterTrackAtVtx();
217  eid_match_SC_dPhi = ele.deltaPhiSuperClusterTrackAtVtx();
218 
219  // Shower shape vars
220  eid_shape_full5x5_HoverE = ele.full5x5_hcalOverEcal();
221  eid_shape_full5x5_r9 = ele.full5x5_r9();
222 
223  // Misc
224  eid_rho = rho;
225 
226  eid_brem_frac = ele.fbrem();
227  core_shFracHits = ele.shFracInnerHits();
228 
229  // Unbiased BDT from ElectronSeed
230  gsf_bdtout1 = unbiased;
231 
232  // Clusters
233  if (ele.core().isNonnull()) {
234  reco::GsfTrackRef gsf = ele.gsfTrack();
235  if (gsf.isNonnull()) {
236  reco::SuperClusterRef sc = ele.superCluster();
237  if (sc.isNonnull()) {
238  // Propagate electron track to ECAL surface
239  double mass2 = 0.000511 * 0.000511;
240  float p2 = pow(gsf->p(), 2);
241  float energy = sqrt(mass2 + p2);
242  XYZTLorentzVector mom = XYZTLorentzVector(gsf->px(), gsf->py(), gsf->pz(), energy);
243  XYZTLorentzVector pos = XYZTLorentzVector(gsf->vx(), gsf->vy(), gsf->vz(), 0.);
244  BaseParticlePropagator propagator(RawParticle(mom, pos, gsf->charge()), 0, 0, field_z);
245  propagator.propagateToEcalEntrance(true); // true only first half loop , false more than one loop
246  bool reach_ECAL = propagator.getSuccess(); // 0 does not reach ECAL, 1 yes barrel, 2 yes endcaps
247  // ECAL entry point for track
248  GlobalPoint ecal_pos(propagator.particle().x(), propagator.particle().y(), propagator.particle().z());
249 
250  // Track-cluster matching for most energetic clusters
251  sc_clus1_nxtal = -999;
252  sc_clus1_dphi = -999.;
253  sc_clus2_dphi = -999.;
254  sc_clus1_deta = -999.;
255  sc_clus2_deta = -999.;
256  sc_clus1_E = -999.;
257  sc_clus2_E = -999.;
258  sc_clus1_E_ov_p = -999.;
259  sc_clus2_E_ov_p = -999.;
261  *gsf,
262  reach_ECAL,
263  ecal_pos,
264  sc_clus1_nxtal,
265  sc_clus1_dphi,
266  sc_clus2_dphi,
267  sc_clus1_deta,
268  sc_clus2_deta,
269  sc_clus1_E,
270  sc_clus2_E,
271  sc_clus1_E_ov_p,
272  sc_clus2_E_ov_p);
273  sc_clus1_nxtal = (int)sc_clus1_nxtal;
274 
275  } // sc.isNonnull()
276  } // gsf.isNonnull()
277  } // clusters
278 
279  // Out-of-range
280  eid_rho = std::clamp(eid_rho, 0.f, 100.f);
281  eid_sc_eta = std::clamp(eid_sc_eta, -5.f, 5.f);
282  eid_shape_full5x5_r9 = std::clamp(eid_shape_full5x5_r9, 0.f, 2.f);
283  eid_sc_etaWidth = std::clamp(eid_sc_etaWidth, 0.f, 3.14f);
284  eid_sc_phiWidth = std::clamp(eid_sc_phiWidth, 0.f, 3.14f);
285  eid_shape_full5x5_HoverE = std::clamp(eid_shape_full5x5_HoverE, 0.f, 50.f);
286  eid_trk_nhits = std::clamp(eid_trk_nhits, -1.f, 50.f);
287  eid_trk_chi2red = std::clamp(eid_trk_chi2red, -1.f, 50.f);
288  eid_gsf_chi2red = std::clamp(eid_gsf_chi2red, -1.f, 100.f);
289  if (eid_brem_frac < 0.)
290  eid_brem_frac = -1.; //
291  if (eid_brem_frac > 1.)
292  eid_brem_frac = 1.; //
293  eid_gsf_nhits = std::clamp(eid_gsf_nhits, -1.f, 50.f);
294  eid_match_SC_EoverP = std::clamp(eid_match_SC_EoverP, 0.f, 100.f);
295  eid_match_eclu_EoverP = std::clamp(eid_match_eclu_EoverP, -1.f, 1.f);
296  eid_match_SC_dEta = std::clamp(eid_match_SC_dEta, -10.f, 10.f);
297  eid_match_SC_dPhi = std::clamp(eid_match_SC_dPhi, -3.14f, 3.14f);
298  eid_match_seed_dEta = std::clamp(eid_match_seed_dEta, -10.f, 10.f);
299  eid_sc_E = std::clamp(eid_sc_E, 0.f, 1000.f);
300  eid_trk_p = std::clamp(eid_trk_p, -1.f, 1000.f);
301  gsf_mode_p = std::clamp(gsf_mode_p, 0.f, 1000.f);
302  core_shFracHits = std::clamp(core_shFracHits, 0.f, 1.f);
303  gsf_bdtout1 = std::clamp(gsf_bdtout1, -20.f, 20.f);
304  if (gsf_dr < 0.)
305  gsf_dr = 5.; //
306  if (gsf_dr > 5.)
307  gsf_dr = 5.; //
308  if (trk_dr < 0.)
309  trk_dr = 5.; //
310  if (trk_dr > 5.)
311  trk_dr = 5.; //
312  sc_Nclus = std::clamp(sc_Nclus, 0.f, 20.f);
313  sc_clus1_nxtal = std::clamp(sc_clus1_nxtal, 0.f, 100.f);
314  sc_clus1_dphi = std::clamp(sc_clus1_dphi, -3.14f, 3.14f);
315  sc_clus2_dphi = std::clamp(sc_clus2_dphi, -3.14f, 3.14f);
316  sc_clus1_deta = std::clamp(sc_clus1_deta, -5.f, 5.f);
317  sc_clus2_deta = std::clamp(sc_clus2_deta, -5.f, 5.f);
318  sc_clus1_E = std::clamp(sc_clus1_E, 0.f, 1000.f);
319  sc_clus2_E = std::clamp(sc_clus2_E, 0.f, 1000.f);
320  if (sc_clus1_E_ov_p < 0.)
321  sc_clus1_E_ov_p = -1.; //
322  if (sc_clus2_E_ov_p < 0.)
323  sc_clus2_E_ov_p = -1.; //
324 
325  // Set contents of vector
326  std::vector<float> output = {eid_rho,
327  eid_sc_eta,
328  eid_shape_full5x5_r9,
329  eid_sc_etaWidth,
330  eid_sc_phiWidth,
331  eid_shape_full5x5_HoverE,
332  eid_trk_nhits,
333  eid_trk_chi2red,
334  eid_gsf_chi2red,
335  eid_brem_frac,
336  eid_gsf_nhits,
337  eid_match_SC_EoverP,
338  eid_match_eclu_EoverP,
339  eid_match_SC_dEta,
340  eid_match_SC_dPhi,
341  eid_match_seed_dEta,
342  eid_sc_E,
343  eid_trk_p,
344  gsf_mode_p,
345  core_shFracHits,
346  gsf_bdtout1,
347  gsf_dr,
348  trk_dr,
349  sc_Nclus,
350  sc_clus1_nxtal,
351  sc_clus1_dphi,
352  sc_clus2_dphi,
353  sc_clus1_deta,
354  sc_clus2_deta,
355  sc_clus1_E,
356  sc_clus2_E,
357  sc_clus1_E_ov_p,
358  sc_clus2_E_ov_p};
359  return output;
360  }

References reco::GsfElectron::closestCtfTrackRef(), reco::GsfElectron::core(), reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::GsfElectron::ecalEnergy(), HCALHighEnergyHPDFilter_cfi::energy, reco::GsfElectron::eSuperClusterOverP(), reco::LeafCandidate::eta(), f, reco::GsfElectron::fbrem(), dqmMemoryStats::float, reco::GsfElectron::full5x5_hcalOverEcal(), reco::GsfElectron::full5x5_r9(), ntupleEnum::gsf, reco::GsfElectron::gsfTrack(), createfilelist::int, edm::Ref< C, T, F >::isNonnull(), convertSQLitetoXML_cfg::output, reco::LeafCandidate::p(), p2, reco::LeafCandidate::phi(), funct::pow(), TrackCandidateProducer_cfi::propagator, reco::LeafCandidate::pt(), reco::GsfElectron::shFracInnerHits(), mathSSE::sqrt(), reco::GsfElectron::superCluster(), trackClusterMatching(), and lowPtElectrons_cff::unbiased.

Referenced by LowPtGsfElectronIDProducer::eval().

◆ findEnergeticClusters()

void lowptgsfeleid::findEnergeticClusters ( reco::SuperCluster const &  sc,
int &  clusNum,
float &  maxEne1,
float &  maxEne2,
int &  i1,
int &  i2 
)

Definition at line 600 of file LowPtGsfElectronFeatures.cc.

601  {
602  if (sc.clustersSize() > 0 && sc.clustersBegin() != sc.clustersEnd()) {
603  for (auto const& cluster : sc.clusters()) {
604  if (cluster->energy() > maxEne1) {
605  maxEne1 = cluster->energy();
606  i1 = clusNum;
607  }
608  clusNum++;
609  }
610  if (sc.clustersSize() > 1) {
611  clusNum = 0;
612  for (auto const& cluster : sc.clusters()) {
613  if (clusNum != i1) {
614  if (cluster->energy() > maxEne2) {
615  maxEne2 = cluster->energy();
616  i2 = clusNum;
617  }
618  }
619  clusNum++;
620  }
621  }
622  } // loop over clusters
623  }

References reco::SuperCluster::clusters(), reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), reco::SuperCluster::clustersSize(), testProducerWithPsetDescEmpty_cfi::i1, and testProducerWithPsetDescEmpty_cfi::i2.

Referenced by trackClusterMatching().

◆ trackClusterMatching()

void lowptgsfeleid::trackClusterMatching ( reco::SuperCluster const &  sc,
reco::GsfTrack const &  gsf,
bool const &  reach_ECAL,
GlobalPoint const &  ecal_pos,
float &  sc_clus1_nxtal,
float &  sc_clus1_dphi,
float &  sc_clus2_dphi,
float &  sc_clus1_deta,
float &  sc_clus2_deta,
float &  sc_clus1_E,
float &  sc_clus2_E,
float &  sc_clus1_E_ov_p,
float &  sc_clus2_E_ov_p 
)

Definition at line 627 of file LowPtGsfElectronFeatures.cc.

639  {
640  // Iterate through ECAL clusters and sort in energy
641  int clusNum = 0;
642  float maxEne1 = -1;
643  float maxEne2 = -1;
644  int i1 = -1;
645  int i2 = -1;
646  findEnergeticClusters(sc, clusNum, maxEne1, maxEne2, i1, i2);
647 
648  // track-clusters match
649  clusNum = 0;
650  if (sc.clustersSize() > 0 && sc.clustersBegin() != sc.clustersEnd()) {
651  for (auto const& cluster : sc.clusters()) {
652  float deta = ecal_pos.eta() - cluster->eta();
653  float dphi = reco::deltaPhi(ecal_pos.phi(), cluster->phi());
654  if (clusNum == i1) {
655  sc_clus1_E = cluster->energy();
656  if (gsf.pMode() > 0)
657  sc_clus1_E_ov_p = cluster->energy() / gsf.pMode();
658  sc_clus1_nxtal = (float)cluster->size();
659  if (reach_ECAL > 0) {
660  sc_clus1_deta = deta;
661  sc_clus1_dphi = dphi;
662  }
663  } else if (clusNum == i2) {
664  sc_clus2_E = cluster->energy();
665  if (gsf.pMode() > 0)
666  sc_clus2_E_ov_p = cluster->energy() / gsf.pMode();
667  if (reach_ECAL > 0) {
668  sc_clus2_deta = deta;
669  sc_clus2_dphi = dphi;
670  }
671  }
672  clusNum++;
673  }
674  }
675  }

References reco::SuperCluster::clusters(), reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), reco::SuperCluster::clustersSize(), reco::deltaPhi(), PV3DBase< T, PVType, FrameType >::eta(), findEnergeticClusters(), dqmMemoryStats::float, ntupleEnum::gsf, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, PV3DBase< T, PVType, FrameType >::phi(), and Geom::Phi< T1, Range >::phi().

Referenced by features_V0(), and features_V1().

testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
RawParticle
Definition: RawParticle.h:37
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
pos
Definition: PixelAliasList.h:18
ZElectronSkim_cff.rho
rho
Definition: ZElectronSkim_cff.py:38
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
lowptgsfeleid::findEnergeticClusters
void findEnergeticClusters(reco::SuperCluster const &, int &, float &, float &, int &, int &)
Definition: LowPtGsfElectronFeatures.cc:600
XYZTLorentzVector
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25
BaseParticlePropagator
Definition: BaseParticlePropagator.h:82
edm::Ref< TrackCollection >
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
p2
double p2[4]
Definition: TauolaWrapper.h:90
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
lowptgsfeleid::trackClusterMatching
void trackClusterMatching(reco::SuperCluster const &, reco::GsfTrack const &, bool const &, GlobalPoint const &, float &, float &, float &, float &, float &, float &, float &, float &, float &)
Definition: LowPtGsfElectronFeatures.cc:627
Point3DBase< float, GlobalTag >
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
createfilelist.int
int
Definition: createfilelist.py:10
ntupleEnum.gsf
gsf
Definition: ntupleEnum.py:48
lowPtElectrons_cff.unbiased
unbiased
Definition: lowPtElectrons_cff.py:35
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29