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 47 of file ElectronIdentifier.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file ElectronIdentifier.cc.

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

25  :
26  _effectiveAreas( (c.getParameter<edm::FileInPath>("effAreasConfigFile")).fullPath())
27 
28 {
29  rho_ = -1;
30  ID_ = -1;
35 
40 
45 
50 
55 
60 
65 
70 
75 
80 
85 
90 
95 
100 
105 
110 }
T getParameter(std::string const &) const
std::array< std::array< std::array< double, 2 >, 4 >, 8 > cuts_
EffectiveAreas _effectiveAreas

Member Function Documentation

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

Definition at line 129 of file ElectronIdentifier.cc.

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

Referenced by passID().

129  {
130  return ele->superCluster().isNonnull() && ele->superCluster()->seed().isNonnull() ?
131  ele->deltaEtaSuperClusterTrackAtVtx() - ele->superCluster()->eta() + ele->superCluster()->seed()->eta() : std::numeric_limits<float>::max();
132  }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:249
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:184
float ElectronIdentifier::isolation ( const reco::GsfElectronPtr ele)

Definition at line 133 of file ElectronIdentifier.cc.

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().

133  {
134  if(rho_ < 0 ) {
135  throw;
136  }
138  const float chad = pfIso.sumChargedHadronPt;
139  const float nhad = pfIso.sumNeutralHadronEt;
140  const float pho = pfIso.sumPhotonEt;
141  const float eA = _effectiveAreas.getEffectiveArea( fabs(ele->superCluster()->eta()) );
142  const float iso = chad + std::max(0.0, nhad + pho - rho_*eA);
143 
144  // Apply the cut and return the result
145  // Scale by pT if the relative isolation is requested but avoid division by 0
146  return iso;
147 }
const PflowIsolationVariables & pfIsolationVariables() const
Definition: GsfElectron.h:677
const float getEffectiveArea(float eta) const
EffectiveAreas _effectiveAreas
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Definition: GsfElectron.h:631
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
Definition: GsfElectron.h:630
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:184
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:629
bool ElectronIdentifier::passID ( const reco::GsfElectronPtr ele,
edm::Handle< reco::BeamSpot beamspot,
edm::Handle< reco::ConversionCollection conversions 
)

Definition at line 150 of file ElectronIdentifier.cc.

References funct::abs(), BARREL, 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::BeamSpot::position(), reco::LeafCandidate::pt(), SIGMAIETA, and reco::GsfElectron::superCluster().

Referenced by ZCounting::analyzeElectrons().

150  {
151  if(ID_ == -1) throw;
152  unsigned int region = fabs(ele->superCluster()->eta()) < 1.479 ? EleIDEtaBins::BARREL : EleIDEtaBins::BARREL;
153 
154  if( ele->full5x5_sigmaIetaIeta() > cuts_[EleIDCutNames::SIGMAIETA][ID_][region]) return false;
155  if( dEtaInSeed(ele) > cuts_[EleIDCutNames::DETAINSEED][ID_][region]) return false;
156  if( std::abs(ele->deltaPhiSuperClusterTrackAtVtx()) > cuts_[EleIDCutNames::DPHIIN][ID_][region]) return false;
157  if( ele->hadronicOverEm() > cuts_[EleIDCutNames::HOVERE][ID_][region]) return false;
158  if( isolation(ele)/ele->pt() > cuts_[EleIDCutNames::ISO][ID_][region]) return false;
159  if( std::abs(1.0 - ele->eSuperClusterOverP())/ele->ecalEnergy() > cuts_[EleIDCutNames::ONEOVERE][ID_][region]) return false;
160  if( (ele->gsfTrack()->hitPattern().numberOfAllHits(reco::HitPattern::MISSING_INNER_HITS)) > cuts_[EleIDCutNames::MISSINGHITS][ID_][region]) return false;
161  if( ConversionTools::hasMatchedConversion(*ele,conversions,beamspot->position())) return false;
162 
163  return true;
164 }
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:185
float dEtaInSeed(const reco::GsfElectronPtr &ele)
float eSuperClusterOverP() const
Definition: GsfElectron.h:245
std::array< std::array< std::array< double, 2 >, 4 >, 8 > cuts_
double pt() const final
transverse momentum
float full5x5_sigmaIetaIeta() const
Definition: GsfElectron.h:458
float hadronicOverEm() const
Definition: GsfElectron.h:491
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:252
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static bool hasMatchedConversion(const reco::GsfElectron &ele, const edm::Handle< reco::ConversionCollection > &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
float ecalEnergy() const
Definition: GsfElectron.h:848
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:184
const Point & position() const
position
Definition: BeamSpot.h:62
float isolation(const reco::GsfElectronPtr &ele)
void ElectronIdentifier::setID ( std::string  ID)

Definition at line 122 of file ElectronIdentifier.cc.

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

Referenced by ZCounting::ZCounting().

122  {
123  if(ID=="TIGHT") ID_ = EleIDWorkingPoints::TIGHT;
124  else if(ID=="MEDIUM") ID_ = EleIDWorkingPoints::MEDIUM;
125  else if(ID=="LOOSE") ID_ = EleIDWorkingPoints::LOOSE;
126  else if(ID=="VETO") ID_ = EleIDWorkingPoints::VETO;
127  else throw;
128 }
uint32_t ID
Definition: Definitions.h:26
void ElectronIdentifier::setRho ( double  rho)

Definition at line 112 of file ElectronIdentifier.cc.

References Exception, rho, and rho_.

Referenced by ZCounting::analyzeElectrons().

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

Member Data Documentation

EffectiveAreas ElectronIdentifier::_effectiveAreas
private

Definition at line 61 of file ElectronIdentifier.h.

Referenced by isolation().

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

Definition at line 59 of file ElectronIdentifier.h.

Referenced by ElectronIdentifier(), and passID().

int ElectronIdentifier::ID_
private

Definition at line 58 of file ElectronIdentifier.h.

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

double ElectronIdentifier::rho_
private

Definition at line 57 of file ElectronIdentifier.h.

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