CMS 3D CMS Logo

GsfElectronAlgo.cc
Go to the documentation of this file.
34 
35 
36 #include <Math/Point3D.h>
37 #include <sstream>
38 #include <algorithm>
39 
40 
41 using namespace edm ;
42 using namespace reco ;
43 
44 
46  : cacheIDGeom(0), cacheIDTopo(0), cacheIDTDGeom(0), cacheIDMagField(0),
47  cacheSevLevel(0), mtsTransform(nullptr), constraintAtVtx(nullptr)
48  {}
49 
51  ( const reco::TrackRef & ctfTrack, const reco::GsfTrackRef & gsfTrack )
52  {
53  if ((!originalCtfTrackCollectionRetreived)&&(ctfTrack.isNonnull()))
54  {
55  event->get(ctfTrack.id(),originalCtfTracks) ;
56  originalCtfTrackCollectionRetreived = true ;
57  }
58  if ((!originalGsfTrackCollectionRetreived)&&(gsfTrack.isNonnull()))
59  {
60  event->get(gsfTrack.id(),originalGsfTracks) ;
61  originalGsfTrackCollectionRetreived = true ;
62  }
63  }
64 
65 
68  const reco::BeamSpot & bs )
69  : coreRef(core),
70  gsfTrackRef(coreRef->gsfTrack()),
71  superClusterRef(coreRef->superCluster()),
72  ctfTrackRef(coreRef->ctfTrack()), shFracInnerHits(coreRef->ctfGsfOverlap()),
73  beamSpot(bs)
74  {}
75 
76 
79  {
80  // determine charge from SC
81  GlobalPoint orig, scpos ;
82  ele_convert(beamSpot.position(),orig) ;
83  ele_convert(superClusterRef->position(),scpos) ;
84  GlobalVector scvect(scpos-orig) ;
85  GlobalPoint inntkpos = innTSOS.globalPosition() ;
86  GlobalVector inntkvect = GlobalVector(inntkpos-orig) ;
87  float dPhiInnEle=normalizedPhi(scvect.barePhi()-inntkvect.barePhi()) ;
88  if(dPhiInnEle>0) info.scPixCharge = -1 ;
89  else info.scPixCharge = 1 ;
90 
91  // flags
92  int chargeGsf = gsfTrackRef->charge() ;
93  info.isGsfScPixConsistent = ((chargeGsf*info.scPixCharge)>0) ;
94  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull()&&((chargeGsf*ctfTrackRef->charge())>0)) ;
96 
97  // default charge
98  if (info.isGsfScPixConsistent||ctfTrackRef.isNull())
99  { charge = info.scPixCharge ; }
100  else
101  { charge = ctfTrackRef->charge() ; }
102  }
103 
105  {
106  CaloClusterPtr eleRef ;
107  TrajectoryStateOnSurface tempTSOS ;
108  TrajectoryStateOnSurface outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef) ;
109  float dphimin = 1.e30 ;
110  for(auto const& bc : superClusterRef->clusters())
111  {
112  GlobalPoint posclu(bc->position().x(),bc->position().y(),bc->position().z()) ;
113  tempTSOS = mtsTransform.extrapolatedState(outTSOS,posclu) ;
114  if (!tempTSOS.isValid()) tempTSOS=outTSOS ;
115  GlobalPoint extrap = tempTSOS.globalPosition() ;
116  float dphi = EleRelPointPair(posclu,extrap,beamSpot.position()).dPhi() ;
117  if (std::abs(dphi)<dphimin)
118  {
119  dphimin = std::abs(dphi) ;
120  eleRef = bc;
121  eleTSOS = tempTSOS ;
122  }
123  }
124  return eleRef ;
125  }
126 
129  {
130  //at innermost point
131  innTSOS = mtsTransform.innerStateOnSurface(*gsfTrackRef);
132  if (!innTSOS.isValid()) return false;
133 
134  //at vertex
135  // innermost state propagation to the beam spot position
136  GlobalPoint bsPos ;
137  ele_convert(beamSpot.position(),bsPos) ;
138  vtxTSOS = mtsTransform.extrapolatedState(innTSOS,bsPos) ;
139  if (!vtxTSOS.isValid()) vtxTSOS=innTSOS;
140 
141  //at seed
142  outTSOS = mtsTransform.outerStateOnSurface(*gsfTrackRef);
143  if (!outTSOS.isValid()) return false;
144 
145  // TrajectoryStateOnSurface seedTSOS
146  seedTSOS = mtsTransform.extrapolatedState(outTSOS,
147  GlobalPoint(superClusterRef->seed()->position().x(),
148  superClusterRef->seed()->position().y(),
149  superClusterRef->seed()->position().z()));
150  if (!seedTSOS.isValid()) seedTSOS=outTSOS;
151 
152  // at scl
153  sclTSOS = mtsTransform.extrapolatedState(innTSOS,GlobalPoint(superClusterRef->x(),superClusterRef->y(),superClusterRef->z()));
154  if (!sclTSOS.isValid()) sclTSOS=outTSOS;
155 
156  // constrained momentum
157  constrainedVtxTSOS = constraintAtVtx.constrainAtBeamSpot(*gsfTrackRef,beamSpot);
158 
159  return true ;
160  }
161 
163  {
176  multiTrajectoryStateMode::momentumFromModeCartesian(constrainedVtxTSOS,vtxMomWithConstraint);
177  }
178 
180  {
181  double scale = superClusterRef->energy()/vtxMom.mag() ;
183  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
184  superClusterRef->energy() ) ;
185  }
186 
189  EventData const& eventData)
190 {
191  const reco::CaloCluster & seedCluster = *(theClus->seed()) ;
192  DetId seedXtalId = seedCluster.seed();
193  int detector = seedXtalId.subdetId();
194  const EcalRecHitCollection* ecalRecHits = nullptr ;
195  if (detector==EcalBarrel)
196  ecalRecHits = eventData.barrelRecHits.product() ;
197  else
198  ecalRecHits = eventData.endcapRecHits.product() ;
199 
200  int nSaturatedXtals = 0;
201  bool isSeedSaturated = false;
202  for (auto&& hitFractionPair : theClus->hitsAndFractions()) {
203  auto&& ecalRecHit = ecalRecHits->find(hitFractionPair.first);
204  if (ecalRecHit == ecalRecHits->end()) continue;
205  if (ecalRecHit->checkFlag(EcalRecHit::Flags::kSaturated)) {
206  nSaturatedXtals++;
207  if (seedXtalId == ecalRecHit->detid())
208  isSeedSaturated = true;
209  }
210  }
211  si.nSaturatedXtals = nSaturatedXtals;
212  si.isSeedSaturated = isSeedSaturated;
213 
214 }
215 
216 template<bool full5x5>
218  ElectronHcalHelper const& hcalHelper,
219  reco::GsfElectron::ShowerShape & showerShape,
220  EventData const& eventData)
221  {
222 
223  using ClusterTools = EcalClusterToolsT<full5x5>;
224 
225  const reco::CaloCluster & seedCluster = *(theClus->seed()) ;
226  // temporary, till CaloCluster->seed() is made available
227  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
228  int detector = seedXtalId.subdetId() ;
229 
232  const EcalRecHitCollection * recHits = nullptr ;
233  std::vector<int> recHitFlagsToBeExcluded ;
234  std::vector<int> recHitSeverityToBeExcluded ;
235  if (detector==EcalBarrel)
236  {
237  recHits = eventData.barrelRecHits.product() ;
238  recHitFlagsToBeExcluded = generalData_.recHitsCfg.recHitFlagsToBeExcludedBarrel ;
239  recHitSeverityToBeExcluded = generalData_.recHitsCfg.recHitSeverityToBeExcludedBarrel ;
240  }
241  else
242  {
243  recHits = eventData.endcapRecHits.product() ;
244  recHitFlagsToBeExcluded = generalData_.recHitsCfg.recHitFlagsToBeExcludedEndcaps ;
245  recHitSeverityToBeExcluded = generalData_.recHitsCfg.recHitSeverityToBeExcludedEndcaps ;
246  }
247 
248  std::vector<float> covariances = ClusterTools::covariances(seedCluster,recHits,topology,geometry) ;
249  std::vector<float> localCovariances = ClusterTools::localCovariances(seedCluster,recHits,topology) ;
250  showerShape.sigmaEtaEta = sqrt(covariances[0]) ;
251  showerShape.sigmaIetaIeta = sqrt(localCovariances[0]) ;
252  if (!edm::isNotFinite(localCovariances[2])) showerShape.sigmaIphiIphi = sqrt(localCovariances[2]) ;
253  showerShape.e1x5 = ClusterTools::e1x5(seedCluster,recHits,topology) ;
254  showerShape.e2x5Max = ClusterTools::e2x5Max(seedCluster,recHits,topology) ;
255  showerShape.e5x5 = ClusterTools::e5x5(seedCluster,recHits,topology) ;
256  showerShape.r9 = ClusterTools::e3x3(seedCluster,recHits,topology)/theClus->rawEnergy() ;
257 
258  const float scale = full5x5 ? showerShape.e5x5 : theClus->energy();
259 
260  showerShape.hcalDepth1OverEcal = hcalHelper.hcalESumDepth1(*theClus)/theClus->energy() ;
261  showerShape.hcalDepth2OverEcal = hcalHelper.hcalESumDepth2(*theClus)/theClus->energy() ;
262  showerShape.hcalTowersBehindClusters = hcalHelper.hcalTowersBehindClusters(*theClus) ;
265  showerShape.invalidHcal = (showerShape.hcalDepth1OverEcalBc == 0 &&
266  showerShape.hcalDepth2OverEcalBc == 0 &&
267  !hcalHelper.hasActiveHcal(*theClus));
268 
269  // extra shower shapes
270  const float see_by_spp = showerShape.sigmaIetaIeta*showerShape.sigmaIphiIphi;
271  if( see_by_spp > 0 ) {
272  showerShape.sigmaIetaIphi = localCovariances[1] / see_by_spp;
273  } else if ( localCovariances[1] > 0 ) {
274  showerShape.sigmaIetaIphi = 1.f;
275  } else {
276  showerShape.sigmaIetaIphi = -1.f;
277  }
278  showerShape.eMax = ClusterTools::eMax(seedCluster,recHits);
279  showerShape.e2nd = ClusterTools::e2nd(seedCluster,recHits);
280  showerShape.eTop = ClusterTools::eTop(seedCluster,recHits,topology);
281  showerShape.eLeft = ClusterTools::eLeft(seedCluster,recHits,topology);
282  showerShape.eRight = ClusterTools::eRight(seedCluster,recHits,topology);
283  showerShape.eBottom = ClusterTools::eBottom(seedCluster,recHits,topology);
284 
285  showerShape.e2x5Left = ClusterTools::e2x5Left(seedCluster,recHits,topology);
286  showerShape.e2x5Right = ClusterTools::e2x5Right(seedCluster,recHits,topology);
287  showerShape.e2x5Top = ClusterTools::e2x5Top(seedCluster,recHits,topology);
288  showerShape.e2x5Bottom = ClusterTools::e2x5Bottom(seedCluster,recHits,topology);
289  }
290 
291 
292 //===================================================================
293 // GsfElectronAlgo
294 //===================================================================
295 
297  ( const InputTagsConfiguration & inputCfg,
298  const StrategyConfiguration & strategyCfg,
299  const CutsConfiguration & cutsCfg,
300  const CutsConfiguration & cutsCfgPflow,
301  const ElectronHcalHelper::Configuration & hcalCfg,
302  const ElectronHcalHelper::Configuration & hcalCfgPflow,
303  const IsolationConfiguration & isoCfg,
304  const EcalRecHitsConfiguration & recHitsCfg,
305  EcalClusterFunctionBaseClass * superClusterErrorFunction,
306  EcalClusterFunctionBaseClass * crackCorrectionFunction,
307  const RegressionHelper::Configuration & regCfg,
308  const edm::ParameterSet& tkIsol03Cfg,
309  const edm::ParameterSet& tkIsol04Cfg,
310  const edm::ParameterSet& tkIsolHEEP03Cfg,
311  const edm::ParameterSet& tkIsolHEEP04Cfg
312 
313  )
314 : generalData_{inputCfg,strategyCfg,cutsCfg,cutsCfgPflow,isoCfg,recHitsCfg,hcalCfg,hcalCfgPflow,superClusterErrorFunction,crackCorrectionFunction,regCfg},
315  eventSetupData_{},
316  tkIsol03Calc_(tkIsol03Cfg),tkIsol04Calc_(tkIsol04Cfg),
317  tkIsolHEEP03Calc_(tkIsolHEEP03Cfg),tkIsolHEEP04Calc_(tkIsolHEEP04Cfg)
318 
319  {}
320 
322  {
323  // get EventSetupRecords if needed
324  const bool updateField = eventSetupData_.cacheIDMagField!=es.get<IdealMagneticFieldRecord>().cacheIdentifier();
325  if (updateField){
328  }
329 
330  const bool updateGeometry = eventSetupData_.cacheIDTDGeom!=es.get<TrackerDigiGeometryRecord>().cacheIdentifier();
331  if (updateGeometry){
334  }
335 
336  if ( updateField || updateGeometry ) {
337  eventSetupData_.mtsTransform = std::make_unique<MultiTrajectoryStateTransform>(eventSetupData_.trackerHandle.product(),eventSetupData_.magField.product());
338  eventSetupData_.constraintAtVtx = std::make_unique<GsfConstraintAtVertex>(es) ;
339  }
340 
342  eventSetupData_.cacheIDGeom=es.get<CaloGeometryRecord>().cacheIdentifier();
344  }
345 
347  eventSetupData_.cacheIDTopo=es.get<CaloTopologyRecord>().cacheIdentifier();
349  }
350 
355 
356 
361 
363  eventSetupData_.cacheSevLevel = es.get<EcalSeverityLevelAlgoRcd>().cacheIdentifier();
365  }
366  }
367 
368 
370  {
371  // prepare access to hcal data
374 
375  auto const& towers = event.get(generalData_.inputCfg.hcalTowersTag) ;
376 
377  // Isolation algos
378  float egHcalIsoConeSizeOutSmall=0.3, egHcalIsoConeSizeOutLarge=0.4;
379  float egHcalIsoConeSizeIn=generalData_.isoCfg.intRadiusHcal,egHcalIsoPtMin=generalData_.isoCfg.etMinHcal;
380  int egHcalDepth1=1, egHcalDepth2=2;
381 
382  float egIsoConeSizeOutSmall=0.3, egIsoConeSizeOutLarge=0.4, egIsoJurassicWidth=generalData_.isoCfg.jurassicWidth;
383  float egIsoPtMinBarrel=generalData_.isoCfg.etMinBarrel,egIsoEMinBarrel=generalData_.isoCfg.eMinBarrel, egIsoConeSizeInBarrel=generalData_.isoCfg.intRadiusEcalBarrel;
384  float egIsoPtMinEndcap=generalData_.isoCfg.etMinEndcaps,egIsoEMinEndcap=generalData_.isoCfg.eMinEndcaps, egIsoConeSizeInEndcap=generalData_.isoCfg.intRadiusEcalEndcaps;
385 
388 
389  EventData eventData{
390  .event = &event,
391  .beamspot = &event.get(generalData_.inputCfg.beamSpotTag),
392  .previousElectrons = event.getHandle(generalData_.inputCfg.previousGsfElectrons),
393  .pflowElectrons = event.getHandle(generalData_.inputCfg.pflowGsfElectronsTag),
394  .coreElectrons = event.getHandle(generalData_.inputCfg.gsfElectronCores),
395  .barrelRecHits = barrelRecHits,
396  .endcapRecHits = endcapRecHits,
397  .currentCtfTracks = event.getHandle(generalData_.inputCfg.ctfTracks),
398  .seeds = event.getHandle(generalData_.inputCfg.seedsTag),
400  .vertices = event.getHandle(generalData_.inputCfg.vtxCollectionTag),
402  .hadDepth1Isolation03 = EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth1,&towers),
403  .hadDepth1Isolation04 = EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth1,&towers),
404  .hadDepth2Isolation03 = EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth2,&towers),
405  .hadDepth2Isolation04 = EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth2,&towers),
406  .hadDepth1Isolation03Bc = EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,0.,egHcalIsoPtMin,egHcalDepth1,&towers),
407  .hadDepth1Isolation04Bc = EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,0.,egHcalIsoPtMin,egHcalDepth1,&towers),
408  .hadDepth2Isolation03Bc = EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,0.,egHcalIsoPtMin,egHcalDepth2,&towers),
409  .hadDepth2Isolation04Bc = EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,0.,egHcalIsoPtMin,egHcalDepth2,&towers),
410  .ecalBarrelIsol03 = EgammaRecHitIsolation(egIsoConeSizeOutSmall,egIsoConeSizeInBarrel,egIsoJurassicWidth,egIsoPtMinBarrel,egIsoEMinBarrel,eventSetupData_.caloGeom,*barrelRecHits,eventSetupData_.sevLevel.product(),DetId::Ecal),
411  .ecalBarrelIsol04 = EgammaRecHitIsolation(egIsoConeSizeOutLarge,egIsoConeSizeInBarrel,egIsoJurassicWidth,egIsoPtMinBarrel,egIsoEMinBarrel,eventSetupData_.caloGeom,*barrelRecHits,eventSetupData_.sevLevel.product(),DetId::Ecal),
412  .ecalEndcapIsol03 = EgammaRecHitIsolation(egIsoConeSizeOutSmall,egIsoConeSizeInEndcap,egIsoJurassicWidth,egIsoPtMinEndcap,egIsoEMinEndcap,eventSetupData_.caloGeom,*endcapRecHits,eventSetupData_.sevLevel.product(),DetId::Ecal),
413  .ecalEndcapIsol04 = EgammaRecHitIsolation(egIsoConeSizeOutLarge,egIsoConeSizeInEndcap,egIsoJurassicWidth,egIsoPtMinEndcap,egIsoEMinEndcap,eventSetupData_.caloGeom,*endcapRecHits,eventSetupData_.sevLevel.product(),DetId::Ecal)
414  } ;
415 
416  eventData.ecalBarrelIsol03.setUseNumCrystals(generalData_.isoCfg.useNumCrystals);
417  eventData.ecalBarrelIsol03.setVetoClustered(generalData_.isoCfg.vetoClustered);
418  eventData.ecalBarrelIsol03.doSeverityChecks(eventData.barrelRecHits.product(),generalData_.recHitsCfg.recHitSeverityToBeExcludedBarrel);
419  eventData.ecalBarrelIsol03.doFlagChecks(generalData_.recHitsCfg.recHitFlagsToBeExcludedBarrel);
420  eventData.ecalBarrelIsol04.setUseNumCrystals(generalData_.isoCfg.useNumCrystals);
421  eventData.ecalBarrelIsol04.setVetoClustered(generalData_.isoCfg.vetoClustered);
422  eventData.ecalBarrelIsol04.doSeverityChecks(eventData.barrelRecHits.product(),generalData_.recHitsCfg.recHitSeverityToBeExcludedBarrel);
423  eventData.ecalBarrelIsol04.doFlagChecks(generalData_.recHitsCfg.recHitFlagsToBeExcludedBarrel);
424  eventData.ecalEndcapIsol03.setUseNumCrystals(generalData_.isoCfg.useNumCrystals);
425  eventData.ecalEndcapIsol03.setVetoClustered(generalData_.isoCfg.vetoClustered);
426  eventData.ecalEndcapIsol03.doSeverityChecks(eventData.endcapRecHits.product(),generalData_.recHitsCfg.recHitSeverityToBeExcludedEndcaps);
427  eventData.ecalEndcapIsol03.doFlagChecks(generalData_.recHitsCfg.recHitFlagsToBeExcludedEndcaps);
428  eventData.ecalEndcapIsol04.setUseNumCrystals(generalData_.isoCfg.useNumCrystals);
429  eventData.ecalEndcapIsol04.setVetoClustered(generalData_.isoCfg.vetoClustered);
430  eventData.ecalEndcapIsol04.doSeverityChecks(eventData.endcapRecHits.product(),generalData_.recHitsCfg.recHitSeverityToBeExcludedEndcaps);
431  eventData.ecalEndcapIsol04.doFlagChecks(generalData_.recHitsCfg.recHitFlagsToBeExcludedEndcaps);
432 
433  return eventData;
434  }
435 
436 
438  edm::Event const& event,
439  edm::EventSetup const& eventSetup,
441  {
442  checkSetup(eventSetup);
443  auto eventData = beginEvent(event);
444 
445  const GsfElectronCoreCollection * coreCollection = eventData.coreElectrons.product() ;
446  for ( unsigned int i=0 ; i<coreCollection->size() ; ++i )
447  {
448  // check there is no existing electron with this core
449  const GsfElectronCoreRef coreRef = edm::Ref<GsfElectronCoreCollection>(eventData.coreElectrons,i) ;
450  bool coreFound = false ;
451  for(auto const& ele : electrons)
452  {
453  if (ele.core()==coreRef)
454  {
455  coreFound = true ;
456  break ;
457  }
458  }
459  if (coreFound) continue ;
460 
461  // check there is a super-cluster
462  if (coreRef->superCluster().isNull()) continue ;
463 
464  // prepare internal structure for electron specific data
465  ElectronData electronData(coreRef,*eventData.beamspot) ;
466 
467  // calculate and check Trajectory StatesOnSurface....
468  if ( !electronData.calculateTSOS( *eventSetupData_.mtsTransform, *eventSetupData_.constraintAtVtx ) ) continue ;
469 
470  createElectron(electrons, electronData, eventData, hoc) ;
471 
472  } // loop over tracks
473 
474  }
475 
476 
478  {
479  // default value
480  ele.setPassCutBasedPreselection(false) ;
481 
482  // kind of seeding
483  bool eg = ele.core()->ecalDrivenSeed() ;
484  bool pf = ele.core()->trackerDrivenSeed() && !ele.core()->ecalDrivenSeed() ;
486  if (eg&&pf) { throw cms::Exception("GsfElectronAlgo|BothEcalAndPureTrackerDriven")<<"An electron cannot be both egamma and purely pflow" ; }
487  if ((!eg)&&(!pf)) { throw cms::Exception("GsfElectronAlgo|NeitherEcalNorPureTrackerDriven")<<"An electron cannot be neither egamma nor purely pflow" ; }
488 
490 
491  // Et cut
492  double etaValue = EleRelPoint(ele.superCluster()->position(),bs.position()).eta() ;
493  double etValue = ele.superCluster()->energy()/cosh(etaValue) ;
494  LogTrace("GsfElectronAlgo") << "Et : " << etValue ;
495  if (ele.isEB() && (etValue < cfg->minSCEtBarrel)) return ;
496  if (ele.isEE() && (etValue < cfg->minSCEtEndcaps)) return ;
497  LogTrace("GsfElectronAlgo") << "Et criteria are satisfied";
498 
499  // E/p cut
500  double eopValue = ele.eSuperClusterOverP() ;
501  LogTrace("GsfElectronAlgo") << "E/p : " << eopValue ;
502  if (ele.isEB() && (eopValue > cfg->maxEOverPBarrel)) return ;
503  if (ele.isEE() && (eopValue > cfg->maxEOverPEndcaps)) return ;
504  if (ele.isEB() && (eopValue < cfg->minEOverPBarrel)) return ;
505  if (ele.isEE() && (eopValue < cfg->minEOverPEndcaps)) return ;
506  LogTrace("GsfElectronAlgo") << "E/p criteria are satisfied";
507 
508  // HoE cuts
509  LogTrace("GsfElectronAlgo") << "HoE1 : " << ele.hcalDepth1OverEcal() << ", HoE2 : " << ele.hcalDepth2OverEcal();
510  double hoeCone = ele.hcalOverEcal();
511  double hoeTower = ele.hcalOverEcalBc();
512  const reco::CaloCluster & seedCluster = *(ele.superCluster()->seed()) ;
513  int detector = seedCluster.hitsAndFractions()[0].first.subdetId() ;
514  bool HoEveto = false ;
515  double scle = ele.superCluster()->energy();
516 
517  if (detector==EcalBarrel) HoEveto =
518  hoeCone*scle<cfg->maxHBarrelCone || hoeTower*scle<cfg->maxHBarrelTower ||
519  hoeCone<cfg->maxHOverEBarrelCone || hoeTower<cfg->maxHOverEBarrelTower;
520  else if (detector==EcalEndcap) HoEveto =
521  hoeCone*scle<cfg->maxHEndcapsCone || hoeTower*scle<cfg->maxHEndcapsTower ||
522  hoeCone<cfg->maxHOverEEndcapsCone || hoeTower<cfg->maxHOverEEndcapsTower;
523 
524  if ( !HoEveto ) return ;
525  LogTrace("GsfElectronAlgo") << "H/E criteria are satisfied";
526 
527  // delta eta criteria
528  double deta = ele.deltaEtaSuperClusterTrackAtVtx() ;
529  LogTrace("GsfElectronAlgo") << "delta eta : " << deta ;
530  if (ele.isEB() && (std::abs(deta) > cfg->maxDeltaEtaBarrel)) return ;
531  if (ele.isEE() && (std::abs(deta) > cfg->maxDeltaEtaEndcaps)) return ;
532  LogTrace("GsfElectronAlgo") << "Delta eta criteria are satisfied";
533 
534  // delta phi criteria
535  double dphi = ele.deltaPhiSuperClusterTrackAtVtx();
536  LogTrace("GsfElectronAlgo") << "delta phi : " << dphi;
537  if (ele.isEB() && (std::abs(dphi) > cfg->maxDeltaPhiBarrel)) return ;
538  if (ele.isEE() && (std::abs(dphi) > cfg->maxDeltaPhiEndcaps)) return ;
539  LogTrace("GsfElectronAlgo") << "Delta phi criteria are satisfied";
540 
541  // sigma ieta ieta
542  LogTrace("GsfElectronAlgo") << "sigma ieta ieta : " << ele.sigmaIetaIeta();
543  if (ele.isEB() && (ele.sigmaIetaIeta() > cfg->maxSigmaIetaIetaBarrel)) return ;
544  if (ele.isEE() && (ele.sigmaIetaIeta() > cfg->maxSigmaIetaIetaEndcaps)) return ;
545  LogTrace("GsfElectronAlgo") << "Sigma ieta ieta criteria are satisfied";
546 
547  // fiducial
548  if (!ele.isEB() && cfg->isBarrel) return ;
549  if (!ele.isEE() && cfg->isEndcaps) return ;
550  if (cfg->isFiducial && (ele.isEBEEGap()||ele.isEBEtaGap()||ele.isEBPhiGap()||ele.isEERingGap()||ele.isEEDeeGap())) return ;
551  LogTrace("GsfElectronAlgo") << "Fiducial flags criteria are satisfied";
552 
553  // seed in TEC
554  edm::RefToBase<TrajectorySeed> seed = ele.gsfTrack()->extra()->seedRef() ;
555  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>() ;
556  if (eg && !generalData_.cutsCfg.seedFromTEC)
557  {
558  if (elseed.isNull())
559  { throw cms::Exception("GsfElectronAlgo|NotElectronSeed")<<"The GsfTrack seed is not an ElectronSeed ?!" ; }
560  else
561  { if (elseed->subDet2()==6) return ; }
562  }
563 
564  // transverse impact parameter
565  if (std::abs(ele.gsfTrack()->dxy(bs.position()))>cfg->maxTIP) return ;
566  LogTrace("GsfElectronAlgo") << "TIP criterion is satisfied" ;
567 
568  LogTrace("GsfElectronAlgo") << "All cut based criteria are satisfied" ;
569  ele.setPassCutBasedPreselection(true) ;
570  }
571 
572 
574  {
575  // eventually check ctf track
576  if (generalData_.strategyCfg.ctfTracksCheck && electronData.ctfTrackRef.isNull()) {
577  electronData.ctfTrackRef = gsfElectronTools::getClosestCtfToGsf( electronData.gsfTrackRef,
578  eventData.currentCtfTracks ).first;
579  }
580 
581  // charge ID
582  int eleCharge ;
583  GsfElectron::ChargeInfo eleChargeInfo ;
584  electronData.computeCharge(eleCharge,eleChargeInfo) ;
585 
586  // electron basic cluster
588 
589  // Seed cluster
590  const reco::CaloCluster & seedCluster = *(electronData.superClusterRef->seed()) ;
591 
592  // seed Xtal
593  // temporary, till CaloCluster->seed() is made available
594  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
595 
596  electronData.calculateMode() ;
597 
598 
599  //====================================================
600  // Candidate attributes
601  //====================================================
602 
603  Candidate::LorentzVector momentum = electronData.calculateMomentum() ;
604 
605 
606  //====================================================
607  // Track-Cluster Matching
608  //====================================================
609 
611  tcMatching.electronCluster = elbcRef ;
612  tcMatching.eSuperClusterOverP = (electronData.vtxMom.mag()>0)?(electronData.superClusterRef->energy()/electronData.vtxMom.mag()):(-1.) ;
613  tcMatching.eSeedClusterOverP = (electronData.vtxMom.mag()>0.)?(seedCluster.energy()/electronData.vtxMom.mag()):(-1) ;
614  tcMatching.eSeedClusterOverPout = (electronData.seedMom.mag()>0.)?(seedCluster.energy()/electronData.seedMom.mag()):(-1.) ;
615  tcMatching.eEleClusterOverPout = (electronData.eleMom.mag()>0.)?(elbcRef->energy()/electronData.eleMom.mag()):(-1.) ;
616 
617  EleRelPointPair scAtVtx(electronData.superClusterRef->position(),electronData.sclPos,eventData.beamspot->position()) ;
618  tcMatching.deltaEtaSuperClusterAtVtx = scAtVtx.dEta() ;
619  tcMatching.deltaPhiSuperClusterAtVtx = scAtVtx.dPhi() ;
620 
621  EleRelPointPair seedAtCalo(seedCluster.position(),electronData.seedPos,eventData.beamspot->position()) ;
622  tcMatching.deltaEtaSeedClusterAtCalo = seedAtCalo.dEta() ;
623  tcMatching.deltaPhiSeedClusterAtCalo = seedAtCalo.dPhi() ;
624 
625  EleRelPointPair ecAtCalo(elbcRef->position(),electronData.elePos,eventData.beamspot->position()) ;
626  tcMatching.deltaEtaEleClusterAtCalo = ecAtCalo.dEta() ;
627  tcMatching.deltaPhiEleClusterAtCalo = ecAtCalo.dPhi() ;
628 
629 
630  //=======================================================
631  // Track extrapolations
632  //=======================================================
633 
635  ele_convert(electronData.vtxPos,tkExtra.positionAtVtx) ;
636  ele_convert(electronData.sclPos,tkExtra.positionAtCalo) ;
637  ele_convert(electronData.vtxMom,tkExtra.momentumAtVtx) ;
638  ele_convert(electronData.sclMom,tkExtra.momentumAtCalo) ;
639  ele_convert(electronData.seedMom,tkExtra.momentumOut) ;
640  ele_convert(electronData.eleMom,tkExtra.momentumAtEleClus) ;
642 
643 
644  //=======================================================
645  // Closest Ctf Track
646  //=======================================================
647 
649  ctfInfo.ctfTrack = electronData.ctfTrackRef ;
650  ctfInfo.shFracInnerHits = electronData.shFracInnerHits ;
651 
652 
653  //====================================================
654  // FiducialFlags, using nextToBoundary definition of gaps
655  //====================================================
656 
657  reco::GsfElectron::FiducialFlags fiducialFlags ;
658  int region = seedXtalId.det();
659  int detector = seedXtalId.subdetId() ;
660  double feta=std::abs(electronData.superClusterRef->position().eta()) ;
661  if (detector==EcalBarrel)
662  {
663  fiducialFlags.isEB = true ;
664  EBDetId ebdetid(seedXtalId);
665  if (EBDetId::isNextToEtaBoundary(ebdetid))
666  {
667  if (ebdetid.ietaAbs()==85)
668  { fiducialFlags.isEBEEGap = true ; }
669  else
670  { fiducialFlags.isEBEtaGap = true ; }
671  }
672  if (EBDetId::isNextToPhiBoundary(ebdetid))
673  { fiducialFlags.isEBPhiGap = true ; }
674  }
675  else if (detector==EcalEndcap)
676  {
677  fiducialFlags.isEE = true ;
678  EEDetId eedetid(seedXtalId);
679  if (EEDetId::isNextToRingBoundary(eedetid))
680  {
681  if (std::abs(feta)<2.)
682  { fiducialFlags.isEBEEGap = true ; }
683  else
684  { fiducialFlags.isEERingGap = true ; }
685  }
686  if (EEDetId::isNextToDBoundary(eedetid))
687  { fiducialFlags.isEEDeeGap = true ; }
688  }
689  else if ( EcalTools::isHGCalDet((DetId::Detector)region) )
690  {
691  fiducialFlags.isEE = true ;
692  //HGCalDetId eeDetid(seedXtalId);
693  // fill in fiducial information when we know how to use it...
694  }
695  else
696  { throw cms::Exception("GsfElectronAlgo|UnknownXtalRegion")<<"createElectron(): do not know if it is a barrel or endcap seed cluster !!!!" ; }
697 
698 
699  //====================================================
700  // SaturationInfo
701  //====================================================
702 
703  reco::GsfElectron::SaturationInfo saturationInfo;
704  calculateSaturationInfo(electronData.superClusterRef, saturationInfo, eventData);
705 
706  //====================================================
707  // ShowerShape
708  //====================================================
709 
710  reco::GsfElectron::ShowerShape showerShape;
711  reco::GsfElectron::ShowerShape full5x5_showerShape;
712  if( !EcalTools::isHGCalDet((DetId::Detector)region) ) {
713  const bool pflow = !(electronData.coreRef->ecalDrivenSeed());
714  auto const& hcalHelper = pflow ? generalData_.hcalHelperPflow : generalData_.hcalHelper;
715  calculateShowerShape<false>(electronData.superClusterRef,hcalHelper,showerShape,eventData) ;
716  calculateShowerShape<true>(electronData.superClusterRef,hcalHelper,full5x5_showerShape,eventData) ;
717  }
718 
719  //====================================================
720  // ConversionRejection
721  //====================================================
722 
723  eventData.retreiveOriginalTrackCollections(electronData.ctfTrackRef,electronData.coreRef->gsfTrack()) ;
724 
725  double BInTesla = eventSetupData_.magField->inTesla(GlobalPoint(0.,0.,0.)).z() ;
727  if (!ctfTracks.isValid()) { ctfTracks = eventData.currentCtfTracks ; }
728 
729  // values of conversionInfo.flag
730  // -9999 : Partner track was not found
731  // 0 : Partner track found in the CTF collection using
732  // 1 : Partner track found in the CTF collection using
733  // 2 : Partner track found in the GSF collection using
734  // 3 : Partner track found in the GSF collection using the electron's GSF track
736  (*electronData.coreRef,ctfTracks,eventData.originalGsfTracks,BInTesla) ;
737 
739  conversionVars.flags = conversionInfo.flag ;
740  conversionVars.dist = conversionInfo.dist ;
741  conversionVars.dcot = conversionInfo.dcot ;
742  conversionVars.radius = conversionInfo.radiusOfConversion ;
744  //this is an intentionally bugged version which ignores the GsfTrack
745  //this is a bug which was introduced in reduced e/gamma where the GsfTrack gets
746  //relinked to a new collection which means it can no longer match the conversion
747  //as it matches based on product/id
748  //we keep this defination for the MVAs
749  const auto matchedConv = ConversionTools::matchedConversion(electronData.coreRef->ctfTrack(),
750  *eventData.conversions,
751  eventData.beamspot->position(),
752  2.0,1e-6,0);
753  conversionVars.vtxFitProb = ConversionTools::getVtxFitProb(matchedConv);
754  }
755  if ((conversionVars.flags==0)or(conversionVars.flags==1))
756  conversionVars.partner = TrackBaseRef(conversionInfo.conversionPartnerCtfTk) ;
757  else if ((conversionVars.flags==2)or(conversionVars.flags==3))
758  conversionVars.partner = TrackBaseRef(conversionInfo.conversionPartnerGsfTk) ;
759 
760 
761  //====================================================
762  // Go !
763  //====================================================
764 
765  electrons.emplace_back( eleCharge,eleChargeInfo,electronData.coreRef,
766  tcMatching, tkExtra, ctfInfo,
767  fiducialFlags,showerShape, full5x5_showerShape,
768  conversionVars, saturationInfo ) ;
769  auto & ele = electrons.back();
770  // Will be overwritten later in the case of the regression
771  ele.setCorrectedEcalEnergyError(generalData_.superClusterErrorFunction->getValue(*(ele.superCluster()),0)) ;
772  ele.setP4(GsfElectron::P4_FROM_SUPER_CLUSTER,momentum,0,true) ;
773 
774  //====================================================
775  // brems fractions
776  //====================================================
777 
778  if (electronData.innMom.mag()>0.)
779  { ele.setTrackFbrem((electronData.innMom.mag()-electronData.outMom.mag())/electronData.innMom.mag()) ; }
780 
781  // the supercluster is the refined one The seed is not necessarily the first cluster
782  // hence the use of the electronCluster
783  SuperClusterRef sc = ele.superCluster() ;
784  if (!(sc.isNull()))
785  {
786  CaloClusterPtr cl = ele.electronCluster() ;
787  if (sc->clustersSize()>1)
788  {
789  float pf_fbrem =( sc->energy() - cl->energy() ) / sc->energy();
790  ele.setSuperClusterFbrem( pf_fbrem ) ;
791  }
792  else
793  {
794  ele.setSuperClusterFbrem(0) ;
795  }
796  }
797 
798  //====================================================
799  // classification and corrections
800  //====================================================
801  // classification
802  ElectronClassification theClassifier ;
803  theClassifier.classify(ele) ;
804  theClassifier.refineWithPflow(ele) ;
805  // ecal energy
808  {
810  eventData.vertices,
811  eventData.barrelRecHits,
812  eventData.endcapRecHits);
813  }
814  else // original implementation
815  {
816  if( !EcalTools::isHGCalDet((DetId::Detector)region) ) {
817  if (ele.core()->ecalDrivenSeed())
818  {
820  { theEnCorrector.classBasedParameterizationEnergy(ele,*eventData.beamspot) ; }
822  { theEnCorrector.classBasedParameterizationUncertainty(ele) ; }
823  }
824  else
825  {
827  { theEnCorrector.simpleParameterizationUncertainty(ele) ; }
828  }
829  }
830  }
831 
832  // momentum
833  // Keep the default correction running first. The track momentum error is computed in there
834  if (ele.core()->ecalDrivenSeed())
835  {
836  ElectronMomentumCorrector theMomCorrector;
837  theMomCorrector.correct(ele,electronData.vtxTSOS);
838  }
840  {
842  }
843 
844  //====================================================
845  // now isolation variables
846  //====================================================
847 
849  dr03.tkSumPt = tkIsol03Calc_.calIsolPt(*ele.gsfTrack(),*eventData.currentCtfTracks);
850  dr04.tkSumPt = tkIsol04Calc_.calIsolPt(*ele.gsfTrack(),*eventData.currentCtfTracks);
851  dr03.tkSumPtHEEP = tkIsolHEEP03Calc_.calIsolPt(*ele.gsfTrack(),*eventData.currentCtfTracks);
852  dr04.tkSumPtHEEP = tkIsolHEEP04Calc_.calIsolPt(*ele.gsfTrack(),*eventData.currentCtfTracks);
853 
854  if( !EcalTools::isHGCalDet((DetId::Detector)region) ) {
859  dr03.ecalRecHitSumEt = eventData.ecalBarrelIsol03.getEtSum(&ele);
860  dr03.ecalRecHitSumEt += eventData.ecalEndcapIsol03.getEtSum(&ele);
865  dr04.ecalRecHitSumEt = eventData.ecalBarrelIsol04.getEtSum(&ele);
866  dr04.ecalRecHitSumEt += eventData.ecalEndcapIsol04.getEtSum(&ele);
867  }
868  ele.setIsolation03(dr03);
869  ele.setIsolation04(dr04);
870 
871 
872  //====================================================
873  // preselection flag
874  //====================================================
875 
876  setCutBasedPreselectionFlag(ele,*eventData.beamspot) ;
877  //setting mva flag, currently GedGsfElectron and GsfElectron pre-selection flags have desynced
878  //this is for GedGsfElectrons, GsfElectrons (ie old pre 7X std reco) resets this later on
879  //in the function "addPfInfo"
880  //yes this is awful, we'll fix it once we work out how to...
881  float mvaValue = hoc->sElectronMVAEstimator->mva( ele,*(eventData.vertices));
882  ele.setPassMvaPreselection(mvaValue>generalData_.strategyCfg.PreSelectMVA);
883 
884  //====================================================
885  // Pixel match variables
886  //====================================================
888 
889  LogTrace("GsfElectronAlgo")<<"Constructed new electron with energy "<< ele.p4().e() ;
890  }
891 
892 
893 // Pixel match variables
895  int sd1 = 0 ;
896  int sd2 = 0 ;
897  float dPhi1 = 0 ;
898  float dPhi2 = 0 ;
899  float dRz1 = 0 ;
900  float dRz2 = 0 ;
901  edm::RefToBase<TrajectorySeed> seed = ele.gsfTrack()->extra()->seedRef();
902  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>();
903  if(seed.isNull()){}
904  else{
905  if(elseed.isNull()){}
906  else{
907  sd1 = elseed->subDet1() ;
908  sd2 = elseed->subDet2() ;
909  dPhi1 = (ele.charge()>0) ? elseed->dPhi1Pos() : elseed->dPhi1() ;
910  dPhi2 = (ele.charge()>0) ? elseed->dPhi2Pos() : elseed->dPhi2() ;
911  dRz1 = (ele.charge()>0) ? elseed->dRz1Pos () : elseed->dRz1 () ;
912  dRz2 = (ele.charge()>0) ? elseed->dRz2Pos () : elseed->dRz2 () ;
913  }
914  }
915  ele.setPixelMatchSubdetectors(sd1,sd2) ;
916  ele.setPixelMatchDPhi1(dPhi1) ;
917  ele.setPixelMatchDPhi2(dPhi2) ;
918  ele.setPixelMatchDRz1 (dRz1 ) ;
919  ele.setPixelMatchDRz2 (dRz2 ) ;
920 }
TrajectoryStateOnSurface constrainAtBeamSpot(const reco::GsfTrack &, const reco::BeamSpot &) const
(multi)TSOS after including the beamspot
edm::Handle< reco::TrackCollection > originalCtfTracks
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:186
EgammaRecHitIsolation ecalEndcapIsol04
EgammaRecHitIsolation ecalBarrelIsol03
unsigned long long cacheIdentifier() const
const double dist
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:131
void applyCombinationRegression(reco::GsfElectron &ele) const
static bool isHGCalDet(DetId::Detector thedet)
identify HGCal cells
Definition: EcalTools.h:54
std::unique_ptr< const SoftElectronMVAEstimator > sElectronMVAEstimator
const CutsConfiguration cutsCfgPflow
static bool isNextToEtaBoundary(EBDetId id)
Definition: EBDetId.cc:108
EgammaRecHitIsolation ecalEndcapIsol03
static reco::Conversion const * matchedConversion(const reco::GsfElectron &ele, const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
static const TGPicture * info(bool iBackgroundIsBlack)
void setPassCutBasedPreselection(bool flag)
Definition: GsfElectron.h:727
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:251
void calculateSaturationInfo(const reco::SuperClusterRef &, reco::GsfElectron::SaturationInfo &, EventData const &eventData)
void setPixelMatchDRz2(float dRz2)
Definition: GsfElectron.h:902
EgammaTowerIsolation hadDepth1Isolation03
edm::EDGetTokenT< reco::GsfElectronCoreCollection > gsfElectronCores
bool isEBEtaGap() const
Definition: GsfElectron.h:361
void readEvent(const edm::Event &)
ConversionInfo getConversionInfo(const reco::GsfElectronCore &, const edm::Handle< reco::TrackCollection > &ctftracks_h, const edm::Handle< reco::GsfTrackCollection > &gsftracks_h, const double bFieldAtOrigin, const double minFracSharedHits=0.45)
EgammaTowerIsolation hadDepth2Isolation03
float eSuperClusterOverP() const
Definition: GsfElectron.h:249
std::unique_ptr< const MultiTrajectoryStateTransform > mtsTransform
CaloTopology const * topology(0)
void retreiveOriginalTrackCollections(const reco::TrackRef &, const reco::GsfTrackRef &)
void setPixelMatchDPhi1(float dPhi1)
Definition: GsfElectron.h:899
void createElectron(reco::GsfElectronCollection &electrons, ElectronData &electronData, EventData &eventData, const gsfAlgoHelpers::HeavyObjectCache *)
bool isEBEEGap() const
Definition: GsfElectron.h:359
float hcalDepth2OverEcal() const
Definition: GsfElectron.h:447
edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
double getEtSum(const reco::Candidate *emObject) const
const IsolationConfiguration isoCfg
edm::EDGetTokenT< reco::VertexCollection > vtxCollectionTag
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:9
Definition: __init__.py:1
#define nullptr
const EcalRecHitsConfiguration recHitsCfg
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
EgammaTowerIsolation hadDepth1Isolation04Bc
edm::Handle< EcalRecHitCollection > endcapRecHits
EgammaTowerIsolation hadDepth1Isolation03Bc
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:197
edm::Event const * event
int charge() const final
electric charge
Definition: LeafCandidate.h:91
void checkSetup(const edm::EventSetup &)
bool isEERingGap() const
Definition: GsfElectron.h:365
edm::EDGetTokenT< EcalRecHitCollection > endcapRecHitCollection
void computeCharge(int &charge, reco::GsfElectron::ChargeInfo &info)
const InputTagsConfiguration inputCfg
edm::ESHandle< EcalSeverityLevelAlgo > sevLevel
void calculateShowerShape(const reco::SuperClusterRef &, ElectronHcalHelper const &hcalHelper, reco::GsfElectron::ShowerShape &, EventData const &eventData)
bool isEEDeeGap() const
Definition: GsfElectron.h:364
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
edm::EDGetTokenT< reco::GsfElectronCollection > pflowGsfElectronsTag
double hcalESumDepth1(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0) const
const StrategyConfiguration strategyCfg
bool isEE() const
Definition: GsfElectron.h:357
ProductID id() const
Accessor for product ID.
Definition: Ref.h:257
bool isEB() const
Definition: GsfElectron.h:356
const reco::TrackRef conversionPartnerCtfTk
TrajectoryStateOnSurface outerStateOnSurface(const reco::GsfTrack &tk) const
void setPixelMatchSubdetectors(int sd1, int sd2)
Definition: GsfElectron.h:898
edm::EDGetTokenT< EcalRecHitCollection > barrelRecHitCollection
edm::ESHandle< CaloTopology > caloTopo
edm::EDGetTokenT< reco::GsfPFRecTrackCollection > gsfPfRecTracksTag
return((rh^lh)&mask)
edm::EDGetTokenT< reco::ConversionCollection > conversions
void completeElectrons(reco::GsfElectronCollection &electrons, edm::Event const &event, edm::EventSetup const &eventSetup, const gsfAlgoHelpers::HeavyObjectCache *hoc)
T barePhi() const
Definition: PV3DBase.h:68
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag
EventSetupData eventSetupData_
virtual float getValue(const reco::BasicCluster &, const EcalRecHitCollection &) const =0
EleTkIsolFromCands tkIsolHEEP03Calc_
void setUseNumCrystals(bool b=true)
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:253
static float getVtxFitProb(const reco::Conversion *conv)
T mag() const
Definition: PV3DBase.h:67
float sigmaIetaIeta() const
Definition: GsfElectron.h:440
EgammaTowerIsolation hadDepth1Isolation04
void simpleParameterizationUncertainty(reco::GsfElectron &)
TrajectoryStateOnSurface extrapolatedState(const TrajectoryStateOnSurface tsos, const GlobalPoint &point) const
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:36
void checkSetup(edm::EventSetup const &eventSetup)
bool positionFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalPoint &position)
const int flag
T sqrt(T t)
Definition: SSEVec.h:18
static bool isNextToPhiBoundary(EBDetId id)
Definition: EBDetId.cc:113
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::Handle< EcalRecHitCollection > barrelRecHits
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:256
T z() const
Definition: PV3DBase.h:64
std::vector< GsfElectronCore > GsfElectronCoreCollection
const double radiusOfConversion
void correct(reco::GsfElectron &, TrajectoryStateOnSurface &)
float hcalOverEcal() const
Definition: GsfElectron.h:448
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: GsfElectron.h:400
static bool isNextToRingBoundary(EEDetId id)
Definition: EEDetId.cc:284
double energy() const
cluster energy
Definition: CaloCluster.h:126
const CutsConfiguration cutsCfg
double calIsolPt(Args &&...args) const
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsTag
const reco::BeamSpot * beamspot
edm::ESHandle< MagneticField > magField
EgammaTowerIsolation hadDepth2Isolation04Bc
std::unique_ptr< GsfConstraintAtVertex > constraintAtVtx
edm::Handle< reco::ConversionCollection > conversions
static bool isNextToDBoundary(EEDetId id)
Definition: EEDetId.cc:279
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isValid() const
Definition: HandleBase.h:74
float hcalOverEcalBc() const
Definition: GsfElectron.h:452
bool isNull() const
Checks for null.
Definition: Ref.h:248
#define LogTrace(id)
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
edm::EDGetTokenT< CaloTowerCollection > hcalTowersTag
unsigned long long cacheIDMagField
void classify(reco::GsfElectron &)
ElectronHcalHelper hcalHelperPflow
const double dcot
const_iterator end() const
edm::EDGetTokenT< reco::TrackCollection > ctfTracks
GsfElectronAlgo(const InputTagsConfiguration &, const StrategyConfiguration &, const CutsConfiguration &cutsCfg, const CutsConfiguration &cutsCfgPflow, const ElectronHcalHelper::Configuration &hcalCfg, const ElectronHcalHelper::Configuration &hcalCfgPflow, const IsolationConfiguration &, const EcalRecHitsConfiguration &, EcalClusterFunctionBaseClass *superClusterErrorFunction, EcalClusterFunctionBaseClass *crackCorrectionFunction, const RegressionHelper::Configuration &regCfg, const edm::ParameterSet &tkIsol03Cfg, const edm::ParameterSet &tkIsol04Cfg, const edm::ParameterSet &tkIsolHEEP03Cfg, const edm::ParameterSet &tkIsolHEEP04Cfg)
const reco::GsfTrackRef conversionPartnerGsfTk
float hcalDepth1OverEcal() const
Definition: GsfElectron.h:446
bool calculateTSOS(MultiTrajectoryStateTransform const &, GsfConstraintAtVertex const &)
void setPixelMatchDPhi2(float dPhi2)
Definition: GsfElectron.h:900
reco::CaloClusterPtr getEleBasicCluster(MultiTrajectoryStateTransform const &)
Definition: DetId.h:18
void classBasedParameterizationEnergy(reco::GsfElectron &, const reco::BeamSpot &bs)
edm::Handle< reco::VertexCollection > vertices
EgammaRecHitIsolation ecalBarrelIsol04
void setPixelMatchInfomation(reco::GsfElectron &)
DetId seed() const
return DetId of seed
Definition: CaloCluster.h:207
double hcalESumDepth2(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0) const
bool hasActiveHcal(const reco::SuperCluster &sc) const
Detector
Definition: DetId.h:26
EcalClusterFunctionBaseClass * superClusterErrorFunction
REF castTo() const
Definition: RefToBase.h:289
bool isNull() const
Checks for null.
Definition: RefToBase.h:331
const reco::GsfTrackRef gsfTrackRef
GeneralData generalData_
EgammaTowerIsolation hadDepth2Isolation03Bc
void ele_convert(const Type1 &obj1, Type2 &obj2)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
double hcalESumDepth2BehindClusters(const std::vector< CaloTowerDetId > &towers) const
math::XYZVectorF momentumAtVtxWithConstraint
Definition: GsfElectron.h:289
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
void refineWithPflow(reco::GsfElectron &)
iterator find(key_type k)
fixed size matrix
edm::Handle< reco::GsfTrackCollection > originalGsfTracks
HLT enums.
void applyEcalRegression(reco::GsfElectron &electron, const edm::Handle< reco::VertexCollection > &vertices, const edm::Handle< EcalRecHitCollection > &rechitsEB, const edm::Handle< EcalRecHitCollection > &rechitsEE) const
std::pair< reco::TrackRef, float > getClosestCtfToGsf(reco::GsfTrackRef const &, edm::Handle< reco::TrackCollection > const &ctfTracksH)
const reco::GsfElectronCoreRef coreRef
T get() const
Definition: EventSetup.h:71
std::vector< CaloTowerDetId > hcalTowersBehindClusters(const reco::SuperCluster &sc) const
bool isEBPhiGap() const
Definition: GsfElectron.h:362
edm::Handle< reco::TrackCollection > currentCtfTracks
EleTkIsolFromCands tkIsol04Calc_
double getTowerEtSum(const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
edm::ESHandle< CaloGeometry > caloGeom
EcalClusterFunctionBaseClass * crackCorrectionFunction
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:185
const reco::SuperClusterRef superClusterRef
const Point & position() const
position
Definition: BeamSpot.h:62
ElectronData(const reco::GsfElectronCoreRef &core, const reco::BeamSpot &bs)
ElectronHcalHelper hcalHelper
bool momentumFromModeCartesian(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
edm::ESHandle< TrackerGeometry > trackerHandle
EleTkIsolFromCands tkIsolHEEP04Calc_
EventData beginEvent(edm::Event const &event)
virtual void init(const edm::EventSetup &es)=0
EleTkIsolFromCands tkIsol03Calc_
int ietaAbs() const
get the absolute value of the crystal ieta
Definition: EBDetId.h:47
void classBasedParameterizationUncertainty(reco::GsfElectron &)
T const * product() const
Definition: ESHandle.h:86
EgammaTowerIsolation hadDepth2Isolation04
void checkSetup(const edm::EventSetup &)
void setPixelMatchDRz1(float dRz1)
Definition: GsfElectron.h:901
void setCutBasedPreselectionFlag(reco::GsfElectron &ele, const reco::BeamSpot &)
double hcalESumDepth1BehindClusters(const std::vector< CaloTowerDetId > &towers) const
Definition: event.py:1
math::PtEtaPhiELorentzVectorF LorentzVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
TrajectoryStateOnSurface vtxTSOS
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
reco::Candidate::LorentzVector calculateMomentum()