CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfElectronAlgo.cc
Go to the documentation of this file.
1 
9 
12 
24 
28 
31 
32 
34 
37 
38 
40 
41 
42 
43 #include <Math/Point3D.h>
44 #include <sstream>
45 #include <algorithm>
46 
47 
48 using namespace edm ;
49 using namespace std ;
50 using namespace reco ;
51 
52 
53 //===================================================================
54 // GsfElectronAlgo::GeneralData
55 //===================================================================
56 
57 // general data and helpers
59  {
60  // constructors
62  ( const InputTagsConfiguration &,
63  const StrategyConfiguration &,
64  const CutsConfiguration & cutsCfg,
65  const CutsConfiguration & cutsCfgPflow,
66  const ElectronHcalHelper::Configuration & hcalCfg,
67  const ElectronHcalHelper::Configuration & hcalCfgPflow,
68  const IsolationConfiguration &,
70  EcalClusterFunctionBaseClass * superClusterErrorFunction,
71  EcalClusterFunctionBaseClass * crackCorrectionFunction ) ;
72  ~GeneralData() ;
73 
74  // configurables
81 
82  // additional configuration and helpers
86  } ;
87 
89  ( const InputTagsConfiguration & inputConfig,
90  const StrategyConfiguration & strategyConfig,
91  const CutsConfiguration & cutsConfig,
92  const CutsConfiguration & cutsConfigPflow,
93  const ElectronHcalHelper::Configuration & hcalConfig,
94  const ElectronHcalHelper::Configuration & hcalConfigPflow,
95  const IsolationConfiguration & isoConfig,
96  const EcalRecHitsConfiguration & recHitsConfig,
97  EcalClusterFunctionBaseClass * superClusterErrorFunc,
98  EcalClusterFunctionBaseClass * crackCorrectionFunc
99  )
100  : inputCfg(inputConfig),
101  strategyCfg(strategyConfig),
102  cutsCfg(cutsConfig),
103  cutsCfgPflow(cutsConfigPflow),
104  isoCfg(isoConfig),
105  recHitsCfg(recHitsConfig),
106  hcalHelper(new ElectronHcalHelper(hcalConfig)),
107  hcalHelperPflow(new ElectronHcalHelper(hcalConfigPflow)),
108  superClusterErrorFunction(superClusterErrorFunc),
109  crackCorrectionFunction(crackCorrectionFunc)
110  {}
111 
113  {
114  delete hcalHelper ;
115  delete hcalHelperPflow ;
116  }
117 
118 //===================================================================
119 // GsfElectronAlgo::EventSetupData
120 //===================================================================
121 
123  {
124  EventSetupData() ;
125  ~EventSetupData() ;
126 
127  unsigned long long cacheIDGeom ;
128  unsigned long long cacheIDTopo ;
129  unsigned long long cacheIDTDGeom ;
130  unsigned long long cacheIDMagField ;
131  //unsigned long long cacheChStatus ;
132  unsigned long long cacheSevLevel ;
133 
138  //edm::ESHandle<EcalChannelStatus> chStatus ;
140 
144 } ;
145 
147  : cacheIDGeom(0), cacheIDTopo(0), cacheIDTDGeom(0), cacheIDMagField(0),/*cacheChStatus(0),*/
148  cacheSevLevel(0), mtsTransform(0), constraintAtVtx(0), mtsMode(new MultiTrajectoryStateMode)
149  {}
150 
152  {
153  delete mtsMode ;
154  delete constraintAtVtx ;
155  delete mtsTransform ;
156  }
157 
158 
159 //===================================================================
160 // GsfElectronAlgo::EventData
161 //===================================================================
162 
164  {
165  // general
169 
170  EventData() ;
171  ~EventData() ;
172 
173  // utilities
174  void retreiveOriginalTrackCollections
175  ( const reco::TrackRef &, const reco::GsfTrackRef & ) ;
176 
177  // input collections
192 
193  // isolation helpers
194  ElectronTkIsolation * tkIsolation03, * tkIsolation04 ;
195  EgammaTowerIsolation * hadDepth1Isolation03, * hadDepth1Isolation04 ;
196  EgammaTowerIsolation * hadDepth2Isolation03, * hadDepth2Isolation04 ;
197  EgammaTowerIsolation * hadDepth1Isolation03Bc, * hadDepth1Isolation04Bc ;
198  EgammaTowerIsolation * hadDepth2Isolation03Bc, * hadDepth2Isolation04Bc ;
201  EgammaRecHitIsolation * ecalBarrelIsol03, * ecalBarrelIsol04 ;
202  EgammaRecHitIsolation * ecalEndcapIsol03, * ecalEndcapIsol04 ;
203  } ;
204 
206  : event(0), beamspot(0),
207  originalCtfTrackCollectionRetreived(false),
208  originalGsfTrackCollectionRetreived(false),
209  tkIsolation03(0), tkIsolation04(0),
210  hadDepth1Isolation03(0), hadDepth1Isolation04(0),
211  hadDepth2Isolation03(0), hadDepth2Isolation04(0),
212  ecalBarrelHitsMeta(0), ecalEndcapHitsMeta(0),
213  ecalBarrelIsol03(0), ecalBarrelIsol04(0),
214  ecalEndcapIsol03(0), ecalEndcapIsol04(0)
215  {
217  }
218 
220  {
221  delete tkIsolation03 ;
222  delete tkIsolation04 ;
223  delete hadDepth1Isolation03 ;
224  delete hadDepth1Isolation04 ;
225  delete hadDepth2Isolation03 ;
226  delete hadDepth2Isolation04 ;
227  delete ecalBarrelHitsMeta ;
228  delete ecalEndcapHitsMeta ;
229  delete ecalBarrelIsol03 ;
230  delete ecalBarrelIsol04 ;
231  delete ecalEndcapIsol03 ;
232  delete ecalEndcapIsol04 ;
233 
234  GsfElectronPtrCollection::const_iterator it ;
235  for ( it = electrons->begin() ; it != electrons->end() ; it++ )
236  { delete (*it) ; }
237  delete electrons ;
238  }
239 
241  ( const reco::TrackRef & ctfTrack, const reco::GsfTrackRef & gsfTrack )
242  {
243  if ((!originalCtfTrackCollectionRetreived)&&(ctfTrack.isNonnull()))
244  {
245  event->get(ctfTrack.id(),originalCtfTracks) ;
246  originalCtfTrackCollectionRetreived = true ;
247  }
248  if ((!originalGsfTrackCollectionRetreived)&&(gsfTrack.isNonnull()))
249  {
250  event->get(gsfTrack.id(),originalGsfTracks) ;
251  originalGsfTrackCollectionRetreived = true ;
252  }
253  }
254 
255 
256 //===================================================================
257 // GsfElectronAlgo::ElectronData
258 //===================================================================
259 
261  {
262  // Refs to subproducts
269 
270  // constructors
272  ( const reco::GsfElectronCoreRef & core,
273  const reco::BeamSpot & bs ) ;
274  ~ElectronData() ;
275 
276  // utilities
277  void checkCtfTrack( edm::Handle<reco::TrackCollection> currentCtfTracks ) ;
278  void computeCharge( int & charge, reco::GsfElectron::ChargeInfo & info ) ;
279  CaloClusterPtr getEleBasicCluster( const MultiTrajectoryStateTransform * ) ;
280  bool calculateTSOS( const MultiTrajectoryStateTransform *, GsfConstraintAtVertex * ) ;
281  void calculateMode( const MultiTrajectoryStateMode * mtsMode ) ;
282  Candidate::LorentzVector calculateMomentum() ;
283 
284  // TSOS
292 
293  // mode
294  GlobalVector innMom, seedMom, eleMom, sclMom, vtxMom, outMom ;
295  GlobalPoint innPos, seedPos, elePos, sclPos, vtxPos, outPos ;
297  } ;
298 
300  ( const reco::GsfElectronCoreRef & core,
301  const reco::BeamSpot & bs )
302  : coreRef(core),
303  gsfTrackRef(coreRef->gsfTrack()),
304  superClusterRef(coreRef->superCluster()),
305  ctfTrackRef(coreRef->ctfTrack()), shFracInnerHits(coreRef->ctfGsfOverlap()),
306  beamSpot(bs)
307  {}
308 
310  {}
311 
313  {
314  if (!ctfTrackRef.isNull()) return ;
315 
316  // Code below from Puneeth Kalavase
317 
318  shFracInnerHits = 0 ;
319  const TrackCollection * ctfTrackCollection = currentCtfTracks.product() ;
320 
321  // get the Hit Pattern for the gsfTrack
322  const HitPattern & gsfHitPattern = gsfTrackRef->hitPattern() ;
323 
324  unsigned int counter ;
325  TrackCollection::const_iterator ctfTkIter ;
326  for ( ctfTkIter = ctfTrackCollection->begin() , counter = 0 ;
327  ctfTkIter != ctfTrackCollection->end() ; ctfTkIter++, counter++ )
328  {
329 
330  double dEta = gsfTrackRef->eta() - ctfTkIter->eta() ;
331  double dPhi = gsfTrackRef->phi() - ctfTkIter->phi() ;
332  double pi = acos(-1.);
333  if(std::abs(dPhi) > pi) dPhi = 2*pi - std::abs(dPhi) ;
334 
335  // dont want to look at every single track in the event!
336  if (sqrt(dEta*dEta + dPhi*dPhi) > 0.3) continue ;
337 
338  unsigned int shared = 0 ;
339  int gsfHitCounter = 0 ;
340  int numGsfInnerHits = 0 ;
341  int numCtfInnerHits = 0 ;
342 
343  // get the CTF Track Hit Pattern
344  const HitPattern & ctfHitPattern = ctfTkIter->hitPattern() ;
345 
346  trackingRecHit_iterator elHitsIt ;
347  for ( elHitsIt = gsfTrackRef->recHitsBegin() ;
348  elHitsIt != gsfTrackRef->recHitsEnd() ;
349  elHitsIt++, gsfHitCounter++ )
350  {
351  if (!((**elHitsIt).isValid())) //count only valid Hits
352  { continue ; }
353 
354  // look only in the pixels/TIB/TID
355  uint32_t gsfHit = gsfHitPattern.getHitPattern(gsfHitCounter) ;
356  if (!(gsfHitPattern.pixelHitFilter(gsfHit) ||
357  gsfHitPattern.stripTIBHitFilter(gsfHit) ||
358  gsfHitPattern.stripTIDHitFilter(gsfHit) ) )
359  { continue ; }
360 
361  numGsfInnerHits++ ;
362 
363  int ctfHitsCounter = 0 ;
364  numCtfInnerHits = 0 ;
365  trackingRecHit_iterator ctfHitsIt ;
366  for ( ctfHitsIt = ctfTkIter->recHitsBegin() ;
367  ctfHitsIt != ctfTkIter->recHitsEnd() ;
368  ctfHitsIt++, ctfHitsCounter++ )
369  {
370  if(!((**ctfHitsIt).isValid())) //count only valid Hits!
371  { continue ; }
372 
373  uint32_t ctfHit = ctfHitPattern.getHitPattern(ctfHitsCounter);
374  if( !(ctfHitPattern.pixelHitFilter(ctfHit) ||
375  ctfHitPattern.stripTIBHitFilter(ctfHit) ||
376  ctfHitPattern.stripTIDHitFilter(ctfHit) ) )
377  { continue ; }
378 
379  numCtfInnerHits++ ;
380 
381  if( (**elHitsIt).sharesInput(&(**ctfHitsIt),TrackingRecHit::all) )
382  {
383  shared++ ;
384  break ;
385  }
386 
387  } //ctfHits iterator
388 
389  } //gsfHits iterator
390 
391  if ((numGsfInnerHits==0)||(numCtfInnerHits==0))
392  { continue ; }
393 
394  if ( static_cast<float>(shared)/min(numGsfInnerHits,numCtfInnerHits) > shFracInnerHits )
395  {
396  shFracInnerHits = static_cast<float>(shared)/min(numGsfInnerHits, numCtfInnerHits);
397  ctfTrackRef = TrackRef(currentCtfTracks,counter);
398  }
399  } //ctfTrack iterator
400  }
401 
404  {
405  // determine charge from SC
406  GlobalPoint orig, scpos ;
407  ele_convert(beamSpot.position(),orig) ;
408  ele_convert(superClusterRef->position(),scpos) ;
409  GlobalVector scvect(scpos-orig) ;
410  GlobalPoint inntkpos = innTSOS.globalPosition() ;
411  GlobalVector inntkvect = GlobalVector(inntkpos-orig) ;
412  float dPhiInnEle=normalized_phi(scvect.phi()-inntkvect.phi()) ;
413  if(dPhiInnEle>0) info.scPixCharge = -1 ;
414  else info.scPixCharge = 1 ;
415 
416  // flags
417  int chargeGsf = gsfTrackRef->charge() ;
418  info.isGsfScPixConsistent = ((chargeGsf*info.scPixCharge)>0) ;
419  info.isGsfCtfConsistent = (ctfTrackRef.isNonnull()&&((chargeGsf*ctfTrackRef->charge())>0)) ;
421 
422  // default charge
423  if (info.isGsfScPixConsistent||ctfTrackRef.isNull())
424  { charge = info.scPixCharge ; }
425  else
426  { charge = ctfTrackRef->charge() ; }
427  }
428 
430  ( const MultiTrajectoryStateTransform * mtsTransform )
431  {
432  CaloClusterPtr eleRef ;
433  TrajectoryStateOnSurface tempTSOS ;
434  TrajectoryStateOnSurface outTSOS = mtsTransform->outerStateOnSurface(*gsfTrackRef) ;
435  float dphimin = 1.e30 ;
436  for (CaloCluster_iterator bc=superClusterRef->clustersBegin(); bc!=superClusterRef->clustersEnd(); bc++)
437  {
438  GlobalPoint posclu((*bc)->position().x(),(*bc)->position().y(),(*bc)->position().z()) ;
439  tempTSOS = mtsTransform->extrapolatedState(outTSOS,posclu) ;
440  if (!tempTSOS.isValid()) tempTSOS=outTSOS ;
441  GlobalPoint extrap = tempTSOS.globalPosition() ;
442  float dphi = EleRelPointPair(posclu,extrap,beamSpot.position()).dPhi() ;
443  if (std::abs(dphi)<dphimin)
444  {
445  dphimin = std::abs(dphi) ;
446  eleRef = (*bc);
447  eleTSOS = tempTSOS ;
448  }
449  }
450  return eleRef ;
451  }
452 
454  ( const MultiTrajectoryStateTransform * mtsTransform, GsfConstraintAtVertex * constraintAtVtx )
455  {
456  //at innermost point
457  innTSOS = mtsTransform->innerStateOnSurface(*gsfTrackRef);
458  if (!innTSOS.isValid()) return false;
459 
460  //at vertex
461  // innermost state propagation to the beam spot position
462  GlobalPoint bsPos ;
463  ele_convert(beamSpot.position(),bsPos) ;
464  vtxTSOS = mtsTransform->extrapolatedState(innTSOS,bsPos) ;
465  if (!vtxTSOS.isValid()) vtxTSOS=innTSOS;
466 
467  //at seed
468  outTSOS = mtsTransform->outerStateOnSurface(*gsfTrackRef);
469  if (!outTSOS.isValid()) return false;
470 
471  // TrajectoryStateOnSurface seedTSOS
472  seedTSOS = mtsTransform->extrapolatedState(outTSOS,
473  GlobalPoint(superClusterRef->seed()->position().x(),
474  superClusterRef->seed()->position().y(),
475  superClusterRef->seed()->position().z()));
476  if (!seedTSOS.isValid()) seedTSOS=outTSOS;
477 
478  // at scl
479  sclTSOS = mtsTransform->extrapolatedState(innTSOS,GlobalPoint(superClusterRef->x(),superClusterRef->y(),superClusterRef->z()));
480  if (!sclTSOS.isValid()) sclTSOS=outTSOS;
481 
482  // constrained momentum
483  constrainedVtxTSOS = constraintAtVtx->constrainAtBeamSpot(*gsfTrackRef,beamSpot);
484 
485  return true ;
486  }
487 
489  {
490  mtsMode->momentumFromModeCartesian(innTSOS,innMom) ;
491  mtsMode->positionFromModeCartesian(innTSOS,innPos) ;
492  mtsMode->momentumFromModeCartesian(seedTSOS,seedMom) ;
493  mtsMode->positionFromModeCartesian(seedTSOS,seedPos) ;
494  mtsMode->momentumFromModeCartesian(eleTSOS,eleMom) ;
495  mtsMode->positionFromModeCartesian(eleTSOS,elePos) ;
496  mtsMode->momentumFromModeCartesian(sclTSOS,sclMom) ;
497  mtsMode->positionFromModeCartesian(sclTSOS,sclPos) ;
498  mtsMode->momentumFromModeCartesian(vtxTSOS,vtxMom) ;
499  mtsMode->positionFromModeCartesian(vtxTSOS,vtxPos) ;
500  mtsMode->momentumFromModeCartesian(outTSOS,outMom);
501  mtsMode->positionFromModeCartesian(outTSOS,outPos) ;
502  mtsMode->momentumFromModeCartesian(constrainedVtxTSOS,vtxMomWithConstraint);
503  }
504 
506  {
507  double scale = superClusterRef->energy()/vtxMom.mag() ;
509  ( vtxMom.x()*scale,vtxMom.y()*scale,vtxMom.z()*scale,
510  superClusterRef->energy() ) ;
511  }
512 
514  {
515  const reco::CaloCluster & seedCluster = *(theClus->seed()) ;
516  // temporary, till CaloCluster->seed() is made available
517  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
518  int detector = seedXtalId.subdetId() ;
519 
520  const CaloTopology * topology = eventSetupData_->caloTopo.product() ;
522  const EcalRecHitCollection * recHits = 0 ;
523  std::vector<int> recHitFlagsToBeExcluded ;
524  std::vector<int> recHitSeverityToBeExcluded ;
525  const EcalSeverityLevelAlgo * severityLevelAlgo = eventSetupData_->sevLevel.product() ;
526  if (detector==EcalBarrel)
527  {
528  recHits = eventData_->barrelRecHits.product() ;
529  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedBarrel ;
530  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedBarrel ;
531  }
532  else
533  {
534  recHits = eventData_->endcapRecHits.product() ;
535  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedEndcaps ;
536  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedEndcaps ;
537  }
538 
539  std::vector<float> covariances = EcalClusterTools::covariances(seedCluster,recHits,topology,geometry,recHitFlagsToBeExcluded,recHitSeverityToBeExcluded,severityLevelAlgo) ;
540  std::vector<float> localCovariances = EcalClusterTools::localCovariances(seedCluster,recHits,topology,recHitFlagsToBeExcluded,recHitSeverityToBeExcluded,severityLevelAlgo) ;
541  showerShape.sigmaEtaEta = sqrt(covariances[0]) ;
542  showerShape.sigmaIetaIeta = sqrt(localCovariances[0]) ;
543  if (!isnan(localCovariances[2])) showerShape.sigmaIphiIphi = sqrt(localCovariances[2]) ;
544  showerShape.e1x5 = EcalClusterTools::e1x5(seedCluster,recHits,topology,recHitFlagsToBeExcluded,recHitSeverityToBeExcluded,severityLevelAlgo) ;
545  showerShape.e2x5Max = EcalClusterTools::e2x5Max(seedCluster,recHits,topology,recHitFlagsToBeExcluded,recHitSeverityToBeExcluded,severityLevelAlgo) ;
546  showerShape.e5x5 = EcalClusterTools::e5x5(seedCluster,recHits,topology,recHitFlagsToBeExcluded,recHitSeverityToBeExcluded,severityLevelAlgo) ;
547  showerShape.r9 = EcalClusterTools::e3x3(seedCluster,recHits,topology,recHitFlagsToBeExcluded,recHitSeverityToBeExcluded,severityLevelAlgo)/theClus->rawEnergy() ;
548 
549  if (pflow)
550  {
551  showerShape.hcalDepth1OverEcal = generalData_->hcalHelperPflow->hcalESumDepth1(*theClus)/theClus->energy() ;
552  showerShape.hcalDepth2OverEcal = generalData_->hcalHelperPflow->hcalESumDepth2(*theClus)/theClus->energy() ;
556  }
557  else
558  {
559  showerShape.hcalDepth1OverEcal = generalData_->hcalHelper->hcalESumDepth1(*theClus)/theClus->energy() ;
560  showerShape.hcalDepth2OverEcal = generalData_->hcalHelper->hcalESumDepth2(*theClus)/theClus->energy() ;
564  }
565  }
566 
567 
568 //===================================================================
569 // GsfElectronAlgo
570 //===================================================================
571 
573  ( const InputTagsConfiguration & inputCfg,
574  const StrategyConfiguration & strategyCfg,
575  const CutsConfiguration & cutsCfg,
576  const CutsConfiguration & cutsCfgPflow,
577  const ElectronHcalHelper::Configuration & hcalCfg,
578  const ElectronHcalHelper::Configuration & hcalCfgPflow,
579  const IsolationConfiguration & isoCfg,
580  const EcalRecHitsConfiguration & recHitsCfg,
581  EcalClusterFunctionBaseClass * superClusterErrorFunction,
582  EcalClusterFunctionBaseClass * crackCorrectionFunction
583  )
584  : generalData_(new GeneralData(inputCfg,strategyCfg,cutsCfg,cutsCfgPflow,hcalCfg,hcalCfgPflow,isoCfg,recHitsCfg,superClusterErrorFunction,crackCorrectionFunction)),
587  {}
588 
590  {
591  delete generalData_ ;
592  delete eventSetupData_ ;
593  delete eventData_ ;
594  delete electronData_ ;
595  }
596 
598  {
599  // get EventSetupRecords if needed
600  bool updateField(false);
602  updateField = true;
605  }
606 
607  bool updateGeometry(false);
609  updateGeometry = true;
612  }
613 
614  if ( updateField || updateGeometry ) {
615  delete eventSetupData_->mtsTransform ;
619  }
620 
622  eventSetupData_->cacheIDGeom=es.get<CaloGeometryRecord>().cacheIdentifier();
624  }
625 
627  eventSetupData_->cacheIDTopo=es.get<CaloTopologyRecord>().cacheIdentifier();
629  }
630 
633 
638 
639  //if(eventSetupData_->cacheChStatus!=es.get<EcalChannelStatusRcd>().cacheIdentifier()){
640  // eventSetupData_->cacheChStatus=es.get<EcalChannelStatusRcd>().cacheIdentifier();
641  // es.get<EcalChannelStatusRcd>().get(eventSetupData_->chStatus);
642  //}
643 
645  eventSetupData_->cacheSevLevel = es.get<EcalSeverityLevelAlgoRcd>().cacheIdentifier();
647  }
648  }
649 
651  {
652  GsfElectronPtrCollection::const_iterator it ;
653  for
654  ( it = eventData_->electrons->begin() ;
655  it != eventData_->electrons->end() ;
656  it++ )
657  { outEle.push_back(**it) ; }
658  }
659 
661  {
662  if (eventData_!=0)
663  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"unexpected event data" ; }
664  eventData_ = new EventData ;
665 
666  // init the handles linked to the current event
667  eventData_->event = &event ;
674  event.getByLabel(generalData_->inputCfg.hcalTowersTag,eventData_->towers) ;
675  event.getByLabel(generalData_->inputCfg.pfMVA,eventData_->pfMva) ;
676  event.getByLabel(generalData_->inputCfg.seedsTag,eventData_->seeds) ;
679 
680  // get the beamspot from the Event:
681  edm::Handle<reco::BeamSpot> recoBeamSpotHandle ;
682  event.getByLabel(generalData_->inputCfg.beamSpotTag,recoBeamSpotHandle) ;
683  eventData_->beamspot = recoBeamSpotHandle.product() ;
684 
685  // prepare access to hcal data
688 
689  // Isolation algos
690  float extRadiusSmall=0.3, extRadiusLarge=0.4 ;
691  float intRadiusBarrel=generalData_->isoCfg.intRadiusBarrelTk, intRadiusEndcap=generalData_->isoCfg.intRadiusEndcapTk, stripBarrel=generalData_->isoCfg.stripBarrelTk, stripEndcap=generalData_->isoCfg.stripEndcapTk ;
693  eventData_->tkIsolation03 = new ElectronTkIsolation(extRadiusSmall,intRadiusBarrel,intRadiusEndcap,stripBarrel,stripEndcap,ptMin,maxVtxDist,drb,eventData_->currentCtfTracks.product(),eventData_->beamspot->position()) ;
694  eventData_->tkIsolation04 = new ElectronTkIsolation(extRadiusLarge,intRadiusBarrel,intRadiusEndcap,stripBarrel,stripEndcap,ptMin,maxVtxDist,drb,eventData_->currentCtfTracks.product(),eventData_->beamspot->position()) ;
695 
696  float egHcalIsoConeSizeOutSmall=0.3, egHcalIsoConeSizeOutLarge=0.4;
697  float egHcalIsoConeSizeIn=generalData_->isoCfg.intRadiusHcal,egHcalIsoPtMin=generalData_->isoCfg.etMinHcal;
698  int egHcalDepth1=1, egHcalDepth2=2;
699  eventData_->hadDepth1Isolation03 = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
700  eventData_->hadDepth2Isolation03 = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
701  eventData_->hadDepth1Isolation04 = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
702  eventData_->hadDepth2Isolation04 = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
703  eventData_->hadDepth1Isolation03Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,0.,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
704  eventData_->hadDepth2Isolation03Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,0.,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
705  eventData_->hadDepth1Isolation04Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,0.,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
706  eventData_->hadDepth2Isolation04Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,0.,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
707 
708  float egIsoConeSizeOutSmall=0.3, egIsoConeSizeOutLarge=0.4, egIsoJurassicWidth=generalData_->isoCfg.jurassicWidth;
709  float egIsoPtMinBarrel=generalData_->isoCfg.etMinBarrel,egIsoEMinBarrel=generalData_->isoCfg.eMinBarrel, egIsoConeSizeInBarrel=generalData_->isoCfg.intRadiusEcalBarrel;
710  float egIsoPtMinEndcap=generalData_->isoCfg.etMinEndcaps,egIsoEMinEndcap=generalData_->isoCfg.eMinEndcaps, egIsoConeSizeInEndcap=generalData_->isoCfg.intRadiusEcalEndcaps;
713  eventData_->ecalBarrelIsol03 = new EgammaRecHitIsolation(egIsoConeSizeOutSmall,egIsoConeSizeInBarrel,egIsoJurassicWidth,egIsoPtMinBarrel,egIsoEMinBarrel,eventSetupData_->caloGeom,eventData_->ecalBarrelHitsMeta,eventSetupData_->sevLevel.product(),DetId::Ecal);
714  eventData_->ecalBarrelIsol04 = new EgammaRecHitIsolation(egIsoConeSizeOutLarge,egIsoConeSizeInBarrel,egIsoJurassicWidth,egIsoPtMinBarrel,egIsoEMinBarrel,eventSetupData_->caloGeom,eventData_->ecalBarrelHitsMeta,eventSetupData_->sevLevel.product(),DetId::Ecal);
715  eventData_->ecalEndcapIsol03 = new EgammaRecHitIsolation(egIsoConeSizeOutSmall,egIsoConeSizeInEndcap,egIsoJurassicWidth,egIsoPtMinEndcap,egIsoEMinEndcap,eventSetupData_->caloGeom,eventData_->ecalEndcapHitsMeta,eventSetupData_->sevLevel.product(),DetId::Ecal);
716  eventData_->ecalEndcapIsol04 = new EgammaRecHitIsolation(egIsoConeSizeOutLarge,egIsoConeSizeInEndcap,egIsoJurassicWidth,egIsoPtMinEndcap,egIsoEMinEndcap,eventSetupData_->caloGeom,eventData_->ecalEndcapHitsMeta,eventSetupData_->sevLevel.product(),DetId::Ecal);
733  }
734 
736  {
737  if (eventData_==0)
738  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"lacking event data" ; }
739  delete eventData_ ;
740  eventData_ = 0 ;
741  }
742 
743 void GsfElectronAlgo::displayInternalElectrons( const std::string & title ) const
744  {
745  LogTrace("GsfElectronAlgo") << "========== " << title << " ==========";
746  LogTrace("GsfElectronAlgo") << "Event: " << eventData_->event->id();
747  LogTrace("GsfElectronAlgo") << "Number of electrons: " << eventData_->electrons->size() ;
748  GsfElectronPtrCollection::const_iterator it ;
749  for ( it = eventData_->electrons->begin(); it != eventData_->electrons->end(); it++ )
750  {
751  LogTrace("GsfElectronAlgo") << "Electron with charge, pt, eta, phi: " << (*it)->charge() << " , "
752  << (*it)->pt() << " , " << (*it)->eta() << " , " << (*it)->phi();
753  }
754  LogTrace("GsfElectronAlgo") << "=================================================";
755  }
756 
758  {
759  if (electronData_!=0)
760  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"unexpected electron data" ; }
761 
762  const GsfElectronCoreCollection * coreCollection = eventData_->coreElectrons.product() ;
763  for ( unsigned int i=0 ; i<coreCollection->size() ; ++i )
764  {
765  // check there is no existing electron with this core
767  bool coreFound = false ;
768  GsfElectronPtrCollection::const_iterator itrEle ;
769  for
770  ( itrEle = eventData_->electrons->begin() ;
771  itrEle != eventData_->electrons->end() ;
772  itrEle++ )
773  {
774  if ((*itrEle)->core()==coreRef)
775  {
776  coreFound = true ;
777  break ;
778  }
779  }
780  if (coreFound) continue ;
781 
782  // check there is a super-cluster
783  if (coreRef->superCluster().isNull()) continue ;
784 
785  // prepare internal structure for electron specific data
786  delete electronData_ ;
787  electronData_ = new ElectronData(coreRef,*eventData_->beamspot) ;
788 
789  // calculate and check Trajectory StatesOnSurface....
791 
792  createElectron() ;
793 
794  } // loop over tracks
795 
796  delete electronData_ ;
797  electronData_ = 0 ;
798  }
799 
801  {
802  const GsfElectronCollection * oldElectrons = eventData_->previousElectrons.product() ;
804  GsfElectronCollection::const_iterator oldElectron ;
805  for
806  ( oldElectron = oldElectrons->begin() ;
807  oldElectron != oldElectrons->end() ;
808  ++oldElectron )
809  {
810  const GsfElectronCoreRef oldCoreRef = oldElectron->core() ;
811  const GsfTrackRef oldElectronGsfTrackRef = oldCoreRef->gsfTrack() ;
812  unsigned int icore ;
813  for ( icore=0 ; icore<newCores->size() ; ++icore )
814  {
815  if (oldElectronGsfTrackRef==(*newCores)[icore].gsfTrack())
816  {
818  eventData_->electrons->push_back(new GsfElectron(*oldElectron,coreRef)) ;
819  break ;
820  }
821  }
822  }
823  }
824 
826  {
827  bool found ;
829  GsfElectronCollection::const_iterator pfElectron ;
830 
831  GsfElectronPtrCollection::iterator el ;
832  for
833  ( el = eventData_->electrons->begin() ;
834  el != eventData_->electrons->end() ;
835  el++ )
836  {
837 // // MVA
838 // // we check that the value is never inferior to the no-cut value
839 // // we generally use in the configuration file for minMVA.
840 // GsfTrackRef gsfTrackRef = (*el)->gsfTrack() ;
841 // float mva = (*eventData_->pfMva.product())[gsfTrackRef] ;
842 // if (mva<noCutMin) { throw cms::Exception("GsfElectronAlgo|UnexpectedMvaValue")<<"unexpected MVA value: "<<mva ; }
843 //
844 // // Mva Output
845 // GsfElectron::MvaOutput mvaOutput ;
846 // mvaOutput.mva = mva ;
847 // (*el)->setMvaOutput(mvaOutput) ;
848 
849  // Retreive info from pflow electrons
850  found = false ;
851  for
852  ( pfElectron = pfElectrons->begin() ; pfElectron != pfElectrons->end() ; pfElectron++ )
853  {
854  if (pfElectron->gsfTrack()==(*el)->gsfTrack())
855  {
856  if (found)
857  {
858  edm::LogWarning("GsfElectronProducer")<<"associated pfGsfElectron already found" ;
859  }
860  else
861  {
862  found = true ;
863  (*el)->setPfIsolationVariables(pfElectron->pfIsolationVariables()) ;
864  (*el)->setMvaInput(pfElectron->mvaInput()) ;
865  (*el)->setMvaOutput(pfElectron->mvaOutput()) ;
866  if ((*el)->ecalDrivenSeed())
867  { (*el)->setP4(GsfElectron::P4_PFLOW_COMBINATION,pfElectron->p4(GsfElectron::P4_PFLOW_COMBINATION),pfElectron->p4Error(GsfElectron::P4_PFLOW_COMBINATION),false) ; }
868  else
869  { (*el)->setP4(GsfElectron::P4_PFLOW_COMBINATION,pfElectron->p4(GsfElectron::P4_PFLOW_COMBINATION),pfElectron->p4Error(GsfElectron::P4_PFLOW_COMBINATION),true) ; }
870  double noCutMin = -999999999. ;
871  if ((*el)->mva()<noCutMin) { throw cms::Exception("GsfElectronAlgo|UnexpectedMvaValue")<<"unexpected MVA value: "<<(*el)->mva() ; }
872  }
873  }
874  }
875 
876  // Preselection
878 
879  // Shower Shape of pflow cluster
880  if (!((*el)->pflowSuperCluster().isNull()))
881  {
882  reco::GsfElectron::ShowerShape pflowShowerShape ;
883  calculateShowerShape((*el)->pflowSuperCluster(),true,pflowShowerShape) ;
884  (*el)->setPfShowerShape(pflowShowerShape) ;
885  }
886  else if ((*el)->passingPflowPreselection())
887  { edm::LogError("GsfElectronCoreProducer")<<"Preselected tracker driven GsfTrack with no associated pflow SuperCluster." ; }
888 
889  // PfBrem
890  SuperClusterRef sc = (*el)->pflowSuperCluster() ;
891  if (!(sc.isNull()))
892  {
893 
894  if (sc->clustersSize()>1)
895  {
896  CaloCluster_iterator first = sc->clustersBegin() ;
897  (*el)->setPfSuperClusterFbrem((sc->energy()-(*first)->energy())/sc->energy()) ;
898  }
899  else
900  { (*el)->setPfSuperClusterFbrem(0.) ; }
901  ElectronClassification theClassifier ;
902  theClassifier.refineWithPflow(**el) ;
903  }
904  }
905  }
906 
908  { return (ele->passingCutBasedPreselection()||ele->passingPflowPreselection()) ; }
909 
911  {
913  GsfElectronPtrCollection::iterator eitr = eventData_->electrons->begin() ;
914  while (eitr!=eventData_->electrons->end())
915  {
916  LogTrace("GsfElectronAlgo")<<"========== removed not preselected "<<ei<<"/"<<emax<<"==========" ;
917  if (isPreselected(*eitr))
918  { ++eitr ; ++ei ; }
919  else
920  { delete (*eitr) ; eitr = eventData_->electrons->erase(eitr) ; ++ei ; }
921  }
922  }
923 
925  {
926  // default value
927  ele->setPassCutBasedPreselection(false) ;
928 
929  // kind of seeding
930  bool eg = ele->core()->ecalDrivenSeed() ;
931  bool pf = ele->core()->trackerDrivenSeed() && !ele->core()->ecalDrivenSeed() ;
932  if (eg&&pf) { throw cms::Exception("GsfElectronAlgo|BothEcalAndPureTrackerDriven")<<"An electron cannot be both egamma and purely pflow" ; }
933  if ((!eg)&&(!pf)) { throw cms::Exception("GsfElectronAlgo|NeitherEcalNorPureTrackerDriven")<<"An electron cannot be neither egamma nor purely pflow" ; }
935 
936  // Et cut
937  double etaValue = EleRelPoint(ele->superCluster()->position(),bs.position()).eta() ;
938  double etValue = ele->superCluster()->energy()/cosh(etaValue) ;
939  LogTrace("GsfElectronAlgo") << "Et : " << etValue ;
940  if (ele->isEB() && (etValue < cfg->minSCEtBarrel)) return ;
941  if (ele->isEE() && (etValue < cfg->minSCEtEndcaps)) return ;
942  LogTrace("GsfElectronAlgo") << "Et criteria are satisfied";
943 
944  // E/p cut
945  double eopValue = ele->eSuperClusterOverP() ;
946  LogTrace("GsfElectronAlgo") << "E/p : " << eopValue ;
947  if (ele->isEB() && (eopValue > cfg->maxEOverPBarrel)) return ;
948  if (ele->isEE() && (eopValue > cfg->maxEOverPEndcaps)) return ;
949  if (ele->isEB() && (eopValue < cfg->minEOverPBarrel)) return ;
950  if (ele->isEE() && (eopValue < cfg->minEOverPEndcaps)) return ;
951  LogTrace("GsfElectronAlgo") << "E/p criteria are satisfied";
952 
953  // HoE cuts
954  LogTrace("GsfElectronAlgo") << "HoE1 : " << ele->hcalDepth1OverEcal() << ", HoE2 : " << ele->hcalDepth2OverEcal();
955  double had = ele->hcalOverEcal()*ele->superCluster()->energy() ;
956  const reco::CaloCluster & seedCluster = *(ele->superCluster()->seed()) ;
957  int detector = seedCluster.hitsAndFractions()[0].first.subdetId() ;
958  bool HoEveto = false ;
959  if (detector==EcalBarrel && (had<cfg->maxHBarrel || (had/ele->superCluster()->energy())<cfg->maxHOverEBarrel)) HoEveto=true;
960  else if (detector==EcalEndcap && (had<cfg->maxHEndcaps || (had/ele->superCluster()->energy())<cfg->maxHOverEEndcaps)) HoEveto=true;
961  if ( !HoEveto ) return ;
962  LogTrace("GsfElectronAlgo") << "H/E criteria are satisfied";
963 
964  // delta eta criteria
965  double deta = ele->deltaEtaSuperClusterTrackAtVtx() ;
966  LogTrace("GsfElectronAlgo") << "delta eta : " << deta ;
967  if (ele->isEB() && (std::abs(deta) > cfg->maxDeltaEtaBarrel)) return ;
968  if (ele->isEE() && (std::abs(deta) > cfg->maxDeltaEtaEndcaps)) return ;
969  LogTrace("GsfElectronAlgo") << "Delta eta criteria are satisfied";
970 
971  // delta phi criteria
972  double dphi = ele->deltaPhiSuperClusterTrackAtVtx();
973  LogTrace("GsfElectronAlgo") << "delta phi : " << dphi;
974  if (ele->isEB() && (std::abs(dphi) > cfg->maxDeltaPhiBarrel)) return ;
975  if (ele->isEE() && (std::abs(dphi) > cfg->maxDeltaPhiEndcaps)) return ;
976  LogTrace("GsfElectronAlgo") << "Delta phi criteria are satisfied";
977 
978  // sigma ieta ieta
979  LogTrace("GsfElectronAlgo") << "sigma ieta ieta : " << ele->sigmaIetaIeta();
980  if (ele->isEB() && (ele->sigmaIetaIeta() > cfg->maxSigmaIetaIetaBarrel)) return ;
981  if (ele->isEE() && (ele->sigmaIetaIeta() > cfg->maxSigmaIetaIetaEndcaps)) return ;
982  LogTrace("GsfElectronAlgo") << "Sigma ieta ieta criteria are satisfied";
983 
984  // fiducial
985  if (!ele->isEB() && cfg->isBarrel) return ;
986  if (!ele->isEE() && cfg->isEndcaps) return ;
987  if (cfg->isFiducial && (ele->isEBEEGap()||ele->isEBEtaGap()||ele->isEBPhiGap()||ele->isEERingGap()||ele->isEEDeeGap())) return ;
988  LogTrace("GsfElectronAlgo") << "Fiducial flags criteria are satisfied";
989 
990  // seed in TEC
991  edm::RefToBase<TrajectorySeed> seed = ele->gsfTrack()->extra()->seedRef() ;
992  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>() ;
993  if (eg && !generalData_->cutsCfg.seedFromTEC)
994  {
995  if (elseed.isNull())
996  { throw cms::Exception("GsfElectronAlgo|NotElectronSeed")<<"The GsfTrack seed is not an ElectronSeed ?!" ; }
997  else
998  { if (elseed->subDet2()==6) return ; }
999  }
1000 
1001  // transverse impact parameter
1002  if (std::abs(ele->gsfTrack()->dxy(bs.position()))>cfg->maxTIP) return ;
1003  LogTrace("GsfElectronAlgo") << "TIP criterion is satisfied" ;
1004 
1005  LogTrace("GsfElectronAlgo") << "All cut based criteria are satisfied" ;
1006  ele->setPassCutBasedPreselection(true) ;
1007  }
1008 
1010  {
1011  ele->setPassMvaPreselection(false) ;
1012 
1013  if (ele->core()->ecalDrivenSeed())
1014  { if (ele->mvaOutput().mva>=generalData_->cutsCfg.minMVA) ele->setPassMvaPreselection(true) ; }
1015  else
1016  { if (ele->mvaOutput().mva>=generalData_->cutsCfgPflow.minMVA) ele->setPassMvaPreselection(true) ; }
1017 
1018  if (ele->passingMvaPreselection())
1019  { LogTrace("GsfElectronAlgo") << "Main mva criterion is satisfied" ; }
1020 
1022 
1023 // ele->setPassPflowPreselection(false) ;
1024 // if (ele->core()->ecalDrivenSeed())
1025 // {
1026 // if ((ele->mvaOutput().mva>=generalData_->cutsCfg.minMVA) ||
1027 // (ele->mvaOutput().mvaByPassForIsolated>=generalData_->cutsCfg.minMvaByPassForIsolated))
1028 // ele->setPassPflowPreselection(true) ;
1029 // }
1030 // else
1031 // {
1032 // if ((ele->mvaOutput().mva>=generalData_->cutsCfgPflow.minMVA) ||
1033 // (ele->mvaOutput().mvaByPassForIsolated>=generalData_->cutsCfgPflow.minMvaByPassForIsolated))
1034 // ele->setPassPflowPreselection(true) ;
1035 // }
1036 // if (ele->passingPflowPreselection())
1037 // { LogTrace("GsfElectronAlgo") << "Mva criteria are satisfied" ; }
1038  }
1039 
1041  {
1042  // eventually check ctf track
1045 
1046  // charge ID
1047  int eleCharge ;
1048  GsfElectron::ChargeInfo eleChargeInfo ;
1049  electronData_->computeCharge(eleCharge,eleChargeInfo) ;
1050 
1051  // electron basic cluster
1053 
1054  // Seed cluster
1055  const reco::CaloCluster & seedCluster = *(electronData_->superClusterRef->seed()) ;
1056 
1057  // seed Xtal
1058  // temporary, till CaloCluster->seed() is made available
1059  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
1060 
1062 
1063 
1064  //====================================================
1065  // Candidate attributes
1066  //====================================================
1067 
1069 
1070 
1071  //====================================================
1072  // Track-Cluster Matching
1073  //====================================================
1074 
1076  tcMatching.electronCluster = elbcRef ;
1077  tcMatching.eSuperClusterOverP = (electronData_->vtxMom.mag()>0)?(electronData_->superClusterRef->energy()/electronData_->vtxMom.mag()):(-1.) ;
1078  tcMatching.eSeedClusterOverP = (electronData_->vtxMom.mag()>0.)?(seedCluster.energy()/electronData_->vtxMom.mag()):(-1) ;
1079  tcMatching.eSeedClusterOverPout = (electronData_->seedMom.mag()>0.)?(seedCluster.energy()/electronData_->seedMom.mag()):(-1.) ;
1080  tcMatching.eEleClusterOverPout = (electronData_->eleMom.mag()>0.)?(elbcRef->energy()/electronData_->eleMom.mag()):(-1.) ;
1081 
1083  tcMatching.deltaEtaSuperClusterAtVtx = scAtVtx.dEta() ;
1084  tcMatching.deltaPhiSuperClusterAtVtx = scAtVtx.dPhi() ;
1085 
1086  EleRelPointPair seedAtCalo(seedCluster.position(),electronData_->seedPos,eventData_->beamspot->position()) ;
1087  tcMatching.deltaEtaSeedClusterAtCalo = seedAtCalo.dEta() ;
1088  tcMatching.deltaPhiSeedClusterAtCalo = seedAtCalo.dPhi() ;
1089 
1090  EleRelPointPair ecAtCalo(elbcRef->position(),electronData_->elePos,eventData_->beamspot->position()) ;
1091  tcMatching.deltaEtaEleClusterAtCalo = ecAtCalo.dEta() ;
1092  tcMatching.deltaPhiEleClusterAtCalo = ecAtCalo.dPhi() ;
1093 
1094 
1095  //=======================================================
1096  // Track extrapolations
1097  //=======================================================
1098 
1107 
1108 
1109  //=======================================================
1110  // Closest Ctf Track
1111  //=======================================================
1112 
1114  ctfInfo.ctfTrack = electronData_->ctfTrackRef ;
1116 
1117 
1118  //====================================================
1119  // FiducialFlags, using nextToBoundary definition of gaps
1120  //====================================================
1121 
1122  reco::GsfElectron::FiducialFlags fiducialFlags ;
1123  int detector = seedXtalId.subdetId() ;
1124  double feta=std::abs(electronData_->superClusterRef->position().eta()) ;
1125  if (detector==EcalBarrel)
1126  {
1127  fiducialFlags.isEB = true ;
1128  EBDetId ebdetid(seedXtalId);
1129  if (EBDetId::isNextToEtaBoundary(ebdetid))
1130  {
1131  if (ebdetid.ietaAbs()==85)
1132  { fiducialFlags.isEBEEGap = true ; }
1133  else
1134  { fiducialFlags.isEBEtaGap = true ; }
1135  }
1136  if (EBDetId::isNextToPhiBoundary(ebdetid))
1137  { fiducialFlags.isEBPhiGap = true ; }
1138  }
1139  else if (detector==EcalEndcap)
1140  {
1141  fiducialFlags.isEE = true ;
1142  EEDetId eedetid(seedXtalId);
1143  if (EEDetId::isNextToRingBoundary(eedetid))
1144  {
1145  if (std::abs(feta)<2.)
1146  { fiducialFlags.isEBEEGap = true ; }
1147  else
1148  { fiducialFlags.isEERingGap = true ; }
1149  }
1150  if (EEDetId::isNextToDBoundary(eedetid))
1151  { fiducialFlags.isEEDeeGap = true ; }
1152  }
1153  else
1154  { throw cms::Exception("GsfElectronAlgo|UnknownXtalRegion")<<"createElectron(): do not know if it is a barrel or endcap seed cluster !!!!" ; }
1155 
1156 
1157  //====================================================
1158  // ShowerShape
1159  //====================================================
1160 
1161  reco::GsfElectron::ShowerShape showerShape ;
1162  calculateShowerShape(electronData_->superClusterRef,!(electronData_->coreRef->ecalDrivenSeed()),showerShape) ;
1163 
1164 
1165  //====================================================
1166  // ConversionRejection
1167  //====================================================
1168 
1170 
1171  ConversionFinder conversionFinder ;
1172  double BInTesla = eventSetupData_->magField->inTesla(GlobalPoint(0.,0.,0.)).z() ;
1174  if (!ctfTracks.isValid()) { ctfTracks = eventData_->currentCtfTracks ; }
1175 
1176  // values of conversionInfo.flag()
1177  // -9999 : Partner track was not found
1178  // 0 : Partner track found in the CTF collection using
1179  // 1 : Partner track found in the CTF collection using
1180  // 2 : Partner track found in the GSF collection using
1181  // 3 : Partner track found in the GSF collection using the electron's GSF track
1182  ConversionInfo conversionInfo = conversionFinder.getConversionInfo
1183  (*electronData_->coreRef,ctfTracks,eventData_->originalGsfTracks,BInTesla) ;
1184 
1186  conversionVars.flags = conversionInfo.flag() ;
1187  conversionVars.dist = conversionInfo.dist() ;
1188  conversionVars.dcot = conversionInfo.dcot() ;
1189  conversionVars.radius = conversionInfo.radiusOfConversion() ;
1190  if ((conversionVars.flags==0)or(conversionVars.flags==1))
1191  conversionVars.partner = TrackBaseRef(conversionInfo.conversionPartnerCtfTk()) ;
1192  else if ((conversionVars.flags==2)or(conversionVars.flags==3))
1193  conversionVars.partner = TrackBaseRef(conversionInfo.conversionPartnerGsfTk()) ;
1194 
1195 
1196  //====================================================
1197  // Go !
1198  //====================================================
1199 
1200  GsfElectron * ele = new
1201  GsfElectron
1202  ( eleCharge,eleChargeInfo,electronData_->coreRef,
1203  tcMatching, tkExtra, ctfInfo,
1204  fiducialFlags,showerShape,
1205  conversionVars ) ;
1207  ele->setP4(GsfElectron::P4_FROM_SUPER_CLUSTER,momentum,0,true) ;
1208 
1209 
1210  //====================================================
1211  // brems fractions
1212  //====================================================
1213 
1214  if (electronData_->innMom.mag()>0.)
1216 
1217  SuperClusterRef sc = ele->superCluster() ;
1218  if (!(sc.isNull()))
1219  {
1220  CaloClusterPtr cl = ele->electronCluster() ;
1221  if (sc->clustersSize()>1)
1222  { ele->setSuperClusterFbrem( ( sc->energy() - cl->energy() ) / sc->energy() ) ; }
1223  else
1224  { ele->setSuperClusterFbrem(0) ; }
1225  }
1226 
1227 
1228  //====================================================
1229  // classification and corrections
1230  //====================================================
1231 
1232  // classification
1233  ElectronClassification theClassifier ;
1234  theClassifier.classify(*ele) ;
1235 
1236  // ecal energy
1238  if (ele->core()->ecalDrivenSeed())
1239  {
1241  { theEnCorrector.classBasedParameterizationEnergy(*ele,*eventData_->beamspot) ; }
1243  { theEnCorrector.classBasedParameterizationUncertainty(*ele) ; }
1244  }
1245  else
1246  {
1248  { theEnCorrector.simpleParameterizationUncertainty(*ele) ; }
1249  }
1250 
1251  // momentum
1252  if (ele->core()->ecalDrivenSeed())
1253  {
1254  ElectronMomentumCorrector theMomCorrector;
1255  theMomCorrector.correct(*ele,electronData_->vtxTSOS);
1256  }
1257 
1258 
1259  //====================================================
1260  // now isolation variables
1261  //====================================================
1262 
1276  ele->setIsolation03(dr03);
1277  ele->setIsolation04(dr04);
1278 
1279 
1280  //====================================================
1281  // preselection flag
1282  //====================================================
1283 
1285 
1286  LogTrace("GsfElectronAlgo")<<"Constructed new electron with energy "<< ele->p4().e() ;
1287 
1288  eventData_->electrons->push_back(ele) ;
1289  }
1290 
1291 
1292 //=======================================================================================
1293 // Ambiguity solving
1294 //=======================================================================================
1295 
1296 //bool better_electron( const reco::GsfElectron * e1, const reco::GsfElectron * e2 )
1297 // { return (std::abs(e1->eSuperClusterOverP()-1)<std::abs(e2->eSuperClusterOverP()-1)) ; }
1298 
1299 void GsfElectronAlgo::setAmbiguityData( bool ignoreNotPreselected )
1300  {
1301  GsfElectronPtrCollection::iterator e1, e2 ;
1306  else
1307  { throw cms::Exception("GsfElectronAlgo|UnknownAmbiguitySortingStrategy")<<"value of generalData_->strategyCfg.ambSortingStrategy is : "<<generalData_->strategyCfg.ambSortingStrategy ; }
1308 
1309  // init
1310  for
1311  ( e1 = eventData_->electrons->begin() ;
1312  e1 != eventData_->electrons->end() ;
1313  ++e1 )
1314  {
1315  (*e1)->clearAmbiguousGsfTracks() ;
1316  (*e1)->setAmbiguous(false) ;
1317  }
1318 
1319  // get ambiguous from GsfPfRecTracks
1321  {
1322  for
1323  ( e1 = eventData_->electrons->begin() ;
1324  e1 != eventData_->electrons->end() ;
1325  ++e1 )
1326  {
1327  bool found = false ;
1328  const GsfPFRecTrackCollection * gsfPfRecTrackCollection = eventData_->gsfPfRecTracks.product() ;
1329  GsfPFRecTrackCollection::const_iterator gsfPfRecTrack ;
1330  for ( gsfPfRecTrack=gsfPfRecTrackCollection->begin() ;
1331  gsfPfRecTrack!=gsfPfRecTrackCollection->end() ;
1332  ++gsfPfRecTrack )
1333  {
1334  if (gsfPfRecTrack->gsfTrackRef()==(*e1)->gsfTrack())
1335  {
1336  if (found)
1337  {
1338  edm::LogWarning("GsfElectronAlgo")<<"associated gsfPfRecTrack already found" ;
1339  }
1340  else
1341  {
1342  found = true ;
1343  const std::vector<reco::GsfPFRecTrackRef> & duplicates(gsfPfRecTrack->convBremGsfPFRecTrackRef()) ;
1344  std::vector<reco::GsfPFRecTrackRef>::const_iterator duplicate ;
1345  for ( duplicate = duplicates.begin() ; duplicate != duplicates.end() ; duplicate ++ )
1346  { (*e1)->addAmbiguousGsfTrack((*duplicate)->gsfTrackRef()) ; }
1347  }
1348  }
1349  }
1350  }
1351  }
1352  // or search overlapping clusters
1353  else
1354  {
1355  for
1356  ( e1 = eventData_->electrons->begin() ;
1357  e1 != eventData_->electrons->end() ;
1358  ++e1 )
1359  {
1360  if ((*e1)->ambiguous()) continue ;
1361  if ( ignoreNotPreselected && !isPreselected(*e1) ) continue ;
1362 
1363  SuperClusterRef scRef1 = (*e1)->superCluster();
1364  CaloClusterPtr eleClu1 = (*e1)->electronCluster();
1365  LogDebug("GsfElectronAlgo")
1366  << "Blessing electron with E/P " << (*e1)->eSuperClusterOverP()
1367  << ", cluster " << scRef1.get()
1368  << " & track " << (*e1)->gsfTrack().get() ;
1369 
1370  for
1371  ( e2 = e1, ++e2 ;
1372  e2 != eventData_->electrons->end() ;
1373  ++e2 )
1374  {
1375  if ((*e2)->ambiguous()) continue ;
1376  if ( ignoreNotPreselected && !isPreselected(*e2) ) continue ;
1377 
1378  SuperClusterRef scRef2 = (*e2)->superCluster();
1379  CaloClusterPtr eleClu2 = (*e2)->electronCluster();
1380 
1381  // search if same cluster
1382  bool sameCluster = false ;
1384  { sameCluster = (scRef1==scRef2) ; }
1386  {
1387  float eMin = 1. ;
1388  float threshold = eMin*cosh(EleRelPoint(scRef1->position(),eventData_->beamspot->position()).eta()) ;
1389  sameCluster =
1391  (EgAmbiguityTools::sharedEnergy(&(*scRef1->seed()),&(*eleClu2),eventData_->barrelRecHits,eventData_->endcapRecHits)>=threshold) ||
1393  (EgAmbiguityTools::sharedEnergy(&(*scRef1->seed()),&(*scRef2->seed()),eventData_->barrelRecHits,eventData_->endcapRecHits)>=threshold) ) ;
1394  }
1395  else
1396  { throw cms::Exception("GsfElectronAlgo|UnknownAmbiguityClustersOverlapStrategy")<<"value of generalData_->strategyCfg.ambClustersOverlapStrategy is : "<<generalData_->strategyCfg.ambClustersOverlapStrategy ; }
1397 
1398  // main instructions
1399  if (sameCluster)
1400  {
1401  LogDebug("GsfElectronAlgo")
1402  << "Discarding electron with E/P " << (*e2)->eSuperClusterOverP()
1403  << ", cluster " << scRef2.get()
1404  << " and track " << (*e2)->gsfTrack().get() ;
1405  (*e1)->addAmbiguousGsfTrack((*e2)->gsfTrack()) ;
1406  (*e2)->setAmbiguous(true) ;
1407  }
1408  else if ((*e1)->gsfTrack()==(*e2)->gsfTrack())
1409  {
1410  edm::LogWarning("GsfElectronAlgo")
1411  << "Forgetting electron with E/P " << (*e2)->eSuperClusterOverP()
1412  << ", cluster " << scRef2.get()
1413  << " and track " << (*e2)->gsfTrack().get() ;
1414  (*e2)->setAmbiguous(true) ;
1415  }
1416  }
1417  }
1418  }
1419  }
1420 
1422  {
1423  GsfElectronPtrCollection::size_type ei = 1, emax = eventData_->electrons->size() ;
1424  GsfElectronPtrCollection::iterator eitr = eventData_->electrons->begin() ;
1425  while (eitr!=eventData_->electrons->end())
1426  {
1427  LogTrace("GsfElectronAlgo")<<"========== remove ambiguous "<<ei<<"/"<<emax<<"==========" ;
1428  if ((*eitr)->ambiguous())
1429  { delete (*eitr) ; eitr = eventData_->electrons->erase(eitr) ; ++ei ; }
1430  else
1431  { ++eitr ; ++ei ; }
1432  }
1433  }
1434 
1435 
#define LogDebug(id)
TrajectoryStateOnSurface constrainAtBeamSpot(const reco::GsfTrack &, const reco::BeamSpot &) const
(multi)TSOS after including the beamspot
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:228
ElectronHcalHelper * hcalHelperPflow
edm::Handle< reco::TrackCollection > originalCtfTracks
unsigned long long cacheIdentifier() const
edm::Handle< reco::ElectronSeedCollection > seeds
const MultiTrajectoryStateMode * mtsMode
bool isPreselected(reco::GsfElectron *ele)
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:123
void setTrackFbrem(float fbrem)
Definition: GsfElectron.h:642
int i
Definition: DBlmapReader.cc:9
edm::Handle< edm::ValueMap< float > > pfMva
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
Definition: GsfElectron.cc:178
GeneralData * generalData_
const CutsConfiguration cutsCfgPflow
static bool isNextToEtaBoundary(EBDetId id)
Definition: EBDetId.cc:175
EgammaTowerIsolation * hadDepth1Isolation04Bc
reco::GsfTrackRef conversionPartnerGsfTk() const
void setPassCutBasedPreselection(bool flag)
Definition: GsfElectron.h:593
bool positionFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalPoint &position) const
bool isEBEtaGap() const
Definition: GsfElectron.h:335
void readEvent(const edm::Event &)
EgammaTowerIsolation * hadDepth1Isolation03Bc
double radiusOfConversion() const
void clonePreviousElectrons()
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:204
float eSuperClusterOverP() const
Definition: GsfElectron.h:229
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool isBetter(const reco::GsfElectron *, const reco::GsfElectron *)
void retreiveOriginalTrackCollections(const reco::TrackRef &, const reco::GsfTrackRef &)
bool isEBEEGap() const
Definition: GsfElectron.h:333
float hcalDepth2OverEcal() const
Definition: GsfElectron.h:389
void doSeverityChecks(const EcalRecHitCollection *const recHits, const std::vector< int > v)
double getEtSum(const reco::Candidate *emObject) const
const IsolationConfiguration isoCfg
void calculateShowerShape(const reco::SuperClusterRef &, bool pflow, reco::GsfElectron::ShowerShape &)
void beginEvent(edm::Event &)
GeneralData(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)
TrajectoryStateOnSurface sclTSOS
const EcalRecHitsConfiguration recHitsCfg
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
EventSetupData * eventSetupData_
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
edm::Handle< EcalRecHitCollection > endcapRecHits
double hcalESumDepth2BehindClusters(const std::vector< CaloTowerDetId > &towers)
double dist() const
#define abs(x)
Definition: mlp_lapack.h:159
std::vector< CaloTowerDetId > hcalTowersBehindClusters(const reco::SuperCluster &sc)
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:189
#define min(a, b)
Definition: mlp_lapack.h:161
void checkSetup(const edm::EventSetup &)
bool isEERingGap() const
Definition: GsfElectron.h:339
bool passingCutBasedPreselection() const
Definition: GsfElectron.h:585
bool passingMvaPreselection() const
Definition: GsfElectron.h:601
void computeCharge(int &charge, reco::GsfElectron::ChargeInfo &info)
bool momentumFromModeCartesian(const TrajectoryStateOnSurface tsos, GlobalVector &momentum) const
void checkCtfTrack(edm::Handle< reco::TrackCollection > currentCtfTracks)
T eta() const
double hcalESumDepth1BehindClusters(const std::vector< CaloTowerDetId > &towers)
const InputTagsConfiguration inputCfg
edm::ESHandle< EcalSeverityLevelAlgo > sevLevel
TrajectoryStateOnSurface innTSOS
void doFlagChecks(const std::vector< int > v)
uint16_t size_type
bool isEEDeeGap() const
Definition: GsfElectron.h:338
double charge(const std::vector< uint8_t > &Ampls)
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
EgammaTowerIsolation * hadDepth1Isolation03
const StrategyConfiguration strategyCfg
bool isEE() const
Definition: GsfElectron.h:331
bool isEB() const
Definition: GsfElectron.h:330
TrajectoryStateOnSurface outerStateOnSurface(const reco::GsfTrack &tk) const
double getTowerEtSum(const reco::Candidate *, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
edm::ESHandle< CaloTopology > caloTopo
reco::TrackRef conversionPartnerCtfTk() const
static std::vector< float > covariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry, float w0=4.7)
const Double_t pi
void setSuperClusterFbrem(float fbrem)
Definition: GsfElectron.h:643
static bool stripTIDHitFilter(uint32_t pattern)
Definition: HitPattern.h:423
EgammaRecHitIsolation * ecalBarrelIsol04
TrajectoryStateOnSurface constrainedVtxTSOS
virtual float getValue(const reco::BasicCluster &, const EcalRecHitCollection &) const =0
EgammaTowerIsolation * hadDepth2Isolation03
EgammaTowerIsolation * hadDepth1Isolation04
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
ElectronTkIsolation * tkIsolation03
void setUseNumCrystals(bool b=true)
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:233
void setCorrectedEcalEnergyError(float newEnergyError)
Definition: GsfElectron.cc:158
bool isNull() const
Checks for null.
Definition: Ref.h:247
T mag() const
Definition: PV3DBase.h:66
float sigmaIetaIeta() const
Definition: GsfElectron.h:382
static std::vector< float > localCovariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=4.7)
void simpleParameterizationUncertainty(reco::GsfElectron &)
TrajectoryStateOnSurface extrapolatedState(const TrajectoryStateOnSurface tsos, const GlobalPoint &point) const
void setCutBasedPreselectionFlag(reco::GsfElectron *ele, const reco::BeamSpot &)
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:22
EgammaRecHitIsolation * ecalEndcapIsol03
float sharedEnergy(const reco::CaloCluster *, const reco::CaloCluster *, edm::Handle< EcalRecHitCollection > &barrelRecHits, edm::Handle< EcalRecHitCollection > &endcapRecHits)
bool isnan(float x)
Definition: math.h:13
EgammaTowerIsolation * hadDepth2Isolation03Bc
RealType normalized_phi(RealType phi)
T sqrt(T t)
Definition: SSEVec.h:46
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:168
GsfConstraintAtVertex * constraintAtVtx
static bool isNextToPhiBoundary(EBDetId id)
Definition: EBDetId.cc:180
edm::Handle< EcalRecHitCollection > barrelRecHits
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:236
std::vector< GsfElectronCore > GsfElectronCoreCollection
void correct(reco::GsfElectron &, TrajectoryStateOnSurface &)
static bool pixelHitFilter(uint32_t pattern)
Definition: HitPattern.h:384
float hcalOverEcal() const
Definition: GsfElectron.h:390
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
void setPassMvaPreselection(bool flag)
Definition: GsfElectron.h:600
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: GsfElectron.h:366
const MultiTrajectoryStateTransform * mtsTransform
static bool isNextToRingBoundary(EEDetId id)
Definition: EEDetId.cc:391
std::list< reco::GsfElectron * > GsfElectronPtrCollection
double hcalESumDepth2(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
double energy() const
cluster energy
Definition: CaloCluster.h:120
const CutsConfiguration cutsCfg
ElectronHcalHelper * hcalHelper
const reco::BeamSpot * beamspot
edm::ESHandle< MagneticField > magField
GsfElectronPtrCollection * electrons
CaloClusterPtr getEleBasicCluster(const MultiTrajectoryStateTransform *)
static bool isNextToDBoundary(EEDetId id)
Definition: EEDetId.cc:383
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 first
Definition: L1TdeRCT.cc:94
bool isValid() const
Definition: HandleBase.h:76
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
void setIsolation04(const IsolationVariables &dr04)
Definition: GsfElectron.h:463
#define LogTrace(id)
float cl
Definition: Combine.cc:71
void classify(reco::GsfElectron &)
EgammaTowerIsolation * hadDepth2Isolation04Bc
edm::Handle< reco::GsfElectronCollection > previousElectrons
float hcalDepth1OverEcal() const
Definition: GsfElectron.h:388
Definition: DetId.h:20
void classBasedParameterizationEnergy(reco::GsfElectron &, const reco::BeamSpot &bs)
EgammaRecHitIsolation * ecalBarrelIsol03
edm::Handle< reco::GsfElectronCollection > pflowElectrons
EcalRecHitMetaCollection * ecalBarrelHitsMeta
int flag() const
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)
EcalClusterFunctionBaseClass * superClusterErrorFunction
const T & get() const
Definition: EventSetup.h:55
REF castTo() const
cast to a concrete type
Definition: RefToBase.h:241
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:14
void setPflowPreselectionFlag(reco::GsfElectron *ele)
const MvaOutput & mvaOutput() const
Definition: GsfElectron.h:558
T const * product() const
Definition: ESHandle.h:62
const reco::GsfTrackRef gsfTrackRef
void ele_convert(const Type1 &obj1, Type2 &obj2)
T const * product() const
Definition: Handle.h:74
bool calculateTSOS(const MultiTrajectoryStateTransform *, GsfConstraintAtVertex *)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:38
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
math::XYZVectorF momentumAtVtxWithConstraint
Definition: GsfElectron.h:266
double getPtTracks(const reco::GsfElectron *) const
TrajectoryStateOnSurface innerStateOnSurface(const reco::GsfTrack &tk) const
TrajectoryStateOnSurface seedTSOS
void refineWithPflow(reco::GsfElectron &)
void setIsolation03(const IsolationVariables &dr03)
Definition: GsfElectron.h:462
ESHandle< TrackerGeometry > geometry
edm::EventID id() const
Definition: EventBase.h:56
edm::Handle< reco::GsfTrackCollection > originalGsfTracks
EgammaTowerIsolation * hadDepth2Isolation04
void setVetoClustered(bool b=true)
SimpleCaloRecHitMetaCollection< EcalRecHitCollection > EcalRecHitMetaCollection
const reco::GsfElectronCoreRef coreRef
bool isEBPhiGap() const
Definition: GsfElectron.h:336
edm::Handle< reco::TrackCollection > currentCtfTracks
static float e2x5Max(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
edm::ESHandle< CaloGeometry > caloGeom
EcalClusterFunctionBaseClass * crackCorrectionFunction
void removeAmbiguousElectrons()
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
double hcalESumDepth1(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
void displayInternalElectrons(const std::string &title) const
void setPassPflowPreselection(bool flag)
Definition: GsfElectron.h:594
EgammaRecHitIsolation * ecalEndcapIsol04
static float e1x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
void removeNotPreselectedElectrons()
const reco::SuperClusterRef superClusterRef
TrajectoryStateOnSurface eleTSOS
const Point & position() const
position
Definition: BeamSpot.h:63
EventData * eventData_
double dcot() const
TrajectoryStateOnSurface outTSOS
ElectronData(const reco::GsfElectronCoreRef &core, const reco::BeamSpot &bs)
void copyElectrons(reco::GsfElectronCollection &)
ProductID id() const
Accessor for product ID.
Definition: Ref.h:256
ElectronTkIsolation * tkIsolation04
ElectronData * electronData_
edm::ESHandle< TrackerGeometry > trackerHandle
void setAmbiguityData(bool ignoreNotPreselected=true)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
virtual void init(const edm::EventSetup &es)=0
edm::Handle< reco::GsfElectronCoreCollection > coreElectrons
int ietaAbs() const
get the absolute value of the crystal ieta
Definition: EBDetId.h:42
void classBasedParameterizationUncertainty(reco::GsfElectron &)
edm::Handle< CaloTowerCollection > towers
void calculateMode(const MultiTrajectoryStateMode *mtsMode)
math::PtEtaPhiELorentzVectorF LorentzVector
EcalRecHitMetaCollection * ecalEndcapHitsMeta
Global3DVector GlobalVector
Definition: GlobalVector.h:10
void checkSetup(const edm::EventSetup &)
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracks
TrajectoryStateOnSurface vtxTSOS
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:169
static bool stripTIBHitFilter(uint32_t pattern)
Definition: HitPattern.h:416
Candidate::LorentzVector calculateMomentum()
bool passingPflowPreselection() const
Definition: GsfElectron.h:586
const reco::BeamSpot beamSpot