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 &mva_NIso_Cfg, const ElectronMVAEstimator::Configuration &mva_Iso_Cfg, 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)
 
void setPixelMatchInfomation (reco::GsfElectron *)
 

Private Attributes

ElectronDataelectronData_
 
EventDataeventData_
 
EventSetupDataeventSetupData_
 
GeneralDatageneralData_
 

Detailed Description

Definition at line 57 of file GsfElectronAlgo.h.

Member Typedef Documentation

Definition at line 215 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 mva_NIso_Cfg,
const ElectronMVAEstimator::Configuration mva_Iso_Cfg,
const RegressionHelper::Configuration regCfg 
)

Definition at line 653 of file GsfElectronAlgo.cc.

667  : generalData_(new GeneralData(inputCfg,strategyCfg,cutsCfg,cutsCfgPflow,hcalCfg,hcalCfgPflow,isoCfg,recHitsCfg,superClusterErrorFunction,crackCorrectionFunction,mva_NIso_Cfg,mva_Iso_Cfg,regCfg)),
668  eventSetupData_(new EventSetupData),
670  {}
GeneralData * generalData_
EventSetupData * eventSetupData_
EventData * eventData_
ElectronData * electronData_
GsfElectronAlgo::~GsfElectronAlgo ( )

Definition at line 672 of file GsfElectronAlgo.cc.

References electronData_, eventData_, eventSetupData_, and generalData_.

673  {
674  delete generalData_ ;
675  delete eventSetupData_ ;
676  delete eventData_ ;
677  delete electronData_ ;
678  }
GeneralData * generalData_
EventSetupData * eventSetupData_
EventData * eventData_
ElectronData * electronData_

Member Function Documentation

void GsfElectronAlgo::addPflowInfo ( )

Definition at line 941 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronProducer::produce().

942  {
943  bool found ;
944  const GsfElectronCollection * edElectrons = eventData_->previousElectrons.product() ;
946  GsfElectronCollection::const_iterator pfElectron, edElectron ;
947  unsigned int edIndex, pfIndex ;
948 
949  GsfElectronPtrCollection::iterator el ;
950  for
951  ( el = eventData_->electrons->begin() ;
952  el != eventData_->electrons->end() ;
953  el++ )
954  {
955 
956  // Retreive info from pflow electrons
957  found = false ;
958  for
959  ( pfIndex = 0, pfElectron = pfElectrons->begin() ; pfElectron != pfElectrons->end() ; pfIndex++, pfElectron++ )
960  {
961  if (pfElectron->gsfTrack()==(*el)->gsfTrack())
962  {
963  if (found)
964  {
965  edm::LogWarning("GsfElectronProducer")<<"associated pfGsfElectron already found" ;
966  }
967  else
968  {
969  found = true ;
970 
971  // Isolation Values
972  if( (eventData_->pfIsolationValues).size() != 0 )
973  {
975  pfElectronRef(eventData_->pflowElectrons, pfIndex);
977  isoVariables.sumChargedHadronPt =(*(eventData_->pfIsolationValues)[0])[pfElectronRef];
978  isoVariables.sumPhotonEt =(*(eventData_->pfIsolationValues)[1])[pfElectronRef];
979  isoVariables.sumNeutralHadronEt =(*(eventData_->pfIsolationValues)[2])[pfElectronRef];
980  (*el)->setPfIsolationVariables(isoVariables);
981  }
982 
983 // (*el)->setPfIsolationVariables(pfElectron->pfIsolationVariables()) ;
984  (*el)->setMvaInput(pfElectron->mvaInput()) ;
985  (*el)->setMvaOutput(pfElectron->mvaOutput()) ;
986  if ((*el)->ecalDrivenSeed())
987  { (*el)->setP4(GsfElectron::P4_PFLOW_COMBINATION,pfElectron->p4(GsfElectron::P4_PFLOW_COMBINATION),pfElectron->p4Error(GsfElectron::P4_PFLOW_COMBINATION),false) ; }
988  else
989  { (*el)->setP4(GsfElectron::P4_PFLOW_COMBINATION,pfElectron->p4(GsfElectron::P4_PFLOW_COMBINATION),pfElectron->p4Error(GsfElectron::P4_PFLOW_COMBINATION),true) ; }
990  double noCutMin = -999999999. ;
991  if ((*el)->mva_e_pi()<noCutMin) { throw cms::Exception("GsfElectronAlgo|UnexpectedMvaValue")<<"unexpected MVA value: "<<(*el)->mva_e_pi() ; }
992  }
993  }
994  }
995 
996  // Isolation Values
997  // Retreive not found info from ed electrons
998  if( (eventData_->edIsolationValues).size() != 0 )
999  {
1000  edIndex = 0, edElectron = edElectrons->begin() ;
1001  while ((found == false)&&(edElectron != edElectrons->end()))
1002  {
1003  if (edElectron->gsfTrack()==(*el)->gsfTrack())
1004  {
1005  found = true ;
1006 
1007  // CONSTRUCTION D UNE REF dans le handle eventData_->previousElectrons avec l'indice edIndex,
1008  // puis recuperation dans la ValueMap ED
1009 
1011  edElectronRef(eventData_->previousElectrons, edIndex);
1013  isoVariables.sumChargedHadronPt =(*(eventData_->edIsolationValues)[0])[edElectronRef];
1014  isoVariables.sumPhotonEt =(*(eventData_->edIsolationValues)[1])[edElectronRef];
1015  isoVariables.sumNeutralHadronEt =(*(eventData_->edIsolationValues)[2])[edElectronRef];
1016  (*el)->setPfIsolationVariables(isoVariables);
1017  }
1018 
1019  edIndex++ ;
1020  edElectron++ ;
1021  }
1022  }
1023 
1024  // Preselection
1026 
1027  }
1028  }
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Definition: GsfElectron.h:561
IsolationValueMaps pfIsolationValues
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
Definition: GsfElectron.h:560
GsfElectronPtrCollection * electrons
edm::Handle< reco::GsfElectronCollection > previousElectrons
edm::Handle< reco::GsfElectronCollection > pflowElectrons
T const * product() const
Definition: Handle.h:81
void setPflowPreselectionFlag(reco::GsfElectron *ele)
EventData * eventData_
volatile std::atomic< bool > shutdown_flag false
IsolationValueMaps edIsolationValues
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:559
void GsfElectronAlgo::beginEvent ( edm::Event event)

Definition at line 747 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().

748  {
749  if (eventData_!=0)
750  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"unexpected event data" ; }
751  eventData_ = new EventData ;
752 
753  // init the handles linked to the current event
754  eventData_->event = &event ;
761  event.getByToken(generalData_->inputCfg.hcalTowersTag,eventData_->towers) ;
762  event.getByToken(generalData_->inputCfg.pfMVA,eventData_->pfMva) ;
763  event.getByToken(generalData_->inputCfg.seedsTag,eventData_->seeds) ;
767 
768  // get the beamspot from the Event:
769  edm::Handle<reco::BeamSpot> recoBeamSpotHandle ;
770  event.getByToken(generalData_->inputCfg.beamSpotTag,recoBeamSpotHandle) ;
771  eventData_->beamspot = recoBeamSpotHandle.product() ;
772 
773  // prepare access to hcal data
776 
777  // Isolation algos
778  float extRadiusSmall=0.3, extRadiusLarge=0.4 ;
779  float intRadiusBarrel=generalData_->isoCfg.intRadiusBarrelTk, intRadiusEndcap=generalData_->isoCfg.intRadiusEndcapTk, stripBarrel=generalData_->isoCfg.stripBarrelTk, stripEndcap=generalData_->isoCfg.stripEndcapTk ;
781  eventData_->tkIsolation03 = new ElectronTkIsolation(extRadiusSmall,intRadiusBarrel,intRadiusEndcap,stripBarrel,stripEndcap,ptMin,maxVtxDist,drb,eventData_->currentCtfTracks.product(),eventData_->beamspot->position()) ;
782  eventData_->tkIsolation04 = new ElectronTkIsolation(extRadiusLarge,intRadiusBarrel,intRadiusEndcap,stripBarrel,stripEndcap,ptMin,maxVtxDist,drb,eventData_->currentCtfTracks.product(),eventData_->beamspot->position()) ;
783 
784  float egHcalIsoConeSizeOutSmall=0.3, egHcalIsoConeSizeOutLarge=0.4;
785  float egHcalIsoConeSizeIn=generalData_->isoCfg.intRadiusHcal,egHcalIsoPtMin=generalData_->isoCfg.etMinHcal;
786  int egHcalDepth1=1, egHcalDepth2=2;
787  eventData_->hadDepth1Isolation03 = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
788  eventData_->hadDepth2Isolation03 = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
789  eventData_->hadDepth1Isolation04 = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
790  eventData_->hadDepth2Isolation04 = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
791  eventData_->hadDepth1Isolation03Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,0.,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
792  eventData_->hadDepth2Isolation03Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,0.,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
793  eventData_->hadDepth1Isolation04Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,0.,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
794  eventData_->hadDepth2Isolation04Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,0.,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
795 
796  float egIsoConeSizeOutSmall=0.3, egIsoConeSizeOutLarge=0.4, egIsoJurassicWidth=generalData_->isoCfg.jurassicWidth;
797  float egIsoPtMinBarrel=generalData_->isoCfg.etMinBarrel,egIsoEMinBarrel=generalData_->isoCfg.eMinBarrel, egIsoConeSizeInBarrel=generalData_->isoCfg.intRadiusEcalBarrel;
798  float egIsoPtMinEndcap=generalData_->isoCfg.etMinEndcaps,egIsoEMinEndcap=generalData_->isoCfg.eMinEndcaps, egIsoConeSizeInEndcap=generalData_->isoCfg.intRadiusEcalEndcaps;
799  eventData_->ecalBarrelIsol03 = new EgammaRecHitIsolation(egIsoConeSizeOutSmall,egIsoConeSizeInBarrel,egIsoJurassicWidth,egIsoPtMinBarrel,egIsoEMinBarrel,eventSetupData_->caloGeom,*(eventData_->barrelRecHits),eventSetupData_->sevLevel.product(),DetId::Ecal);
800  eventData_->ecalBarrelIsol04 = new EgammaRecHitIsolation(egIsoConeSizeOutLarge,egIsoConeSizeInBarrel,egIsoJurassicWidth,egIsoPtMinBarrel,egIsoEMinBarrel,eventSetupData_->caloGeom,*(eventData_->barrelRecHits),eventSetupData_->sevLevel.product(),DetId::Ecal);
801  eventData_->ecalEndcapIsol03 = new EgammaRecHitIsolation(egIsoConeSizeOutSmall,egIsoConeSizeInEndcap,egIsoJurassicWidth,egIsoPtMinEndcap,egIsoEMinEndcap,eventSetupData_->caloGeom,*(eventData_->endcapRecHits),eventSetupData_->sevLevel.product(),DetId::Ecal);
802  eventData_->ecalEndcapIsol04 = new EgammaRecHitIsolation(egIsoConeSizeOutLarge,egIsoConeSizeInEndcap,egIsoJurassicWidth,egIsoPtMinEndcap,egIsoEMinEndcap,eventSetupData_->caloGeom,*(eventData_->endcapRecHits),eventSetupData_->sevLevel.product(),DetId::Ecal);
819 
820  //Fill in the Isolation Value Maps for PF and EcalDriven electrons
821  std::vector<edm::InputTag> inputTagIsoVals;
823  inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumChargedHadronPt"));
824  inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumPhotonEt"));
825  inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumNeutralHadronEt"));
826 
827  eventData_->pfIsolationValues.resize(inputTagIsoVals.size());
828 
829  for (size_t j = 0; j<inputTagIsoVals.size(); ++j) {
830  event.getByLabel(inputTagIsoVals[j], eventData_->pfIsolationValues[j]);
831  }
832 
833  }
834 
836  inputTagIsoVals.clear();
837  inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumChargedHadronPt"));
838  inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumPhotonEt"));
839  inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumNeutralHadronEt"));
840 
841  eventData_->edIsolationValues.resize(inputTagIsoVals.size());
842 
843  for (size_t j = 0; j<inputTagIsoVals.size(); ++j) {
844  event.getByLabel(inputTagIsoVals[j], eventData_->edIsolationValues[j]);
845  }
846  }
847  }
ElectronHcalHelper * hcalHelperPflow
T getParameter(std::string const &) const
edm::Handle< reco::ElectronSeedCollection > seeds
bool empty() const
Definition: ParameterSet.h:217
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: Handle.h:81
T const * product() const
Definition: ESHandle.h:86
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 541 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, HLT_50nsGRun_cff::recHits, 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().

542  {
543  const reco::CaloCluster & seedCluster = *(theClus->seed()) ;
544  // temporary, till CaloCluster->seed() is made available
545  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
546  int detector = seedXtalId.subdetId() ;
547 
550  const EcalRecHitCollection * recHits = 0 ;
551  std::vector<int> recHitFlagsToBeExcluded ;
552  std::vector<int> recHitSeverityToBeExcluded ;
553  if (detector==EcalBarrel)
554  {
555  recHits = eventData_->barrelRecHits.product() ;
556  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedBarrel ;
557  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedBarrel ;
558  }
559  else
560  {
561  recHits = eventData_->endcapRecHits.product() ;
562  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedEndcaps ;
563  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedEndcaps ;
564  }
565 
566  std::vector<float> covariances = EcalClusterTools::covariances(seedCluster,recHits,topology,geometry) ;
567  std::vector<float> localCovariances = EcalClusterTools::localCovariances(seedCluster,recHits,topology) ;
568  showerShape.sigmaEtaEta = sqrt(covariances[0]) ;
569  showerShape.sigmaIetaIeta = sqrt(localCovariances[0]) ;
570  if (!edm::isNotFinite(localCovariances[2])) showerShape.sigmaIphiIphi = sqrt(localCovariances[2]) ;
571  showerShape.e1x5 = EcalClusterTools::e1x5(seedCluster,recHits,topology) ;
572  showerShape.e2x5Max = EcalClusterTools::e2x5Max(seedCluster,recHits,topology) ;
573  showerShape.e5x5 = EcalClusterTools::e5x5(seedCluster,recHits,topology) ;
574  showerShape.r9 = EcalClusterTools::e3x3(seedCluster,recHits,topology)/theClus->rawEnergy() ;
575 
576  if (pflow)
577  {
578  showerShape.hcalDepth1OverEcal = generalData_->hcalHelperPflow->hcalESumDepth1(*theClus)/theClus->energy() ;
579  showerShape.hcalDepth2OverEcal = generalData_->hcalHelperPflow->hcalESumDepth2(*theClus)/theClus->energy() ;
583  }
584  else
585  {
586  showerShape.hcalDepth1OverEcal = generalData_->hcalHelper->hcalESumDepth1(*theClus)/theClus->energy() ;
587  showerShape.hcalDepth2OverEcal = generalData_->hcalHelper->hcalESumDepth2(*theClus)/theClus->energy() ;
591  }
592  }
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:192
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:386
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:86
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 594 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, HLT_50nsGRun_cff::recHits, 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().

595  {
596  const reco::CaloCluster & seedCluster = *(theClus->seed()) ;
597  // temporary, till CaloCluster->seed() is made available
598  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
599  int detector = seedXtalId.subdetId() ;
600 
603  const EcalRecHitCollection * recHits = 0 ;
604  std::vector<int> recHitFlagsToBeExcluded ;
605  std::vector<int> recHitSeverityToBeExcluded ;
606  if (detector==EcalBarrel)
607  {
608  recHits = eventData_->barrelRecHits.product() ;
609  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedBarrel ;
610  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedBarrel ;
611  }
612  else
613  {
614  recHits = eventData_->endcapRecHits.product() ;
615  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedEndcaps ;
616  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedEndcaps ;
617  }
618 
619  std::vector<float> covariances = noZS::EcalClusterTools::covariances(seedCluster,recHits,topology,geometry) ;
620  std::vector<float> localCovariances = noZS::EcalClusterTools::localCovariances(seedCluster,recHits,topology) ;
621  showerShape.sigmaEtaEta = sqrt(covariances[0]) ;
622  showerShape.sigmaIetaIeta = sqrt(localCovariances[0]) ;
623  if (!edm::isNotFinite(localCovariances[2])) showerShape.sigmaIphiIphi = sqrt(localCovariances[2]) ;
624  showerShape.e1x5 = noZS::EcalClusterTools::e1x5(seedCluster,recHits,topology) ;
625  showerShape.e2x5Max = noZS::EcalClusterTools::e2x5Max(seedCluster,recHits,topology) ;
626  showerShape.e5x5 = noZS::EcalClusterTools::e5x5(seedCluster,recHits,topology) ;
627  showerShape.r9 = noZS::EcalClusterTools::e3x3(seedCluster,recHits,topology)/theClus->rawEnergy() ;
628 
629  if (pflow)
630  {
631  showerShape.hcalDepth1OverEcal = generalData_->hcalHelperPflow->hcalESumDepth1(*theClus)/theClus->energy() ;
632  showerShape.hcalDepth2OverEcal = generalData_->hcalHelperPflow->hcalESumDepth2(*theClus)/theClus->energy() ;
636  }
637  else
638  {
639  showerShape.hcalDepth1OverEcal = generalData_->hcalHelper->hcalESumDepth1(*theClus)/theClus->energy() ;
640  showerShape.hcalDepth2OverEcal = generalData_->hcalHelper->hcalESumDepth2(*theClus)/theClus->energy() ;
644  }
645  }
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:192
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:386
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:86
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 680 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().

681  {
682  // get EventSetupRecords if needed
683  bool updateField(false);
685  updateField = true;
688  }
689 
690  bool updateGeometry(false);
692  updateGeometry = true;
695  }
696 
697  if ( updateField || updateGeometry ) {
698  delete eventSetupData_->mtsTransform ;
702  }
703 
705  eventSetupData_->cacheIDGeom=es.get<CaloGeometryRecord>().cacheIdentifier();
707  }
708 
710  eventSetupData_->cacheIDTopo=es.get<CaloTopologyRecord>().cacheIdentifier();
712  }
713 
718 
719 
724 
725  //if(eventSetupData_->cacheChStatus!=es.get<EcalChannelStatusRcd>().cacheIdentifier()){
726  // eventSetupData_->cacheChStatus=es.get<EcalChannelStatusRcd>().cacheIdentifier();
727  // es.get<EcalChannelStatusRcd>().get(eventSetupData_->chStatus);
728  //}
729 
731  eventSetupData_->cacheSevLevel = es.get<EcalSeverityLevelAlgoRcd>().cacheIdentifier();
733  }
734  }
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:86
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 914 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronProducer::produce().

915  {
916  const GsfElectronCollection * oldElectrons = eventData_->previousElectrons.product() ;
918  GsfElectronCollection::const_iterator oldElectron ;
919  for
920  ( oldElectron = oldElectrons->begin() ;
921  oldElectron != oldElectrons->end() ;
922  ++oldElectron )
923  {
924  const GsfElectronCoreRef oldCoreRef = oldElectron->core() ;
925  const GsfTrackRef oldElectronGsfTrackRef = oldCoreRef->gsfTrack() ;
926  unsigned int icore ;
927  for ( icore=0 ; icore<newCores->size() ; ++icore )
928  {
929  if (oldElectronGsfTrackRef==(*newCores)[icore].gsfTrack())
930  {
932  eventData_->electrons->push_back(new GsfElectron(*oldElectron,coreRef)) ;
933  break ;
934  }
935  }
936  }
937  }
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 871 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().

872  {
873  if (electronData_!=0)
874  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"unexpected electron data" ; }
875 
876  const GsfElectronCoreCollection * coreCollection = eventData_->coreElectrons.product() ;
877  for ( unsigned int i=0 ; i<coreCollection->size() ; ++i )
878  {
879  // check there is no existing electron with this core
881  bool coreFound = false ;
882  GsfElectronPtrCollection::const_iterator itrEle ;
883  for
884  ( itrEle = eventData_->electrons->begin() ;
885  itrEle != eventData_->electrons->end() ;
886  itrEle++ )
887  {
888  if ((*itrEle)->core()==coreRef)
889  {
890  coreFound = true ;
891  break ;
892  }
893  }
894  if (coreFound) continue ;
895 
896  // check there is a super-cluster
897  if (coreRef->superCluster().isNull()) continue ;
898 
899  // prepare internal structure for electron specific data
900  delete electronData_ ;
901  electronData_ = new ElectronData(coreRef,*eventData_->beamspot) ;
902 
903  // calculate and check Trajectory StatesOnSurface....
905 
906  createElectron() ;
907 
908  } // loop over tracks
909 
910  delete electronData_ ;
911  electronData_ = 0 ;
912  }
int i
Definition: DBlmapReader.cc:9
EventSetupData * eventSetupData_
GsfConstraintAtVertex * constraintAtVtx
std::vector< GsfElectronCore > GsfElectronCoreCollection
const MultiTrajectoryStateTransform * mtsTransform
const reco::BeamSpot * beamspot
GsfElectronPtrCollection * electrons
bool isNull() const
Checks for null.
Definition: Ref.h:247
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 737 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronBaseProducer::fillEvent().

738  {
739  GsfElectronPtrCollection::const_iterator it ;
740  for
741  ( it = eventData_->electrons->begin() ;
742  it != eventData_->electrons->end() ;
743  it++ )
744  { outEle.push_back(**it) ; }
745  }
GsfElectronPtrCollection * electrons
EventData * eventData_
void GsfElectronAlgo::createElectron ( )
private

Definition at line 1207 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, GsfElectronAlgo::EventData::event, 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, SoftElectronMVAEstimator::mva(), 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::PreSelectMVA, 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, GsfElectronAlgo::GeneralData::sElectronMVAEstimator, reco::GsfElectron::setCorrectedEcalEnergyError(), setCutBasedPreselectionFlag(), reco::GsfElectron::setIsolation03(), reco::GsfElectron::setIsolation04(), reco::GsfElectron::setP4(), reco::GsfElectron::setPassMvaPreselection(), setPixelMatchInfomation(), 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().

1208  {
1209  // eventually check ctf track
1212 
1213  // charge ID
1214  int eleCharge ;
1215  GsfElectron::ChargeInfo eleChargeInfo ;
1216  electronData_->computeCharge(eleCharge,eleChargeInfo) ;
1217 
1218  // electron basic cluster
1220 
1221  // Seed cluster
1222  const reco::CaloCluster & seedCluster = *(electronData_->superClusterRef->seed()) ;
1223 
1224  // seed Xtal
1225  // temporary, till CaloCluster->seed() is made available
1226  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
1227 
1229 
1230 
1231  //====================================================
1232  // Candidate attributes
1233  //====================================================
1234 
1236 
1237 
1238  //====================================================
1239  // Track-Cluster Matching
1240  //====================================================
1241 
1243  tcMatching.electronCluster = elbcRef ;
1244  tcMatching.eSuperClusterOverP = (electronData_->vtxMom.mag()>0)?(electronData_->superClusterRef->energy()/electronData_->vtxMom.mag()):(-1.) ;
1245  tcMatching.eSeedClusterOverP = (electronData_->vtxMom.mag()>0.)?(seedCluster.energy()/electronData_->vtxMom.mag()):(-1) ;
1246  tcMatching.eSeedClusterOverPout = (electronData_->seedMom.mag()>0.)?(seedCluster.energy()/electronData_->seedMom.mag()):(-1.) ;
1247  tcMatching.eEleClusterOverPout = (electronData_->eleMom.mag()>0.)?(elbcRef->energy()/electronData_->eleMom.mag()):(-1.) ;
1248 
1250  tcMatching.deltaEtaSuperClusterAtVtx = scAtVtx.dEta() ;
1251  tcMatching.deltaPhiSuperClusterAtVtx = scAtVtx.dPhi() ;
1252 
1253  EleRelPointPair seedAtCalo(seedCluster.position(),electronData_->seedPos,eventData_->beamspot->position()) ;
1254  tcMatching.deltaEtaSeedClusterAtCalo = seedAtCalo.dEta() ;
1255  tcMatching.deltaPhiSeedClusterAtCalo = seedAtCalo.dPhi() ;
1256 
1257  EleRelPointPair ecAtCalo(elbcRef->position(),electronData_->elePos,eventData_->beamspot->position()) ;
1258  tcMatching.deltaEtaEleClusterAtCalo = ecAtCalo.dEta() ;
1259  tcMatching.deltaPhiEleClusterAtCalo = ecAtCalo.dPhi() ;
1260 
1261 
1262  //=======================================================
1263  // Track extrapolations
1264  //=======================================================
1265 
1274 
1275 
1276  //=======================================================
1277  // Closest Ctf Track
1278  //=======================================================
1279 
1281  ctfInfo.ctfTrack = electronData_->ctfTrackRef ;
1283 
1284 
1285  //====================================================
1286  // FiducialFlags, using nextToBoundary definition of gaps
1287  //====================================================
1288 
1289  reco::GsfElectron::FiducialFlags fiducialFlags ;
1290  int detector = seedXtalId.subdetId() ;
1291  double feta=std::abs(electronData_->superClusterRef->position().eta()) ;
1292  if (detector==EcalBarrel)
1293  {
1294  fiducialFlags.isEB = true ;
1295  EBDetId ebdetid(seedXtalId);
1296  if (EBDetId::isNextToEtaBoundary(ebdetid))
1297  {
1298  if (ebdetid.ietaAbs()==85)
1299  { fiducialFlags.isEBEEGap = true ; }
1300  else
1301  { fiducialFlags.isEBEtaGap = true ; }
1302  }
1303  if (EBDetId::isNextToPhiBoundary(ebdetid))
1304  { fiducialFlags.isEBPhiGap = true ; }
1305  }
1306  else if (detector==EcalEndcap)
1307  {
1308  fiducialFlags.isEE = true ;
1309  EEDetId eedetid(seedXtalId);
1310  if (EEDetId::isNextToRingBoundary(eedetid))
1311  {
1312  if (std::abs(feta)<2.)
1313  { fiducialFlags.isEBEEGap = true ; }
1314  else
1315  { fiducialFlags.isEERingGap = true ; }
1316  }
1317  if (EEDetId::isNextToDBoundary(eedetid))
1318  { fiducialFlags.isEEDeeGap = true ; }
1319  }
1320  else
1321  { throw cms::Exception("GsfElectronAlgo|UnknownXtalRegion")<<"createElectron(): do not know if it is a barrel or endcap seed cluster !!!!" ; }
1322 
1323 
1324  //====================================================
1325  // ShowerShape
1326  //====================================================
1327 
1328  reco::GsfElectron::ShowerShape showerShape ;
1329  calculateShowerShape(electronData_->superClusterRef,!(electronData_->coreRef->ecalDrivenSeed()),showerShape) ;
1330 
1331  reco::GsfElectron::ShowerShape full5x5_showerShape ;
1332  calculateShowerShape_full5x5(electronData_->superClusterRef,!(electronData_->coreRef->ecalDrivenSeed()),full5x5_showerShape) ;
1333 
1334  //====================================================
1335  // ConversionRejection
1336  //====================================================
1337 
1339 
1340  ConversionFinder conversionFinder ;
1341  double BInTesla = eventSetupData_->magField->inTesla(GlobalPoint(0.,0.,0.)).z() ;
1343  if (!ctfTracks.isValid()) { ctfTracks = eventData_->currentCtfTracks ; }
1344 
1345  // values of conversionInfo.flag()
1346  // -9999 : Partner track was not found
1347  // 0 : Partner track found in the CTF collection using
1348  // 1 : Partner track found in the CTF collection using
1349  // 2 : Partner track found in the GSF collection using
1350  // 3 : Partner track found in the GSF collection using the electron's GSF track
1351  ConversionInfo conversionInfo = conversionFinder.getConversionInfo
1352  (*electronData_->coreRef,ctfTracks,eventData_->originalGsfTracks,BInTesla) ;
1353 
1355  conversionVars.flags = conversionInfo.flag() ;
1356  conversionVars.dist = conversionInfo.dist() ;
1357  conversionVars.dcot = conversionInfo.dcot() ;
1358  conversionVars.radius = conversionInfo.radiusOfConversion() ;
1359  if ((conversionVars.flags==0)or(conversionVars.flags==1))
1360  conversionVars.partner = TrackBaseRef(conversionInfo.conversionPartnerCtfTk()) ;
1361  else if ((conversionVars.flags==2)or(conversionVars.flags==3))
1362  conversionVars.partner = TrackBaseRef(conversionInfo.conversionPartnerGsfTk()) ;
1363 
1364 
1365  //====================================================
1366  // Go !
1367  //====================================================
1368 
1369  GsfElectron * ele = new
1370  GsfElectron
1371  ( eleCharge,eleChargeInfo,electronData_->coreRef,
1372  tcMatching, tkExtra, ctfInfo,
1373  fiducialFlags,showerShape, full5x5_showerShape,
1374  conversionVars ) ;
1375  // Will be overwritten later in the case of the regression
1377  ele->setP4(GsfElectron::P4_FROM_SUPER_CLUSTER,momentum,0,true) ;
1378 
1379 
1380  //====================================================
1381  // brems fractions
1382  //====================================================
1383 
1384  if (electronData_->innMom.mag()>0.)
1386 
1387  // the supercluster is the refined one The seed is not necessarily the first cluster
1388  // hence the use of the electronCluster
1389  SuperClusterRef sc = ele->superCluster() ;
1390  if (!(sc.isNull()))
1391  {
1392  CaloClusterPtr cl = ele->electronCluster() ;
1393  if (sc->clustersSize()>1)
1394  {
1395  float pf_fbrem =( sc->energy() - cl->energy() ) / sc->energy();
1396  ele->setSuperClusterFbrem( pf_fbrem ) ;
1397  }
1398  else
1399  {
1400  ele->setSuperClusterFbrem(0) ;
1401  }
1402  }
1403 
1404  //====================================================
1405  // classification and corrections
1406  //====================================================
1407  // classification
1408  ElectronClassification theClassifier ;
1409  theClassifier.classify(*ele) ;
1410  theClassifier.refineWithPflow(*ele) ;
1411  // ecal energy
1414  {
1419  }
1420  else // original implementation
1421  {
1422  if (ele->core()->ecalDrivenSeed())
1423  {
1425  { theEnCorrector.classBasedParameterizationEnergy(*ele,*eventData_->beamspot) ; }
1427  { theEnCorrector.classBasedParameterizationUncertainty(*ele) ; }
1428  }
1429  else
1430  {
1432  { theEnCorrector.simpleParameterizationUncertainty(*ele) ; }
1433  }
1434  }
1435 
1436  // momentum
1437  // Keep the default correction running first. The track momentum error is computed in there
1438  if (ele->core()->ecalDrivenSeed())
1439  {
1440  ElectronMomentumCorrector theMomCorrector;
1441  theMomCorrector.correct(*ele,electronData_->vtxTSOS);
1442  }
1444  {
1446  }
1447 
1448  //====================================================
1449  // now isolation variables
1450  //====================================================
1451 
1465  ele->setIsolation03(dr03);
1466  ele->setIsolation04(dr04);
1467 
1468 
1469  //====================================================
1470  // preselection flag
1471  //====================================================
1472 
1474  //setting mva flag, currently GedGsfElectron and GsfElectron pre-selection flags have desynced
1475  //this is for GedGsfElectrons, GsfElectrons (ie old pre 7X std reco) resets this later on
1476  //in the function "addPfInfo"
1477  //yes this is awful, we'll fix it once we work out how to...
1478  float mvaValue=generalData_->sElectronMVAEstimator->mva( *(ele),*(eventData_->event));
1480 
1481  //====================================================
1482  // Pixel match variables
1483  //====================================================
1485 
1486  LogTrace("GsfElectronAlgo")<<"Constructed new electron with energy "<< ele->p4().e() ;
1487 
1488  eventData_->electrons->push_back(ele) ;
1489  }
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:242
void setPixelMatchInfomation(reco::GsfElectron *)
edm::Handle< reco::TrackCollection > originalCtfTracks
const MultiTrajectoryStateMode * mtsMode
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:126
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:197
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:223
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:192
void computeCharge(int &charge, reco::GsfElectron::ChargeInfo &info)
void checkCtfTrack(edm::Handle< reco::TrackCollection > currentCtfTracks)
EgammaTowerIsolation * hadDepth1Isolation03
const StrategyConfiguration strategyCfg
SoftElectronMVAEstimator * sElectronMVAEstimator
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:177
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:31
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 &)
void setPassMvaPreselection(bool flag)
Definition: GsfElectron.h:647
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: GsfElectron.h:386
const MultiTrajectoryStateTransform * mtsTransform
static bool isNextToRingBoundary(EEDetId id)
Definition: EEDetId.cc:375
double energy() const
cluster energy
Definition: CaloCluster.h:121
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:75
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool isNull() const
Checks for null.
Definition: Ref.h:247
void setIsolation04(const IsolationVariables &dr04)
Definition: GsfElectron.h:504
#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:37
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
double mva(const reco::GsfElectron &myElectron, const edm::Event &evt)
math::XYZVectorF momentumAtVtxWithConstraint
Definition: GsfElectron.h:283
double getPtTracks(const reco::GsfElectron *) const
void refineWithPflow(reco::GsfElectron &)
void setIsolation03(const IsolationVariables &dr03)
Definition: GsfElectron.h:503
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
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 857 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronBaseProducer::fillEvent().

858  {
859  LogTrace("GsfElectronAlgo") << "========== " << title << " ==========";
860  LogTrace("GsfElectronAlgo") << "Event: " << eventData_->event->id();
861  LogTrace("GsfElectronAlgo") << "Number of electrons: " << eventData_->electrons->size() ;
862  GsfElectronPtrCollection::const_iterator it ;
863  for ( it = eventData_->electrons->begin(); it != eventData_->electrons->end(); it++ )
864  {
865  LogTrace("GsfElectronAlgo") << "Electron with charge, pt, eta, phi: " << (*it)->charge() << " , "
866  << (*it)->pt() << " , " << (*it)->eta() << " , " << (*it)->phi();
867  }
868  LogTrace("GsfElectronAlgo") << "=================================================";
869  }
GsfElectronPtrCollection * electrons
#define LogTrace(id)
edm::EventID id() const
Definition: EventBase.h:60
EventData * eventData_
void GsfElectronAlgo::endEvent ( )

Definition at line 849 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronBaseProducer::endEvent().

850  {
851  if (eventData_==0)
852  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"lacking event data" ; }
853  delete eventData_ ;
854  eventData_ = 0 ;
855  }
EventData * eventData_
const reco::SuperClusterRef GsfElectronAlgo::getTrSuperCluster ( const reco::GsfTrackRef trackRef)
private
bool GsfElectronAlgo::isPreselected ( reco::GsfElectron ele)
private

Definition at line 1030 of file GsfElectronAlgo.cc.

References reco::GsfElectron::ecalDrivenSeed(), GsfElectronAlgo::StrategyConfiguration::gedElectronMode, generalData_, GsfElectronAlgo::StrategyConfiguration::MaxElePtForOnlyMVA, reco::GsfElectron::passingCutBasedPreselection(), reco::GsfElectron::passingMvaPreselection(), reco::GsfElectron::passingPflowPreselection(), reco::LeafCandidate::pt(), and GsfElectronAlgo::GeneralData::strategyCfg.

Referenced by removeNotPreselectedElectrons(), and setAmbiguityData().

1031  {
1032  bool passCutBased=ele->passingCutBasedPreselection();
1033  bool passPF=ele->passingPflowPreselection(); //it is worth nothing for gedGsfElectrons, this does nothing as its not set till GedGsfElectron finaliser, this is always false
1035  bool passmva=ele->passingMvaPreselection();
1036  if(!ele->ecalDrivenSeed()){
1038  return passmva && passCutBased;
1039  else
1040  return passmva;
1041  }
1042  else{
1043  return passCutBased || passPF || passmva;
1044  }
1045  }
1046  else{
1047  return passCutBased || passPF;
1048  }
1049 
1050  return true;
1051  }
GeneralData * generalData_
bool passingCutBasedPreselection() const
Definition: GsfElectron.h:632
bool passingMvaPreselection() const
Definition: GsfElectron.h:648
virtual double pt() const
transverse momentum
const StrategyConfiguration strategyCfg
bool ecalDrivenSeed() const
Definition: GsfElectron.h:186
bool passingPflowPreselection() const
Definition: GsfElectron.h:633
void GsfElectronAlgo::removeAmbiguousElectrons ( )

Definition at line 1621 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronBaseProducer::fillEvent().

1622  {
1623  GsfElectronPtrCollection::size_type ei = 1, emax = eventData_->electrons->size() ;
1624  GsfElectronPtrCollection::iterator eitr = eventData_->electrons->begin() ;
1625  while (eitr!=eventData_->electrons->end())
1626  {
1627  LogTrace("GsfElectronAlgo")<<"========== remove ambiguous "<<ei<<"/"<<emax<<"==========" ;
1628  if ((*eitr)->ambiguous())
1629  { delete (*eitr) ; eitr = eventData_->electrons->erase(eitr) ; ++ei ; }
1630  else
1631  { ++eitr ; ++ei ; }
1632  }
1633  }
uint16_t size_type
GsfElectronPtrCollection * electrons
#define LogTrace(id)
EventData * eventData_
void GsfElectronAlgo::removeNotPreselectedElectrons ( )

Definition at line 1053 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronBaseProducer::fillEvent().

1054  {
1055  GsfElectronPtrCollection::size_type ei = 1, emax = eventData_->electrons->size() ;
1056  GsfElectronPtrCollection::iterator eitr = eventData_->electrons->begin() ;
1057  while (eitr!=eventData_->electrons->end())
1058  {
1059  LogTrace("GsfElectronAlgo")<<"========== removed not preselected "<<ei<<"/"<<emax<<"==========" ;
1060  if (isPreselected(*eitr))
1061  { ++eitr ; ++ei ; }
1062  else
1063  { delete (*eitr) ; eitr = eventData_->electrons->erase(eitr) ; ++ei ; }
1064  }
1065  }
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 1499 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::StrategyConfiguration::ambClustersOverlapStrategy, GsfElectronAlgo::StrategyConfiguration::ambSortingStrategy, GsfElectronAlgo::EventData::barrelRecHits, GsfElectronAlgo::EventData::beamspot, cond::persistency::duplicate(), 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().

1500  {
1501  GsfElectronPtrCollection::iterator e1, e2 ;
1506  else
1507  { throw cms::Exception("GsfElectronAlgo|UnknownAmbiguitySortingStrategy")<<"value of generalData_->strategyCfg.ambSortingStrategy is : "<<generalData_->strategyCfg.ambSortingStrategy ; }
1508 
1509  // init
1510  for
1511  ( e1 = eventData_->electrons->begin() ;
1512  e1 != eventData_->electrons->end() ;
1513  ++e1 )
1514  {
1515  (*e1)->clearAmbiguousGsfTracks() ;
1516  (*e1)->setAmbiguous(false) ;
1517  }
1518 
1519  // get ambiguous from GsfPfRecTracks
1521  {
1522  for
1523  ( e1 = eventData_->electrons->begin() ;
1524  e1 != eventData_->electrons->end() ;
1525  ++e1 )
1526  {
1527  bool found = false ;
1528  const GsfPFRecTrackCollection * gsfPfRecTrackCollection = eventData_->gsfPfRecTracks.product() ;
1529  GsfPFRecTrackCollection::const_iterator gsfPfRecTrack ;
1530  for ( gsfPfRecTrack=gsfPfRecTrackCollection->begin() ;
1531  gsfPfRecTrack!=gsfPfRecTrackCollection->end() ;
1532  ++gsfPfRecTrack )
1533  {
1534  if (gsfPfRecTrack->gsfTrackRef()==(*e1)->gsfTrack())
1535  {
1536  if (found)
1537  {
1538  edm::LogWarning("GsfElectronAlgo")<<"associated gsfPfRecTrack already found" ;
1539  }
1540  else
1541  {
1542  found = true ;
1543  const std::vector<reco::GsfPFRecTrackRef> & duplicates(gsfPfRecTrack->convBremGsfPFRecTrackRef()) ;
1544  std::vector<reco::GsfPFRecTrackRef>::const_iterator duplicate ;
1545  for ( duplicate = duplicates.begin() ; duplicate != duplicates.end() ; duplicate ++ )
1546  { (*e1)->addAmbiguousGsfTrack((*duplicate)->gsfTrackRef()) ; }
1547  }
1548  }
1549  }
1550  }
1551  }
1552  // or search overlapping clusters
1553  else
1554  {
1555  for
1556  ( e1 = eventData_->electrons->begin() ;
1557  e1 != eventData_->electrons->end() ;
1558  ++e1 )
1559  {
1560  if ((*e1)->ambiguous()) continue ;
1561  if ( ignoreNotPreselected && !isPreselected(*e1) ) continue ;
1562 
1563  SuperClusterRef scRef1 = (*e1)->superCluster();
1564  CaloClusterPtr eleClu1 = (*e1)->electronCluster();
1565  LogDebug("GsfElectronAlgo")
1566  << "Blessing electron with E/P " << (*e1)->eSuperClusterOverP()
1567  << ", cluster " << scRef1.get()
1568  << " & track " << (*e1)->gsfTrack().get() ;
1569 
1570  for
1571  ( e2 = e1, ++e2 ;
1572  e2 != eventData_->electrons->end() ;
1573  ++e2 )
1574  {
1575  if ((*e2)->ambiguous()) continue ;
1576  if ( ignoreNotPreselected && !isPreselected(*e2) ) continue ;
1577 
1578  SuperClusterRef scRef2 = (*e2)->superCluster();
1579  CaloClusterPtr eleClu2 = (*e2)->electronCluster();
1580 
1581  // search if same cluster
1582  bool sameCluster = false ;
1584  { sameCluster = (scRef1==scRef2) ; }
1586  {
1587  float eMin = 1. ;
1588  float threshold = eMin*cosh(EleRelPoint(scRef1->position(),eventData_->beamspot->position()).eta()) ;
1589  sameCluster =
1591  (EgAmbiguityTools::sharedEnergy(&(*scRef1->seed()),&(*eleClu2),eventData_->barrelRecHits,eventData_->endcapRecHits)>=threshold) ||
1593  (EgAmbiguityTools::sharedEnergy(&(*scRef1->seed()),&(*scRef2->seed()),eventData_->barrelRecHits,eventData_->endcapRecHits)>=threshold) ) ;
1594  }
1595  else
1596  { throw cms::Exception("GsfElectronAlgo|UnknownAmbiguityClustersOverlapStrategy")<<"value of generalData_->strategyCfg.ambClustersOverlapStrategy is : "<<generalData_->strategyCfg.ambClustersOverlapStrategy ; }
1597 
1598  // main instructions
1599  if (sameCluster)
1600  {
1601  LogDebug("GsfElectronAlgo")
1602  << "Discarding electron with E/P " << (*e2)->eSuperClusterOverP()
1603  << ", cluster " << scRef2.get()
1604  << " and track " << (*e2)->gsfTrack().get() ;
1605  (*e1)->addAmbiguousGsfTrack((*e2)->gsfTrack()) ;
1606  (*e2)->setAmbiguous(true) ;
1607  }
1608  else if ((*e1)->gsfTrack()==(*e2)->gsfTrack())
1609  {
1610  edm::LogWarning("GsfElectronAlgo")
1611  << "Forgetting electron with E/P " << (*e2)->eSuperClusterOverP()
1612  << ", cluster " << scRef2.get()
1613  << " and track " << (*e2)->gsfTrack().get() ;
1614  (*e2)->setAmbiguous(true) ;
1615  }
1616  }
1617  }
1618  }
1619  }
#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
static const boost::regex duplicate("duplicateIOV[[:print:]]+?[S|s]ince[=| ]([[:alnum:]]+?);.*")
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
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
const reco::BeamSpot * beamspot
GsfElectronPtrCollection * electrons
T const * product() const
Definition: Handle.h:81
const Point & position() const
position
Definition: BeamSpot.h:62
EventData * eventData_
volatile std::atomic< bool > shutdown_flag false
edm::ESHandle< TrackerGeometry > trackerHandle
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracks
void GsfElectronAlgo::setCutBasedPreselectionFlag ( reco::GsfElectron ele,
const reco::BeamSpot bs 
)
private

Definition at line 1068 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(), 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(), mathSSE::return(), fileCollector::seed, GsfElectronAlgo::CutsConfiguration::seedFromTEC, reco::GsfElectron::setPassCutBasedPreselection(), reco::GsfElectron::sigmaIetaIeta(), GsfElectronAlgo::GeneralData::strategyCfg, and reco::GsfElectron::superCluster().

Referenced by createElectron().

1069  {
1070  // default value
1071  ele->setPassCutBasedPreselection(false) ;
1072 
1073  // kind of seeding
1074  bool eg = ele->core()->ecalDrivenSeed() ;
1075  bool pf = ele->core()->trackerDrivenSeed() && !ele->core()->ecalDrivenSeed() ;
1076  bool gedMode = generalData_->strategyCfg.gedElectronMode;
1077  if (eg&&pf) { throw cms::Exception("GsfElectronAlgo|BothEcalAndPureTrackerDriven")<<"An electron cannot be both egamma and purely pflow" ; }
1078  if ((!eg)&&(!pf)) { throw cms::Exception("GsfElectronAlgo|NeitherEcalNorPureTrackerDriven")<<"An electron cannot be neither egamma nor purely pflow" ; }
1079 
1080  const CutsConfiguration * cfg = ((eg||gedMode)?&generalData_->cutsCfg:&generalData_->cutsCfgPflow);
1081 
1082  // Et cut
1083  double etaValue = EleRelPoint(ele->superCluster()->position(),bs.position()).eta() ;
1084  double etValue = ele->superCluster()->energy()/cosh(etaValue) ;
1085  LogTrace("GsfElectronAlgo") << "Et : " << etValue ;
1086  if (ele->isEB() && (etValue < cfg->minSCEtBarrel)) return ;
1087  if (ele->isEE() && (etValue < cfg->minSCEtEndcaps)) return ;
1088  LogTrace("GsfElectronAlgo") << "Et criteria are satisfied";
1089 
1090  // E/p cut
1091  double eopValue = ele->eSuperClusterOverP() ;
1092  LogTrace("GsfElectronAlgo") << "E/p : " << eopValue ;
1093  if (ele->isEB() && (eopValue > cfg->maxEOverPBarrel)) return ;
1094  if (ele->isEE() && (eopValue > cfg->maxEOverPEndcaps)) return ;
1095  if (ele->isEB() && (eopValue < cfg->minEOverPBarrel)) return ;
1096  if (ele->isEE() && (eopValue < cfg->minEOverPEndcaps)) return ;
1097  LogTrace("GsfElectronAlgo") << "E/p criteria are satisfied";
1098 
1099  // HoE cuts
1100  LogTrace("GsfElectronAlgo") << "HoE1 : " << ele->hcalDepth1OverEcal() << ", HoE2 : " << ele->hcalDepth2OverEcal();
1101  double had = ele->hcalOverEcal()*ele->superCluster()->energy() ;
1102  const reco::CaloCluster & seedCluster = *(ele->superCluster()->seed()) ;
1103  int detector = seedCluster.hitsAndFractions()[0].first.subdetId() ;
1104  bool HoEveto = false ;
1105  if (detector==EcalBarrel && (had<cfg->maxHBarrel || (had/ele->superCluster()->energy())<cfg->maxHOverEBarrel)) HoEveto=true;
1106  else if (detector==EcalEndcap && (had<cfg->maxHEndcaps || (had/ele->superCluster()->energy())<cfg->maxHOverEEndcaps)) HoEveto=true;
1107  if ( !HoEveto ) return ;
1108  LogTrace("GsfElectronAlgo") << "H/E criteria are satisfied";
1109 
1110  // delta eta criteria
1111  double deta = ele->deltaEtaSuperClusterTrackAtVtx() ;
1112  LogTrace("GsfElectronAlgo") << "delta eta : " << deta ;
1113  if (ele->isEB() && (std::abs(deta) > cfg->maxDeltaEtaBarrel)) return ;
1114  if (ele->isEE() && (std::abs(deta) > cfg->maxDeltaEtaEndcaps)) return ;
1115  LogTrace("GsfElectronAlgo") << "Delta eta criteria are satisfied";
1116 
1117  // delta phi criteria
1118  double dphi = ele->deltaPhiSuperClusterTrackAtVtx();
1119  LogTrace("GsfElectronAlgo") << "delta phi : " << dphi;
1120  if (ele->isEB() && (std::abs(dphi) > cfg->maxDeltaPhiBarrel)) return ;
1121  if (ele->isEE() && (std::abs(dphi) > cfg->maxDeltaPhiEndcaps)) return ;
1122  LogTrace("GsfElectronAlgo") << "Delta phi criteria are satisfied";
1123 
1124  // sigma ieta ieta
1125  LogTrace("GsfElectronAlgo") << "sigma ieta ieta : " << ele->sigmaIetaIeta();
1126  if (ele->isEB() && (ele->sigmaIetaIeta() > cfg->maxSigmaIetaIetaBarrel)) return ;
1127  if (ele->isEE() && (ele->sigmaIetaIeta() > cfg->maxSigmaIetaIetaEndcaps)) return ;
1128  LogTrace("GsfElectronAlgo") << "Sigma ieta ieta criteria are satisfied";
1129 
1130  // fiducial
1131  if (!ele->isEB() && cfg->isBarrel) return ;
1132  if (!ele->isEE() && cfg->isEndcaps) return ;
1133  if (cfg->isFiducial && (ele->isEBEEGap()||ele->isEBEtaGap()||ele->isEBPhiGap()||ele->isEERingGap()||ele->isEEDeeGap())) return ;
1134  LogTrace("GsfElectronAlgo") << "Fiducial flags criteria are satisfied";
1135 
1136  // seed in TEC
1137  edm::RefToBase<TrajectorySeed> seed = ele->gsfTrack()->extra()->seedRef() ;
1138  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>() ;
1139  if (eg && !generalData_->cutsCfg.seedFromTEC)
1140  {
1141  if (elseed.isNull())
1142  { throw cms::Exception("GsfElectronAlgo|NotElectronSeed")<<"The GsfTrack seed is not an ElectronSeed ?!" ; }
1143  else
1144  { if (elseed->subDet2()==6) return ; }
1145  }
1146 
1147  // transverse impact parameter
1148  if (std::abs(ele->gsfTrack()->dxy(bs.position()))>cfg->maxTIP) return ;
1149  LogTrace("GsfElectronAlgo") << "TIP criterion is satisfied" ;
1150 
1151  LogTrace("GsfElectronAlgo") << "All cut based criteria are satisfied" ;
1152  ele->setPassCutBasedPreselection(true) ;
1153  }
GeneralData * generalData_
const CutsConfiguration cutsCfgPflow
void setPassCutBasedPreselection(bool flag)
Definition: GsfElectron.h:640
tuple cfg
Definition: looper.py:259
bool isEBEtaGap() const
Definition: GsfElectron.h:355
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
bool isEBEEGap() const
Definition: GsfElectron.h:353
float hcalDepth2OverEcal() const
Definition: GsfElectron.h:409
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:192
bool isEERingGap() const
Definition: GsfElectron.h:359
T eta() const
bool isEEDeeGap() const
Definition: GsfElectron.h:358
const StrategyConfiguration strategyCfg
bool isEE() const
Definition: GsfElectron.h:351
bool isEB() const
Definition: GsfElectron.h:350
return((rh^lh)&mask)
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
float sigmaIetaIeta() const
Definition: GsfElectron.h:402
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:410
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const CutsConfiguration cutsCfg
bool isNull() const
Checks for null.
Definition: Ref.h:247
#define LogTrace(id)
float hcalDepth1OverEcal() const
Definition: GsfElectron.h:408
REF castTo() const
cast to a concrete type
Definition: RefToBase.h:241
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
bool isEBPhiGap() const
Definition: GsfElectron.h:356
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 1171 of file GsfElectronAlgo.cc.

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

Referenced by GEDGsfElectronProducer::produce().

1172 {
1173  GsfElectronPtrCollection::iterator el ;
1174  for
1175  ( el = eventData_->electrons->begin() ;
1176  el != eventData_->electrons->end() ;
1177  el++ )
1178  {
1179  std::map<reco::GsfTrackRef,reco::GsfElectron::MvaInput>::const_iterator itcheck=mvaInputs.find((*el)->gsfTrack());
1180  (*el)->setMvaInput(itcheck->second);
1181  }
1182 }
GsfElectronPtrCollection * electrons
EventData * eventData_
void GsfElectronAlgo::setMVAOutputs ( const std::map< reco::GsfTrackRef, reco::GsfElectron::MvaOutput > &  mvaOutputs)

Definition at line 1184 of file GsfElectronAlgo.cc.

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

Referenced by GEDGsfElectronProducer::produce().

1185 {
1186  GsfElectronPtrCollection::iterator el ;
1187  for
1188  ( el = eventData_->electrons->begin() ;
1189  el != eventData_->electrons->end() ;
1190  el++ )
1191  {
1193  float mva_NIso_Value= generalData_->sElectronMVAEstimator->mva( *(*el),*(eventData_->event));
1194  float mva_Iso_Value = generalData_->iElectronMVAEstimator->mva( *(*el), eventData_->vertices->size() );
1195  GsfElectron::MvaOutput mvaOutput ;
1196  mvaOutput.mva_e_pi = mva_NIso_Value ;
1197  mvaOutput.mva_Isolated = mva_Iso_Value ;
1198  (*el)->setMvaOutput(mvaOutput);
1199  }
1200  else{
1201  std::map<reco::GsfTrackRef,reco::GsfElectron::MvaOutput>::const_iterator itcheck=mvaOutputs.find((*el)->gsfTrack());
1202  (*el)->setMvaOutput(itcheck->second);
1203  }
1204  }
1205 }
GeneralData * generalData_
const StrategyConfiguration strategyCfg
SoftElectronMVAEstimator * sElectronMVAEstimator
GsfElectronPtrCollection * electrons
edm::Handle< reco::VertexCollection > vertices
double mva(const reco::GsfElectron &myElectron, const edm::Event &evt)
double mva(const reco::GsfElectron &myElectron, int nvertices=0)
EventData * eventData_
ElectronMVAEstimator * iElectronMVAEstimator
void GsfElectronAlgo::setPflowPreselectionFlag ( reco::GsfElectron ele)
private

Definition at line 1155 of file GsfElectronAlgo.cc.

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

Referenced by addPflowInfo().

1156  {
1157  ele->setPassMvaPreselection(false) ;
1158 
1159  if (ele->core()->ecalDrivenSeed())
1160  { if (ele->mvaOutput().mva_e_pi>=generalData_->cutsCfg.minMVA) ele->setPassMvaPreselection(true) ; }
1161  else
1163 
1164  if (ele->passingMvaPreselection())
1165  { LogTrace("GsfElectronAlgo") << "Main mva criterion is satisfied" ; }
1166 
1168 
1169  }
GeneralData * generalData_
const CutsConfiguration cutsCfgPflow
bool passingMvaPreselection() const
Definition: GsfElectron.h:648
void setPassMvaPreselection(bool flag)
Definition: GsfElectron.h:647
const CutsConfiguration cutsCfg
#define LogTrace(id)
const MvaOutput & mvaOutput() const
Definition: GsfElectron.h:606
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
void setPassPflowPreselection(bool flag)
Definition: GsfElectron.h:641
void GsfElectronAlgo::setPixelMatchInfomation ( reco::GsfElectron ele)
private

Definition at line 1637 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(), fileCollector::seed, reco::GsfElectron::setPixelMatchDPhi1(), reco::GsfElectron::setPixelMatchDPhi2(), reco::GsfElectron::setPixelMatchDRz1(), reco::GsfElectron::setPixelMatchDRz2(), and reco::GsfElectron::setPixelMatchSubdetectors().

Referenced by createElectron().

1637  {
1638  int sd1 = 0 ;
1639  int sd2 = 0 ;
1640  float dPhi1 = 0 ;
1641  float dPhi2 = 0 ;
1642  float dRz1 = 0 ;
1643  float dRz2 = 0 ;
1644  edm::RefToBase<TrajectorySeed> seed = ele->gsfTrack()->extra()->seedRef();
1645  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>();
1646  if(seed.isNull()){}
1647  else{
1648  if(elseed.isNull()){}
1649  else{
1650  sd1 = elseed->subDet1() ;
1651  sd2 = elseed->subDet2() ;
1652  dPhi1 = (ele->charge()>0) ? elseed->dPhi1Pos() : elseed->dPhi1() ;
1653  dPhi2 = (ele->charge()>0) ? elseed->dPhi2Pos() : elseed->dPhi2() ;
1654  dRz1 = (ele->charge()>0) ? elseed->dRz1Pos () : elseed->dRz1 () ;
1655  dRz2 = (ele->charge()>0) ? elseed->dRz2Pos () : elseed->dRz2 () ;
1656  }
1657  }
1658  ele->setPixelMatchSubdetectors(sd1,sd2) ;
1659  ele->setPixelMatchDPhi1(dPhi1) ;
1660  ele->setPixelMatchDPhi2(dPhi2) ;
1661  ele->setPixelMatchDRz1 (dRz1 ) ;
1662  ele->setPixelMatchDRz2 (dRz2 ) ;
1663 }
void setPixelMatchDRz2(float dRz2)
Definition: GsfElectron.h:815
void setPixelMatchDPhi1(float dPhi1)
Definition: GsfElectron.h:812
void setPixelMatchSubdetectors(int sd1, int sd2)
Definition: GsfElectron.h:811
virtual int charge() const
electric charge
Definition: LeafCandidate.h:91
bool isNull() const
Checks for null.
Definition: Ref.h:247
void setPixelMatchDPhi2(float dPhi2)
Definition: GsfElectron.h:813
REF castTo() const
cast to a concrete type
Definition: RefToBase.h:241
bool isNull() const
Checks for null.
Definition: RefToBase.h:270
void setPixelMatchDRz1(float dRz1)
Definition: GsfElectron.h:814
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183

Member Data Documentation

ElectronData* GsfElectronAlgo::electronData_
private

Definition at line 242 of file GsfElectronAlgo.h.

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

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