Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25408 from guitargeek/EgammaID_9_4_12_minimal
[9_4_X] Egamma Fall17 V2 IDs
- Loading branch information
Showing
54 changed files
with
1,311 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
run2_miniAOD_devel = cms.Modifier() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...ElectronIdentification/data/Fall17/effAreaElectrons_cone03_pfNeuHadronsAndPhotons_94X.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This file contains Effective Area constants for | ||
# computing pile-up corrections for the neutral hadron and photon | ||
# isolation for an electron object. | ||
# Documentation: | ||
# | ||
# https://indico.cern.ch/event/697576/contributions/2940576/attachments/1620927/2578913/eleIdTuning.pdf | ||
# (slides 3 to 5) | ||
# | ||
# The effective areas are based on 90% efficient contours | ||
# | ||
# |eta| min |eta| max effective area | ||
0.000 1.000 0.1440 | ||
1.000 1.479 0.1562 | ||
1.479 2.000 0.1032 | ||
2.000 2.200 0.0859 | ||
2.200 2.300 0.1116 | ||
2.300 2.400 0.1321 | ||
2.400 2.500 0.1654 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
RecoEgamma/ElectronIdentification/plugins/cuts/GsfEleRelPFIsoScaledCut.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#include "PhysicsTools/SelectorUtils/interface/CutApplicatorWithEventContentBase.h" | ||
#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" | ||
#include "RecoEgamma/EgammaTools/interface/EffectiveAreas.h" | ||
|
||
|
||
class GsfEleRelPFIsoScaledCut : public CutApplicatorWithEventContentBase { | ||
public: | ||
GsfEleRelPFIsoScaledCut(const edm::ParameterSet& c); | ||
|
||
result_type operator()(const reco::GsfElectronPtr&) const final; | ||
|
||
void setConsumes(edm::ConsumesCollector&) final; | ||
void getEventContent(const edm::EventBase&) final; | ||
|
||
double value(const reco::CandidatePtr& cand) const final; | ||
|
||
CandidateType candidateType() const final { | ||
return ELECTRON; | ||
} | ||
|
||
private: | ||
const float barrelC0_, endcapC0_, barrelCpt_, endcapCpt_, barrelCutOff_; | ||
EffectiveAreas effectiveAreas_; | ||
edm::Handle<double> rhoHandle_; | ||
}; | ||
|
||
DEFINE_EDM_PLUGIN(CutApplicatorFactory, GsfEleRelPFIsoScaledCut, "GsfEleRelPFIsoScaledCut"); | ||
|
||
GsfEleRelPFIsoScaledCut::GsfEleRelPFIsoScaledCut(const edm::ParameterSet& c) : | ||
CutApplicatorWithEventContentBase(c), | ||
barrelC0_(c.getParameter<double>("barrelC0")), | ||
endcapC0_(c.getParameter<double>("endcapC0")), | ||
barrelCpt_(c.getParameter<double>("barrelCpt")), | ||
endcapCpt_(c.getParameter<double>("endcapCpt")), | ||
barrelCutOff_(c.getParameter<double>("barrelCutOff")), | ||
effectiveAreas_((c.getParameter<edm::FileInPath>("effAreasConfigFile")).fullPath()) | ||
{ | ||
edm::InputTag rhoTag = c.getParameter<edm::InputTag>("rho"); | ||
contentTags_.emplace("rho",rhoTag); | ||
} | ||
|
||
void GsfEleRelPFIsoScaledCut::setConsumes(edm::ConsumesCollector& cc){ | ||
auto rho = cc.consumes<double>(contentTags_["rho"]); | ||
contentTokens_.emplace("rho", rho); | ||
} | ||
|
||
void GsfEleRelPFIsoScaledCut::getEventContent(const edm::EventBase& ev){ | ||
ev.getByLabel(contentTags_["rho"], rhoHandle_); | ||
} | ||
|
||
CutApplicatorBase::result_type GsfEleRelPFIsoScaledCut::operator()(const reco::GsfElectronPtr& cand) const { | ||
// Establish the cut value | ||
double absEta = std::abs(cand->superCluster()->eta()); | ||
|
||
const float C0 = (absEta < barrelCutOff_ ? barrelC0_ : endcapC0_); | ||
const float Cpt = (absEta < barrelCutOff_ ? barrelCpt_ : endcapCpt_); | ||
const float isoCut = C0+Cpt/cand->pt(); | ||
|
||
return value(cand) < isoCut; | ||
} | ||
|
||
double GsfEleRelPFIsoScaledCut::value(const reco::CandidatePtr& cand) const { | ||
|
||
// Establish the cut value | ||
reco::GsfElectronPtr ele(cand); | ||
double absEta = std::abs(ele->superCluster()->eta()); | ||
|
||
// Compute the combined isolation with effective area correction | ||
auto pfIso = ele->pfIsolationVariables(); | ||
const float chad = pfIso.sumChargedHadronPt; | ||
const float nhad = pfIso.sumNeutralHadronEt; | ||
const float pho = pfIso.sumPhotonEt; | ||
const float eA = effectiveAreas_.getEffectiveArea(absEta); | ||
const float rho = rhoHandle_.isValid() ? (float)(*rhoHandle_) : 0; // std::max likes float arguments | ||
const float iso = chad + std::max(0.0f, nhad + pho - rho*eA); | ||
return iso/cand->pt(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.