forked from CERN-PH-CMG/cmg-cmssw
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #14 from ikrav/egm_id_74X_v0
Updated pho/ele ID for 740
- Loading branch information
Showing
10 changed files
with
668 additions
and
110 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
EgammaAnalysis/PhotonTools/data/PHYS14/effAreaPhotons_cone03_pfChargedHadrons_V2.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,13 @@ | ||
# This file contains Effective Area constants for | ||
# computing pile-up corrections for the Charged Hadrons isolation | ||
# for a photon object. | ||
# Source: https://indico.cern.ch/event/369225/contribution/1/material/slides/0.pdf | ||
# | ||
# |eta| min |eta| max effective area | ||
0.0000 1.0000 0.0234 | ||
1.0000 1.4790 0.0189 | ||
1.4790 2.0000 0.0171 | ||
2.0000 2.2000 0.0129 | ||
2.2000 2.3000 0.0110 | ||
2.3000 2.4000 0.0074 | ||
2.4000 5.0000 0.0035 |
13 changes: 13 additions & 0 deletions
13
EgammaAnalysis/PhotonTools/data/PHYS14/effAreaPhotons_cone03_pfNeutralHadrons_V2.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,13 @@ | ||
# This file contains Effective Area constants for | ||
# computing pile-up corrections for the Neutral Hadrons isolation | ||
# for a photon object. | ||
# Source: https://indico.cern.ch/event/369225/contribution/1/material/slides/0.pdf | ||
# | ||
# |eta| min |eta| max effective area | ||
0.0000 1.0000 0.0053 | ||
1.0000 1.4790 0.0103 | ||
1.4790 2.0000 0.0057 | ||
2.0000 2.2000 0.0070 | ||
2.2000 2.3000 0.0152 | ||
2.3000 2.4000 0.0230 | ||
2.4000 5.0000 0.1709 |
13 changes: 13 additions & 0 deletions
13
EgammaAnalysis/PhotonTools/data/PHYS14/effAreaPhotons_cone03_pfPhotons_V2.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,13 @@ | ||
# This file contains Effective Area constants for | ||
# computing pile-up corrections for the photons isolation | ||
# for a photon object. | ||
# Source: https://indico.cern.ch/event/369225/contribution/1/material/slides/0.pdf | ||
# | ||
# |eta| min |eta| max effective area | ||
0.0000 1.0000 0.0896 | ||
1.0000 1.4790 0.0762 | ||
1.4790 2.0000 0.0383 | ||
2.0000 2.2000 0.0534 | ||
2.2000 2.3000 0.0846 | ||
2.3000 2.4000 0.1032 | ||
2.4000 5.0000 0.1598 |
112 changes: 112 additions & 0 deletions
112
RecoEgamma/PhotonIdentification/plugins/cuts/PhoAnyPFIsoWithEAAndExpoScalingEBCut.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,112 @@ | ||
#include "PhysicsTools/SelectorUtils/interface/CutApplicatorWithEventContentBase.h" | ||
#include "DataFormats/EgammaCandidates/interface/Photon.h" | ||
#include "RecoEgamma/EgammaTools/interface/EffectiveAreas.h" | ||
|
||
|
||
class PhoAnyPFIsoWithEAAndExpoScalingEBCut : public CutApplicatorWithEventContentBase { | ||
public: | ||
PhoAnyPFIsoWithEAAndExpoScalingEBCut(const edm::ParameterSet& c); | ||
|
||
result_type operator()(const reco::PhotonPtr&) const override final; | ||
|
||
void setConsumes(edm::ConsumesCollector&) override final; | ||
void getEventContent(const edm::EventBase&) override final; | ||
|
||
CandidateType candidateType() const override final { | ||
return PHOTON; | ||
} | ||
|
||
private: | ||
// Cut values | ||
float _C1_EB; | ||
float _C2_EB; | ||
float _C3_EB; | ||
float _C1_EE; | ||
float _C2_EE; | ||
// Configuration | ||
float _barrelCutOff; | ||
bool _useRelativeIso; | ||
// Effective area constants | ||
EffectiveAreas _effectiveAreas; | ||
// The isolations computed upstream | ||
edm::Handle<edm::ValueMap<float> > _anyPFIsoMap; | ||
// The rho | ||
edm::Handle< double > _rhoHandle; | ||
|
||
constexpr static char anyPFIsoWithEA_[] = "anyPFIsoWithEA"; | ||
constexpr static char rhoString_ [] = "rho"; | ||
}; | ||
|
||
constexpr char PhoAnyPFIsoWithEAAndExpoScalingEBCut::anyPFIsoWithEA_[]; | ||
constexpr char PhoAnyPFIsoWithEAAndExpoScalingEBCut::rhoString_[]; | ||
|
||
DEFINE_EDM_PLUGIN(CutApplicatorFactory, | ||
PhoAnyPFIsoWithEAAndExpoScalingEBCut, | ||
"PhoAnyPFIsoWithEAAndExpoScalingEBCut"); | ||
|
||
PhoAnyPFIsoWithEAAndExpoScalingEBCut::PhoAnyPFIsoWithEAAndExpoScalingEBCut(const edm::ParameterSet& c) : | ||
CutApplicatorWithEventContentBase(c), | ||
_C1_EB(c.getParameter<double>("C1_EB")), | ||
_C2_EB(c.getParameter<double>("C2_EB")), | ||
_C3_EB(c.getParameter<double>("C3_EB")), | ||
_C1_EE(c.getParameter<double>("C1_EE")), | ||
_C2_EE(c.getParameter<double>("C2_EE")), | ||
_barrelCutOff(c.getParameter<double>("barrelCutOff")), | ||
_useRelativeIso(c.getParameter<bool>("useRelativeIso")), | ||
_effectiveAreas( (c.getParameter<edm::FileInPath>("effAreasConfigFile")).fullPath()) | ||
{ | ||
|
||
edm::InputTag maptag = c.getParameter<edm::InputTag>("anyPFIsoMap"); | ||
contentTags_.emplace(anyPFIsoWithEA_,maptag); | ||
|
||
edm::InputTag rhoTag = c.getParameter<edm::InputTag>("rho"); | ||
contentTags_.emplace(rhoString_,rhoTag); | ||
|
||
} | ||
|
||
void PhoAnyPFIsoWithEAAndExpoScalingEBCut::setConsumes(edm::ConsumesCollector& cc) { | ||
auto anyPFIsoWithEA = | ||
cc.consumes<edm::ValueMap<float> >(contentTags_[anyPFIsoWithEA_]); | ||
contentTokens_.emplace(anyPFIsoWithEA_,anyPFIsoWithEA); | ||
|
||
auto rho = cc.consumes<double>(contentTags_[rhoString_]); | ||
contentTokens_.emplace(rhoString_, rho); | ||
} | ||
|
||
void PhoAnyPFIsoWithEAAndExpoScalingEBCut::getEventContent(const edm::EventBase& ev) { | ||
ev.getByLabel(contentTags_[anyPFIsoWithEA_],_anyPFIsoMap); | ||
ev.getByLabel(contentTags_[rhoString_],_rhoHandle); | ||
} | ||
|
||
CutApplicatorBase::result_type | ||
PhoAnyPFIsoWithEAAndExpoScalingEBCut:: | ||
operator()(const reco::PhotonPtr& cand) const{ | ||
|
||
// Figure out the cut value | ||
// The value is generally pt-dependent: C1 + pt * C2 | ||
const float pt = cand->pt(); | ||
|
||
// In this version of the isolation cut we apply | ||
// exponential pt scaling to the barrel isolation cut, | ||
// and linear pt scaling to the endcap isolation cut. | ||
double absEta = std::abs(cand->superCluster()->position().eta()); | ||
const float isolationCutValue = | ||
( absEta < _barrelCutOff ? | ||
_C1_EB + exp( pt*_C2_EB + _C3_EB) | ||
: _C1_EE + pt * _C2_EE); | ||
|
||
// Retrieve the variable value for this particle | ||
float anyPFIso = (*_anyPFIsoMap)[cand]; | ||
|
||
// Apply pile-up correction | ||
double eA = _effectiveAreas.getEffectiveArea( absEta ); | ||
double rho = *_rhoHandle; | ||
float anyPFIsoWithEA = std::max(0.0, anyPFIso - rho * eA); | ||
|
||
// Divide by pT if the relative isolation is requested | ||
if( _useRelativeIso ) | ||
anyPFIsoWithEA /= pt; | ||
|
||
// Apply the cut and return the result | ||
return anyPFIsoWithEA < isolationCutValue; | ||
} |
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
66 changes: 66 additions & 0 deletions
66
RecoEgamma/PhotonIdentification/plugins/cuts/PhoFull5x5SigmaIEtaIEtaValueMapCut.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,66 @@ | ||
#include "PhysicsTools/SelectorUtils/interface/CutApplicatorWithEventContentBase.h" | ||
#include "DataFormats/EgammaCandidates/interface/Photon.h" | ||
|
||
class PhoFull5x5SigmaIEtaIEtaValueMapCut : public CutApplicatorWithEventContentBase { | ||
public: | ||
PhoFull5x5SigmaIEtaIEtaValueMapCut(const edm::ParameterSet& c); | ||
|
||
result_type operator()(const reco::PhotonPtr&) const override final; | ||
|
||
void setConsumes(edm::ConsumesCollector&) override final; | ||
void getEventContent(const edm::EventBase&) override final; | ||
|
||
CandidateType candidateType() const override final { | ||
return PHOTON; | ||
} | ||
|
||
private: | ||
float _cutValueEB; | ||
float _cutValueEE; | ||
float _barrelCutOff; | ||
edm::Handle<edm::ValueMap<float> > _full5x5SigmaIEtaIEtaMap; | ||
|
||
constexpr static char full5x5SigmaIEtaIEta_[] = "full5x5SigmaIEtaIEta"; | ||
}; | ||
|
||
constexpr char PhoFull5x5SigmaIEtaIEtaValueMapCut::full5x5SigmaIEtaIEta_[]; | ||
|
||
DEFINE_EDM_PLUGIN(CutApplicatorFactory, | ||
PhoFull5x5SigmaIEtaIEtaValueMapCut, | ||
"PhoFull5x5SigmaIEtaIEtaValueMapCut"); | ||
|
||
PhoFull5x5SigmaIEtaIEtaValueMapCut::PhoFull5x5SigmaIEtaIEtaValueMapCut(const edm::ParameterSet& c) : | ||
CutApplicatorWithEventContentBase(c), | ||
_cutValueEB(c.getParameter<double>("cutValueEB")), | ||
_cutValueEE(c.getParameter<double>("cutValueEE")), | ||
_barrelCutOff(c.getParameter<double>("barrelCutOff")) { | ||
|
||
edm::InputTag maptag = c.getParameter<edm::InputTag>("full5x5SigmaIEtaIEtaMap"); | ||
contentTags_.emplace(full5x5SigmaIEtaIEta_,maptag); | ||
} | ||
|
||
void PhoFull5x5SigmaIEtaIEtaValueMapCut::setConsumes(edm::ConsumesCollector& cc) { | ||
auto full5x5SigmaIEtaIEta = | ||
cc.consumes<edm::ValueMap<float> >(contentTags_[full5x5SigmaIEtaIEta_]); | ||
contentTokens_.emplace(full5x5SigmaIEtaIEta_,full5x5SigmaIEtaIEta); | ||
} | ||
|
||
void PhoFull5x5SigmaIEtaIEtaValueMapCut::getEventContent(const edm::EventBase& ev) { | ||
ev.getByLabel(contentTags_[full5x5SigmaIEtaIEta_],_full5x5SigmaIEtaIEtaMap); | ||
} | ||
|
||
CutApplicatorBase::result_type | ||
PhoFull5x5SigmaIEtaIEtaValueMapCut:: | ||
operator()(const reco::PhotonPtr& cand) const{ | ||
|
||
// Figure out the cut value | ||
const float cutValue = | ||
( std::abs(cand->superCluster()->position().eta()) < _barrelCutOff ? | ||
_cutValueEB : _cutValueEE ); | ||
|
||
// Retrieve the variable value for this particle | ||
const float full5x5SigmaIEtaIEta = (*_full5x5SigmaIEtaIEtaMap)[cand]; | ||
|
||
// Apply the cut and return the result | ||
return full5x5SigmaIEtaIEta < cutValue; | ||
} |
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.