CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
GsfElectronAlgo Class Reference

#include <GsfElectronAlgo.h>

Classes

struct  CutsConfiguration
 
struct  EcalRecHitsConfiguration
 
struct  ElectronData
 
struct  EventData
 
struct  EventSetupData
 
struct  GeneralData
 
struct  InputTagsConfiguration
 
struct  IsolationConfiguration
 
struct  StrategyConfiguration
 

Public Member Functions

void completeElectrons (reco::GsfElectronCollection &electrons, edm::Event const &event, edm::EventSetup const &eventSetup, const gsfAlgoHelpers::HeavyObjectCache *hoc)
 
 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)
 

Private Member Functions

EventData beginEvent (edm::Event const &event)
 
void calculateSaturationInfo (const reco::SuperClusterRef &, reco::GsfElectron::SaturationInfo &, EventData const &eventData)
 
template<bool full5x5>
void calculateShowerShape (const reco::SuperClusterRef &, ElectronHcalHelper const &hcalHelper, reco::GsfElectron::ShowerShape &, EventData const &eventData)
 
void checkSetup (edm::EventSetup const &eventSetup)
 
void createElectron (reco::GsfElectronCollection &electrons, ElectronData &electronData, EventData &eventData, const gsfAlgoHelpers::HeavyObjectCache *)
 
const reco::SuperClusterRef getTrSuperCluster (const reco::GsfTrackRef &trackRef)
 
void setCutBasedPreselectionFlag (reco::GsfElectron &ele, const reco::BeamSpot &)
 
void setMVAepiBasedPreselectionFlag (reco::GsfElectron &ele)
 
void setPixelMatchInfomation (reco::GsfElectron &)
 

Private Attributes

EventSetupData eventSetupData_
 
GeneralData generalData_
 
EleTkIsolFromCands tkIsol03Calc_
 
EleTkIsolFromCands tkIsol04Calc_
 
EleTkIsolFromCands tkIsolHEEP03Calc_
 
EleTkIsolFromCands tkIsolHEEP04Calc_
 

Detailed Description

Definition at line 50 of file GsfElectronAlgo.h.

Constructor & Destructor Documentation

GsfElectronAlgo::GsfElectronAlgo ( const InputTagsConfiguration inputCfg,
const StrategyConfiguration strategyCfg,
const CutsConfiguration cutsCfg,
const CutsConfiguration cutsCfgPflow,
const ElectronHcalHelper::Configuration hcalCfg,
const ElectronHcalHelper::Configuration hcalCfgPflow,
const IsolationConfiguration isoCfg,
const EcalRecHitsConfiguration recHitsCfg,
EcalClusterFunctionBaseClass superClusterErrorFunction,
EcalClusterFunctionBaseClass crackCorrectionFunction,
const RegressionHelper::Configuration regCfg,
const edm::ParameterSet tkIsol03Cfg,
const edm::ParameterSet tkIsol04Cfg,
const edm::ParameterSet tkIsolHEEP03Cfg,
const edm::ParameterSet tkIsolHEEP04Cfg 
)

Definition at line 297 of file GsfElectronAlgo.cc.

References eventSetupData_, tkIsol03Calc_, tkIsol04Calc_, tkIsolHEEP03Calc_, and tkIsolHEEP04Calc_.

Referenced by calculateShowerShape().

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  {}
EventSetupData eventSetupData_
EleTkIsolFromCands tkIsolHEEP03Calc_
GeneralData generalData_
EleTkIsolFromCands tkIsol04Calc_
EleTkIsolFromCands tkIsolHEEP04Calc_
EleTkIsolFromCands tkIsol03Calc_

Member Function Documentation

GsfElectronAlgo::EventData GsfElectronAlgo::beginEvent ( edm::Event const &  event)
private

Definition at line 369 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::InputTagsConfiguration::barrelRecHitCollection, particleFlowSuperClusterOOTECAL_cff::barrelRecHits, GsfElectronAlgo::InputTagsConfiguration::beamSpotTag, GsfElectronAlgo::EventSetupData::caloGeom, GsfElectronAlgo::InputTagsConfiguration::conversions, GsfElectronAlgo::InputTagsConfiguration::ctfTracks, DetId::Ecal, GsfElectronAlgo::IsolationConfiguration::eMinBarrel, GsfElectronAlgo::IsolationConfiguration::eMinEndcaps, GsfElectronAlgo::InputTagsConfiguration::endcapRecHitCollection, particleFlowSuperClusterOOTECAL_cff::endcapRecHits, GsfElectronAlgo::IsolationConfiguration::etMinBarrel, GsfElectronAlgo::IsolationConfiguration::etMinEndcaps, GsfElectronAlgo::IsolationConfiguration::etMinHcal, event(), GsfElectronAlgo::EventData::event, eventSetupData_, GsfElectronAlgo::StrategyConfiguration::fillConvVtxFitProb, generalData_, GsfElectronAlgo::InputTagsConfiguration::gsfElectronCores, GsfElectronAlgo::InputTagsConfiguration::gsfPfRecTracksTag, GsfElectronAlgo::GeneralData::hcalHelper, GsfElectronAlgo::GeneralData::hcalHelperPflow, GsfElectronAlgo::InputTagsConfiguration::hcalTowersTag, GsfElectronAlgo::GeneralData::inputCfg, GsfElectronAlgo::IsolationConfiguration::intRadiusEcalBarrel, GsfElectronAlgo::IsolationConfiguration::intRadiusEcalEndcaps, GsfElectronAlgo::IsolationConfiguration::intRadiusHcal, GsfElectronAlgo::GeneralData::isoCfg, GsfElectronAlgo::IsolationConfiguration::jurassicWidth, GsfElectronAlgo::InputTagsConfiguration::pflowGsfElectronsTag, GsfElectronAlgo::InputTagsConfiguration::previousGsfElectrons, edm::ESHandle< T >::product(), ElectronHcalHelper::readEvent(), GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedEndcaps, GsfElectronAlgo::GeneralData::recHitsCfg, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedEndcaps, GsfElectronAlgo::InputTagsConfiguration::seedsTag, EgammaRecHitIsolation::setUseNumCrystals(), GsfElectronAlgo::EventSetupData::sevLevel, GsfElectronAlgo::GeneralData::strategyCfg, GsfElectronAlgo::StrategyConfiguration::useGsfPfRecTracks, GsfElectronAlgo::IsolationConfiguration::useNumCrystals, GsfElectronAlgo::IsolationConfiguration::vetoClustered, and GsfElectronAlgo::InputTagsConfiguration::vtxCollectionTag.

Referenced by completeElectrons().

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  }
edm::EDGetTokenT< reco::GsfElectronCoreCollection > gsfElectronCores
void readEvent(const edm::Event &)
edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons
const IsolationConfiguration isoCfg
edm::EDGetTokenT< reco::VertexCollection > vtxCollectionTag
const EcalRecHitsConfiguration recHitsCfg
edm::EDGetTokenT< EcalRecHitCollection > endcapRecHitCollection
const InputTagsConfiguration inputCfg
edm::ESHandle< EcalSeverityLevelAlgo > sevLevel
edm::EDGetTokenT< reco::GsfElectronCollection > pflowGsfElectronsTag
const StrategyConfiguration strategyCfg
edm::EDGetTokenT< EcalRecHitCollection > barrelRecHitCollection
edm::EDGetTokenT< reco::GsfPFRecTrackCollection > gsfPfRecTracksTag
edm::EDGetTokenT< reco::ConversionCollection > conversions
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag
EventSetupData eventSetupData_
void setUseNumCrystals(bool b=true)
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsTag
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
edm::EDGetTokenT< CaloTowerCollection > hcalTowersTag
ElectronHcalHelper hcalHelperPflow
edm::EDGetTokenT< reco::TrackCollection > ctfTracks
GeneralData generalData_
edm::ESHandle< CaloGeometry > caloGeom
ElectronHcalHelper hcalHelper
T const * product() const
Definition: ESHandle.h:86
Definition: event.py:1
void GsfElectronAlgo::calculateSaturationInfo ( const reco::SuperClusterRef theClus,
reco::GsfElectron::SaturationInfo si,
EventData const &  eventData 
)
private

Definition at line 187 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::barrelRecHits, gamEcalExtractorBlocks_cff::detector, EcalBarrel, ecalRecalibRecHit_cfi::ecalRecHit, edm::SortedCollection< T, SORT >::end(), GsfElectronAlgo::EventData::endcapRecHits, edm::SortedCollection< T, SORT >::find(), reco::GsfElectron::SaturationInfo::isSeedSaturated, reco::GsfElectron::SaturationInfo::nSaturatedXtals, nullptr, reco::CaloCluster::seed(), and DetId::subdetId().

Referenced by createElectron().

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 }
#define nullptr
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
const_iterator end() const
Definition: DetId.h:18
DetId seed() const
return DetId of seed
Definition: CaloCluster.h:207
iterator find(key_type k)
template<bool full5x5>
void GsfElectronAlgo::calculateShowerShape ( const reco::SuperClusterRef theClus,
ElectronHcalHelper const &  hcalHelper,
reco::GsfElectron::ShowerShape showerShape,
EventData const &  eventData 
)
private

Definition at line 217 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::barrelRecHits, GsfElectronAlgo::EventSetupData::caloGeom, GsfElectronAlgo::EventSetupData::caloTopo, gamEcalExtractorBlocks_cff::detector, reco::GsfElectron::ShowerShape::e1x5, reco::GsfElectron::ShowerShape::e2nd, reco::GsfElectron::ShowerShape::e2x5Bottom, reco::GsfElectron::ShowerShape::e2x5Left, reco::GsfElectron::ShowerShape::e2x5Max, reco::GsfElectron::ShowerShape::e2x5Right, reco::GsfElectron::ShowerShape::e2x5Top, reco::GsfElectron::ShowerShape::e5x5, reco::GsfElectron::ShowerShape::eBottom, EcalBarrel, reco::GsfElectron::ShowerShape::eLeft, photonPostprocessing_cfi::eMax, reco::GsfElectron::ShowerShape::eMax, GsfElectronAlgo::EventData::endcapRecHits, reco::GsfElectron::ShowerShape::eRight, reco::GsfElectron::ShowerShape::eTop, eventSetupData_, generalData_, GsfElectronAlgo(), ElectronHcalHelper::hasActiveHcal(), reco::GsfElectron::ShowerShape::hcalDepth1OverEcal, reco::GsfElectron::ShowerShape::hcalDepth1OverEcalBc, reco::GsfElectron::ShowerShape::hcalDepth2OverEcal, reco::GsfElectron::ShowerShape::hcalDepth2OverEcalBc, ElectronHcalHelper::hcalESumDepth1(), ElectronHcalHelper::hcalESumDepth1BehindClusters(), ElectronHcalHelper::hcalESumDepth2(), ElectronHcalHelper::hcalESumDepth2BehindClusters(), ElectronHcalHelper::hcalTowersBehindClusters(), reco::GsfElectron::ShowerShape::hcalTowersBehindClusters, reco::CaloCluster::hitsAndFractions(), reco::GsfElectron::ShowerShape::invalidHcal, edm::isNotFinite(), nullptr, edm::ESHandle< T >::product(), reco::GsfElectron::ShowerShape::r9, GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedEndcaps, GsfElectronAlgo::GeneralData::recHitsCfg, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedEndcaps, Scenarios_cff::scale, reco::GsfElectron::ShowerShape::sigmaEtaEta, reco::GsfElectron::ShowerShape::sigmaIetaIeta, reco::GsfElectron::ShowerShape::sigmaIetaIphi, reco::GsfElectron::ShowerShape::sigmaIphiIphi, mathSSE::sqrt(), DetId::subdetId(), and ecaldqm::topology().

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) ;
263  showerShape.hcalDepth1OverEcalBc = hcalHelper.hcalESumDepth1BehindClusters(showerShape.hcalTowersBehindClusters)/scale ;
264  showerShape.hcalDepth2OverEcalBc = hcalHelper.hcalESumDepth2BehindClusters(showerShape.hcalTowersBehindClusters)/scale ;
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  }
CaloTopology const * topology(0)
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
#define nullptr
const EcalRecHitsConfiguration recHitsCfg
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:197
edm::ESHandle< CaloTopology > caloTopo
EventSetupData eventSetupData_
T sqrt(T t)
Definition: SSEVec.h:18
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: GsfElectron.h:400
Definition: DetId.h:18
GeneralData generalData_
edm::ESHandle< CaloGeometry > caloGeom
T const * product() const
Definition: ESHandle.h:86
void GsfElectronAlgo::checkSetup ( edm::EventSetup const &  eventSetup)
private

Definition at line 321 of file GsfElectronAlgo.cc.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), GsfElectronAlgo::EventSetupData::cacheIDGeom, GsfElectronAlgo::EventSetupData::cacheIDMagField, GsfElectronAlgo::EventSetupData::cacheIDTDGeom, GsfElectronAlgo::EventSetupData::cacheIDTopo, GsfElectronAlgo::EventSetupData::cacheSevLevel, GsfElectronAlgo::EventSetupData::caloGeom, GsfElectronAlgo::EventSetupData::caloTopo, RegressionHelper::checkSetup(), ElectronHcalHelper::checkSetup(), GsfElectronAlgo::EventSetupData::constraintAtVtx, GsfElectronAlgo::GeneralData::crackCorrectionFunction, eventSetupData_, generalData_, edm::EventSetup::get(), GsfElectronAlgo::GeneralData::hcalHelper, GsfElectronAlgo::GeneralData::hcalHelperPflow, EcalClusterFunctionBaseClass::init(), GsfElectronAlgo::EventSetupData::magField, GsfElectronAlgo::EventSetupData::mtsTransform, edm::ESHandle< T >::product(), GsfElectronAlgo::GeneralData::regHelper, GsfElectronAlgo::EventSetupData::sevLevel, GsfElectronAlgo::GeneralData::strategyCfg, GsfElectronAlgo::GeneralData::superClusterErrorFunction, GsfElectronAlgo::EventSetupData::trackerHandle, GsfElectronAlgo::StrategyConfiguration::useCombinationRegression, and GsfElectronAlgo::StrategyConfiguration::useEcalRegression.

Referenced by completeElectrons().

322  {
323  // get EventSetupRecords if needed
324  const bool updateField = eventSetupData_.cacheIDMagField!=es.get<IdealMagneticFieldRecord>().cacheIdentifier();
325  if (updateField){
326  eventSetupData_.cacheIDMagField=es.get<IdealMagneticFieldRecord>().cacheIdentifier();
328  }
329 
330  const bool updateGeometry = eventSetupData_.cacheIDTDGeom!=es.get<TrackerDigiGeometryRecord>().cacheIdentifier();
331  if (updateGeometry){
332  eventSetupData_.cacheIDTDGeom=es.get<TrackerDigiGeometryRecord>().cacheIdentifier();
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  }
unsigned long long cacheIdentifier() const
std::unique_ptr< const MultiTrajectoryStateTransform > mtsTransform
void checkSetup(const edm::EventSetup &)
edm::ESHandle< EcalSeverityLevelAlgo > sevLevel
const StrategyConfiguration strategyCfg
edm::ESHandle< CaloTopology > caloTopo
EventSetupData eventSetupData_
edm::ESHandle< MagneticField > magField
std::unique_ptr< GsfConstraintAtVertex > constraintAtVtx
unsigned long long cacheIDMagField
ElectronHcalHelper hcalHelperPflow
EcalClusterFunctionBaseClass * superClusterErrorFunction
GeneralData generalData_
edm::ESHandle< CaloGeometry > caloGeom
EcalClusterFunctionBaseClass * crackCorrectionFunction
ElectronHcalHelper hcalHelper
edm::ESHandle< TrackerGeometry > trackerHandle
virtual void init(const edm::EventSetup &es)=0
T const * product() const
Definition: ESHandle.h:86
void checkSetup(const edm::EventSetup &)
void GsfElectronAlgo::completeElectrons ( reco::GsfElectronCollection electrons,
edm::Event const &  event,
edm::EventSetup const &  eventSetup,
const gsfAlgoHelpers::HeavyObjectCache hoc 
)

Definition at line 437 of file GsfElectronAlgo.cc.

References beginEvent(), GsfElectronAlgo::ElectronData::calculateTSOS(), checkSetup(), GsfElectronAlgo::EventSetupData::constraintAtVtx, createElectron(), eventSetupData_, funct::false, mps_fire::i, edm::Ref< C, T, F >::isNull(), GsfElectronAlgo::EventSetupData::mtsTransform, and funct::true.

Referenced by GsfElectronProducer::produce(), GsfElectronEcalDrivenProducer::produce(), GEDGsfElectronProducer::produce(), and LowPtGsfElectronProducer::produce().

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  }
std::unique_ptr< const MultiTrajectoryStateTransform > mtsTransform
void createElectron(reco::GsfElectronCollection &electrons, ElectronData &electronData, EventData &eventData, const gsfAlgoHelpers::HeavyObjectCache *)
EventSetupData eventSetupData_
void checkSetup(edm::EventSetup const &eventSetup)
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::unique_ptr< GsfConstraintAtVertex > constraintAtVtx
bool isNull() const
Checks for null.
Definition: Ref.h:248
EventData beginEvent(edm::Event const &event)
Definition: event.py:1
void GsfElectronAlgo::createElectron ( reco::GsfElectronCollection electrons,
ElectronData electronData,
EventData eventData,
const gsfAlgoHelpers::HeavyObjectCache hoc 
)
private

Definition at line 573 of file GsfElectronAlgo.cc.

References funct::abs(), RegressionHelper::applyCombinationRegression(), RegressionHelper::applyEcalRegression(), GsfElectronAlgo::EventData::barrelRecHits, GsfElectronAlgo::EventData::beamspot, GsfElectronAlgo::ElectronData::calculateMode(), GsfElectronAlgo::ElectronData::calculateMomentum(), calculateSaturationInfo(), EleTkIsolFromCands::calIsolPt(), haddnano::cl, ElectronEnergyCorrector::classBasedParameterizationEnergy(), ElectronEnergyCorrector::classBasedParameterizationUncertainty(), ElectronClassification::classify(), GsfElectronAlgo::ElectronData::computeCharge(), ConversionInfo::conversionPartnerCtfTk, ConversionInfo::conversionPartnerGsfTk, GsfElectronAlgo::EventData::conversions, GsfElectronAlgo::ElectronData::coreRef, ElectronMomentumCorrector::correct(), GsfElectronAlgo::GeneralData::crackCorrectionFunction, reco::GsfElectron::ClosestCtfTrack::ctfTrack, GsfElectronAlgo::ElectronData::ctfTrackRef, gedGsfElectronCores_cfi::ctfTracks, GsfElectronAlgo::StrategyConfiguration::ctfTracksCheck, GsfElectronAlgo::EventData::currentCtfTracks, ConversionInfo::dcot, reco::GsfElectron::ConversionRejection::dcot, reco::GsfElectron::TrackClusterMatching::deltaEtaEleClusterAtCalo, reco::GsfElectron::TrackClusterMatching::deltaEtaSeedClusterAtCalo, reco::GsfElectron::TrackClusterMatching::deltaEtaSuperClusterAtVtx, reco::GsfElectron::TrackClusterMatching::deltaPhiEleClusterAtCalo, reco::GsfElectron::TrackClusterMatching::deltaPhiSeedClusterAtCalo, reco::GsfElectron::TrackClusterMatching::deltaPhiSuperClusterAtVtx, DetId::det(), gamEcalExtractorBlocks_cff::detector, ConversionInfo::dist, reco::GsfElectron::ConversionRejection::dist, MillePedeFileConverter_cfg::e, EcalBarrel, GsfElectronAlgo::EventData::ecalBarrelIsol03, GsfElectronAlgo::EventData::ecalBarrelIsol04, GsfElectronAlgo::StrategyConfiguration::ecalDrivenEcalEnergyFromClassBasedParameterization, GsfElectronAlgo::StrategyConfiguration::ecalDrivenEcalErrorFromClassBasedParameterization, EcalEndcap, GsfElectronAlgo::EventData::ecalEndcapIsol03, GsfElectronAlgo::EventData::ecalEndcapIsol04, reco::GsfElectron::IsolationVariables::ecalRecHitSumEt, reco::GsfElectron::TrackClusterMatching::eEleClusterOverPout, ele_convert(), reco::GsfElectron::TrackClusterMatching::electronCluster, GsfElectronAlgo::ElectronData::eleMom, GsfElectronAlgo::ElectronData::elePos, GsfElectronAlgo::EventData::endcapRecHits, reco::CaloCluster::energy(), reco::GsfElectron::TrackClusterMatching::eSeedClusterOverP, reco::GsfElectron::TrackClusterMatching::eSeedClusterOverPout, reco::GsfElectron::TrackClusterMatching::eSuperClusterOverP, eventSetupData_, Exception, GsfElectronAlgo::StrategyConfiguration::fillConvVtxFitProb, ConversionInfo::flag, reco::GsfElectron::ConversionRejection::flags, generalData_, gsfElectronTools::getClosestCtfToGsf(), egammaTools::getConversionInfo(), GsfElectronAlgo::ElectronData::getEleBasicCluster(), EgammaRecHitIsolation::getEtSum(), EgammaTowerIsolation::getTowerEtSum(), EcalClusterFunctionBaseClass::getValue(), ConversionTools::getVtxFitProb(), GsfElectronAlgo::ElectronData::gsfTrackRef, GsfElectronAlgo::EventData::hadDepth1Isolation03, GsfElectronAlgo::EventData::hadDepth1Isolation03Bc, GsfElectronAlgo::EventData::hadDepth1Isolation04, GsfElectronAlgo::EventData::hadDepth1Isolation04Bc, GsfElectronAlgo::EventData::hadDepth2Isolation03, GsfElectronAlgo::EventData::hadDepth2Isolation03Bc, GsfElectronAlgo::EventData::hadDepth2Isolation04, GsfElectronAlgo::EventData::hadDepth2Isolation04Bc, reco::GsfElectron::IsolationVariables::hcalDepth1TowerSumEt, reco::GsfElectron::IsolationVariables::hcalDepth1TowerSumEtBc, reco::GsfElectron::IsolationVariables::hcalDepth2TowerSumEt, reco::GsfElectron::IsolationVariables::hcalDepth2TowerSumEtBc, GsfElectronAlgo::GeneralData::hcalHelper, GsfElectronAlgo::GeneralData::hcalHelperPflow, reco::GsfElectron::ShowerShape::hcalTowersBehindClusters, reco::CaloCluster::hitsAndFractions(), EBDetId::ietaAbs(), GsfElectronAlgo::ElectronData::innMom, MagneticField::inTesla(), reco::GsfElectron::FiducialFlags::isEB, reco::GsfElectron::FiducialFlags::isEBEEGap, reco::GsfElectron::FiducialFlags::isEBEtaGap, reco::GsfElectron::FiducialFlags::isEBPhiGap, reco::GsfElectron::FiducialFlags::isEE, reco::GsfElectron::FiducialFlags::isEEDeeGap, reco::GsfElectron::FiducialFlags::isEERingGap, EcalTools::isHGCalDet(), EEDetId::isNextToDBoundary(), EBDetId::isNextToEtaBoundary(), EBDetId::isNextToPhiBoundary(), EEDetId::isNextToRingBoundary(), edm::Ref< C, T, F >::isNull(), edm::HandleBase::isValid(), LogTrace, PV3DBase< T, PVType, FrameType >::mag(), GsfElectronAlgo::EventSetupData::magField, ConversionTools::matchedConversion(), reco::GsfElectron::TrackExtrapolations::momentumAtCalo, reco::GsfElectron::TrackExtrapolations::momentumAtEleClus, reco::GsfElectron::TrackExtrapolations::momentumAtVtx, reco::GsfElectron::TrackExtrapolations::momentumAtVtxWithConstraint, reco::GsfElectron::TrackExtrapolations::momentumOut, GsfElectronAlgo::EventSetupData::mtsTransform, or, GsfElectronAlgo::EventData::originalCtfTracks, GsfElectronAlgo::EventData::originalGsfTracks, GsfElectronAlgo::ElectronData::outMom, reco::GsfElectron::ConversionRejection::partner, reco::BeamSpot::position(), reco::CaloCluster::position(), reco::GsfElectron::TrackExtrapolations::positionAtCalo, reco::GsfElectron::TrackExtrapolations::positionAtVtx, GsfElectronAlgo::StrategyConfiguration::PreSelectMVA, GsfElectronAlgo::StrategyConfiguration::pureTrackerDrivenEcalErrorFromSimpleParameterization, reco::GsfElectron::ConversionRejection::radius, ConversionInfo::radiusOfConversion, ElectronClassification::refineWithPflow(), GsfElectronAlgo::GeneralData::regHelper, GsfElectronAlgo::EventData::retreiveOriginalTrackCollections(), SimDataFormats::CaloAnalysis::sc, GsfElectronAlgo::ElectronData::sclMom, GsfElectronAlgo::ElectronData::sclPos, GsfElectronAlgo::ElectronData::seedMom, GsfElectronAlgo::ElectronData::seedPos, gsfAlgoHelpers::HeavyObjectCache::sElectronMVAEstimator, setCutBasedPreselectionFlag(), setPixelMatchInfomation(), reco::GsfElectron::ClosestCtfTrack::shFracInnerHits, GsfElectronAlgo::ElectronData::shFracInnerHits, ElectronEnergyCorrector::simpleParameterizationUncertainty(), GsfElectronAlgo::GeneralData::strategyCfg, DetId::subdetId(), GsfElectronAlgo::GeneralData::superClusterErrorFunction, GsfElectronAlgo::ElectronData::superClusterRef, tkIsol03Calc_, tkIsol04Calc_, tkIsolHEEP03Calc_, tkIsolHEEP04Calc_, reco::GsfElectron::IsolationVariables::tkSumPt, reco::GsfElectron::IsolationVariables::tkSumPtHEEP, funct::true, GsfElectronAlgo::StrategyConfiguration::useCombinationRegression, GsfElectronAlgo::StrategyConfiguration::useEcalRegression, GsfElectronAlgo::EventData::vertices, reco::GsfElectron::ConversionRejection::vtxFitProb, GsfElectronAlgo::ElectronData::vtxMom, GsfElectronAlgo::ElectronData::vtxMomWithConstraint, GsfElectronAlgo::ElectronData::vtxPos, GsfElectronAlgo::ElectronData::vtxTSOS, and PV3DBase< T, PVType, FrameType >::z().

Referenced by completeElectrons().

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
587  CaloClusterPtr elbcRef = electronData.getEleBasicCluster(*eventSetupData_.mtsTransform) ;
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) ;
641  ele_convert(electronData.vtxMomWithConstraint,tkExtra.momentumAtVtxWithConstraint) ;
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() ;
726  edm::Handle<reco::TrackCollection> ctfTracks = eventData.originalCtfTracks ;
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) ) {
855  dr03.hcalDepth1TowerSumEt = eventData.hadDepth1Isolation03.getTowerEtSum(&ele) ;
856  dr03.hcalDepth2TowerSumEt = eventData.hadDepth2Isolation03.getTowerEtSum(&ele) ;
857  dr03.hcalDepth1TowerSumEtBc = eventData.hadDepth1Isolation03Bc.getTowerEtSum(&ele,&(showerShape.hcalTowersBehindClusters)) ;
858  dr03.hcalDepth2TowerSumEtBc = eventData.hadDepth2Isolation03Bc.getTowerEtSum(&ele,&(showerShape.hcalTowersBehindClusters)) ;
859  dr03.ecalRecHitSumEt = eventData.ecalBarrelIsol03.getEtSum(&ele);
860  dr03.ecalRecHitSumEt += eventData.ecalEndcapIsol03.getEtSum(&ele);
861  dr04.hcalDepth1TowerSumEt = eventData.hadDepth1Isolation04.getTowerEtSum(&ele);
862  dr04.hcalDepth2TowerSumEt = eventData.hadDepth2Isolation04.getTowerEtSum(&ele);
863  dr04.hcalDepth1TowerSumEtBc = eventData.hadDepth1Isolation04Bc.getTowerEtSum(&ele,&(showerShape.hcalTowersBehindClusters)) ;
864  dr04.hcalDepth2TowerSumEtBc = eventData.hadDepth2Isolation04Bc.getTowerEtSum(&ele,&(showerShape.hcalTowersBehindClusters)) ;
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  }
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
static bool isNextToEtaBoundary(EBDetId id)
Definition: EBDetId.cc:108
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)
void calculateSaturationInfo(const reco::SuperClusterRef &, reco::GsfElectron::SaturationInfo &, EventData const &eventData)
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)
std::unique_ptr< const MultiTrajectoryStateTransform > mtsTransform
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:197
const StrategyConfiguration strategyCfg
const reco::TrackRef conversionPartnerCtfTk
EventSetupData eventSetupData_
virtual float getValue(const reco::BasicCluster &, const EcalRecHitCollection &) const =0
EleTkIsolFromCands tkIsolHEEP03Calc_
static float getVtxFitProb(const reco::Conversion *conv)
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:36
const int flag
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
T z() const
Definition: PV3DBase.h:64
const double radiusOfConversion
void correct(reco::GsfElectron &, TrajectoryStateOnSurface &)
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
double calIsolPt(Args &&...args) const
edm::ESHandle< MagneticField > magField
static bool isNextToDBoundary(EEDetId id)
Definition: EEDetId.cc:279
bool isValid() const
Definition: HandleBase.h:74
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.
void classify(reco::GsfElectron &)
ElectronHcalHelper hcalHelperPflow
const double dcot
const reco::GsfTrackRef conversionPartnerGsfTk
Definition: DetId.h:18
void setPixelMatchInfomation(reco::GsfElectron &)
EcalClusterFunctionBaseClass * superClusterErrorFunction
Detector
Definition: DetId.h:26
GeneralData generalData_
void ele_convert(const Type1 &obj1, Type2 &obj2)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
math::XYZVectorF momentumAtVtxWithConstraint
Definition: GsfElectron.h:289
void refineWithPflow(reco::GsfElectron &)
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)
EleTkIsolFromCands tkIsol04Calc_
EcalClusterFunctionBaseClass * crackCorrectionFunction
ElectronHcalHelper hcalHelper
EleTkIsolFromCands tkIsolHEEP04Calc_
EleTkIsolFromCands tkIsol03Calc_
void setCutBasedPreselectionFlag(reco::GsfElectron &ele, const reco::BeamSpot &)
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
const reco::SuperClusterRef GsfElectronAlgo::getTrSuperCluster ( const reco::GsfTrackRef trackRef)
private
void GsfElectronAlgo::setCutBasedPreselectionFlag ( reco::GsfElectron ele,
const reco::BeamSpot bs 
)
private

Definition at line 477 of file GsfElectronAlgo.cc.

References funct::abs(), edm::RefToBase< T >::castTo(), looper::cfg, reco::GsfElectron::core(), GsfElectronAlgo::GeneralData::cutsCfg, GsfElectronAlgo::GeneralData::cutsCfgPflow, reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), gamEcalExtractorBlocks_cff::detector, EcalBarrel, EcalEndcap, reco::GsfElectron::eSuperClusterOverP(), PVValHelper::eta, Exception, funct::false, GsfElectronAlgo::StrategyConfiguration::gedElectronMode, generalData_, reco::GsfElectron::gsfTrack(), reco::GsfElectron::hcalDepth1OverEcal(), reco::GsfElectron::hcalDepth2OverEcal(), reco::GsfElectron::hcalOverEcal(), reco::GsfElectron::hcalOverEcalBc(), reco::CaloCluster::hitsAndFractions(), GsfElectronAlgo::CutsConfiguration::isBarrel, reco::GsfElectron::isEB(), reco::GsfElectron::isEBEEGap(), reco::GsfElectron::isEBEtaGap(), reco::GsfElectron::isEBPhiGap(), reco::GsfElectron::isEE(), reco::GsfElectron::isEEDeeGap(), reco::GsfElectron::isEERingGap(), GsfElectronAlgo::CutsConfiguration::isEndcaps, GsfElectronAlgo::CutsConfiguration::isFiducial, edm::Ref< C, T, F >::isNull(), LogTrace, GsfElectronAlgo::CutsConfiguration::maxDeltaEtaBarrel, GsfElectronAlgo::CutsConfiguration::maxDeltaEtaEndcaps, GsfElectronAlgo::CutsConfiguration::maxDeltaPhiBarrel, GsfElectronAlgo::CutsConfiguration::maxDeltaPhiEndcaps, GsfElectronAlgo::CutsConfiguration::maxEOverPBarrel, GsfElectronAlgo::CutsConfiguration::maxEOverPEndcaps, GsfElectronAlgo::CutsConfiguration::maxHBarrelCone, GsfElectronAlgo::CutsConfiguration::maxHBarrelTower, GsfElectronAlgo::CutsConfiguration::maxHEndcapsCone, GsfElectronAlgo::CutsConfiguration::maxHEndcapsTower, GsfElectronAlgo::CutsConfiguration::maxHOverEBarrelCone, GsfElectronAlgo::CutsConfiguration::maxHOverEBarrelTower, GsfElectronAlgo::CutsConfiguration::maxHOverEEndcapsCone, GsfElectronAlgo::CutsConfiguration::maxHOverEEndcapsTower, GsfElectronAlgo::CutsConfiguration::maxSigmaIetaIetaBarrel, GsfElectronAlgo::CutsConfiguration::maxSigmaIetaIetaEndcaps, GsfElectronAlgo::CutsConfiguration::maxTIP, GsfElectronAlgo::CutsConfiguration::minEOverPBarrel, GsfElectronAlgo::CutsConfiguration::minEOverPEndcaps, GsfElectronAlgo::CutsConfiguration::minSCEtBarrel, GsfElectronAlgo::CutsConfiguration::minSCEtEndcaps, packedPFCandidateRefMixer_cfi::pf, reco::BeamSpot::position(), mathSSE::return(), SurveyInfoScenario_cff::seed, GsfElectronAlgo::CutsConfiguration::seedFromTEC, reco::GsfElectron::setPassCutBasedPreselection(), reco::GsfElectron::sigmaIetaIeta(), GsfElectronAlgo::GeneralData::strategyCfg, and reco::GsfElectron::superCluster().

Referenced by createElectron().

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 
489  const CutsConfiguration * cfg = ((eg||gedMode)?&generalData_.cutsCfg:&generalData_.cutsCfgPflow);
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  }
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:186
const CutsConfiguration cutsCfgPflow
void setPassCutBasedPreselection(bool flag)
Definition: GsfElectron.h:727
bool isEBEtaGap() const
Definition: GsfElectron.h:361
float eSuperClusterOverP() const
Definition: GsfElectron.h:249
bool isEBEEGap() const
Definition: GsfElectron.h:359
float hcalDepth2OverEcal() const
Definition: GsfElectron.h:447
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:197
bool isEERingGap() const
Definition: GsfElectron.h:365
bool isEEDeeGap() const
Definition: GsfElectron.h:364
const StrategyConfiguration strategyCfg
bool isEE() const
Definition: GsfElectron.h:357
bool isEB() const
Definition: GsfElectron.h:356
return((rh^lh)&mask)
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:253
float sigmaIetaIeta() const
Definition: GsfElectron.h:440
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:256
float hcalOverEcal() const
Definition: GsfElectron.h:448
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const CutsConfiguration cutsCfg
float hcalOverEcalBc() const
Definition: GsfElectron.h:452
bool isNull() const
Checks for null.
Definition: Ref.h:248
#define LogTrace(id)
float hcalDepth1OverEcal() const
Definition: GsfElectron.h:446
REF castTo() const
Definition: RefToBase.h:289
GeneralData generalData_
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
bool isEBPhiGap() const
Definition: GsfElectron.h:362
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:185
const Point & position() const
position
Definition: BeamSpot.h:62
void GsfElectronAlgo::setMVAepiBasedPreselectionFlag ( reco::GsfElectron ele)
private
void GsfElectronAlgo::setPixelMatchInfomation ( reco::GsfElectron ele)
private

Definition at line 894 of file GsfElectronAlgo.cc.

References edm::RefToBase< T >::castTo(), reco::LeafCandidate::charge(), reco::GsfElectron::gsfTrack(), edm::RefToBase< T >::isNull(), edm::Ref< C, T, F >::isNull(), SurveyInfoScenario_cff::seed, reco::GsfElectron::setPixelMatchDPhi1(), reco::GsfElectron::setPixelMatchDPhi2(), reco::GsfElectron::setPixelMatchDRz1(), reco::GsfElectron::setPixelMatchDRz2(), and reco::GsfElectron::setPixelMatchSubdetectors().

Referenced by createElectron().

894  {
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 }
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:186
void setPixelMatchDRz2(float dRz2)
Definition: GsfElectron.h:904
void setPixelMatchDPhi1(float dPhi1)
Definition: GsfElectron.h:901
int charge() const final
electric charge
Definition: LeafCandidate.h:91
void setPixelMatchSubdetectors(int sd1, int sd2)
Definition: GsfElectron.h:900
bool isNull() const
Checks for null.
Definition: Ref.h:248
void setPixelMatchDPhi2(float dPhi2)
Definition: GsfElectron.h:902
REF castTo() const
Definition: RefToBase.h:289
bool isNull() const
Checks for null.
Definition: RefToBase.h:331
void setPixelMatchDRz1(float dRz1)
Definition: GsfElectron.h:903

Member Data Documentation

EventSetupData GsfElectronAlgo::eventSetupData_
private
GeneralData GsfElectronAlgo::generalData_
private
EleTkIsolFromCands GsfElectronAlgo::tkIsol03Calc_
private

Definition at line 355 of file GsfElectronAlgo.h.

Referenced by createElectron(), and GsfElectronAlgo().

EleTkIsolFromCands GsfElectronAlgo::tkIsol04Calc_
private

Definition at line 356 of file GsfElectronAlgo.h.

Referenced by createElectron(), and GsfElectronAlgo().

EleTkIsolFromCands GsfElectronAlgo::tkIsolHEEP03Calc_
private

Definition at line 357 of file GsfElectronAlgo.h.

Referenced by createElectron(), and GsfElectronAlgo().

EleTkIsolFromCands GsfElectronAlgo::tkIsolHEEP04Calc_
private

Definition at line 358 of file GsfElectronAlgo.h.

Referenced by createElectron(), and GsfElectronAlgo().