CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | 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 Types

typedef std::list
< reco::GsfElectron * > 
GsfElectronPtrCollection
 

Public Member Functions

void addPflowInfo ()
 
void beginEvent (edm::Event &)
 
void checkSetup (const edm::EventSetup &)
 
void clonePreviousElectrons ()
 
void completeElectrons ()
 
void copyElectrons (reco::GsfElectronCollection &)
 
void displayInternalElectrons (const std::string &title) const
 
void endEvent ()
 
 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 SoftElectronMVAEstimator::Configuration &mvaCfg, const RegressionHelper::Configuration &regCfg)
 
void removeAmbiguousElectrons ()
 
void removeNotPreselectedElectrons ()
 
void setAmbiguityData (bool ignoreNotPreselected=true)
 
void setMVAInputs (const std::map< reco::GsfTrackRef, reco::GsfElectron::MvaInput > &mvaInputs)
 
void setMVAOutputs (const std::map< reco::GsfTrackRef, reco::GsfElectron::MvaOutput > &mvaOutputs)
 
 ~GsfElectronAlgo ()
 

Private Member Functions

void calculateShowerShape (const reco::SuperClusterRef &, bool pflow, reco::GsfElectron::ShowerShape &)
 
void calculateShowerShape_full5x5 (const reco::SuperClusterRef &, bool pflow, reco::GsfElectron::ShowerShape &)
 
void createElectron ()
 
const reco::SuperClusterRef getTrSuperCluster (const reco::GsfTrackRef &trackRef)
 
bool isPreselected (reco::GsfElectron *ele)
 
void setCutBasedPreselectionFlag (reco::GsfElectron *ele, const reco::BeamSpot &)
 
void setMVAepiBasedPreselectionFlag (reco::GsfElectron *ele)
 
void setPflowPreselectionFlag (reco::GsfElectron *ele)
 

Private Attributes

ElectronDataelectronData_
 
EventDataeventData_
 
EventSetupDataeventSetupData_
 
GeneralDatageneralData_
 

Detailed Description

Definition at line 57 of file GsfElectronAlgo.h.

Member Typedef Documentation

Definition at line 214 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 SoftElectronMVAEstimator::Configuration mvaCfg,
const RegressionHelper::Configuration regCfg 
)

Definition at line 639 of file GsfElectronAlgo.cc.

652  : generalData_(new GeneralData(inputCfg,strategyCfg,cutsCfg,cutsCfgPflow,hcalCfg,hcalCfgPflow,isoCfg,recHitsCfg,superClusterErrorFunction,crackCorrectionFunction,mvaCfg,regCfg)),
653  eventSetupData_(new EventSetupData),
655  {}
GeneralData * generalData_
EventSetupData * eventSetupData_
EventData * eventData_
ElectronData * electronData_
GsfElectronAlgo::~GsfElectronAlgo ( )

Definition at line 657 of file GsfElectronAlgo.cc.

References electronData_, eventData_, eventSetupData_, and generalData_.

658  {
659  delete generalData_ ;
660  delete eventSetupData_ ;
661  delete eventData_ ;
662  delete electronData_ ;
663  }
GeneralData * generalData_
EventSetupData * eventSetupData_
EventData * eventData_
ElectronData * electronData_

Member Function Documentation

void GsfElectronAlgo::addPflowInfo ( )

Definition at line 926 of file GsfElectronAlgo.cc.

References calculateShowerShape(), GsfElectronAlgo::EventData::edIsolationValues, GsfElectronAlgo::EventData::electrons, eventData_, edm::hlt::Exception, edm::false, first, newFWLiteAna::found, edm::Ref< C, T, F >::isNull(), pfElectrons_cff::pfElectrons, GsfElectronAlgo::EventData::pfIsolationValues, GsfElectronAlgo::EventData::pflowElectrons, GsfElectronAlgo::EventData::previousElectrons, edm::Handle< T >::product(), ElectronClassification::refineWithPflow(), setPflowPreselectionFlag(), reco::GsfElectron::PflowIsolationVariables::sumChargedHadronPt, reco::GsfElectron::PflowIsolationVariables::sumNeutralHadronEt, reco::GsfElectron::PflowIsolationVariables::sumPhotonEt, and funct::true.

Referenced by GsfElectronProducer::produce().

927  {
928  bool found ;
929  const GsfElectronCollection * edElectrons = eventData_->previousElectrons.product() ;
931  GsfElectronCollection::const_iterator pfElectron, edElectron ;
932  unsigned int edIndex, pfIndex ;
933 
934  GsfElectronPtrCollection::iterator el ;
935  for
936  ( el = eventData_->electrons->begin() ;
937  el != eventData_->electrons->end() ;
938  el++ )
939  {
940 // // MVA
941 // // we check that the value is never inferior to the no-cut value
942 // // we generally use in the configuration file for minMVA.
943 // GsfTrackRef gsfTrackRef = (*el)->gsfTrack() ;
944 // float mva = (*eventData_->pfMva.product())[gsfTrackRef] ;
945 // if (mva<noCutMin) { throw cms::Exception("GsfElectronAlgo|UnexpectedMvaValue")<<"unexpected MVA value: "<<mva ; }
946 //
947 // // Mva Output
948 // GsfElectron::MvaOutput mvaOutput ;
949 // mvaOutput.mva = mva ;
950 // (*el)->setMvaOutput(mvaOutput) ;
951 
952  // Retreive info from pflow electrons
953  found = false ;
954  for
955  ( pfIndex = 0, pfElectron = pfElectrons->begin() ; pfElectron != pfElectrons->end() ; pfIndex++, pfElectron++ )
956  {
957  if (pfElectron->gsfTrack()==(*el)->gsfTrack())
958  {
959  if (found)
960  {
961  edm::LogWarning("GsfElectronProducer")<<"associated pfGsfElectron already found" ;
962  }
963  else
964  {
965  found = true ;
966 
967  // Isolation Values
968  if( (eventData_->pfIsolationValues).size() != 0 )
969  {
971  pfElectronRef(eventData_->pflowElectrons, pfIndex);
973  isoVariables.sumChargedHadronPt =(*(eventData_->pfIsolationValues)[0])[pfElectronRef];
974  isoVariables.sumPhotonEt =(*(eventData_->pfIsolationValues)[1])[pfElectronRef];
975  isoVariables.sumNeutralHadronEt =(*(eventData_->pfIsolationValues)[2])[pfElectronRef];
976  (*el)->setPfIsolationVariables(isoVariables);
977  }
978 
979 // (*el)->setPfIsolationVariables(pfElectron->pfIsolationVariables()) ;
980  (*el)->setMvaInput(pfElectron->mvaInput()) ;
981  (*el)->setMvaOutput(pfElectron->mvaOutput()) ;
982  if ((*el)->ecalDrivenSeed())
983  { (*el)->setP4(GsfElectron::P4_PFLOW_COMBINATION,pfElectron->p4(GsfElectron::P4_PFLOW_COMBINATION),pfElectron->p4Error(GsfElectron::P4_PFLOW_COMBINATION),false) ; }
984  else
985  { (*el)->setP4(GsfElectron::P4_PFLOW_COMBINATION,pfElectron->p4(GsfElectron::P4_PFLOW_COMBINATION),pfElectron->p4Error(GsfElectron::P4_PFLOW_COMBINATION),true) ; }
986  double noCutMin = -999999999. ;
987  if ((*el)->mva()<noCutMin) { throw cms::Exception("GsfElectronAlgo|UnexpectedMvaValue")<<"unexpected MVA value: "<<(*el)->mva() ; }
988  }
989  }
990  }
991 
992  // Isolation Values
993  // Retreive not found info from ed electrons
994  if( (eventData_->edIsolationValues).size() != 0 )
995  {
996  edIndex = 0, edElectron = edElectrons->begin() ;
997  while ((found == false)&&(edElectron != edElectrons->end()))
998  {
999  if (edElectron->gsfTrack()==(*el)->gsfTrack())
1000  {
1001  found = true ;
1002 
1003  // CONSTRUCTION D UNE REF dans le handle eventData_->previousElectrons avec l'indice edIndex,
1004  // puis recuperation dans la ValueMap ED
1005 
1007  edElectronRef(eventData_->previousElectrons, edIndex);
1009  isoVariables.sumChargedHadronPt =(*(eventData_->edIsolationValues)[0])[edElectronRef];
1010  isoVariables.sumPhotonEt =(*(eventData_->edIsolationValues)[1])[edElectronRef];
1011  isoVariables.sumNeutralHadronEt =(*(eventData_->edIsolationValues)[2])[edElectronRef];
1012  (*el)->setPfIsolationVariables(isoVariables);
1013  }
1014 
1015  edIndex++ ;
1016  edElectron++ ;
1017  }
1018  }
1019 
1020  // Preselection
1022 
1023  // Shower Shape of pflow cluster
1024  if (!((*el)->parentSuperCluster().isNull()))
1025  {
1026  reco::GsfElectron::ShowerShape pflowShowerShape ;
1027  calculateShowerShape((*el)->parentSuperCluster(),true,pflowShowerShape) ;
1028  (*el)->setPfShowerShape(pflowShowerShape) ;
1029  }
1030  else if ((*el)->passingPflowPreselection())
1031  { edm::LogError("GsfElectronCoreProducer")<<"Preselected tracker driven GsfTrack with no associated pflow SuperCluster." ; }
1032 
1033  // PfBrem
1034  SuperClusterRef sc = (*el)->parentSuperCluster() ;
1035  if (!(sc.isNull()))
1036  {
1037 
1038  if (sc->clustersSize()>1)
1039  {
1040  CaloCluster_iterator first = sc->clustersBegin() ;
1041  (*el)->setPfSuperClusterFbrem((sc->energy()-(*first)->energy())/sc->energy()) ;
1042  }
1043  else
1044  { (*el)->setPfSuperClusterFbrem(0.) ; }
1045  ElectronClassification theClassifier ;
1046  theClassifier.refineWithPflow(**el) ;
1047  }
1048  }
1049  }
void calculateShowerShape(const reco::SuperClusterRef &, bool pflow, reco::GsfElectron::ShowerShape &)
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
bool isNull() const
Checks for null.
Definition: Ref.h:247
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Definition: GsfElectron.h:558
IsolationValueMaps pfIsolationValues
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
Definition: GsfElectron.h:557
GsfElectronPtrCollection * electrons
bool first
Definition: L1TdeRCT.cc:75
edm::Handle< reco::GsfElectronCollection > previousElectrons
edm::Handle< reco::GsfElectronCollection > pflowElectrons
void setPflowPreselectionFlag(reco::GsfElectron *ele)
T const * product() const
Definition: Handle.h:81
void refineWithPflow(reco::GsfElectron &)
EventData * eventData_
volatile std::atomic< bool > shutdown_flag false
IsolationValueMaps edIsolationValues
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:556
void GsfElectronAlgo::beginEvent ( edm::Event event)

Definition at line 732 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::InputTagsConfiguration::barrelRecHitCollection, GsfElectronAlgo::EventData::barrelRecHits, GsfElectronAlgo::EventData::beamspot, GsfElectronAlgo::InputTagsConfiguration::beamSpotTag, GsfElectronAlgo::EventSetupData::caloGeom, GsfElectronAlgo::EventData::coreElectrons, GsfElectronAlgo::InputTagsConfiguration::ctfTracks, GsfElectronAlgo::EventData::currentCtfTracks, EgammaRecHitIsolation::doFlagChecks(), EgammaRecHitIsolation::doSeverityChecks(), DetId::Ecal, GsfElectronAlgo::EventData::ecalBarrelIsol03, GsfElectronAlgo::EventData::ecalBarrelIsol04, GsfElectronAlgo::EventData::ecalEndcapIsol03, GsfElectronAlgo::EventData::ecalEndcapIsol04, GsfElectronAlgo::EventData::edIsolationValues, GsfElectronAlgo::InputTagsConfiguration::edIsoVals, GsfElectronAlgo::IsolationConfiguration::eMinBarrel, GsfElectronAlgo::IsolationConfiguration::eMinEndcaps, edm::ParameterSet::empty(), GsfElectronAlgo::InputTagsConfiguration::endcapRecHitCollection, GsfElectronAlgo::EventData::endcapRecHits, GsfElectronAlgo::IsolationConfiguration::etMinBarrel, GsfElectronAlgo::IsolationConfiguration::etMinEndcaps, GsfElectronAlgo::IsolationConfiguration::etMinHcal, event(), GsfElectronAlgo::EventData::event, eventData_, eventSetupData_, edm::hlt::Exception, generalData_, edm::ParameterSet::getParameter(), GsfElectronAlgo::InputTagsConfiguration::gsfElectronCores, GsfElectronAlgo::EventData::gsfPfRecTracks, GsfElectronAlgo::InputTagsConfiguration::gsfPfRecTracksTag, GsfElectronAlgo::EventData::hadDepth1Isolation03, GsfElectronAlgo::EventData::hadDepth1Isolation03Bc, GsfElectronAlgo::EventData::hadDepth1Isolation04, GsfElectronAlgo::EventData::hadDepth1Isolation04Bc, GsfElectronAlgo::EventData::hadDepth2Isolation03, GsfElectronAlgo::EventData::hadDepth2Isolation03Bc, GsfElectronAlgo::EventData::hadDepth2Isolation04, GsfElectronAlgo::EventData::hadDepth2Isolation04Bc, GsfElectronAlgo::GeneralData::hcalHelper, GsfElectronAlgo::GeneralData::hcalHelperPflow, GsfElectronAlgo::InputTagsConfiguration::hcalTowersTag, GsfElectronAlgo::GeneralData::inputCfg, GsfElectronAlgo::IsolationConfiguration::intRadiusBarrelTk, GsfElectronAlgo::IsolationConfiguration::intRadiusEcalBarrel, GsfElectronAlgo::IsolationConfiguration::intRadiusEcalEndcaps, GsfElectronAlgo::IsolationConfiguration::intRadiusEndcapTk, GsfElectronAlgo::IsolationConfiguration::intRadiusHcal, GsfElectronAlgo::GeneralData::isoCfg, j, GsfElectronAlgo::IsolationConfiguration::jurassicWidth, GsfElectronAlgo::IsolationConfiguration::maxDrbTk, GsfElectronAlgo::IsolationConfiguration::maxVtxDistTk, GsfElectronAlgo::EventData::pfIsolationValues, GsfElectronAlgo::InputTagsConfiguration::pfIsoVals, GsfElectronAlgo::EventData::pflowElectrons, GsfElectronAlgo::InputTagsConfiguration::pflowGsfElectronsTag, GsfElectronAlgo::InputTagsConfiguration::pfMVA, GsfElectronAlgo::EventData::pfMva, reco::BeamSpot::position(), GsfElectronAlgo::EventData::previousElectrons, GsfElectronAlgo::InputTagsConfiguration::previousGsfElectrons, edm::Handle< T >::product(), edm::ESHandle< class >::product(), PtMinSelector_cfg::ptMin, GsfElectronAlgo::IsolationConfiguration::ptMinTk, ElectronHcalHelper::readEvent(), GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedEndcaps, GsfElectronAlgo::GeneralData::recHitsCfg, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedEndcaps, GsfElectronAlgo::EventData::seeds, GsfElectronAlgo::InputTagsConfiguration::seedsTag, EgammaRecHitIsolation::setUseNumCrystals(), EgammaRecHitIsolation::setVetoClustered(), GsfElectronAlgo::EventSetupData::sevLevel, GsfElectronAlgo::GeneralData::strategyCfg, GsfElectronAlgo::IsolationConfiguration::stripBarrelTk, GsfElectronAlgo::IsolationConfiguration::stripEndcapTk, GsfElectronAlgo::EventData::tkIsolation03, GsfElectronAlgo::EventData::tkIsolation04, GsfElectronAlgo::EventData::towers, GsfElectronAlgo::StrategyConfiguration::useGsfPfRecTracks, GsfElectronAlgo::IsolationConfiguration::useNumCrystals, GsfElectronAlgo::EventData::vertices, GsfElectronAlgo::IsolationConfiguration::vetoClustered, and GsfElectronAlgo::InputTagsConfiguration::vtxCollectionTag.

Referenced by GsfElectronBaseProducer::beginEvent().

733  {
734  if (eventData_!=0)
735  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"unexpected event data" ; }
736  eventData_ = new EventData ;
737 
738  // init the handles linked to the current event
739  eventData_->event = &event ;
746  event.getByToken(generalData_->inputCfg.hcalTowersTag,eventData_->towers) ;
747  event.getByToken(generalData_->inputCfg.pfMVA,eventData_->pfMva) ;
748  event.getByToken(generalData_->inputCfg.seedsTag,eventData_->seeds) ;
752 
753  // get the beamspot from the Event:
754  edm::Handle<reco::BeamSpot> recoBeamSpotHandle ;
755  event.getByToken(generalData_->inputCfg.beamSpotTag,recoBeamSpotHandle) ;
756  eventData_->beamspot = recoBeamSpotHandle.product() ;
757 
758  // prepare access to hcal data
761 
762  // Isolation algos
763  float extRadiusSmall=0.3, extRadiusLarge=0.4 ;
764  float intRadiusBarrel=generalData_->isoCfg.intRadiusBarrelTk, intRadiusEndcap=generalData_->isoCfg.intRadiusEndcapTk, stripBarrel=generalData_->isoCfg.stripBarrelTk, stripEndcap=generalData_->isoCfg.stripEndcapTk ;
766  eventData_->tkIsolation03 = new ElectronTkIsolation(extRadiusSmall,intRadiusBarrel,intRadiusEndcap,stripBarrel,stripEndcap,ptMin,maxVtxDist,drb,eventData_->currentCtfTracks.product(),eventData_->beamspot->position()) ;
767  eventData_->tkIsolation04 = new ElectronTkIsolation(extRadiusLarge,intRadiusBarrel,intRadiusEndcap,stripBarrel,stripEndcap,ptMin,maxVtxDist,drb,eventData_->currentCtfTracks.product(),eventData_->beamspot->position()) ;
768 
769  float egHcalIsoConeSizeOutSmall=0.3, egHcalIsoConeSizeOutLarge=0.4;
770  float egHcalIsoConeSizeIn=generalData_->isoCfg.intRadiusHcal,egHcalIsoPtMin=generalData_->isoCfg.etMinHcal;
771  int egHcalDepth1=1, egHcalDepth2=2;
772  eventData_->hadDepth1Isolation03 = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
773  eventData_->hadDepth2Isolation03 = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
774  eventData_->hadDepth1Isolation04 = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
775  eventData_->hadDepth2Isolation04 = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
776  eventData_->hadDepth1Isolation03Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,0.,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
777  eventData_->hadDepth2Isolation03Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,0.,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
778  eventData_->hadDepth1Isolation04Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,0.,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
779  eventData_->hadDepth2Isolation04Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,0.,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
780 
781  float egIsoConeSizeOutSmall=0.3, egIsoConeSizeOutLarge=0.4, egIsoJurassicWidth=generalData_->isoCfg.jurassicWidth;
782  float egIsoPtMinBarrel=generalData_->isoCfg.etMinBarrel,egIsoEMinBarrel=generalData_->isoCfg.eMinBarrel, egIsoConeSizeInBarrel=generalData_->isoCfg.intRadiusEcalBarrel;
783  float egIsoPtMinEndcap=generalData_->isoCfg.etMinEndcaps,egIsoEMinEndcap=generalData_->isoCfg.eMinEndcaps, egIsoConeSizeInEndcap=generalData_->isoCfg.intRadiusEcalEndcaps;
784  eventData_->ecalBarrelIsol03 = new EgammaRecHitIsolation(egIsoConeSizeOutSmall,egIsoConeSizeInBarrel,egIsoJurassicWidth,egIsoPtMinBarrel,egIsoEMinBarrel,eventSetupData_->caloGeom,*(eventData_->barrelRecHits),eventSetupData_->sevLevel.product(),DetId::Ecal);
785  eventData_->ecalBarrelIsol04 = new EgammaRecHitIsolation(egIsoConeSizeOutLarge,egIsoConeSizeInBarrel,egIsoJurassicWidth,egIsoPtMinBarrel,egIsoEMinBarrel,eventSetupData_->caloGeom,*(eventData_->barrelRecHits),eventSetupData_->sevLevel.product(),DetId::Ecal);
786  eventData_->ecalEndcapIsol03 = new EgammaRecHitIsolation(egIsoConeSizeOutSmall,egIsoConeSizeInEndcap,egIsoJurassicWidth,egIsoPtMinEndcap,egIsoEMinEndcap,eventSetupData_->caloGeom,*(eventData_->endcapRecHits),eventSetupData_->sevLevel.product(),DetId::Ecal);
787  eventData_->ecalEndcapIsol04 = new EgammaRecHitIsolation(egIsoConeSizeOutLarge,egIsoConeSizeInEndcap,egIsoJurassicWidth,egIsoPtMinEndcap,egIsoEMinEndcap,eventSetupData_->caloGeom,*(eventData_->endcapRecHits),eventSetupData_->sevLevel.product(),DetId::Ecal);
804 
805  //Fill in the Isolation Value Maps for PF and EcalDriven electrons
806  std::vector<edm::InputTag> inputTagIsoVals;
808  inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumChargedHadronPt"));
809  inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumPhotonEt"));
810  inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumNeutralHadronEt"));
811 
812  eventData_->pfIsolationValues.resize(inputTagIsoVals.size());
813 
814  for (size_t j = 0; j<inputTagIsoVals.size(); ++j) {
815  event.getByLabel(inputTagIsoVals[j], eventData_->pfIsolationValues[j]);
816  }
817 
818  }
819 
821  inputTagIsoVals.clear();
822  inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumChargedHadronPt"));
823  inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumPhotonEt"));
824  inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumNeutralHadronEt"));
825 
826  eventData_->edIsolationValues.resize(inputTagIsoVals.size());
827 
828  for (size_t j = 0; j<inputTagIsoVals.size(); ++j) {
829  event.getByLabel(inputTagIsoVals[j], eventData_->edIsolationValues[j]);
830  }
831  }
832  }
ElectronHcalHelper * hcalHelperPflow
T getParameter(std::string const &) const
edm::Handle< reco::ElectronSeedCollection > seeds
bool empty() const
Definition: ParameterSet.h:216
edm::Handle< edm::ValueMap< float > > pfMva
GeneralData * generalData_
EgammaTowerIsolation * hadDepth1Isolation04Bc
edm::EDGetTokenT< reco::GsfElectronCoreCollection > gsfElectronCores
void readEvent(const edm::Event &)
EgammaTowerIsolation * hadDepth1Isolation03Bc
edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons
const IsolationConfiguration isoCfg
edm::EDGetTokenT< reco::VertexCollection > vtxCollectionTag
const EcalRecHitsConfiguration recHitsCfg
EventSetupData * eventSetupData_
edm::Handle< EcalRecHitCollection > endcapRecHits
edm::EDGetTokenT< EcalRecHitCollection > endcapRecHitCollection
const InputTagsConfiguration inputCfg
edm::ESHandle< EcalSeverityLevelAlgo > sevLevel
EgammaTowerIsolation * hadDepth1Isolation03
edm::EDGetTokenT< reco::GsfElectronCollection > pflowGsfElectronsTag
const StrategyConfiguration strategyCfg
edm::EDGetTokenT< EcalRecHitCollection > barrelRecHitCollection
void doFlagChecks(const std::vector< int > &v)
edm::EDGetTokenT< reco::GsfPFRecTrackCollection > gsfPfRecTracksTag
EgammaRecHitIsolation * ecalBarrelIsol04
EgammaTowerIsolation * hadDepth2Isolation03
EgammaTowerIsolation * hadDepth1Isolation04
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag
ElectronTkIsolation * tkIsolation03
void setUseNumCrystals(bool b=true)
EgammaRecHitIsolation * ecalEndcapIsol03
EgammaTowerIsolation * hadDepth2Isolation03Bc
edm::Handle< EcalRecHitCollection > barrelRecHits
IsolationValueMaps pfIsolationValues
int j
Definition: DBlmapReader.cc:9
ElectronHcalHelper * hcalHelper
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsTag
const reco::BeamSpot * beamspot
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< edm::ValueMap< float > > pfMVA
void doSeverityChecks(const EcalRecHitCollection *const recHits, const std::vector< int > &v)
edm::EDGetTokenT< CaloTowerCollection > hcalTowersTag
EgammaTowerIsolation * hadDepth2Isolation04Bc
edm::EDGetTokenT< reco::TrackCollection > ctfTracks
edm::Handle< reco::GsfElectronCollection > previousElectrons
edm::Handle< reco::VertexCollection > vertices
EgammaRecHitIsolation * ecalBarrelIsol03
edm::Handle< reco::GsfElectronCollection > pflowElectrons
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:81
EgammaTowerIsolation * hadDepth2Isolation04
void setVetoClustered(bool b=true)
edm::Handle< reco::TrackCollection > currentCtfTracks
edm::ESHandle< CaloGeometry > caloGeom
EgammaRecHitIsolation * ecalEndcapIsol04
const Point & position() const
position
Definition: BeamSpot.h:62
EventData * eventData_
ElectronTkIsolation * tkIsolation04
IsolationValueMaps edIsolationValues
edm::Handle< reco::GsfElectronCoreCollection > coreElectrons
edm::Handle< CaloTowerCollection > towers
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracks
void GsfElectronAlgo::calculateShowerShape ( const reco::SuperClusterRef theClus,
bool  pflow,
reco::GsfElectron::ShowerShape showerShape 
)
private

Definition at line 527 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::barrelRecHits, GsfElectronAlgo::EventSetupData::caloGeom, GsfElectronAlgo::EventSetupData::caloTopo, reco::GsfElectron::ShowerShape::e1x5, reco::GsfElectron::ShowerShape::e2x5Max, reco::GsfElectron::ShowerShape::e5x5, EcalBarrel, GsfElectronAlgo::EventData::endcapRecHits, eventData_, eventSetupData_, generalData_, geometry, reco::GsfElectron::ShowerShape::hcalDepth1OverEcal, reco::GsfElectron::ShowerShape::hcalDepth1OverEcalBc, reco::GsfElectron::ShowerShape::hcalDepth2OverEcal, reco::GsfElectron::ShowerShape::hcalDepth2OverEcalBc, ElectronHcalHelper::hcalESumDepth1(), ElectronHcalHelper::hcalESumDepth1BehindClusters(), ElectronHcalHelper::hcalESumDepth2(), ElectronHcalHelper::hcalESumDepth2BehindClusters(), GsfElectronAlgo::GeneralData::hcalHelper, GsfElectronAlgo::GeneralData::hcalHelperPflow, ElectronHcalHelper::hcalTowersBehindClusters(), reco::GsfElectron::ShowerShape::hcalTowersBehindClusters, reco::CaloCluster::hitsAndFractions(), edm::isNotFinite(), edm::ESHandle< class >::product(), reco::GsfElectron::ShowerShape::r9, GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedEndcaps, GsfElectronAlgo::GeneralData::recHitsCfg, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedEndcaps, reco::GsfElectron::ShowerShape::sigmaEtaEta, reco::GsfElectron::ShowerShape::sigmaIetaIeta, reco::GsfElectron::ShowerShape::sigmaIphiIphi, mathSSE::sqrt(), DetId::subdetId(), and ecaldqm::topology().

Referenced by addPflowInfo(), and createElectron().

528  {
529  const reco::CaloCluster & seedCluster = *(theClus->seed()) ;
530  // temporary, till CaloCluster->seed() is made available
531  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
532  int detector = seedXtalId.subdetId() ;
533 
536  const EcalRecHitCollection * recHits = 0 ;
537  std::vector<int> recHitFlagsToBeExcluded ;
538  std::vector<int> recHitSeverityToBeExcluded ;
539  if (detector==EcalBarrel)
540  {
541  recHits = eventData_->barrelRecHits.product() ;
542  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedBarrel ;
543  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedBarrel ;
544  }
545  else
546  {
547  recHits = eventData_->endcapRecHits.product() ;
548  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedEndcaps ;
549  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedEndcaps ;
550  }
551 
552  std::vector<float> covariances = EcalClusterTools::covariances(seedCluster,recHits,topology,geometry) ;
553  std::vector<float> localCovariances = EcalClusterTools::localCovariances(seedCluster,recHits,topology) ;
554  showerShape.sigmaEtaEta = sqrt(covariances[0]) ;
555  showerShape.sigmaIetaIeta = sqrt(localCovariances[0]) ;
556  if (!edm::isNotFinite(localCovariances[2])) showerShape.sigmaIphiIphi = sqrt(localCovariances[2]) ;
557  showerShape.e1x5 = EcalClusterTools::e1x5(seedCluster,recHits,topology) ;
558  showerShape.e2x5Max = EcalClusterTools::e2x5Max(seedCluster,recHits,topology) ;
559  showerShape.e5x5 = EcalClusterTools::e5x5(seedCluster,recHits,topology) ;
560  showerShape.r9 = EcalClusterTools::e3x3(seedCluster,recHits,topology)/theClus->rawEnergy() ;
561 
562  if (pflow)
563  {
564  showerShape.hcalDepth1OverEcal = generalData_->hcalHelperPflow->hcalESumDepth1(*theClus)/theClus->energy() ;
565  showerShape.hcalDepth2OverEcal = generalData_->hcalHelperPflow->hcalESumDepth2(*theClus)/theClus->energy() ;
569  }
570  else
571  {
572  showerShape.hcalDepth1OverEcal = generalData_->hcalHelper->hcalESumDepth1(*theClus)/theClus->energy() ;
573  showerShape.hcalDepth2OverEcal = generalData_->hcalHelper->hcalESumDepth2(*theClus)/theClus->energy() ;
577  }
578  }
ElectronHcalHelper * hcalHelperPflow
GeneralData * generalData_
CaloTopology const * topology(0)
const EcalRecHitsConfiguration recHitsCfg
EventSetupData * eventSetupData_
edm::Handle< EcalRecHitCollection > endcapRecHits
double hcalESumDepth2BehindClusters(const std::vector< CaloTowerDetId > &towers)
std::vector< CaloTowerDetId > hcalTowersBehindClusters(const reco::SuperCluster &sc)
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:190
double hcalESumDepth1BehindClusters(const std::vector< CaloTowerDetId > &towers)
edm::ESHandle< CaloTopology > caloTopo
bool isNotFinite(T x)
Definition: isFinite.h:10
T sqrt(T t)
Definition: SSEVec.h:48
edm::Handle< EcalRecHitCollection > barrelRecHits
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: GsfElectron.h:383
double hcalESumDepth2(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
ElectronHcalHelper * hcalHelper
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
T const * product() const
Definition: ESHandle.h:62
ESHandle< TrackerGeometry > geometry
edm::ESHandle< CaloGeometry > caloGeom
double hcalESumDepth1(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
EventData * eventData_
void GsfElectronAlgo::calculateShowerShape_full5x5 ( const reco::SuperClusterRef theClus,
bool  pflow,
reco::GsfElectron::ShowerShape showerShape 
)
private

Definition at line 580 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::barrelRecHits, GsfElectronAlgo::EventSetupData::caloGeom, GsfElectronAlgo::EventSetupData::caloTopo, EcalClusterToolsT< noZS >::covariances(), EcalClusterToolsT< noZS >::e1x5(), reco::GsfElectron::ShowerShape::e1x5, EcalClusterToolsT< noZS >::e2x5Max(), reco::GsfElectron::ShowerShape::e2x5Max, EcalClusterToolsT< noZS >::e3x3(), EcalClusterToolsT< noZS >::e5x5(), reco::GsfElectron::ShowerShape::e5x5, EcalBarrel, GsfElectronAlgo::EventData::endcapRecHits, eventData_, eventSetupData_, generalData_, geometry, reco::GsfElectron::ShowerShape::hcalDepth1OverEcal, reco::GsfElectron::ShowerShape::hcalDepth1OverEcalBc, reco::GsfElectron::ShowerShape::hcalDepth2OverEcal, reco::GsfElectron::ShowerShape::hcalDepth2OverEcalBc, ElectronHcalHelper::hcalESumDepth1(), ElectronHcalHelper::hcalESumDepth1BehindClusters(), ElectronHcalHelper::hcalESumDepth2(), ElectronHcalHelper::hcalESumDepth2BehindClusters(), GsfElectronAlgo::GeneralData::hcalHelper, GsfElectronAlgo::GeneralData::hcalHelperPflow, ElectronHcalHelper::hcalTowersBehindClusters(), reco::GsfElectron::ShowerShape::hcalTowersBehindClusters, reco::CaloCluster::hitsAndFractions(), edm::isNotFinite(), EcalClusterToolsT< noZS >::localCovariances(), edm::ESHandle< class >::product(), reco::GsfElectron::ShowerShape::r9, GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitFlagsToBeExcludedEndcaps, GsfElectronAlgo::GeneralData::recHitsCfg, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedBarrel, GsfElectronAlgo::EcalRecHitsConfiguration::recHitSeverityToBeExcludedEndcaps, reco::GsfElectron::ShowerShape::sigmaEtaEta, reco::GsfElectron::ShowerShape::sigmaIetaIeta, reco::GsfElectron::ShowerShape::sigmaIphiIphi, mathSSE::sqrt(), DetId::subdetId(), and ecaldqm::topology().

Referenced by createElectron().

581  {
582  const reco::CaloCluster & seedCluster = *(theClus->seed()) ;
583  // temporary, till CaloCluster->seed() is made available
584  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
585  int detector = seedXtalId.subdetId() ;
586 
589  const EcalRecHitCollection * recHits = 0 ;
590  std::vector<int> recHitFlagsToBeExcluded ;
591  std::vector<int> recHitSeverityToBeExcluded ;
592  if (detector==EcalBarrel)
593  {
594  recHits = eventData_->barrelRecHits.product() ;
595  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedBarrel ;
596  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedBarrel ;
597  }
598  else
599  {
600  recHits = eventData_->endcapRecHits.product() ;
601  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedEndcaps ;
602  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedEndcaps ;
603  }
604 
605  std::vector<float> covariances = noZS::EcalClusterTools::covariances(seedCluster,recHits,topology,geometry) ;
606  std::vector<float> localCovariances = noZS::EcalClusterTools::localCovariances(seedCluster,recHits,topology) ;
607  showerShape.sigmaEtaEta = sqrt(covariances[0]) ;
608  showerShape.sigmaIetaIeta = sqrt(localCovariances[0]) ;
609  if (!edm::isNotFinite(localCovariances[2])) showerShape.sigmaIphiIphi = sqrt(localCovariances[2]) ;
610  showerShape.e1x5 = noZS::EcalClusterTools::e1x5(seedCluster,recHits,topology) ;
611  showerShape.e2x5Max = noZS::EcalClusterTools::e2x5Max(seedCluster,recHits,topology) ;
612  showerShape.e5x5 = noZS::EcalClusterTools::e5x5(seedCluster,recHits,topology) ;
613  showerShape.r9 = noZS::EcalClusterTools::e3x3(seedCluster,recHits,topology)/theClus->rawEnergy() ;
614 
615  if (pflow)
616  {
617  showerShape.hcalDepth1OverEcal = generalData_->hcalHelperPflow->hcalESumDepth1(*theClus)/theClus->energy() ;
618  showerShape.hcalDepth2OverEcal = generalData_->hcalHelperPflow->hcalESumDepth2(*theClus)/theClus->energy() ;
622  }
623  else
624  {
625  showerShape.hcalDepth1OverEcal = generalData_->hcalHelper->hcalESumDepth1(*theClus)/theClus->energy() ;
626  showerShape.hcalDepth2OverEcal = generalData_->hcalHelper->hcalESumDepth2(*theClus)/theClus->energy() ;
630  }
631  }
ElectronHcalHelper * hcalHelperPflow
GeneralData * generalData_
static std::vector< float > covariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry, float w0=4.7)
CaloTopology const * topology(0)
const EcalRecHitsConfiguration recHitsCfg
EventSetupData * eventSetupData_
edm::Handle< EcalRecHitCollection > endcapRecHits
double hcalESumDepth2BehindClusters(const std::vector< CaloTowerDetId > &towers)
std::vector< CaloTowerDetId > hcalTowersBehindClusters(const reco::SuperCluster &sc)
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:190
double hcalESumDepth1BehindClusters(const std::vector< CaloTowerDetId > &towers)
edm::ESHandle< CaloTopology > caloTopo
bool isNotFinite(T x)
Definition: isFinite.h:10
T sqrt(T t)
Definition: SSEVec.h:48
edm::Handle< EcalRecHitCollection > barrelRecHits
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: GsfElectron.h:383
static float e2x5Max(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
double hcalESumDepth2(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
ElectronHcalHelper * hcalHelper
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
T const * product() const
Definition: ESHandle.h:62
ESHandle< TrackerGeometry > geometry
edm::ESHandle< CaloGeometry > caloGeom
double hcalESumDepth1(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
EventData * eventData_
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static std::vector< float > localCovariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=4.7)
static float e1x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
void GsfElectronAlgo::checkSetup ( const edm::EventSetup es)

Definition at line 665 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, ElectronHcalHelper::checkSetup(), RegressionHelper::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< class >::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 GsfElectronBaseProducer::beginEvent().

666  {
667  // get EventSetupRecords if needed
668  bool updateField(false);
670  updateField = true;
673  }
674 
675  bool updateGeometry(false);
677  updateGeometry = true;
680  }
681 
682  if ( updateField || updateGeometry ) {
683  delete eventSetupData_->mtsTransform ;
687  }
688 
690  eventSetupData_->cacheIDGeom=es.get<CaloGeometryRecord>().cacheIdentifier();
692  }
693 
695  eventSetupData_->cacheIDTopo=es.get<CaloTopologyRecord>().cacheIdentifier();
697  }
698 
703 
704 
709 
710  //if(eventSetupData_->cacheChStatus!=es.get<EcalChannelStatusRcd>().cacheIdentifier()){
711  // eventSetupData_->cacheChStatus=es.get<EcalChannelStatusRcd>().cacheIdentifier();
712  // es.get<EcalChannelStatusRcd>().get(eventSetupData_->chStatus);
713  //}
714 
716  eventSetupData_->cacheSevLevel = es.get<EcalSeverityLevelAlgoRcd>().cacheIdentifier();
718  }
719  }
ElectronHcalHelper * hcalHelperPflow
unsigned long long cacheIdentifier() const
GeneralData * generalData_
EventSetupData * eventSetupData_
void checkSetup(const edm::EventSetup &)
edm::ESHandle< EcalSeverityLevelAlgo > sevLevel
const StrategyConfiguration strategyCfg
edm::ESHandle< CaloTopology > caloTopo
GsfConstraintAtVertex * constraintAtVtx
const MultiTrajectoryStateTransform * mtsTransform
ElectronHcalHelper * hcalHelper
edm::ESHandle< MagneticField > magField
EcalClusterFunctionBaseClass * superClusterErrorFunction
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::ESHandle< CaloGeometry > caloGeom
EcalClusterFunctionBaseClass * crackCorrectionFunction
RegressionHelper * regHelper
edm::ESHandle< TrackerGeometry > trackerHandle
virtual void init(const edm::EventSetup &es)=0
void checkSetup(const edm::EventSetup &)
void GsfElectronAlgo::clonePreviousElectrons ( )

Definition at line 899 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::coreElectrons, GsfElectronAlgo::EventData::electrons, eventData_, GsfElectronAlgo::EventData::previousElectrons, and edm::Handle< T >::product().

Referenced by GsfElectronProducer::produce().

900  {
901  const GsfElectronCollection * oldElectrons = eventData_->previousElectrons.product() ;
903  GsfElectronCollection::const_iterator oldElectron ;
904  for
905  ( oldElectron = oldElectrons->begin() ;
906  oldElectron != oldElectrons->end() ;
907  ++oldElectron )
908  {
909  const GsfElectronCoreRef oldCoreRef = oldElectron->core() ;
910  const GsfTrackRef oldElectronGsfTrackRef = oldCoreRef->gsfTrack() ;
911  unsigned int icore ;
912  for ( icore=0 ; icore<newCores->size() ; ++icore )
913  {
914  if (oldElectronGsfTrackRef==(*newCores)[icore].gsfTrack())
915  {
917  eventData_->electrons->push_back(new GsfElectron(*oldElectron,coreRef)) ;
918  break ;
919  }
920  }
921  }
922  }
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::vector< GsfElectronCore > GsfElectronCoreCollection
GsfElectronPtrCollection * electrons
edm::Handle< reco::GsfElectronCollection > previousElectrons
T const * product() const
Definition: Handle.h:81
EventData * eventData_
edm::Handle< reco::GsfElectronCoreCollection > coreElectrons
void GsfElectronAlgo::completeElectrons ( )

Definition at line 856 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::beamspot, GsfElectronAlgo::ElectronData::calculateTSOS(), GsfElectronAlgo::EventSetupData::constraintAtVtx, GsfElectronAlgo::EventData::coreElectrons, createElectron(), electronData_, GsfElectronAlgo::EventData::electrons, eventData_, eventSetupData_, edm::hlt::Exception, edm::false, i, edm::Ref< C, T, F >::isNull(), GsfElectronAlgo::EventSetupData::mtsTransform, edm::Handle< T >::product(), and funct::true.

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

857  {
858  if (electronData_!=0)
859  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"unexpected electron data" ; }
860 
861  const GsfElectronCoreCollection * coreCollection = eventData_->coreElectrons.product() ;
862  for ( unsigned int i=0 ; i<coreCollection->size() ; ++i )
863  {
864  // check there is no existing electron with this core
866  bool coreFound = false ;
867  GsfElectronPtrCollection::const_iterator itrEle ;
868  for
869  ( itrEle = eventData_->electrons->begin() ;
870  itrEle != eventData_->electrons->end() ;
871  itrEle++ )
872  {
873  if ((*itrEle)->core()==coreRef)
874  {
875  coreFound = true ;
876  break ;
877  }
878  }
879  if (coreFound) continue ;
880 
881  // check there is a super-cluster
882  if (coreRef->superCluster().isNull()) continue ;
883 
884  // prepare internal structure for electron specific data
885  delete electronData_ ;
886  electronData_ = new ElectronData(coreRef,*eventData_->beamspot) ;
887 
888  // calculate and check Trajectory StatesOnSurface....
890 
891  createElectron() ;
892 
893  } // loop over tracks
894 
895  delete electronData_ ;
896  electronData_ = 0 ;
897  }
int i
Definition: DBlmapReader.cc:9
EventSetupData * eventSetupData_
bool isNull() const
Checks for null.
Definition: Ref.h:247
GsfConstraintAtVertex * constraintAtVtx
std::vector< GsfElectronCore > GsfElectronCoreCollection
const MultiTrajectoryStateTransform * mtsTransform
const reco::BeamSpot * beamspot
GsfElectronPtrCollection * electrons
T const * product() const
Definition: Handle.h:81
bool calculateTSOS(const MultiTrajectoryStateTransform *, GsfConstraintAtVertex *)
EventData * eventData_
volatile std::atomic< bool > shutdown_flag false
ElectronData * electronData_
edm::Handle< reco::GsfElectronCoreCollection > coreElectrons
void GsfElectronAlgo::copyElectrons ( reco::GsfElectronCollection outEle)

Definition at line 722 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::electrons, and eventData_.

Referenced by GsfElectronBaseProducer::fillEvent().

723  {
724  GsfElectronPtrCollection::const_iterator it ;
725  for
726  ( it = eventData_->electrons->begin() ;
727  it != eventData_->electrons->end() ;
728  it++ )
729  { outEle.push_back(**it) ; }
730  }
GsfElectronPtrCollection * electrons
EventData * eventData_
void GsfElectronAlgo::createElectron ( )
private

Definition at line 1242 of file GsfElectronAlgo.cc.

References funct::abs(), RegressionHelper::applyCombinationRegression(), RegressionHelper::applyEcalRegression(), GsfElectronAlgo::EventData::barrelRecHits, GsfElectronAlgo::EventData::beamspot, GsfElectronAlgo::ElectronData::calculateMode(), GsfElectronAlgo::ElectronData::calculateMomentum(), calculateShowerShape(), calculateShowerShape_full5x5(), GsfElectronAlgo::ElectronData::checkCtfTrack(), GetRecoTauVFromDQM_MC_cff::cl, ElectronEnergyCorrector::classBasedParameterizationEnergy(), ElectronEnergyCorrector::classBasedParameterizationUncertainty(), ElectronClassification::classify(), GsfElectronAlgo::ElectronData::computeCharge(), ConversionInfo::conversionPartnerCtfTk(), ConversionInfo::conversionPartnerGsfTk(), reco::GsfElectron::core(), GsfElectronAlgo::ElectronData::coreRef, ElectronMomentumCorrector::correct(), GsfElectronAlgo::GeneralData::crackCorrectionFunction, reco::GsfElectron::ClosestCtfTrack::ctfTrack, GsfElectronAlgo::ElectronData::ctfTrackRef, 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, ConversionInfo::dist(), reco::GsfElectron::ConversionRejection::dist, 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, reco::GsfElectron::electronCluster(), electronData_, GsfElectronAlgo::EventData::electrons, GsfElectronAlgo::ElectronData::eleMom, GsfElectronAlgo::ElectronData::elePos, GsfElectronAlgo::EventData::endcapRecHits, reco::CaloCluster::energy(), reco::GsfElectron::TrackClusterMatching::eSeedClusterOverP, reco::GsfElectron::TrackClusterMatching::eSeedClusterOverPout, reco::GsfElectron::TrackClusterMatching::eSuperClusterOverP, eventData_, eventSetupData_, edm::hlt::Exception, ConversionInfo::flag(), reco::GsfElectron::ConversionRejection::flags, generalData_, GsfElectronAlgo::ElectronData::getEleBasicCluster(), EgammaRecHitIsolation::getEtSum(), ElectronTkIsolation::getPtTracks(), EgammaTowerIsolation::getTowerEtSum(), EcalClusterFunctionBaseClass::getValue(), 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, reco::GsfElectron::ShowerShape::hcalTowersBehindClusters, reco::CaloCluster::hitsAndFractions(), EBDetId::ietaAbs(), GsfElectronAlgo::ElectronData::innMom, 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, 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, reco::GsfElectron::TrackExtrapolations::momentumAtCalo, reco::GsfElectron::TrackExtrapolations::momentumAtEleClus, reco::GsfElectron::TrackExtrapolations::momentumAtVtx, reco::GsfElectron::TrackExtrapolations::momentumAtVtxWithConstraint, reco::GsfElectron::TrackExtrapolations::momentumOut, GsfElectronAlgo::EventSetupData::mtsMode, GsfElectronAlgo::EventSetupData::mtsTransform, or, GsfElectronAlgo::EventData::originalCtfTracks, GsfElectronAlgo::EventData::originalGsfTracks, GsfElectronAlgo::ElectronData::outMom, reco::GsfElectron::p4(), reco::GsfElectron::ConversionRejection::partner, reco::BeamSpot::position(), reco::CaloCluster::position(), reco::GsfElectron::TrackExtrapolations::positionAtCalo, reco::GsfElectron::TrackExtrapolations::positionAtVtx, GsfElectronAlgo::StrategyConfiguration::pureTrackerDrivenEcalErrorFromSimpleParameterization, reco::GsfElectron::ConversionRejection::radius, ConversionInfo::radiusOfConversion(), ElectronClassification::refineWithPflow(), GsfElectronAlgo::GeneralData::regHelper, GsfElectronAlgo::EventData::retreiveOriginalTrackCollections(), GsfElectronAlgo::ElectronData::sclMom, GsfElectronAlgo::ElectronData::sclPos, GsfElectronAlgo::ElectronData::seedMom, GsfElectronAlgo::ElectronData::seedPos, reco::GsfElectron::setCorrectedEcalEnergyError(), setCutBasedPreselectionFlag(), reco::GsfElectron::setIsolation03(), reco::GsfElectron::setIsolation04(), reco::GsfElectron::setP4(), reco::GsfElectron::setPfSuperClusterFbrem(), reco::GsfElectron::setSuperClusterFbrem(), reco::GsfElectron::setTrackFbrem(), reco::GsfElectron::ClosestCtfTrack::shFracInnerHits, GsfElectronAlgo::ElectronData::shFracInnerHits, ElectronEnergyCorrector::simpleParameterizationUncertainty(), GsfElectronAlgo::GeneralData::strategyCfg, DetId::subdetId(), reco::GsfElectron::superCluster(), GsfElectronAlgo::GeneralData::superClusterErrorFunction, GsfElectronAlgo::ElectronData::superClusterRef, GsfElectronAlgo::EventData::tkIsolation03, GsfElectronAlgo::EventData::tkIsolation04, reco::GsfElectron::IsolationVariables::tkSumPt, funct::true, GsfElectronAlgo::StrategyConfiguration::useCombinationRegression, GsfElectronAlgo::StrategyConfiguration::useEcalRegression, GsfElectronAlgo::EventData::vertices, GsfElectronAlgo::ElectronData::vtxMom, GsfElectronAlgo::ElectronData::vtxMomWithConstraint, GsfElectronAlgo::ElectronData::vtxPos, and GsfElectronAlgo::ElectronData::vtxTSOS.

Referenced by completeElectrons().

1243  {
1244  // eventually check ctf track
1247 
1248  // charge ID
1249  int eleCharge ;
1250  GsfElectron::ChargeInfo eleChargeInfo ;
1251  electronData_->computeCharge(eleCharge,eleChargeInfo) ;
1252 
1253  // electron basic cluster
1255 
1256  // Seed cluster
1257  const reco::CaloCluster & seedCluster = *(electronData_->superClusterRef->seed()) ;
1258 
1259  // seed Xtal
1260  // temporary, till CaloCluster->seed() is made available
1261  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
1262 
1264 
1265 
1266  //====================================================
1267  // Candidate attributes
1268  //====================================================
1269 
1271 
1272 
1273  //====================================================
1274  // Track-Cluster Matching
1275  //====================================================
1276 
1278  tcMatching.electronCluster = elbcRef ;
1279  tcMatching.eSuperClusterOverP = (electronData_->vtxMom.mag()>0)?(electronData_->superClusterRef->energy()/electronData_->vtxMom.mag()):(-1.) ;
1280  tcMatching.eSeedClusterOverP = (electronData_->vtxMom.mag()>0.)?(seedCluster.energy()/electronData_->vtxMom.mag()):(-1) ;
1281  tcMatching.eSeedClusterOverPout = (electronData_->seedMom.mag()>0.)?(seedCluster.energy()/electronData_->seedMom.mag()):(-1.) ;
1282  tcMatching.eEleClusterOverPout = (electronData_->eleMom.mag()>0.)?(elbcRef->energy()/electronData_->eleMom.mag()):(-1.) ;
1283 
1285  tcMatching.deltaEtaSuperClusterAtVtx = scAtVtx.dEta() ;
1286  tcMatching.deltaPhiSuperClusterAtVtx = scAtVtx.dPhi() ;
1287 
1288  EleRelPointPair seedAtCalo(seedCluster.position(),electronData_->seedPos,eventData_->beamspot->position()) ;
1289  tcMatching.deltaEtaSeedClusterAtCalo = seedAtCalo.dEta() ;
1290  tcMatching.deltaPhiSeedClusterAtCalo = seedAtCalo.dPhi() ;
1291 
1292  EleRelPointPair ecAtCalo(elbcRef->position(),electronData_->elePos,eventData_->beamspot->position()) ;
1293  tcMatching.deltaEtaEleClusterAtCalo = ecAtCalo.dEta() ;
1294  tcMatching.deltaPhiEleClusterAtCalo = ecAtCalo.dPhi() ;
1295 
1296 
1297  //=======================================================
1298  // Track extrapolations
1299  //=======================================================
1300 
1309 
1310 
1311  //=======================================================
1312  // Closest Ctf Track
1313  //=======================================================
1314 
1316  ctfInfo.ctfTrack = electronData_->ctfTrackRef ;
1318 
1319 
1320  //====================================================
1321  // FiducialFlags, using nextToBoundary definition of gaps
1322  //====================================================
1323 
1324  reco::GsfElectron::FiducialFlags fiducialFlags ;
1325  int detector = seedXtalId.subdetId() ;
1326  double feta=std::abs(electronData_->superClusterRef->position().eta()) ;
1327  if (detector==EcalBarrel)
1328  {
1329  fiducialFlags.isEB = true ;
1330  EBDetId ebdetid(seedXtalId);
1331  if (EBDetId::isNextToEtaBoundary(ebdetid))
1332  {
1333  if (ebdetid.ietaAbs()==85)
1334  { fiducialFlags.isEBEEGap = true ; }
1335  else
1336  { fiducialFlags.isEBEtaGap = true ; }
1337  }
1338  if (EBDetId::isNextToPhiBoundary(ebdetid))
1339  { fiducialFlags.isEBPhiGap = true ; }
1340  }
1341  else if (detector==EcalEndcap)
1342  {
1343  fiducialFlags.isEE = true ;
1344  EEDetId eedetid(seedXtalId);
1345  if (EEDetId::isNextToRingBoundary(eedetid))
1346  {
1347  if (std::abs(feta)<2.)
1348  { fiducialFlags.isEBEEGap = true ; }
1349  else
1350  { fiducialFlags.isEERingGap = true ; }
1351  }
1352  if (EEDetId::isNextToDBoundary(eedetid))
1353  { fiducialFlags.isEEDeeGap = true ; }
1354  }
1355  else
1356  { throw cms::Exception("GsfElectronAlgo|UnknownXtalRegion")<<"createElectron(): do not know if it is a barrel or endcap seed cluster !!!!" ; }
1357 
1358 
1359  //====================================================
1360  // ShowerShape
1361  //====================================================
1362 
1363  reco::GsfElectron::ShowerShape showerShape ;
1364  calculateShowerShape(electronData_->superClusterRef,!(electronData_->coreRef->ecalDrivenSeed()),showerShape) ;
1365 
1366  reco::GsfElectron::ShowerShape full5x5_showerShape ;
1367  calculateShowerShape_full5x5(electronData_->superClusterRef,!(electronData_->coreRef->ecalDrivenSeed()),full5x5_showerShape) ;
1368 
1369  //====================================================
1370  // ConversionRejection
1371  //====================================================
1372 
1374 
1375  ConversionFinder conversionFinder ;
1376  double BInTesla = eventSetupData_->magField->inTesla(GlobalPoint(0.,0.,0.)).z() ;
1378  if (!ctfTracks.isValid()) { ctfTracks = eventData_->currentCtfTracks ; }
1379 
1380  // values of conversionInfo.flag()
1381  // -9999 : Partner track was not found
1382  // 0 : Partner track found in the CTF collection using
1383  // 1 : Partner track found in the CTF collection using
1384  // 2 : Partner track found in the GSF collection using
1385  // 3 : Partner track found in the GSF collection using the electron's GSF track
1386  ConversionInfo conversionInfo = conversionFinder.getConversionInfo
1387  (*electronData_->coreRef,ctfTracks,eventData_->originalGsfTracks,BInTesla) ;
1388 
1390  conversionVars.flags = conversionInfo.flag() ;
1391  conversionVars.dist = conversionInfo.dist() ;
1392  conversionVars.dcot = conversionInfo.dcot() ;
1393  conversionVars.radius = conversionInfo.radiusOfConversion() ;
1394  if ((conversionVars.flags==0)or(conversionVars.flags==1))
1395  conversionVars.partner = TrackBaseRef(conversionInfo.conversionPartnerCtfTk()) ;
1396  else if ((conversionVars.flags==2)or(conversionVars.flags==3))
1397  conversionVars.partner = TrackBaseRef(conversionInfo.conversionPartnerGsfTk()) ;
1398 
1399 
1400  //====================================================
1401  // Go !
1402  //====================================================
1403 
1404  GsfElectron * ele = new
1405  GsfElectron
1406  ( eleCharge,eleChargeInfo,electronData_->coreRef,
1407  tcMatching, tkExtra, ctfInfo,
1408  fiducialFlags,showerShape, full5x5_showerShape,
1409  conversionVars ) ;
1410  // Will be overwritten later in the case of the regression
1412  ele->setP4(GsfElectron::P4_FROM_SUPER_CLUSTER,momentum,0,true) ;
1413 
1414 
1415  //====================================================
1416  // brems fractions
1417  //====================================================
1418 
1419  if (electronData_->innMom.mag()>0.)
1421 
1422  // the supercluster is the refined one The seed is not necessarily the first cluster
1423  // hence the use of the electronCluster
1424  SuperClusterRef sc = ele->superCluster() ;
1425  if (!(sc.isNull()))
1426  {
1427  CaloClusterPtr cl = ele->electronCluster() ;
1428  if (sc->clustersSize()>1)
1429  {
1430  float pf_fbrem =( sc->energy() - cl->energy() ) / sc->energy();
1431  ele->setSuperClusterFbrem( pf_fbrem ) ;
1432  ele->setPfSuperClusterFbrem( pf_fbrem) ;
1433  }
1434  else
1435  {
1436  ele->setSuperClusterFbrem(0) ;
1437  ele->setPfSuperClusterFbrem(0);
1438  }
1439  }
1440 
1441  //====================================================
1442  // classification and corrections
1443  //====================================================
1444  // classification
1445  ElectronClassification theClassifier ;
1446  theClassifier.classify(*ele) ;
1447  theClassifier.refineWithPflow(*ele) ;
1448  // ecal energy
1451  {
1456  }
1457  else // original implementation
1458  {
1459  if (ele->core()->ecalDrivenSeed())
1460  {
1462  { theEnCorrector.classBasedParameterizationEnergy(*ele,*eventData_->beamspot) ; }
1464  { theEnCorrector.classBasedParameterizationUncertainty(*ele) ; }
1465  }
1466  else
1467  {
1469  { theEnCorrector.simpleParameterizationUncertainty(*ele) ; }
1470  }
1471  }
1472 
1473  // momentum
1474  // Keep the default correction running first. The track momentum error is computed in there
1475  if (ele->core()->ecalDrivenSeed())
1476  {
1477  ElectronMomentumCorrector theMomCorrector;
1478  theMomCorrector.correct(*ele,electronData_->vtxTSOS);
1479  }
1481  {
1483  }
1484 
1485  //====================================================
1486  // now isolation variables
1487  //====================================================
1488 
1502  ele->setIsolation03(dr03);
1503  ele->setIsolation04(dr04);
1504 
1505 
1506  //====================================================
1507  // preselection flag
1508  //====================================================
1509 
1511 
1512  LogTrace("GsfElectronAlgo")<<"Constructed new electron with energy "<< ele->p4().e() ;
1513 
1514  eventData_->electrons->push_back(ele) ;
1515  }
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:242
edm::Handle< reco::TrackCollection > originalCtfTracks
const MultiTrajectoryStateMode * mtsMode
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:124
void applyCombinationRegression(reco::GsfElectron &ele) const
void setTrackFbrem(float fbrem)
Definition: GsfElectron.h:687
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
Definition: GsfElectron.cc:203
GeneralData * generalData_
static bool isNextToEtaBoundary(EBDetId id)
Definition: EBDetId.cc:125
EgammaTowerIsolation * hadDepth1Isolation04Bc
reco::GsfTrackRef conversionPartnerGsfTk() const
EgammaTowerIsolation * hadDepth1Isolation03Bc
double radiusOfConversion() const
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc: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
void retreiveOriginalTrackCollections(const reco::TrackRef &, const reco::GsfTrackRef &)
double getEtSum(const reco::Candidate *emObject) const
void calculateShowerShape(const reco::SuperClusterRef &, bool pflow, reco::GsfElectron::ShowerShape &)
EventSetupData * eventSetupData_
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
edm::Handle< EcalRecHitCollection > endcapRecHits
double dist() const
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:190
void computeCharge(int &charge, reco::GsfElectron::ChargeInfo &info)
void checkCtfTrack(edm::Handle< reco::TrackCollection > currentCtfTracks)
EgammaTowerIsolation * hadDepth1Isolation03
const StrategyConfiguration strategyCfg
reco::TrackRef conversionPartnerCtfTk() const
void setSuperClusterFbrem(float fbrem)
Definition: GsfElectron.h:688
EgammaRecHitIsolation * ecalBarrelIsol04
virtual float getValue(const reco::BasicCluster &, const EcalRecHitCollection &) const =0
EgammaTowerIsolation * hadDepth2Isolation03
EgammaTowerIsolation * hadDepth1Isolation04
ElectronTkIsolation * tkIsolation03
void setCorrectedEcalEnergyError(float newEnergyError)
Definition: GsfElectron.cc:183
bool isNull() const
Checks for null.
Definition: Ref.h:247
T mag() const
Definition: PV3DBase.h:67
void calculateShowerShape_full5x5(const reco::SuperClusterRef &, bool pflow, reco::GsfElectron::ShowerShape &)
void setCutBasedPreselectionFlag(reco::GsfElectron *ele, const reco::BeamSpot &)
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:22
EgammaRecHitIsolation * ecalEndcapIsol03
EgammaTowerIsolation * hadDepth2Isolation03Bc
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:182
static bool isNextToPhiBoundary(EBDetId id)
Definition: EBDetId.cc:130
edm::Handle< EcalRecHitCollection > barrelRecHits
void correct(reco::GsfElectron &, TrajectoryStateOnSurface &)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: GsfElectron.h:383
const MultiTrajectoryStateTransform * mtsTransform
static bool isNextToRingBoundary(EEDetId id)
Definition: EEDetId.cc:375
double energy() const
cluster energy
Definition: CaloCluster.h:120
const reco::BeamSpot * beamspot
edm::ESHandle< MagneticField > magField
GsfElectronPtrCollection * electrons
CaloClusterPtr getEleBasicCluster(const MultiTrajectoryStateTransform *)
static bool isNextToDBoundary(EEDetId id)
Definition: EEDetId.cc:367
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:37
void setIsolation04(const IsolationVariables &dr04)
Definition: GsfElectron.h:501
#define LogTrace(id)
void classify(reco::GsfElectron &)
EgammaTowerIsolation * hadDepth2Isolation04Bc
Definition: DetId.h:18
edm::Handle< reco::VertexCollection > vertices
EgammaRecHitIsolation * ecalBarrelIsol03
int flag() const
EcalClusterFunctionBaseClass * superClusterErrorFunction
void ele_convert(const Type1 &obj1, Type2 &obj2)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
math::XYZVectorF momentumAtVtxWithConstraint
Definition: GsfElectron.h:280
double getPtTracks(const reco::GsfElectron *) const
void refineWithPflow(reco::GsfElectron &)
void setIsolation03(const IsolationVariables &dr03)
Definition: GsfElectron.h:500
edm::Handle< reco::GsfTrackCollection > originalGsfTracks
void applyEcalRegression(reco::GsfElectron &electron, const edm::Handle< reco::VertexCollection > &vertices, const edm::Handle< EcalRecHitCollection > &rechitsEB, const edm::Handle< EcalRecHitCollection > &rechitsEE) const
EgammaTowerIsolation * hadDepth2Isolation04
void setPfSuperClusterFbrem(float fbrem)
Definition: GsfElectron.h:689
const reco::GsfElectronCoreRef coreRef
edm::Handle< reco::TrackCollection > currentCtfTracks
double getTowerEtSum(const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
EcalClusterFunctionBaseClass * crackCorrectionFunction
EgammaRecHitIsolation * ecalEndcapIsol04
const reco::SuperClusterRef superClusterRef
const Point & position() const
position
Definition: BeamSpot.h:62
EventData * eventData_
double dcot() const
RegressionHelper * regHelper
ElectronTkIsolation * tkIsolation04
ElectronData * electronData_
void calculateMode(const MultiTrajectoryStateMode *mtsMode)
TrajectoryStateOnSurface vtxTSOS
Candidate::LorentzVector calculateMomentum()
void GsfElectronAlgo::displayInternalElectrons ( const std::string &  title) const

Definition at line 842 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::electrons, GsfElectronAlgo::EventData::event, eventData_, edm::EventBase::id(), and LogTrace.

Referenced by GsfElectronBaseProducer::fillEvent().

843  {
844  LogTrace("GsfElectronAlgo") << "========== " << title << " ==========";
845  LogTrace("GsfElectronAlgo") << "Event: " << eventData_->event->id();
846  LogTrace("GsfElectronAlgo") << "Number of electrons: " << eventData_->electrons->size() ;
847  GsfElectronPtrCollection::const_iterator it ;
848  for ( it = eventData_->electrons->begin(); it != eventData_->electrons->end(); it++ )
849  {
850  LogTrace("GsfElectronAlgo") << "Electron with charge, pt, eta, phi: " << (*it)->charge() << " , "
851  << (*it)->pt() << " , " << (*it)->eta() << " , " << (*it)->phi();
852  }
853  LogTrace("GsfElectronAlgo") << "=================================================";
854  }
GsfElectronPtrCollection * electrons
#define LogTrace(id)
edm::EventID id() const
Definition: EventBase.h:56
EventData * eventData_
void GsfElectronAlgo::endEvent ( )

Definition at line 834 of file GsfElectronAlgo.cc.

References eventData_, and edm::hlt::Exception.

Referenced by GsfElectronBaseProducer::endEvent().

835  {
836  if (eventData_==0)
837  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"lacking event data" ; }
838  delete eventData_ ;
839  eventData_ = 0 ;
840  }
EventData * eventData_
const reco::SuperClusterRef GsfElectronAlgo::getTrSuperCluster ( const reco::GsfTrackRef trackRef)
private
bool GsfElectronAlgo::isPreselected ( reco::GsfElectron ele)
private

Definition at line 1051 of file GsfElectronAlgo.cc.

References reco::GsfElectron::ecalDrivenSeed(), GsfElectronAlgo::EventData::event, eventData_, GsfElectronAlgo::StrategyConfiguration::gedElectronMode, generalData_, GsfElectronAlgo::StrategyConfiguration::MaxElePtForOnlyMVA, SoftElectronMVAEstimator::mva(), reco::GsfElectron::passingCutBasedPreselection(), reco::GsfElectron::passingPflowPreselection(), GsfElectronAlgo::StrategyConfiguration::PreSelectMVA, reco::LeafCandidate::pt(), GsfElectronAlgo::GeneralData::sElectronMVAEstimator, and GsfElectronAlgo::GeneralData::strategyCfg.

Referenced by removeNotPreselectedElectrons(), and setAmbiguityData().

1052  {
1053  float mvaValue=generalData_->sElectronMVAEstimator->mva( *(ele),*(eventData_->event));
1054  bool passCutBased=ele->passingCutBasedPreselection();
1055  bool passPF=ele->passingPflowPreselection();
1057  bool passmva=mvaValue>generalData_->strategyCfg.PreSelectMVA;
1058  if(!ele->ecalDrivenSeed()){
1060  return passmva && passCutBased;
1061  else
1062  return passmva;
1063  }
1064  else{
1065  return passCutBased || passPF || passmva;
1066  }
1067  }
1068  else{
1069  return passCutBased || passPF;
1070  }
1071 
1072  return true;
1073  }
GeneralData * generalData_
bool passingCutBasedPreselection() const
Definition: GsfElectron.h:630
const StrategyConfiguration strategyCfg
SoftElectronMVAEstimator * sElectronMVAEstimator
double mva(const reco::GsfElectron &myElectron, const edm::Event &evt)
EventData * eventData_
virtual float pt() const GCC11_FINAL
transverse momentum
bool ecalDrivenSeed() const
Definition: GsfElectron.h:186
bool passingPflowPreselection() const
Definition: GsfElectron.h:631
void GsfElectronAlgo::removeAmbiguousElectrons ( )

Definition at line 1647 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::electrons, eventData_, and LogTrace.

Referenced by GsfElectronBaseProducer::fillEvent().

1648  {
1649  GsfElectronPtrCollection::size_type ei = 1, emax = eventData_->electrons->size() ;
1650  GsfElectronPtrCollection::iterator eitr = eventData_->electrons->begin() ;
1651  while (eitr!=eventData_->electrons->end())
1652  {
1653  LogTrace("GsfElectronAlgo")<<"========== remove ambiguous "<<ei<<"/"<<emax<<"==========" ;
1654  if ((*eitr)->ambiguous())
1655  { delete (*eitr) ; eitr = eventData_->electrons->erase(eitr) ; ++ei ; }
1656  else
1657  { ++eitr ; ++ei ; }
1658  }
1659  }
uint16_t size_type
GsfElectronPtrCollection * electrons
#define LogTrace(id)
EventData * eventData_
void GsfElectronAlgo::removeNotPreselectedElectrons ( )

Definition at line 1075 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::electrons, eventData_, isPreselected(), and LogTrace.

Referenced by GsfElectronBaseProducer::fillEvent().

1076  {
1077  GsfElectronPtrCollection::size_type ei = 1, emax = eventData_->electrons->size() ;
1078  GsfElectronPtrCollection::iterator eitr = eventData_->electrons->begin() ;
1079  while (eitr!=eventData_->electrons->end())
1080  {
1081  LogTrace("GsfElectronAlgo")<<"========== removed not preselected "<<ei<<"/"<<emax<<"==========" ;
1082  if (isPreselected(*eitr))
1083  { ++eitr ; ++ei ; }
1084  else
1085  { delete (*eitr) ; eitr = eventData_->electrons->erase(eitr) ; ++ei ; }
1086  }
1087  }
bool isPreselected(reco::GsfElectron *ele)
uint16_t size_type
GsfElectronPtrCollection * electrons
#define LogTrace(id)
EventData * eventData_
void GsfElectronAlgo::setAmbiguityData ( bool  ignoreNotPreselected = true)

Definition at line 1525 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::StrategyConfiguration::ambClustersOverlapStrategy, GsfElectronAlgo::StrategyConfiguration::ambSortingStrategy, GsfElectronAlgo::EventData::barrelRecHits, GsfElectronAlgo::EventData::beamspot, reco::e1, reco::e2, GsfElectronAlgo::EventData::electrons, GsfElectronAlgo::EventData::endcapRecHits, eta(), eventData_, eventSetupData_, edm::hlt::Exception, edm::false, newFWLiteAna::found, generalData_, edm::Ref< C, T, F >::get(), GsfElectronAlgo::EventData::gsfPfRecTracks, EgAmbiguityTools::isBetter(), isPreselected(), LogDebug, reco::BeamSpot::position(), edm::Handle< T >::product(), EgAmbiguityTools::sharedEnergy(), GsfElectronAlgo::GeneralData::strategyCfg, dtDQMClient_cfg::threshold, GsfElectronAlgo::EventSetupData::trackerHandle, funct::true, and GsfElectronAlgo::StrategyConfiguration::useGsfPfRecTracks.

Referenced by GsfElectronBaseProducer::fillEvent().

1526  {
1527  GsfElectronPtrCollection::iterator e1, e2 ;
1532  else
1533  { throw cms::Exception("GsfElectronAlgo|UnknownAmbiguitySortingStrategy")<<"value of generalData_->strategyCfg.ambSortingStrategy is : "<<generalData_->strategyCfg.ambSortingStrategy ; }
1534 
1535  // init
1536  for
1537  ( e1 = eventData_->electrons->begin() ;
1538  e1 != eventData_->electrons->end() ;
1539  ++e1 )
1540  {
1541  (*e1)->clearAmbiguousGsfTracks() ;
1542  (*e1)->setAmbiguous(false) ;
1543  }
1544 
1545  // get ambiguous from GsfPfRecTracks
1547  {
1548  for
1549  ( e1 = eventData_->electrons->begin() ;
1550  e1 != eventData_->electrons->end() ;
1551  ++e1 )
1552  {
1553  bool found = false ;
1554  const GsfPFRecTrackCollection * gsfPfRecTrackCollection = eventData_->gsfPfRecTracks.product() ;
1555  GsfPFRecTrackCollection::const_iterator gsfPfRecTrack ;
1556  for ( gsfPfRecTrack=gsfPfRecTrackCollection->begin() ;
1557  gsfPfRecTrack!=gsfPfRecTrackCollection->end() ;
1558  ++gsfPfRecTrack )
1559  {
1560  if (gsfPfRecTrack->gsfTrackRef()==(*e1)->gsfTrack())
1561  {
1562  if (found)
1563  {
1564  edm::LogWarning("GsfElectronAlgo")<<"associated gsfPfRecTrack already found" ;
1565  }
1566  else
1567  {
1568  found = true ;
1569  const std::vector<reco::GsfPFRecTrackRef> & duplicates(gsfPfRecTrack->convBremGsfPFRecTrackRef()) ;
1570  std::vector<reco::GsfPFRecTrackRef>::const_iterator duplicate ;
1571  for ( duplicate = duplicates.begin() ; duplicate != duplicates.end() ; duplicate ++ )
1572  { (*e1)->addAmbiguousGsfTrack((*duplicate)->gsfTrackRef()) ; }
1573  }
1574  }
1575  }
1576  }
1577  }
1578  // or search overlapping clusters
1579  else
1580  {
1581  for
1582  ( e1 = eventData_->electrons->begin() ;
1583  e1 != eventData_->electrons->end() ;
1584  ++e1 )
1585  {
1586  if ((*e1)->ambiguous()) continue ;
1587  if ( ignoreNotPreselected && !isPreselected(*e1) ) continue ;
1588 
1589  SuperClusterRef scRef1 = (*e1)->superCluster();
1590  CaloClusterPtr eleClu1 = (*e1)->electronCluster();
1591  LogDebug("GsfElectronAlgo")
1592  << "Blessing electron with E/P " << (*e1)->eSuperClusterOverP()
1593  << ", cluster " << scRef1.get()
1594  << " & track " << (*e1)->gsfTrack().get() ;
1595 
1596  for
1597  ( e2 = e1, ++e2 ;
1598  e2 != eventData_->electrons->end() ;
1599  ++e2 )
1600  {
1601  if ((*e2)->ambiguous()) continue ;
1602  if ( ignoreNotPreselected && !isPreselected(*e2) ) continue ;
1603 
1604  SuperClusterRef scRef2 = (*e2)->superCluster();
1605  CaloClusterPtr eleClu2 = (*e2)->electronCluster();
1606 
1607  // search if same cluster
1608  bool sameCluster = false ;
1610  { sameCluster = (scRef1==scRef2) ; }
1612  {
1613  float eMin = 1. ;
1614  float threshold = eMin*cosh(EleRelPoint(scRef1->position(),eventData_->beamspot->position()).eta()) ;
1615  sameCluster =
1617  (EgAmbiguityTools::sharedEnergy(&(*scRef1->seed()),&(*eleClu2),eventData_->barrelRecHits,eventData_->endcapRecHits)>=threshold) ||
1619  (EgAmbiguityTools::sharedEnergy(&(*scRef1->seed()),&(*scRef2->seed()),eventData_->barrelRecHits,eventData_->endcapRecHits)>=threshold) ) ;
1620  }
1621  else
1622  { throw cms::Exception("GsfElectronAlgo|UnknownAmbiguityClustersOverlapStrategy")<<"value of generalData_->strategyCfg.ambClustersOverlapStrategy is : "<<generalData_->strategyCfg.ambClustersOverlapStrategy ; }
1623 
1624  // main instructions
1625  if (sameCluster)
1626  {
1627  LogDebug("GsfElectronAlgo")
1628  << "Discarding electron with E/P " << (*e2)->eSuperClusterOverP()
1629  << ", cluster " << scRef2.get()
1630  << " and track " << (*e2)->gsfTrack().get() ;
1631  (*e1)->addAmbiguousGsfTrack((*e2)->gsfTrack()) ;
1632  (*e2)->setAmbiguous(true) ;
1633  }
1634  else if ((*e1)->gsfTrack()==(*e2)->gsfTrack())
1635  {
1636  edm::LogWarning("GsfElectronAlgo")
1637  << "Forgetting electron with E/P " << (*e2)->eSuperClusterOverP()
1638  << ", cluster " << scRef2.get()
1639  << " and track " << (*e2)->gsfTrack().get() ;
1640  (*e2)->setAmbiguous(true) ;
1641  }
1642  }
1643  }
1644  }
1645  }
#define LogDebug(id)
bool isPreselected(reco::GsfElectron *ele)
GeneralData * generalData_
bool isBetter(const reco::GsfElectron *, const reco::GsfElectron *)
EventSetupData * eventSetupData_
edm::Handle< EcalRecHitCollection > endcapRecHits
T eta() const
const StrategyConfiguration strategyCfg
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
float sharedEnergy(const reco::CaloCluster *, const reco::CaloCluster *, edm::Handle< EcalRecHitCollection > &barrelRecHits, edm::Handle< EcalRecHitCollection > &endcapRecHits)
edm::Handle< EcalRecHitCollection > barrelRecHits
const reco::BeamSpot * beamspot
GsfElectronPtrCollection * electrons
Float e1
Definition: deltaR.h:22
T const * product() const
Definition: Handle.h:81
Float e2
Definition: deltaR.h:23
const Point & position() const
position
Definition: BeamSpot.h:62
EventData * eventData_
volatile std::atomic< bool > shutdown_flag false
edm::ESHandle< TrackerGeometry > trackerHandle
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracks
void GsfElectronAlgo::setCutBasedPreselectionFlag ( reco::GsfElectron ele,
const reco::BeamSpot bs 
)
private

Definition at line 1090 of file GsfElectronAlgo.cc.

References funct::abs(), edm::RefToBase< T >::castTo(), reco::GsfElectron::core(), GsfElectronAlgo::GeneralData::cutsCfg, GsfElectronAlgo::GeneralData::cutsCfgPflow, reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), EcalBarrel, EcalEndcap, reco::GsfElectron::eSuperClusterOverP(), eta(), edm::hlt::Exception, edm::false, GsfElectronAlgo::StrategyConfiguration::gedElectronMode, generalData_, reco::GsfElectron::gsfTrack(), reco::GsfElectron::hcalDepth1OverEcal(), reco::GsfElectron::hcalDepth2OverEcal(), reco::GsfElectron::hcalOverEcal(), 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::maxHOverEBarrel, GsfElectronAlgo::CutsConfiguration::maxHOverEEndcaps, GsfElectronAlgo::CutsConfiguration::maxSigmaIetaIetaBarrel, GsfElectronAlgo::CutsConfiguration::maxSigmaIetaIetaEndcaps, GsfElectronAlgo::CutsConfiguration::maxTIP, GsfElectronAlgo::CutsConfiguration::minEOverPBarrel, GsfElectronAlgo::CutsConfiguration::minEOverPEndcaps, GsfElectronAlgo::CutsConfiguration::minSCEtBarrel, GsfElectronAlgo::CutsConfiguration::minSCEtEndcaps, reco::BeamSpot::position(), reco::return(), fileCollector::seed, GsfElectronAlgo::CutsConfiguration::seedFromTEC, reco::GsfElectron::setPassCutBasedPreselection(), reco::GsfElectron::sigmaIetaIeta(), GsfElectronAlgo::GeneralData::strategyCfg, and reco::GsfElectron::superCluster().

Referenced by createElectron().

1091  {
1092  // default value
1093  ele->setPassCutBasedPreselection(false) ;
1094 
1095  // kind of seeding
1096  bool eg = ele->core()->ecalDrivenSeed() ;
1097  bool pf = ele->core()->trackerDrivenSeed() && !ele->core()->ecalDrivenSeed() ;
1098  bool gedMode = generalData_->strategyCfg.gedElectronMode;
1099  if (eg&&pf) { throw cms::Exception("GsfElectronAlgo|BothEcalAndPureTrackerDriven")<<"An electron cannot be both egamma and purely pflow" ; }
1100  if ((!eg)&&(!pf)) { throw cms::Exception("GsfElectronAlgo|NeitherEcalNorPureTrackerDriven")<<"An electron cannot be neither egamma nor purely pflow" ; }
1101 
1102  const CutsConfiguration * cfg = ((eg||gedMode)?&generalData_->cutsCfg:&generalData_->cutsCfgPflow);
1103 
1104  // Et cut
1105  double etaValue = EleRelPoint(ele->superCluster()->position(),bs.position()).eta() ;
1106  double etValue = ele->superCluster()->energy()/cosh(etaValue) ;
1107  LogTrace("GsfElectronAlgo") << "Et : " << etValue ;
1108  if (ele->isEB() && (etValue < cfg->minSCEtBarrel)) return ;
1109  if (ele->isEE() && (etValue < cfg->minSCEtEndcaps)) return ;
1110  LogTrace("GsfElectronAlgo") << "Et criteria are satisfied";
1111 
1112  // E/p cut
1113  double eopValue = ele->eSuperClusterOverP() ;
1114  LogTrace("GsfElectronAlgo") << "E/p : " << eopValue ;
1115  if (ele->isEB() && (eopValue > cfg->maxEOverPBarrel)) return ;
1116  if (ele->isEE() && (eopValue > cfg->maxEOverPEndcaps)) return ;
1117  if (ele->isEB() && (eopValue < cfg->minEOverPBarrel)) return ;
1118  if (ele->isEE() && (eopValue < cfg->minEOverPEndcaps)) return ;
1119  LogTrace("GsfElectronAlgo") << "E/p criteria are satisfied";
1120 
1121  // HoE cuts
1122  LogTrace("GsfElectronAlgo") << "HoE1 : " << ele->hcalDepth1OverEcal() << ", HoE2 : " << ele->hcalDepth2OverEcal();
1123  double had = ele->hcalOverEcal()*ele->superCluster()->energy() ;
1124  const reco::CaloCluster & seedCluster = *(ele->superCluster()->seed()) ;
1125  int detector = seedCluster.hitsAndFractions()[0].first.subdetId() ;
1126  bool HoEveto = false ;
1127  if (detector==EcalBarrel && (had<cfg->maxHBarrel || (had/ele->superCluster()->energy())<cfg->maxHOverEBarrel)) HoEveto=true;
1128  else if (detector==EcalEndcap && (had<cfg->maxHEndcaps || (had/ele->superCluster()->energy())<cfg->maxHOverEEndcaps)) HoEveto=true;
1129  if ( !HoEveto ) return ;
1130  LogTrace("GsfElectronAlgo") << "H/E criteria are satisfied";
1131 
1132  // delta eta criteria
1133  double deta = ele->deltaEtaSuperClusterTrackAtVtx() ;
1134  LogTrace("GsfElectronAlgo") << "delta eta : " << deta ;
1135  if (ele->isEB() && (std::abs(deta) > cfg->maxDeltaEtaBarrel)) return ;
1136  if (ele->isEE() && (std::abs(deta) > cfg->maxDeltaEtaEndcaps)) return ;
1137  LogTrace("GsfElectronAlgo") << "Delta eta criteria are satisfied";
1138 
1139  // delta phi criteria
1140  double dphi = ele->deltaPhiSuperClusterTrackAtVtx();
1141  LogTrace("GsfElectronAlgo") << "delta phi : " << dphi;
1142  if (ele->isEB() && (std::abs(dphi) > cfg->maxDeltaPhiBarrel)) return ;
1143  if (ele->isEE() && (std::abs(dphi) > cfg->maxDeltaPhiEndcaps)) return ;
1144  LogTrace("GsfElectronAlgo") << "Delta phi criteria are satisfied";
1145 
1146  // sigma ieta ieta
1147  LogTrace("GsfElectronAlgo") << "sigma ieta ieta : " << ele->sigmaIetaIeta();
1148  if (ele->isEB() && (ele->sigmaIetaIeta() > cfg->maxSigmaIetaIetaBarrel)) return ;
1149  if (ele->isEE() && (ele->sigmaIetaIeta() > cfg->maxSigmaIetaIetaEndcaps)) return ;
1150  LogTrace("GsfElectronAlgo") << "Sigma ieta ieta criteria are satisfied";
1151 
1152  // fiducial
1153  if (!ele->isEB() && cfg->isBarrel) return ;
1154  if (!ele->isEE() && cfg->isEndcaps) return ;
1155  if (cfg->isFiducial && (ele->isEBEEGap()||ele->isEBEtaGap()||ele->isEBPhiGap()||ele->isEERingGap()||ele->isEEDeeGap())) return ;
1156  LogTrace("GsfElectronAlgo") << "Fiducial flags criteria are satisfied";
1157 
1158  // seed in TEC
1159  edm::RefToBase<TrajectorySeed> seed = ele->gsfTrack()->extra()->seedRef() ;
1160  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>() ;
1161  if (eg && !generalData_->cutsCfg.seedFromTEC)
1162  {
1163  if (elseed.isNull())
1164  { throw cms::Exception("GsfElectronAlgo|NotElectronSeed")<<"The GsfTrack seed is not an ElectronSeed ?!" ; }
1165  else
1166  { if (elseed->subDet2()==6) return ; }
1167  }
1168 
1169  // transverse impact parameter
1170  if (std::abs(ele->gsfTrack()->dxy(bs.position()))>cfg->maxTIP) return ;
1171  LogTrace("GsfElectronAlgo") << "TIP criterion is satisfied" ;
1172 
1173  LogTrace("GsfElectronAlgo") << "All cut based criteria are satisfied" ;
1174  ele->setPassCutBasedPreselection(true) ;
1175  }
GeneralData * generalData_
const CutsConfiguration cutsCfgPflow
void setPassCutBasedPreselection(bool flag)
Definition: GsfElectron.h:638
bool isEBEtaGap() const
Definition: GsfElectron.h:352
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
bool isEBEEGap() const
Definition: GsfElectron.h:350
float hcalDepth2OverEcal() const
Definition: GsfElectron.h:406
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:190
bool isEERingGap() const
Definition: GsfElectron.h:356
T eta() const
bool isEEDeeGap() const
Definition: GsfElectron.h:355
const StrategyConfiguration strategyCfg
bool isEE() const
Definition: GsfElectron.h:348
bool isEB() const
Definition: GsfElectron.h:347
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
bool isNull() const
Checks for null.
Definition: Ref.h:247
float sigmaIetaIeta() const
Definition: GsfElectron.h:399
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:182
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:250
float hcalOverEcal() const
Definition: GsfElectron.h:407
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const CutsConfiguration cutsCfg
#define LogTrace(id)
float hcalDepth1OverEcal() const
Definition: GsfElectron.h:405
REF castTo() const
cast to a concrete type
Definition: RefToBase.h:241
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
return(e1-e2)*(e1-e2)+dp *dp
bool isEBPhiGap() const
Definition: GsfElectron.h:353
const Point & position() const
position
Definition: BeamSpot.h:62
volatile std::atomic< bool > shutdown_flag false
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183
void GsfElectronAlgo::setMVAepiBasedPreselectionFlag ( reco::GsfElectron ele)
private
void GsfElectronAlgo::setMVAInputs ( const std::map< reco::GsfTrackRef, reco::GsfElectron::MvaInput > &  mvaInputs)

Definition at line 1208 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::electrons, and eventData_.

Referenced by GEDGsfElectronProducer::produce().

1209 {
1210  GsfElectronPtrCollection::iterator el ;
1211  for
1212  ( el = eventData_->electrons->begin() ;
1213  el != eventData_->electrons->end() ;
1214  el++ )
1215  {
1216  std::map<reco::GsfTrackRef,reco::GsfElectron::MvaInput>::const_iterator itcheck=mvaInputs.find((*el)->gsfTrack());
1217  (*el)->setMvaInput(itcheck->second);
1218  }
1219 }
GsfElectronPtrCollection * electrons
EventData * eventData_
void GsfElectronAlgo::setMVAOutputs ( const std::map< reco::GsfTrackRef, reco::GsfElectron::MvaOutput > &  mvaOutputs)

Definition at line 1221 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::electrons, GsfElectronAlgo::EventData::event, eventData_, GsfElectronAlgo::StrategyConfiguration::gedElectronMode, generalData_, SoftElectronMVAEstimator::mva(), reco::GsfElectron::MvaOutput::mva, GsfElectronAlgo::GeneralData::sElectronMVAEstimator, and GsfElectronAlgo::GeneralData::strategyCfg.

Referenced by GEDGsfElectronProducer::produce().

1222 {
1223  GsfElectronPtrCollection::iterator el ;
1224  for
1225  ( el = eventData_->electrons->begin() ;
1226  el != eventData_->electrons->end() ;
1227  el++ )
1228  {
1230  float mvaValue=generalData_->sElectronMVAEstimator->mva( *(*el),*(eventData_->event));
1231  GsfElectron::MvaOutput mvaOutput ;
1232  mvaOutput.mva = mvaValue ;
1233  (*el)->setMvaOutput(mvaOutput);
1234  }
1235  else{
1236  std::map<reco::GsfTrackRef,reco::GsfElectron::MvaOutput>::const_iterator itcheck=mvaOutputs.find((*el)->gsfTrack());
1237  (*el)->setMvaOutput(itcheck->second);
1238  }
1239  }
1240 }
GeneralData * generalData_
const StrategyConfiguration strategyCfg
SoftElectronMVAEstimator * sElectronMVAEstimator
GsfElectronPtrCollection * electrons
double mva(const reco::GsfElectron &myElectron, const edm::Event &evt)
EventData * eventData_
void GsfElectronAlgo::setPflowPreselectionFlag ( reco::GsfElectron ele)
private

Definition at line 1177 of file GsfElectronAlgo.cc.

References reco::GsfElectron::core(), GsfElectronAlgo::GeneralData::cutsCfg, GsfElectronAlgo::GeneralData::cutsCfgPflow, generalData_, LogTrace, GsfElectronAlgo::CutsConfiguration::minMVA, reco::GsfElectron::MvaOutput::mva, reco::GsfElectron::mvaOutput(), reco::GsfElectron::passingMvaPreselection(), reco::GsfElectron::setPassMvaPreselection(), and reco::GsfElectron::setPassPflowPreselection().

Referenced by addPflowInfo().

1178  {
1179  ele->setPassMvaPreselection(false) ;
1180 
1181  if (ele->core()->ecalDrivenSeed())
1182  { if (ele->mvaOutput().mva>=generalData_->cutsCfg.minMVA) ele->setPassMvaPreselection(true) ; }
1183  else
1184  { if (ele->mvaOutput().mva>=generalData_->cutsCfgPflow.minMVA) ele->setPassMvaPreselection(true) ; }
1185 
1186  if (ele->passingMvaPreselection())
1187  { LogTrace("GsfElectronAlgo") << "Main mva criterion is satisfied" ; }
1188 
1190 
1191 // ele->setPassPflowPreselection(false) ;
1192 // if (ele->core()->ecalDrivenSeed())
1193 // {
1194 // if ((ele->mvaOutput().mva>=generalData_->cutsCfg.minMVA) ||
1195 // (ele->mvaOutput().mvaByPassForIsolated>=generalData_->cutsCfg.minMvaByPassForIsolated))
1196 // ele->setPassPflowPreselection(true) ;
1197 // }
1198 // else
1199 // {
1200 // if ((ele->mvaOutput().mva>=generalData_->cutsCfgPflow.minMVA) ||
1201 // (ele->mvaOutput().mvaByPassForIsolated>=generalData_->cutsCfgPflow.minMvaByPassForIsolated))
1202 // ele->setPassPflowPreselection(true) ;
1203 // }
1204 // if (ele->passingPflowPreselection())
1205 // { LogTrace("GsfElectronAlgo") << "Mva criteria are satisfied" ; }
1206  }
GeneralData * generalData_
const CutsConfiguration cutsCfgPflow
bool passingMvaPreselection() const
Definition: GsfElectron.h:646
void setPassMvaPreselection(bool flag)
Definition: GsfElectron.h:645
const CutsConfiguration cutsCfg
#define LogTrace(id)
const MvaOutput & mvaOutput() const
Definition: GsfElectron.h:603
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
void setPassPflowPreselection(bool flag)
Definition: GsfElectron.h:639

Member Data Documentation

ElectronData* GsfElectronAlgo::electronData_
private

Definition at line 241 of file GsfElectronAlgo.h.

Referenced by completeElectrons(), createElectron(), and ~GsfElectronAlgo().

EventData* GsfElectronAlgo::eventData_
private
EventSetupData* GsfElectronAlgo::eventSetupData_
private
GeneralData* GsfElectronAlgo::generalData_
private