CMS 3D CMS Logo

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

#include <ElectronIdentifier.h>

Public Member Functions

float dEtaInSeed (const reco::GsfElectronPtr &ele)
 
 ElectronIdentifier (const edm::ParameterSet &c)
 
float isolation (const reco::GsfElectronPtr &ele)
 
bool passID (const reco::GsfElectronPtr &ele, edm::Handle< reco::BeamSpot > beamspot, edm::Handle< reco::ConversionCollection > conversions)
 
void setID (std::string ID)
 
void setRho (double rho)
 

Private Attributes

EffectiveAreas _effectiveAreas
 
std::array< std::array< std::array< double, 2 >, 4 >, 8 > cuts_
 
int ID_
 
double rho_
 

Detailed Description

Definition at line 40 of file ElectronIdentifier.h.

Constructor & Destructor Documentation

◆ ElectronIdentifier()

ElectronIdentifier::ElectronIdentifier ( const edm::ParameterSet c)

Definition at line 24 of file ElectronIdentifier.cc.

25  : _effectiveAreas((c.getParameter<edm::FileInPath>("effAreasConfigFile")).fullPath())
26 
27 {
28  rho_ = -1;
29  ID_ = -1;
34 
39 
44 
49 
54 
59 
64 
69 
74 
79 
84 
89 
94 
99 
104 
109 }

References BARREL, CONVERSION, cuts_, DETAINSEED, DPHIIN, ENDCAP, HOVERE, ID_, ISO, LOOSE, MEDIUM, MISSINGHITS, ONEOVERE, rho_, SIGMAIETA, TIGHT, and VETO.

Member Function Documentation

◆ dEtaInSeed()

float ElectronIdentifier::dEtaInSeed ( const reco::GsfElectronPtr ele)

Definition at line 132 of file ElectronIdentifier.cc.

132  {
133  return ele->superCluster().isNonnull() && ele->superCluster()->seed().isNonnull()
134  ? ele->deltaEtaSuperClusterTrackAtVtx() - ele->superCluster()->eta() + ele->superCluster()->seed()->eta()
136 }

References reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), edm::Ref< C, T, F >::isNonnull(), SiStripPI::max, and reco::GsfElectron::superCluster().

Referenced by passID().

◆ isolation()

float ElectronIdentifier::isolation ( const reco::GsfElectronPtr ele)

Definition at line 137 of file ElectronIdentifier.cc.

137  {
138  if (rho_ < 0) {
139  throw;
140  }
142  const float chad = pfIso.sumChargedHadronPt;
143  const float nhad = pfIso.sumNeutralHadronEt;
144  const float pho = pfIso.sumPhotonEt;
145  const float eA = _effectiveAreas.getEffectiveArea(fabs(ele->superCluster()->eta()));
146  const float iso = chad + std::max(0.0, nhad + pho - rho_ * eA);
147 
148  // Apply the cut and return the result
149  // Scale by pT if the relative isolation is requested but avoid division by 0
150  return iso;
151 }

References _effectiveAreas, EffectiveAreas::getEffectiveArea(), SiStripPI::max, reco::GsfElectron::pfIsolationVariables(), rho_, reco::GsfElectron::PflowIsolationVariables::sumChargedHadronPt, reco::GsfElectron::PflowIsolationVariables::sumNeutralHadronEt, reco::GsfElectron::PflowIsolationVariables::sumPhotonEt, and reco::GsfElectron::superCluster().

Referenced by passID().

◆ passID()

bool ElectronIdentifier::passID ( const reco::GsfElectronPtr ele,
edm::Handle< reco::BeamSpot beamspot,
edm::Handle< reco::ConversionCollection conversions 
)

Definition at line 153 of file ElectronIdentifier.cc.

155  {
156  if (ID_ == -1)
157  throw;
158  unsigned int region = fabs(ele->superCluster()->eta()) < 1.479 ? EleIDEtaBins::BARREL : EleIDEtaBins::BARREL;
159 
161  return false;
163  return false;
165  return false;
167  return false;
168  if (isolation(ele) / ele->pt() > cuts_[EleIDCutNames::ISO][ID_][region])
169  return false;
171  return false;
172  if ((ele->gsfTrack()->hitPattern().numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS)) >
174  return false;
176  return false;
177 
178  return true;
179 }

References funct::abs(), BARREL, pwdgSkimBPark_cfi::conversions, cuts_, reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), DETAINSEED, dEtaInSeed(), DPHIIN, reco::GsfElectron::ecalEnergy(), reco::GsfElectron::eSuperClusterOverP(), reco::GsfElectron::full5x5_sigmaIetaIeta(), reco::GsfElectron::gsfTrack(), reco::GsfElectron::hadronicOverEm(), ConversionTools::hasMatchedConversion(), HOVERE, ID_, ISO, isolation(), reco::HitPattern::MISSING_INNER_HITS, MISSINGHITS, ONEOVERE, reco::LeafCandidate::pt(), HLT_FULL_cff::region, SIGMAIETA, and reco::GsfElectron::superCluster().

Referenced by ZCounting::analyzeElectrons().

◆ setID()

void ElectronIdentifier::setID ( std::string  ID)

Definition at line 120 of file ElectronIdentifier.cc.

120  {
121  if (ID == "TIGHT")
123  else if (ID == "MEDIUM")
125  else if (ID == "LOOSE")
127  else if (ID == "VETO")
129  else
130  throw;
131 }

References ID_, LOOSE, MEDIUM, TIGHT, and VETO.

Referenced by ZCounting::ZCounting().

◆ setRho()

void ElectronIdentifier::setRho ( double  rho)

Definition at line 111 of file ElectronIdentifier.cc.

111  {
112  if (rho >= 0) {
113  rho_ = rho;
114  } else {
115  throw cms::Exception("ValueError") << "Encountered invalid value for energy density rho.\n"
116  << "Value: " << rho << "\n"
117  << "Rho should be a real, positive number.\n";
118  }
119 }

References Exception, rho, and rho_.

Referenced by ZCounting::analyzeElectrons().

Member Data Documentation

◆ _effectiveAreas

EffectiveAreas ElectronIdentifier::_effectiveAreas
private

Definition at line 57 of file ElectronIdentifier.h.

Referenced by isolation().

◆ cuts_

std::array<std::array<std::array<double, 2>, 4>, 8> ElectronIdentifier::cuts_
private

Definition at line 55 of file ElectronIdentifier.h.

Referenced by ElectronIdentifier(), and passID().

◆ ID_

int ElectronIdentifier::ID_
private

Definition at line 54 of file ElectronIdentifier.h.

Referenced by ElectronIdentifier(), passID(), and setID().

◆ rho_

double ElectronIdentifier::rho_
private

Definition at line 53 of file ElectronIdentifier.h.

Referenced by ElectronIdentifier(), isolation(), and setRho().

reco::GsfElectron::gsfTrack
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:163
reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:235
TIGHT
Definition: ElectronIdentifier.h:38
reco::GsfElectron::PflowIsolationVariables
Definition: GsfElectron.h:605
ONEOVERE
Definition: ElectronIdentifier.h:34
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
reco::GsfElectron::hadronicOverEm
float hadronicOverEm() const
Definition: GsfElectron.h:475
BARREL
Definition: ElectronIdentifier.h:39
ElectronIdentifier::cuts_
std::array< std::array< std::array< double, 2 >, 4 >, 8 > cuts_
Definition: ElectronIdentifier.h:55
edm::FileInPath
Definition: FileInPath.h:64
reco::GsfElectron::PflowIsolationVariables::sumPhotonEt
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Definition: GsfElectron.h:609
MISSINGHITS
Definition: ElectronIdentifier.h:35
ElectronIdentifier::isolation
float isolation(const reco::GsfElectronPtr &ele)
Definition: ElectronIdentifier.cc:137
ConversionTools::hasMatchedConversion
static bool hasMatchedConversion(const reco::GsfElectron &ele, const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
Definition: ConversionTools.cc:181
DETAINSEED
Definition: ElectronIdentifier.h:30
beamspot
Definition: BeamSpotWrite2Txt.h:8
CONVERSION
Definition: ElectronIdentifier.h:36
ElectronIdentifier::dEtaInSeed
float dEtaInSeed(const reco::GsfElectronPtr &ele)
Definition: ElectronIdentifier.cc:132
DDAxes::rho
align::ID
uint32_t ID
Definition: Definitions.h:24
reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:232
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
reco::GsfElectron::full5x5_sigmaIetaIeta
float full5x5_sigmaIetaIeta() const
Definition: GsfElectron.h:442
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
ElectronIdentifier::rho_
double rho_
Definition: ElectronIdentifier.h:53
DPHIIN
Definition: ElectronIdentifier.h:31
LOOSE
Definition: ElectronIdentifier.h:38
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88271
HOVERE
Definition: ElectronIdentifier.h:32
VETO
Definition: ElectronIdentifier.h:38
ISO
Definition: ElectronIdentifier.h:33
reco::GsfElectron::PflowIsolationVariables::sumNeutralHadronEt
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
Definition: GsfElectron.h:608
SIGMAIETA
Definition: ElectronIdentifier.h:29
ElectronIdentifier::ID_
int ID_
Definition: ElectronIdentifier.h:54
Exception
Definition: hltDiff.cc:245
reco::HitPattern::MISSING_INNER_HITS
Definition: HitPattern.h:155
reco::GsfElectron::eSuperClusterOverP
float eSuperClusterOverP() const
Definition: GsfElectron.h:228
EffectiveAreas::getEffectiveArea
const float getEffectiveArea(float eta) const
Definition: EffectiveAreas.cc:44
ElectronIdentifier::_effectiveAreas
EffectiveAreas _effectiveAreas
Definition: ElectronIdentifier.h:57
reco::GsfElectron::superCluster
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:162
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::GsfElectron::pfIsolationVariables
const PflowIsolationVariables & pfIsolationVariables() const
Definition: GsfElectron.h:657
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
MEDIUM
Definition: ElectronIdentifier.h:38
pwdgSkimBPark_cfi.conversions
conversions
Definition: pwdgSkimBPark_cfi.py:10
reco::GsfElectron::PflowIsolationVariables::sumChargedHadronPt
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:607
ENDCAP
Definition: ElectronIdentifier.h:39
reco::GsfElectron::ecalEnergy
float ecalEnergy() const
Definition: GsfElectron.h:818