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 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 591 of file GsfElectronAlgo.cc.

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

Definition at line 609 of file GsfElectronAlgo.cc.

References electronData_, eventData_, eventSetupData_, and generalData_.

610  {
611  delete generalData_ ;
612  delete eventSetupData_ ;
613  delete eventData_ ;
614  delete electronData_ ;
615  }
GeneralData * generalData_
EventSetupData * eventSetupData_
EventData * eventData_
ElectronData * electronData_

Member Function Documentation

void GsfElectronAlgo::addPflowInfo ( )

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

879  {
880  bool found ;
881  const GsfElectronCollection * edElectrons = eventData_->previousElectrons.product() ;
883  GsfElectronCollection::const_iterator pfElectron, edElectron ;
884  unsigned int edIndex, pfIndex ;
885 
886  GsfElectronPtrCollection::iterator el ;
887  for
888  ( el = eventData_->electrons->begin() ;
889  el != eventData_->electrons->end() ;
890  el++ )
891  {
892 // // MVA
893 // // we check that the value is never inferior to the no-cut value
894 // // we generally use in the configuration file for minMVA.
895 // GsfTrackRef gsfTrackRef = (*el)->gsfTrack() ;
896 // float mva = (*eventData_->pfMva.product())[gsfTrackRef] ;
897 // if (mva<noCutMin) { throw cms::Exception("GsfElectronAlgo|UnexpectedMvaValue")<<"unexpected MVA value: "<<mva ; }
898 //
899 // // Mva Output
900 // GsfElectron::MvaOutput mvaOutput ;
901 // mvaOutput.mva = mva ;
902 // (*el)->setMvaOutput(mvaOutput) ;
903 
904  // Retreive info from pflow electrons
905  found = false ;
906  for
907  ( pfIndex = 0, pfElectron = pfElectrons->begin() ; pfElectron != pfElectrons->end() ; pfIndex++, pfElectron++ )
908  {
909  if (pfElectron->gsfTrack()==(*el)->gsfTrack())
910  {
911  if (found)
912  {
913  edm::LogWarning("GsfElectronProducer")<<"associated pfGsfElectron already found" ;
914  }
915  else
916  {
917  found = true ;
918 
919  // Isolation Values
920  if( (eventData_->pfIsolationValues).size() != 0 )
921  {
923  pfElectronRef(eventData_->pflowElectrons, pfIndex);
925  isoVariables.sumChargedHadronPt =(*(eventData_->pfIsolationValues)[0])[pfElectronRef];
926  isoVariables.sumPhotonEt =(*(eventData_->pfIsolationValues)[1])[pfElectronRef];
927  isoVariables.sumNeutralHadronEt =(*(eventData_->pfIsolationValues)[2])[pfElectronRef];
928  (*el)->setPfIsolationVariables(isoVariables);
929  }
930 
931 // (*el)->setPfIsolationVariables(pfElectron->pfIsolationVariables()) ;
932  (*el)->setMvaInput(pfElectron->mvaInput()) ;
933  (*el)->setMvaOutput(pfElectron->mvaOutput()) ;
934  if ((*el)->ecalDrivenSeed())
935  { (*el)->setP4(GsfElectron::P4_PFLOW_COMBINATION,pfElectron->p4(GsfElectron::P4_PFLOW_COMBINATION),pfElectron->p4Error(GsfElectron::P4_PFLOW_COMBINATION),false) ; }
936  else
937  { (*el)->setP4(GsfElectron::P4_PFLOW_COMBINATION,pfElectron->p4(GsfElectron::P4_PFLOW_COMBINATION),pfElectron->p4Error(GsfElectron::P4_PFLOW_COMBINATION),true) ; }
938  double noCutMin = -999999999. ;
939  if ((*el)->mva()<noCutMin) { throw cms::Exception("GsfElectronAlgo|UnexpectedMvaValue")<<"unexpected MVA value: "<<(*el)->mva() ; }
940  }
941  }
942  }
943 
944  // Isolation Values
945  // Retreive not found info from ed electrons
946  if( (eventData_->edIsolationValues).size() != 0 )
947  {
948  edIndex = 0, edElectron = edElectrons->begin() ;
949  while ((found == false)&&(edElectron != edElectrons->end()))
950  {
951  if (edElectron->gsfTrack()==(*el)->gsfTrack())
952  {
953  found = true ;
954 
955  // CONSTRUCTION D UNE REF dans le handle eventData_->previousElectrons avec l'indice edIndex,
956  // puis recuperation dans la ValueMap ED
957 
959  edElectronRef(eventData_->previousElectrons, edIndex);
961  isoVariables.sumChargedHadronPt =(*(eventData_->edIsolationValues)[0])[edElectronRef];
962  isoVariables.sumPhotonEt =(*(eventData_->edIsolationValues)[1])[edElectronRef];
963  isoVariables.sumNeutralHadronEt =(*(eventData_->edIsolationValues)[2])[edElectronRef];
964  (*el)->setPfIsolationVariables(isoVariables);
965  }
966 
967  edIndex++ ;
968  edElectron++ ;
969  }
970  }
971 
972  // Preselection
974 
975  // Shower Shape of pflow cluster
976  if (!((*el)->parentSuperCluster().isNull()))
977  {
978  reco::GsfElectron::ShowerShape pflowShowerShape ;
979  calculateShowerShape((*el)->parentSuperCluster(),true,pflowShowerShape) ;
980  (*el)->setPfShowerShape(pflowShowerShape) ;
981  }
982  else if ((*el)->passingPflowPreselection())
983  { edm::LogError("GsfElectronCoreProducer")<<"Preselected tracker driven GsfTrack with no associated pflow SuperCluster." ; }
984 
985  // PfBrem
986  SuperClusterRef sc = (*el)->parentSuperCluster() ;
987  if (!(sc.isNull()))
988  {
989 
990  if (sc->clustersSize()>1)
991  {
992  CaloCluster_iterator first = sc->clustersBegin() ;
993  (*el)->setPfSuperClusterFbrem((sc->energy()-(*first)->energy())/sc->energy()) ;
994  }
995  else
996  { (*el)->setPfSuperClusterFbrem(0.) ; }
997  ElectronClassification theClassifier ;
998  theClassifier.refineWithPflow(**el) ;
999  }
1000  }
1001  }
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:526
IsolationValueMaps pfIsolationValues
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
Definition: GsfElectron.h:525
GsfElectronPtrCollection * electrons
bool first
Definition: L1TdeRCT.cc:79
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:524
void GsfElectronAlgo::beginEvent ( edm::Event event)

Definition at line 684 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::ecalBarrelHitsMeta, GsfElectronAlgo::EventData::ecalBarrelIsol03, GsfElectronAlgo::EventData::ecalBarrelIsol04, GsfElectronAlgo::EventData::ecalEndcapHitsMeta, 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().

685  {
686  if (eventData_!=0)
687  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"unexpected event data" ; }
688  eventData_ = new EventData ;
689 
690  // init the handles linked to the current event
691  eventData_->event = &event ;
698  event.getByToken(generalData_->inputCfg.hcalTowersTag,eventData_->towers) ;
699  event.getByToken(generalData_->inputCfg.pfMVA,eventData_->pfMva) ;
700  event.getByToken(generalData_->inputCfg.seedsTag,eventData_->seeds) ;
704 
705  // get the beamspot from the Event:
706  edm::Handle<reco::BeamSpot> recoBeamSpotHandle ;
707  event.getByToken(generalData_->inputCfg.beamSpotTag,recoBeamSpotHandle) ;
708  eventData_->beamspot = recoBeamSpotHandle.product() ;
709 
710  // prepare access to hcal data
713 
714  // Isolation algos
715  float extRadiusSmall=0.3, extRadiusLarge=0.4 ;
716  float intRadiusBarrel=generalData_->isoCfg.intRadiusBarrelTk, intRadiusEndcap=generalData_->isoCfg.intRadiusEndcapTk, stripBarrel=generalData_->isoCfg.stripBarrelTk, stripEndcap=generalData_->isoCfg.stripEndcapTk ;
718  eventData_->tkIsolation03 = new ElectronTkIsolation(extRadiusSmall,intRadiusBarrel,intRadiusEndcap,stripBarrel,stripEndcap,ptMin,maxVtxDist,drb,eventData_->currentCtfTracks.product(),eventData_->beamspot->position()) ;
719  eventData_->tkIsolation04 = new ElectronTkIsolation(extRadiusLarge,intRadiusBarrel,intRadiusEndcap,stripBarrel,stripEndcap,ptMin,maxVtxDist,drb,eventData_->currentCtfTracks.product(),eventData_->beamspot->position()) ;
720 
721  float egHcalIsoConeSizeOutSmall=0.3, egHcalIsoConeSizeOutLarge=0.4;
722  float egHcalIsoConeSizeIn=generalData_->isoCfg.intRadiusHcal,egHcalIsoPtMin=generalData_->isoCfg.etMinHcal;
723  int egHcalDepth1=1, egHcalDepth2=2;
724  eventData_->hadDepth1Isolation03 = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
725  eventData_->hadDepth2Isolation03 = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
726  eventData_->hadDepth1Isolation04 = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
727  eventData_->hadDepth2Isolation04 = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,egHcalIsoConeSizeIn,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
728  eventData_->hadDepth1Isolation03Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,0.,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
729  eventData_->hadDepth2Isolation03Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutSmall,0.,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
730  eventData_->hadDepth1Isolation04Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,0.,egHcalIsoPtMin,egHcalDepth1,eventData_->towers.product()) ;
731  eventData_->hadDepth2Isolation04Bc = new EgammaTowerIsolation(egHcalIsoConeSizeOutLarge,0.,egHcalIsoPtMin,egHcalDepth2,eventData_->towers.product()) ;
732 
733  float egIsoConeSizeOutSmall=0.3, egIsoConeSizeOutLarge=0.4, egIsoJurassicWidth=generalData_->isoCfg.jurassicWidth;
734  float egIsoPtMinBarrel=generalData_->isoCfg.etMinBarrel,egIsoEMinBarrel=generalData_->isoCfg.eMinBarrel, egIsoConeSizeInBarrel=generalData_->isoCfg.intRadiusEcalBarrel;
735  float egIsoPtMinEndcap=generalData_->isoCfg.etMinEndcaps,egIsoEMinEndcap=generalData_->isoCfg.eMinEndcaps, egIsoConeSizeInEndcap=generalData_->isoCfg.intRadiusEcalEndcaps;
738  eventData_->ecalBarrelIsol03 = new EgammaRecHitIsolation(egIsoConeSizeOutSmall,egIsoConeSizeInBarrel,egIsoJurassicWidth,egIsoPtMinBarrel,egIsoEMinBarrel,eventSetupData_->caloGeom,eventData_->ecalBarrelHitsMeta,eventSetupData_->sevLevel.product(),DetId::Ecal);
739  eventData_->ecalBarrelIsol04 = new EgammaRecHitIsolation(egIsoConeSizeOutLarge,egIsoConeSizeInBarrel,egIsoJurassicWidth,egIsoPtMinBarrel,egIsoEMinBarrel,eventSetupData_->caloGeom,eventData_->ecalBarrelHitsMeta,eventSetupData_->sevLevel.product(),DetId::Ecal);
740  eventData_->ecalEndcapIsol03 = new EgammaRecHitIsolation(egIsoConeSizeOutSmall,egIsoConeSizeInEndcap,egIsoJurassicWidth,egIsoPtMinEndcap,egIsoEMinEndcap,eventSetupData_->caloGeom,eventData_->ecalEndcapHitsMeta,eventSetupData_->sevLevel.product(),DetId::Ecal);
741  eventData_->ecalEndcapIsol04 = new EgammaRecHitIsolation(egIsoConeSizeOutLarge,egIsoConeSizeInEndcap,egIsoJurassicWidth,egIsoPtMinEndcap,egIsoEMinEndcap,eventSetupData_->caloGeom,eventData_->ecalEndcapHitsMeta,eventSetupData_->sevLevel.product(),DetId::Ecal);
758 
759  //Fill in the Isolation Value Maps for PF and EcalDriven electrons
760  std::vector<edm::InputTag> inputTagIsoVals;
762  inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumChargedHadronPt"));
763  inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumPhotonEt"));
764  inputTagIsoVals.push_back(generalData_->inputCfg.pfIsoVals.getParameter<edm::InputTag>("pfSumNeutralHadronEt"));
765 
766  eventData_->pfIsolationValues.resize(inputTagIsoVals.size());
767 
768  for (size_t j = 0; j<inputTagIsoVals.size(); ++j) {
769  event.getByLabel(inputTagIsoVals[j], eventData_->pfIsolationValues[j]);
770  }
771 
772  }
773 
775  inputTagIsoVals.clear();
776  inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumChargedHadronPt"));
777  inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumPhotonEt"));
778  inputTagIsoVals.push_back(generalData_->inputCfg.edIsoVals.getParameter<edm::InputTag>("edSumNeutralHadronEt"));
779 
780  eventData_->edIsolationValues.resize(inputTagIsoVals.size());
781 
782  for (size_t j = 0; j<inputTagIsoVals.size(); ++j) {
783  event.getByLabel(inputTagIsoVals[j], eventData_->edIsolationValues[j]);
784  }
785  }
786  }
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
EcalRecHitMetaCollection * ecalBarrelHitsMeta
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:81
EgammaTowerIsolation * hadDepth2Isolation04
void setVetoClustered(bool b=true)
SimpleCaloRecHitMetaCollection< EcalRecHitCollection > EcalRecHitMetaCollection
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
EcalRecHitMetaCollection * ecalEndcapHitsMeta
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracks
void GsfElectronAlgo::calculateShowerShape ( const reco::SuperClusterRef theClus,
bool  pflow,
reco::GsfElectron::ShowerShape showerShape 
)
private

Definition at line 532 of file GsfElectronAlgo.cc.

References GsfElectronAlgo::EventData::barrelRecHits, GsfElectronAlgo::EventSetupData::caloGeom, GsfElectronAlgo::EventSetupData::caloTopo, EcalClusterTools::covariances(), EcalClusterTools::e1x5(), reco::GsfElectron::ShowerShape::e1x5, EcalClusterTools::e2x5Max(), reco::GsfElectron::ShowerShape::e2x5Max, EcalClusterTools::e3x3(), EcalClusterTools::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(), EcalClusterTools::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(), and DetId::subdetId().

Referenced by addPflowInfo(), and createElectron().

533  {
534  const reco::CaloCluster & seedCluster = *(theClus->seed()) ;
535  // temporary, till CaloCluster->seed() is made available
536  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
537  int detector = seedXtalId.subdetId() ;
538 
539  const CaloTopology * topology = eventSetupData_->caloTopo.product() ;
541  const EcalRecHitCollection * recHits = 0 ;
542  std::vector<int> recHitFlagsToBeExcluded ;
543  std::vector<int> recHitSeverityToBeExcluded ;
544  if (detector==EcalBarrel)
545  {
546  recHits = eventData_->barrelRecHits.product() ;
547  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedBarrel ;
548  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedBarrel ;
549  }
550  else
551  {
552  recHits = eventData_->endcapRecHits.product() ;
553  recHitFlagsToBeExcluded = generalData_->recHitsCfg.recHitFlagsToBeExcludedEndcaps ;
554  recHitSeverityToBeExcluded = generalData_->recHitsCfg.recHitSeverityToBeExcludedEndcaps ;
555  }
556 
557  std::vector<float> covariances = EcalClusterTools::covariances(seedCluster,recHits,topology,geometry) ;
558  std::vector<float> localCovariances = EcalClusterTools::localCovariances(seedCluster,recHits,topology) ;
559  showerShape.sigmaEtaEta = sqrt(covariances[0]) ;
560  showerShape.sigmaIetaIeta = sqrt(localCovariances[0]) ;
561  if (!edm::isNotFinite(localCovariances[2])) showerShape.sigmaIphiIphi = sqrt(localCovariances[2]) ;
562  showerShape.e1x5 = EcalClusterTools::e1x5(seedCluster,recHits,topology) ;
563  showerShape.e2x5Max = EcalClusterTools::e2x5Max(seedCluster,recHits,topology) ;
564  showerShape.e5x5 = EcalClusterTools::e5x5(seedCluster,recHits,topology) ;
565  showerShape.r9 = EcalClusterTools::e3x3(seedCluster,recHits,topology)/theClus->rawEnergy() ;
566 
567  if (pflow)
568  {
569  showerShape.hcalDepth1OverEcal = generalData_->hcalHelperPflow->hcalESumDepth1(*theClus)/theClus->energy() ;
570  showerShape.hcalDepth2OverEcal = generalData_->hcalHelperPflow->hcalESumDepth2(*theClus)/theClus->energy() ;
574  }
575  else
576  {
577  showerShape.hcalDepth1OverEcal = generalData_->hcalHelper->hcalESumDepth1(*theClus)/theClus->energy() ;
578  showerShape.hcalDepth2OverEcal = generalData_->hcalHelper->hcalESumDepth2(*theClus)/theClus->energy() ;
582  }
583  }
ElectronHcalHelper * hcalHelperPflow
GeneralData * generalData_
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
static std::vector< float > covariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry, float w0=4.7)
bool isNotFinite(T x)
Definition: isFinite.h:10
static std::vector< float > localCovariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=4.7)
T sqrt(T t)
Definition: SSEVec.h:48
edm::Handle< EcalRecHitCollection > barrelRecHits
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: GsfElectron.h:369
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
static float e2x5Max(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
edm::ESHandle< CaloGeometry > caloGeom
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
double hcalESumDepth1(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=0)
static float e1x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
EventData * eventData_
void GsfElectronAlgo::checkSetup ( const edm::EventSetup es)

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

618  {
619  // get EventSetupRecords if needed
620  bool updateField(false);
622  updateField = true;
625  }
626 
627  bool updateGeometry(false);
629  updateGeometry = true;
632  }
633 
634  if ( updateField || updateGeometry ) {
635  delete eventSetupData_->mtsTransform ;
639  }
640 
642  eventSetupData_->cacheIDGeom=es.get<CaloGeometryRecord>().cacheIdentifier();
644  }
645 
647  eventSetupData_->cacheIDTopo=es.get<CaloTopologyRecord>().cacheIdentifier();
649  }
650 
655 
656 
661 
662  //if(eventSetupData_->cacheChStatus!=es.get<EcalChannelStatusRcd>().cacheIdentifier()){
663  // eventSetupData_->cacheChStatus=es.get<EcalChannelStatusRcd>().cacheIdentifier();
664  // es.get<EcalChannelStatusRcd>().get(eventSetupData_->chStatus);
665  //}
666 
668  eventSetupData_->cacheSevLevel = es.get<EcalSeverityLevelAlgoRcd>().cacheIdentifier();
670  }
671  }
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 853 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronProducer::produce().

854  {
855  const GsfElectronCollection * oldElectrons = eventData_->previousElectrons.product() ;
857  GsfElectronCollection::const_iterator oldElectron ;
858  for
859  ( oldElectron = oldElectrons->begin() ;
860  oldElectron != oldElectrons->end() ;
861  ++oldElectron )
862  {
863  const GsfElectronCoreRef oldCoreRef = oldElectron->core() ;
864  const GsfTrackRef oldElectronGsfTrackRef = oldCoreRef->gsfTrack() ;
865  unsigned int icore ;
866  for ( icore=0 ; icore<newCores->size() ; ++icore )
867  {
868  if (oldElectronGsfTrackRef==(*newCores)[icore].gsfTrack())
869  {
871  eventData_->electrons->push_back(new GsfElectron(*oldElectron,coreRef)) ;
872  break ;
873  }
874  }
875  }
876  }
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 810 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().

811  {
812  if (electronData_!=0)
813  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"unexpected electron data" ; }
814 
815  const GsfElectronCoreCollection * coreCollection = eventData_->coreElectrons.product() ;
816  for ( unsigned int i=0 ; i<coreCollection->size() ; ++i )
817  {
818  // check there is no existing electron with this core
820  bool coreFound = false ;
821  GsfElectronPtrCollection::const_iterator itrEle ;
822  for
823  ( itrEle = eventData_->electrons->begin() ;
824  itrEle != eventData_->electrons->end() ;
825  itrEle++ )
826  {
827  if ((*itrEle)->core()==coreRef)
828  {
829  coreFound = true ;
830  break ;
831  }
832  }
833  if (coreFound) continue ;
834 
835  // check there is a super-cluster
836  if (coreRef->superCluster().isNull()) continue ;
837 
838  // prepare internal structure for electron specific data
839  delete electronData_ ;
840  electronData_ = new ElectronData(coreRef,*eventData_->beamspot) ;
841 
842  // calculate and check Trajectory StatesOnSurface....
844 
845  createElectron() ;
846 
847  } // loop over tracks
848 
849  delete electronData_ ;
850  electronData_ = 0 ;
851  }
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 674 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronBaseProducer::fillEvent().

675  {
676  GsfElectronPtrCollection::const_iterator it ;
677  for
678  ( it = eventData_->electrons->begin() ;
679  it != eventData_->electrons->end() ;
680  it++ )
681  { outEle.push_back(**it) ; }
682  }
GsfElectronPtrCollection * electrons
EventData * eventData_
void GsfElectronAlgo::createElectron ( )
private

Definition at line 1194 of file GsfElectronAlgo.cc.

References funct::abs(), RegressionHelper::applyCombinationRegression(), RegressionHelper::applyEcalRegression(), GsfElectronAlgo::EventData::barrelRecHits, GsfElectronAlgo::EventData::beamspot, GsfElectronAlgo::ElectronData::calculateMode(), GsfElectronAlgo::ElectronData::calculateMomentum(), calculateShowerShape(), 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(), 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::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().

1195  {
1196  // eventually check ctf track
1199 
1200  // charge ID
1201  int eleCharge ;
1202  GsfElectron::ChargeInfo eleChargeInfo ;
1203  electronData_->computeCharge(eleCharge,eleChargeInfo) ;
1204 
1205  // electron basic cluster
1207 
1208  // Seed cluster
1209  const reco::CaloCluster & seedCluster = *(electronData_->superClusterRef->seed()) ;
1210 
1211  // seed Xtal
1212  // temporary, till CaloCluster->seed() is made available
1213  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
1214 
1216 
1217 
1218  //====================================================
1219  // Candidate attributes
1220  //====================================================
1221 
1223 
1224 
1225  //====================================================
1226  // Track-Cluster Matching
1227  //====================================================
1228 
1230  tcMatching.electronCluster = elbcRef ;
1231  tcMatching.eSuperClusterOverP = (electronData_->vtxMom.mag()>0)?(electronData_->superClusterRef->energy()/electronData_->vtxMom.mag()):(-1.) ;
1232  tcMatching.eSeedClusterOverP = (electronData_->vtxMom.mag()>0.)?(seedCluster.energy()/electronData_->vtxMom.mag()):(-1) ;
1233  tcMatching.eSeedClusterOverPout = (electronData_->seedMom.mag()>0.)?(seedCluster.energy()/electronData_->seedMom.mag()):(-1.) ;
1234  tcMatching.eEleClusterOverPout = (electronData_->eleMom.mag()>0.)?(elbcRef->energy()/electronData_->eleMom.mag()):(-1.) ;
1235 
1237  tcMatching.deltaEtaSuperClusterAtVtx = scAtVtx.dEta() ;
1238  tcMatching.deltaPhiSuperClusterAtVtx = scAtVtx.dPhi() ;
1239 
1240  EleRelPointPair seedAtCalo(seedCluster.position(),electronData_->seedPos,eventData_->beamspot->position()) ;
1241  tcMatching.deltaEtaSeedClusterAtCalo = seedAtCalo.dEta() ;
1242  tcMatching.deltaPhiSeedClusterAtCalo = seedAtCalo.dPhi() ;
1243 
1244  EleRelPointPair ecAtCalo(elbcRef->position(),electronData_->elePos,eventData_->beamspot->position()) ;
1245  tcMatching.deltaEtaEleClusterAtCalo = ecAtCalo.dEta() ;
1246  tcMatching.deltaPhiEleClusterAtCalo = ecAtCalo.dPhi() ;
1247 
1248 
1249  //=======================================================
1250  // Track extrapolations
1251  //=======================================================
1252 
1261 
1262 
1263  //=======================================================
1264  // Closest Ctf Track
1265  //=======================================================
1266 
1268  ctfInfo.ctfTrack = electronData_->ctfTrackRef ;
1270 
1271 
1272  //====================================================
1273  // FiducialFlags, using nextToBoundary definition of gaps
1274  //====================================================
1275 
1276  reco::GsfElectron::FiducialFlags fiducialFlags ;
1277  int detector = seedXtalId.subdetId() ;
1278  double feta=std::abs(electronData_->superClusterRef->position().eta()) ;
1279  if (detector==EcalBarrel)
1280  {
1281  fiducialFlags.isEB = true ;
1282  EBDetId ebdetid(seedXtalId);
1283  if (EBDetId::isNextToEtaBoundary(ebdetid))
1284  {
1285  if (ebdetid.ietaAbs()==85)
1286  { fiducialFlags.isEBEEGap = true ; }
1287  else
1288  { fiducialFlags.isEBEtaGap = true ; }
1289  }
1290  if (EBDetId::isNextToPhiBoundary(ebdetid))
1291  { fiducialFlags.isEBPhiGap = true ; }
1292  }
1293  else if (detector==EcalEndcap)
1294  {
1295  fiducialFlags.isEE = true ;
1296  EEDetId eedetid(seedXtalId);
1297  if (EEDetId::isNextToRingBoundary(eedetid))
1298  {
1299  if (std::abs(feta)<2.)
1300  { fiducialFlags.isEBEEGap = true ; }
1301  else
1302  { fiducialFlags.isEERingGap = true ; }
1303  }
1304  if (EEDetId::isNextToDBoundary(eedetid))
1305  { fiducialFlags.isEEDeeGap = true ; }
1306  }
1307  else
1308  { throw cms::Exception("GsfElectronAlgo|UnknownXtalRegion")<<"createElectron(): do not know if it is a barrel or endcap seed cluster !!!!" ; }
1309 
1310 
1311  //====================================================
1312  // ShowerShape
1313  //====================================================
1314 
1315  reco::GsfElectron::ShowerShape showerShape ;
1316  calculateShowerShape(electronData_->superClusterRef,!(electronData_->coreRef->ecalDrivenSeed()),showerShape) ;
1317 
1318 
1319  //====================================================
1320  // ConversionRejection
1321  //====================================================
1322 
1324 
1325  ConversionFinder conversionFinder ;
1326  double BInTesla = eventSetupData_->magField->inTesla(GlobalPoint(0.,0.,0.)).z() ;
1328  if (!ctfTracks.isValid()) { ctfTracks = eventData_->currentCtfTracks ; }
1329 
1330  // values of conversionInfo.flag()
1331  // -9999 : Partner track was not found
1332  // 0 : Partner track found in the CTF collection using
1333  // 1 : Partner track found in the CTF collection using
1334  // 2 : Partner track found in the GSF collection using
1335  // 3 : Partner track found in the GSF collection using the electron's GSF track
1336  ConversionInfo conversionInfo = conversionFinder.getConversionInfo
1337  (*electronData_->coreRef,ctfTracks,eventData_->originalGsfTracks,BInTesla) ;
1338 
1340  conversionVars.flags = conversionInfo.flag() ;
1341  conversionVars.dist = conversionInfo.dist() ;
1342  conversionVars.dcot = conversionInfo.dcot() ;
1343  conversionVars.radius = conversionInfo.radiusOfConversion() ;
1344  if ((conversionVars.flags==0)or(conversionVars.flags==1))
1345  conversionVars.partner = TrackBaseRef(conversionInfo.conversionPartnerCtfTk()) ;
1346  else if ((conversionVars.flags==2)or(conversionVars.flags==3))
1347  conversionVars.partner = TrackBaseRef(conversionInfo.conversionPartnerGsfTk()) ;
1348 
1349 
1350  //====================================================
1351  // Go !
1352  //====================================================
1353 
1354  GsfElectron * ele = new
1355  GsfElectron
1356  ( eleCharge,eleChargeInfo,electronData_->coreRef,
1357  tcMatching, tkExtra, ctfInfo,
1358  fiducialFlags,showerShape,
1359  conversionVars ) ;
1360  // Will be overwritten later in the case of the regression
1362  ele->setP4(GsfElectron::P4_FROM_SUPER_CLUSTER,momentum,0,true) ;
1363 
1364 
1365  //====================================================
1366  // brems fractions
1367  //====================================================
1368 
1369  if (electronData_->innMom.mag()>0.)
1371 
1372  SuperClusterRef sc = ele->superCluster() ;
1373  if (!(sc.isNull()))
1374  {
1375  CaloClusterPtr cl = ele->electronCluster() ;
1376  if (sc->clustersSize()>1)
1377  { ele->setSuperClusterFbrem( ( sc->energy() - cl->energy() ) / sc->energy() ) ; }
1378  else
1379  { ele->setSuperClusterFbrem(0) ; }
1380  }
1381 
1382 
1383  //====================================================
1384  // classification and corrections
1385  //====================================================
1386  // classification
1387  ElectronClassification theClassifier ;
1388  theClassifier.classify(*ele) ;
1389 
1390  // ecal energy
1393  {
1398  }
1399  else // original implementation
1400  {
1401  if (ele->core()->ecalDrivenSeed())
1402  {
1404  { theEnCorrector.classBasedParameterizationEnergy(*ele,*eventData_->beamspot) ; }
1406  { theEnCorrector.classBasedParameterizationUncertainty(*ele) ; }
1407  }
1408  else
1409  {
1411  { theEnCorrector.simpleParameterizationUncertainty(*ele) ; }
1412  }
1413  }
1414 
1415  // momentum
1416  // Keep the default correction running first. The track momentum error is computed in there
1417  if (ele->core()->ecalDrivenSeed())
1418  {
1419  ElectronMomentumCorrector theMomCorrector;
1420  theMomCorrector.correct(*ele,electronData_->vtxTSOS);
1421  }
1423  {
1425  }
1426 
1427  //====================================================
1428  // now isolation variables
1429  //====================================================
1430 
1444  ele->setIsolation03(dr03);
1445  ele->setIsolation04(dr04);
1446 
1447 
1448  //====================================================
1449  // preselection flag
1450  //====================================================
1451 
1453 
1454  LogTrace("GsfElectronAlgo")<<"Constructed new electron with energy "<< ele->p4().e() ;
1455 
1456  eventData_->electrons->push_back(ele) ;
1457  }
CaloClusterPtr electronCluster() const
Definition: GsfElectron.h:228
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:655
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
Definition: GsfElectron.cc:178
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:204
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:656
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:158
bool isNull() const
Checks for null.
Definition: Ref.h:247
T mag() const
Definition: PV3DBase.h:67
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:168
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:369
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:469
#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:266
double getPtTracks(const reco::GsfElectron *) const
void setIsolation03(const IsolationVariables &dr03)
Definition: GsfElectron.h:468
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 796 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronBaseProducer::fillEvent().

797  {
798  LogTrace("GsfElectronAlgo") << "========== " << title << " ==========";
799  LogTrace("GsfElectronAlgo") << "Event: " << eventData_->event->id();
800  LogTrace("GsfElectronAlgo") << "Number of electrons: " << eventData_->electrons->size() ;
801  GsfElectronPtrCollection::const_iterator it ;
802  for ( it = eventData_->electrons->begin(); it != eventData_->electrons->end(); it++ )
803  {
804  LogTrace("GsfElectronAlgo") << "Electron with charge, pt, eta, phi: " << (*it)->charge() << " , "
805  << (*it)->pt() << " , " << (*it)->eta() << " , " << (*it)->phi();
806  }
807  LogTrace("GsfElectronAlgo") << "=================================================";
808  }
GsfElectronPtrCollection * electrons
#define LogTrace(id)
edm::EventID id() const
Definition: EventBase.h:56
EventData * eventData_
void GsfElectronAlgo::endEvent ( )

Definition at line 788 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronBaseProducer::endEvent().

789  {
790  if (eventData_==0)
791  { throw cms::Exception("GsfElectronAlgo|InternalError")<<"lacking event data" ; }
792  delete eventData_ ;
793  eventData_ = 0 ;
794  }
EventData * eventData_
const reco::SuperClusterRef GsfElectronAlgo::getTrSuperCluster ( const reco::GsfTrackRef trackRef)
private
bool GsfElectronAlgo::isPreselected ( reco::GsfElectron ele)
private

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

1004  {
1005  float mvaValue=generalData_->sElectronMVAEstimator->mva( *(ele),*(eventData_->event));
1006  bool passCutBased=ele->passingCutBasedPreselection();
1007  bool passPF=ele->passingPflowPreselection();
1009  bool passmva=mvaValue>generalData_->strategyCfg.PreSelectMVA;
1010  if(!ele->ecalDrivenSeed()){
1012  return passmva && passCutBased;
1013  else
1014  return passmva;
1015  }
1016  else{
1017  return passCutBased || passPF || passmva;
1018  }
1019  }
1020  else{
1021  return passCutBased || passPF;
1022  }
1023 
1024  return true;
1025  }
GeneralData * generalData_
bool passingCutBasedPreselection() const
Definition: GsfElectron.h:598
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:172
bool passingPflowPreselection() const
Definition: GsfElectron.h:599
void GsfElectronAlgo::removeAmbiguousElectrons ( )

Definition at line 1589 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronBaseProducer::fillEvent().

1590  {
1591  GsfElectronPtrCollection::size_type ei = 1, emax = eventData_->electrons->size() ;
1592  GsfElectronPtrCollection::iterator eitr = eventData_->electrons->begin() ;
1593  while (eitr!=eventData_->electrons->end())
1594  {
1595  LogTrace("GsfElectronAlgo")<<"========== remove ambiguous "<<ei<<"/"<<emax<<"==========" ;
1596  if ((*eitr)->ambiguous())
1597  { delete (*eitr) ; eitr = eventData_->electrons->erase(eitr) ; ++ei ; }
1598  else
1599  { ++eitr ; ++ei ; }
1600  }
1601  }
uint16_t size_type
GsfElectronPtrCollection * electrons
#define LogTrace(id)
EventData * eventData_
void GsfElectronAlgo::removeNotPreselectedElectrons ( )

Definition at line 1027 of file GsfElectronAlgo.cc.

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

Referenced by GsfElectronBaseProducer::fillEvent().

1028  {
1029  GsfElectronPtrCollection::size_type ei = 1, emax = eventData_->electrons->size() ;
1030  GsfElectronPtrCollection::iterator eitr = eventData_->electrons->begin() ;
1031  while (eitr!=eventData_->electrons->end())
1032  {
1033  LogTrace("GsfElectronAlgo")<<"========== removed not preselected "<<ei<<"/"<<emax<<"==========" ;
1034  if (isPreselected(*eitr))
1035  { ++eitr ; ++ei ; }
1036  else
1037  { delete (*eitr) ; eitr = eventData_->electrons->erase(eitr) ; ++ei ; }
1038  }
1039  }
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 1467 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().

1468  {
1469  GsfElectronPtrCollection::iterator e1, e2 ;
1474  else
1475  { throw cms::Exception("GsfElectronAlgo|UnknownAmbiguitySortingStrategy")<<"value of generalData_->strategyCfg.ambSortingStrategy is : "<<generalData_->strategyCfg.ambSortingStrategy ; }
1476 
1477  // init
1478  for
1479  ( e1 = eventData_->electrons->begin() ;
1480  e1 != eventData_->electrons->end() ;
1481  ++e1 )
1482  {
1483  (*e1)->clearAmbiguousGsfTracks() ;
1484  (*e1)->setAmbiguous(false) ;
1485  }
1486 
1487  // get ambiguous from GsfPfRecTracks
1489  {
1490  for
1491  ( e1 = eventData_->electrons->begin() ;
1492  e1 != eventData_->electrons->end() ;
1493  ++e1 )
1494  {
1495  bool found = false ;
1496  const GsfPFRecTrackCollection * gsfPfRecTrackCollection = eventData_->gsfPfRecTracks.product() ;
1497  GsfPFRecTrackCollection::const_iterator gsfPfRecTrack ;
1498  for ( gsfPfRecTrack=gsfPfRecTrackCollection->begin() ;
1499  gsfPfRecTrack!=gsfPfRecTrackCollection->end() ;
1500  ++gsfPfRecTrack )
1501  {
1502  if (gsfPfRecTrack->gsfTrackRef()==(*e1)->gsfTrack())
1503  {
1504  if (found)
1505  {
1506  edm::LogWarning("GsfElectronAlgo")<<"associated gsfPfRecTrack already found" ;
1507  }
1508  else
1509  {
1510  found = true ;
1511  const std::vector<reco::GsfPFRecTrackRef> & duplicates(gsfPfRecTrack->convBremGsfPFRecTrackRef()) ;
1512  std::vector<reco::GsfPFRecTrackRef>::const_iterator duplicate ;
1513  for ( duplicate = duplicates.begin() ; duplicate != duplicates.end() ; duplicate ++ )
1514  { (*e1)->addAmbiguousGsfTrack((*duplicate)->gsfTrackRef()) ; }
1515  }
1516  }
1517  }
1518  }
1519  }
1520  // or search overlapping clusters
1521  else
1522  {
1523  for
1524  ( e1 = eventData_->electrons->begin() ;
1525  e1 != eventData_->electrons->end() ;
1526  ++e1 )
1527  {
1528  if ((*e1)->ambiguous()) continue ;
1529  if ( ignoreNotPreselected && !isPreselected(*e1) ) continue ;
1530 
1531  SuperClusterRef scRef1 = (*e1)->superCluster();
1532  CaloClusterPtr eleClu1 = (*e1)->electronCluster();
1533  LogDebug("GsfElectronAlgo")
1534  << "Blessing electron with E/P " << (*e1)->eSuperClusterOverP()
1535  << ", cluster " << scRef1.get()
1536  << " & track " << (*e1)->gsfTrack().get() ;
1537 
1538  for
1539  ( e2 = e1, ++e2 ;
1540  e2 != eventData_->electrons->end() ;
1541  ++e2 )
1542  {
1543  if ((*e2)->ambiguous()) continue ;
1544  if ( ignoreNotPreselected && !isPreselected(*e2) ) continue ;
1545 
1546  SuperClusterRef scRef2 = (*e2)->superCluster();
1547  CaloClusterPtr eleClu2 = (*e2)->electronCluster();
1548 
1549  // search if same cluster
1550  bool sameCluster = false ;
1552  { sameCluster = (scRef1==scRef2) ; }
1554  {
1555  float eMin = 1. ;
1556  float threshold = eMin*cosh(EleRelPoint(scRef1->position(),eventData_->beamspot->position()).eta()) ;
1557  sameCluster =
1559  (EgAmbiguityTools::sharedEnergy(&(*scRef1->seed()),&(*eleClu2),eventData_->barrelRecHits,eventData_->endcapRecHits)>=threshold) ||
1561  (EgAmbiguityTools::sharedEnergy(&(*scRef1->seed()),&(*scRef2->seed()),eventData_->barrelRecHits,eventData_->endcapRecHits)>=threshold) ) ;
1562  }
1563  else
1564  { throw cms::Exception("GsfElectronAlgo|UnknownAmbiguityClustersOverlapStrategy")<<"value of generalData_->strategyCfg.ambClustersOverlapStrategy is : "<<generalData_->strategyCfg.ambClustersOverlapStrategy ; }
1565 
1566  // main instructions
1567  if (sameCluster)
1568  {
1569  LogDebug("GsfElectronAlgo")
1570  << "Discarding electron with E/P " << (*e2)->eSuperClusterOverP()
1571  << ", cluster " << scRef2.get()
1572  << " and track " << (*e2)->gsfTrack().get() ;
1573  (*e1)->addAmbiguousGsfTrack((*e2)->gsfTrack()) ;
1574  (*e2)->setAmbiguous(true) ;
1575  }
1576  else if ((*e1)->gsfTrack()==(*e2)->gsfTrack())
1577  {
1578  edm::LogWarning("GsfElectronAlgo")
1579  << "Forgetting electron with E/P " << (*e2)->eSuperClusterOverP()
1580  << ", cluster " << scRef2.get()
1581  << " and track " << (*e2)->gsfTrack().get() ;
1582  (*e2)->setAmbiguous(true) ;
1583  }
1584  }
1585  }
1586  }
1587  }
#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 1042 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(), GsfElectronAlgo::CutsConfiguration::seedFromTEC, reco::GsfElectron::setPassCutBasedPreselection(), reco::GsfElectron::sigmaIetaIeta(), GsfElectronAlgo::GeneralData::strategyCfg, and reco::GsfElectron::superCluster().

Referenced by createElectron().

1043  {
1044  // default value
1045  ele->setPassCutBasedPreselection(false) ;
1046 
1047  // kind of seeding
1048  bool eg = ele->core()->ecalDrivenSeed() ;
1049  bool pf = ele->core()->trackerDrivenSeed() && !ele->core()->ecalDrivenSeed() ;
1050  bool gedMode = generalData_->strategyCfg.gedElectronMode;
1051  if (eg&&pf) { throw cms::Exception("GsfElectronAlgo|BothEcalAndPureTrackerDriven")<<"An electron cannot be both egamma and purely pflow" ; }
1052  if ((!eg)&&(!pf)) { throw cms::Exception("GsfElectronAlgo|NeitherEcalNorPureTrackerDriven")<<"An electron cannot be neither egamma nor purely pflow" ; }
1053 
1054  const CutsConfiguration * cfg = ((eg||gedMode)?&generalData_->cutsCfg:&generalData_->cutsCfgPflow);
1055 
1056  // Et cut
1057  double etaValue = EleRelPoint(ele->superCluster()->position(),bs.position()).eta() ;
1058  double etValue = ele->superCluster()->energy()/cosh(etaValue) ;
1059  LogTrace("GsfElectronAlgo") << "Et : " << etValue ;
1060  if (ele->isEB() && (etValue < cfg->minSCEtBarrel)) return ;
1061  if (ele->isEE() && (etValue < cfg->minSCEtEndcaps)) return ;
1062  LogTrace("GsfElectronAlgo") << "Et criteria are satisfied";
1063 
1064  // E/p cut
1065  double eopValue = ele->eSuperClusterOverP() ;
1066  LogTrace("GsfElectronAlgo") << "E/p : " << eopValue ;
1067  if (ele->isEB() && (eopValue > cfg->maxEOverPBarrel)) return ;
1068  if (ele->isEE() && (eopValue > cfg->maxEOverPEndcaps)) return ;
1069  if (ele->isEB() && (eopValue < cfg->minEOverPBarrel)) return ;
1070  if (ele->isEE() && (eopValue < cfg->minEOverPEndcaps)) return ;
1071  LogTrace("GsfElectronAlgo") << "E/p criteria are satisfied";
1072 
1073  // HoE cuts
1074  LogTrace("GsfElectronAlgo") << "HoE1 : " << ele->hcalDepth1OverEcal() << ", HoE2 : " << ele->hcalDepth2OverEcal();
1075  double had = ele->hcalOverEcal()*ele->superCluster()->energy() ;
1076  const reco::CaloCluster & seedCluster = *(ele->superCluster()->seed()) ;
1077  int detector = seedCluster.hitsAndFractions()[0].first.subdetId() ;
1078  bool HoEveto = false ;
1079  if (detector==EcalBarrel && (had<cfg->maxHBarrel || (had/ele->superCluster()->energy())<cfg->maxHOverEBarrel)) HoEveto=true;
1080  else if (detector==EcalEndcap && (had<cfg->maxHEndcaps || (had/ele->superCluster()->energy())<cfg->maxHOverEEndcaps)) HoEveto=true;
1081  if ( !HoEveto ) return ;
1082  LogTrace("GsfElectronAlgo") << "H/E criteria are satisfied";
1083 
1084  // delta eta criteria
1085  double deta = ele->deltaEtaSuperClusterTrackAtVtx() ;
1086  LogTrace("GsfElectronAlgo") << "delta eta : " << deta ;
1087  if (ele->isEB() && (std::abs(deta) > cfg->maxDeltaEtaBarrel)) return ;
1088  if (ele->isEE() && (std::abs(deta) > cfg->maxDeltaEtaEndcaps)) return ;
1089  LogTrace("GsfElectronAlgo") << "Delta eta criteria are satisfied";
1090 
1091  // delta phi criteria
1092  double dphi = ele->deltaPhiSuperClusterTrackAtVtx();
1093  LogTrace("GsfElectronAlgo") << "delta phi : " << dphi;
1094  if (ele->isEB() && (std::abs(dphi) > cfg->maxDeltaPhiBarrel)) return ;
1095  if (ele->isEE() && (std::abs(dphi) > cfg->maxDeltaPhiEndcaps)) return ;
1096  LogTrace("GsfElectronAlgo") << "Delta phi criteria are satisfied";
1097 
1098  // sigma ieta ieta
1099  LogTrace("GsfElectronAlgo") << "sigma ieta ieta : " << ele->sigmaIetaIeta();
1100  if (ele->isEB() && (ele->sigmaIetaIeta() > cfg->maxSigmaIetaIetaBarrel)) return ;
1101  if (ele->isEE() && (ele->sigmaIetaIeta() > cfg->maxSigmaIetaIetaEndcaps)) return ;
1102  LogTrace("GsfElectronAlgo") << "Sigma ieta ieta criteria are satisfied";
1103 
1104  // fiducial
1105  if (!ele->isEB() && cfg->isBarrel) return ;
1106  if (!ele->isEE() && cfg->isEndcaps) return ;
1107  if (cfg->isFiducial && (ele->isEBEEGap()||ele->isEBEtaGap()||ele->isEBPhiGap()||ele->isEERingGap()||ele->isEEDeeGap())) return ;
1108  LogTrace("GsfElectronAlgo") << "Fiducial flags criteria are satisfied";
1109 
1110  // seed in TEC
1111  edm::RefToBase<TrajectorySeed> seed = ele->gsfTrack()->extra()->seedRef() ;
1112  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>() ;
1113  if (eg && !generalData_->cutsCfg.seedFromTEC)
1114  {
1115  if (elseed.isNull())
1116  { throw cms::Exception("GsfElectronAlgo|NotElectronSeed")<<"The GsfTrack seed is not an ElectronSeed ?!" ; }
1117  else
1118  { if (elseed->subDet2()==6) return ; }
1119  }
1120 
1121  // transverse impact parameter
1122  if (std::abs(ele->gsfTrack()->dxy(bs.position()))>cfg->maxTIP) return ;
1123  LogTrace("GsfElectronAlgo") << "TIP criterion is satisfied" ;
1124 
1125  LogTrace("GsfElectronAlgo") << "All cut based criteria are satisfied" ;
1126  ele->setPassCutBasedPreselection(true) ;
1127  }
GeneralData * generalData_
const CutsConfiguration cutsCfgPflow
void setPassCutBasedPreselection(bool flag)
Definition: GsfElectron.h:606
bool isEBEtaGap() const
Definition: GsfElectron.h:338
float eSuperClusterOverP() const
Definition: GsfElectron.h:229
bool isEBEEGap() const
Definition: GsfElectron.h:336
float hcalDepth2OverEcal() const
Definition: GsfElectron.h:392
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:190
bool isEERingGap() const
Definition: GsfElectron.h:342
T eta() const
bool isEEDeeGap() const
Definition: GsfElectron.h:341
const StrategyConfiguration strategyCfg
bool isEE() const
Definition: GsfElectron.h:334
bool isEB() const
Definition: GsfElectron.h:333
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:233
bool isNull() const
Checks for null.
Definition: Ref.h:247
float sigmaIetaIeta() const
Definition: GsfElectron.h:385
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:168
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:236
float hcalOverEcal() const
Definition: GsfElectron.h:393
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const CutsConfiguration cutsCfg
#define LogTrace(id)
float hcalDepth1OverEcal() const
Definition: GsfElectron.h:391
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:339
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:169
void GsfElectronAlgo::setMVAepiBasedPreselectionFlag ( reco::GsfElectron ele)
private
void GsfElectronAlgo::setMVAInputs ( const std::map< reco::GsfTrackRef, reco::GsfElectron::MvaInput > &  mvaInputs)

Definition at line 1160 of file GsfElectronAlgo.cc.

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

Referenced by GEDGsfElectronProducer::produce().

1161 {
1162  GsfElectronPtrCollection::iterator el ;
1163  for
1164  ( el = eventData_->electrons->begin() ;
1165  el != eventData_->electrons->end() ;
1166  el++ )
1167  {
1168  std::map<reco::GsfTrackRef,reco::GsfElectron::MvaInput>::const_iterator itcheck=mvaInputs.find((*el)->gsfTrack());
1169  (*el)->setMvaInput(itcheck->second);
1170  }
1171 }
GsfElectronPtrCollection * electrons
EventData * eventData_
void GsfElectronAlgo::setMVAOutputs ( const std::map< reco::GsfTrackRef, reco::GsfElectron::MvaOutput > &  mvaOutputs)

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

1174 {
1175  GsfElectronPtrCollection::iterator el ;
1176  for
1177  ( el = eventData_->electrons->begin() ;
1178  el != eventData_->electrons->end() ;
1179  el++ )
1180  {
1182  float mvaValue=generalData_->sElectronMVAEstimator->mva( *(*el),*(eventData_->event));
1183  GsfElectron::MvaOutput mvaOutput ;
1184  mvaOutput.mva = mvaValue ;
1185  (*el)->setMvaOutput(mvaOutput);
1186  }
1187  else{
1188  std::map<reco::GsfTrackRef,reco::GsfElectron::MvaOutput>::const_iterator itcheck=mvaOutputs.find((*el)->gsfTrack());
1189  (*el)->setMvaOutput(itcheck->second);
1190  }
1191  }
1192 }
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 1129 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().

1130  {
1131  ele->setPassMvaPreselection(false) ;
1132 
1133  if (ele->core()->ecalDrivenSeed())
1134  { if (ele->mvaOutput().mva>=generalData_->cutsCfg.minMVA) ele->setPassMvaPreselection(true) ; }
1135  else
1136  { if (ele->mvaOutput().mva>=generalData_->cutsCfgPflow.minMVA) ele->setPassMvaPreselection(true) ; }
1137 
1138  if (ele->passingMvaPreselection())
1139  { LogTrace("GsfElectronAlgo") << "Main mva criterion is satisfied" ; }
1140 
1142 
1143 // ele->setPassPflowPreselection(false) ;
1144 // if (ele->core()->ecalDrivenSeed())
1145 // {
1146 // if ((ele->mvaOutput().mva>=generalData_->cutsCfg.minMVA) ||
1147 // (ele->mvaOutput().mvaByPassForIsolated>=generalData_->cutsCfg.minMvaByPassForIsolated))
1148 // ele->setPassPflowPreselection(true) ;
1149 // }
1150 // else
1151 // {
1152 // if ((ele->mvaOutput().mva>=generalData_->cutsCfgPflow.minMVA) ||
1153 // (ele->mvaOutput().mvaByPassForIsolated>=generalData_->cutsCfgPflow.minMvaByPassForIsolated))
1154 // ele->setPassPflowPreselection(true) ;
1155 // }
1156 // if (ele->passingPflowPreselection())
1157 // { LogTrace("GsfElectronAlgo") << "Mva criteria are satisfied" ; }
1158  }
GeneralData * generalData_
const CutsConfiguration cutsCfgPflow
bool passingMvaPreselection() const
Definition: GsfElectron.h:614
void setPassMvaPreselection(bool flag)
Definition: GsfElectron.h:613
const CutsConfiguration cutsCfg
#define LogTrace(id)
const MvaOutput & mvaOutput() const
Definition: GsfElectron.h:571
virtual GsfElectronCoreRef core() const
Definition: GsfElectron.cc:8
void setPassPflowPreselection(bool flag)
Definition: GsfElectron.h:607

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