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 363 of file LowPtGsfElectronFeatures.cc.

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

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(), lowPtElectronProducer_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 134 of file LowPtGsfElectronFeatures.cc.

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

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, 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(), trackClusterMatching(), and lowPtElectronProducer_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 599 of file LowPtGsfElectronFeatures.cc.

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

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 626 of file LowPtGsfElectronFeatures.cc.

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

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:599
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:626
Point3DBase< float, GlobalTag >
lowPtElectronProducer_cff.unbiased
unbiased
Definition: lowPtElectronProducer_cff.py:24
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:49
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