Skip to content

Commit

Permalink
Merge pull request #14 from ikrav/egm_id_74X_v0
Browse files Browse the repository at this point in the history
Updated pho/ele ID for 740
  • Loading branch information
lgray committed May 2, 2015
2 parents 90dff36 + 74a8412 commit df1df46
Show file tree
Hide file tree
Showing 10 changed files with 668 additions and 110 deletions.
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
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
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
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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class PhoAnyPFIsoWithEACut : public CutApplicatorWithEventContentBase {

private:
// Cut values
float _anyPFIsoWithEACutValue_C1_EB;
float _anyPFIsoWithEACutValue_C2_EB;
float _anyPFIsoWithEACutValue_C1_EE;
float _anyPFIsoWithEACutValue_C2_EE;
float _C1_EB;
float _C2_EB;
float _C1_EE;
float _C2_EE;
// Configuration
float _barrelCutOff;
bool _useRelativeIso;
Expand All @@ -45,10 +45,10 @@ DEFINE_EDM_PLUGIN(CutApplicatorFactory,

PhoAnyPFIsoWithEACut::PhoAnyPFIsoWithEACut(const edm::ParameterSet& c) :
CutApplicatorWithEventContentBase(c),
_anyPFIsoWithEACutValue_C1_EB(c.getParameter<double>("anyPFIsoWithEACutValue_C1_EB")),
_anyPFIsoWithEACutValue_C2_EB(c.getParameter<double>("anyPFIsoWithEACutValue_C2_EB")),
_anyPFIsoWithEACutValue_C1_EE(c.getParameter<double>("anyPFIsoWithEACutValue_C1_EE")),
_anyPFIsoWithEACutValue_C2_EE(c.getParameter<double>("anyPFIsoWithEACutValue_C2_EE")),
_C1_EB(c.getParameter<double>("C1_EB")),
_C2_EB(c.getParameter<double>("C2_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())
Expand Down Expand Up @@ -85,9 +85,9 @@ operator()(const reco::PhotonPtr& cand) const{
double absEta = std::abs(cand->superCluster()->position().eta());
const float anyPFIsoWithEACutValue =
( absEta < _barrelCutOff ?
_anyPFIsoWithEACutValue_C1_EB + cand->pt() * _anyPFIsoWithEACutValue_C2_EB
_C1_EB + cand->pt() * _C2_EB
:
_anyPFIsoWithEACutValue_C1_EE + cand->pt() * _anyPFIsoWithEACutValue_C2_EE
_C1_EE + cand->pt() * _C2_EE
);

// Retrieve the variable value for this particle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,31 @@
#include "PhysicsTools/SelectorUtils/interface/CutApplicatorWithEventContentBase.h"
#include "PhysicsTools/SelectorUtils/interface/CutApplicatorBase.h"
#include "DataFormats/EgammaCandidates/interface/Photon.h"

class PhoFull5x5SigmaIEtaIEtaCut : public CutApplicatorWithEventContentBase {
class PhoFull5x5SigmaIEtaIEtaCut : public CutApplicatorBase {
public:
PhoFull5x5SigmaIEtaIEtaCut(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 _full5x5SigmaIEtaIEtaCutValueEB;
float _full5x5SigmaIEtaIEtaCutValueEE;
float _cutValueEB;
float _cutValueEE;
float _barrelCutOff;
edm::Handle<edm::ValueMap<float> > _full5x5SigmaIEtaIEtaMap;

constexpr static char full5x5SigmaIEtaIEta_[] = "full5x5SigmaIEtaIEta";
};

constexpr char PhoFull5x5SigmaIEtaIEtaCut::full5x5SigmaIEtaIEta_[];

DEFINE_EDM_PLUGIN(CutApplicatorFactory,
PhoFull5x5SigmaIEtaIEtaCut,
"PhoFull5x5SigmaIEtaIEtaCut");

PhoFull5x5SigmaIEtaIEtaCut::PhoFull5x5SigmaIEtaIEtaCut(const edm::ParameterSet& c) :
CutApplicatorWithEventContentBase(c),
_full5x5SigmaIEtaIEtaCutValueEB(c.getParameter<double>("full5x5SigmaIEtaIEtaCutValueEB")),
_full5x5SigmaIEtaIEtaCutValueEE(c.getParameter<double>("full5x5SigmaIEtaIEtaCutValueEE")),
CutApplicatorBase(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 PhoFull5x5SigmaIEtaIEtaCut::setConsumes(edm::ConsumesCollector& cc) {
auto full5x5SigmaIEtaIEta =
cc.consumes<edm::ValueMap<float> >(contentTags_[full5x5SigmaIEtaIEta_]);
contentTokens_.emplace(full5x5SigmaIEtaIEta_,full5x5SigmaIEtaIEta);
}

void PhoFull5x5SigmaIEtaIEtaCut::getEventContent(const edm::EventBase& ev) {
ev.getByLabel(contentTags_[full5x5SigmaIEtaIEta_],_full5x5SigmaIEtaIEtaMap);
}

CutApplicatorBase::result_type
Expand All @@ -56,11 +35,8 @@ operator()(const reco::PhotonPtr& cand) const{
// Figure out the cut value
const float full5x5SigmaIEtaIEtaCutValue =
( std::abs(cand->superCluster()->position().eta()) < _barrelCutOff ?
_full5x5SigmaIEtaIEtaCutValueEB : _full5x5SigmaIEtaIEtaCutValueEE );

// Retrieve the variable value for this particle
const float full5x5SigmaIEtaIEta = (*_full5x5SigmaIEtaIEtaMap)[cand];
_cutValueEB : _cutValueEE );

// Apply the cut and return the result
return full5x5SigmaIEtaIEta < full5x5SigmaIEtaIEtaCutValue;
return cand->full5x5_sigmaIetaIeta() < full5x5SigmaIEtaIEtaCutValue;
}
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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
#

central_id_registry.register(cutBasedPhotonID_PHYS14_PU20bx25_V1_standalone_loose.idName,
'dd6bfd9474187cd31aeaabf90f2a51ca')
'28dabb0be297b7a5eb26df8ffeef22b9')
central_id_registry.register(cutBasedPhotonID_PHYS14_PU20bx25_V1_standalone_medium.idName,
'38324dea128c659171cfc517c4327c97')
'd3d464d7b45f94f3944de95a1c0f498e')
central_id_registry.register(cutBasedPhotonID_PHYS14_PU20bx25_V1_standalone_tight.idName,
'ee67005da6543678d1d3f9d12ecbd6bd')
'c61288dd4defe947df67dafc2e868d15')
Loading

0 comments on commit df1df46

Please sign in to comment.