CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
IsoPhotonEBSelector Class Reference

Public Member Functions

const float getEffectiveArea (float eta) const
 
 IsoPhotonEBSelector (const edm::ParameterSet &, edm::ConsumesCollector &iC)
 
void newEvent (const edm::Event &, const edm::EventSetup &)
 
bool operator() (const reco::Photon &) const
 
void printEffectiveAreas () const
 

Public Attributes

const std::vector< double > absEtaMax_
 
const std::vector< double > absEtaMin_
 
const std::vector< double > effectiveAreaValues_
 
const vector< double > hOverECut_
 
const edm::ParameterSet phIDWP_
 
const vector< double > relCombIso_
 
edm::Handle< double > rhoHandle_
 
const vector< double > sigmaIEtaIEtaCut_
 
const edm::EDGetTokenT< double > theRhoToken_
 

Detailed Description

Definition at line 42 of file IsoPhotonEBSelector.cc.

Constructor & Destructor Documentation

◆ IsoPhotonEBSelector()

IsoPhotonEBSelector::IsoPhotonEBSelector ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)

Definition at line 84 of file IsoPhotonEBSelector.cc.

85  : theRhoToken_(iC.consumes<double>(cfg.getParameter<edm::InputTag>("rho"))),
86  absEtaMin_(cfg.getParameter<std::vector<double> >("absEtaMin")),
87  absEtaMax_(cfg.getParameter<std::vector<double> >("absEtaMax")),
88  effectiveAreaValues_(cfg.getParameter<std::vector<double> >("effectiveAreaValues")),
89  phIDWP_(cfg.getParameter<edm::ParameterSet>("phID")),
90  sigmaIEtaIEtaCut_(phIDWP_.getParameter<std::vector<double> >("full5x5_sigmaIEtaIEtaCut")),
91  hOverECut_(phIDWP_.getParameter<std::vector<double> >("hOverECut")),
92  relCombIso_(phIDWP_.getParameter<std::vector<double> >("relCombIsolationWithEACut")) {
93  //printEffectiveAreas();
94 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const vector< double > hOverECut_
const edm::ParameterSet phIDWP_
const vector< double > relCombIso_
const std::vector< double > absEtaMin_
const std::vector< double > effectiveAreaValues_
const std::vector< double > absEtaMax_
const edm::EDGetTokenT< double > theRhoToken_
const vector< double > sigmaIEtaIEtaCut_

Member Function Documentation

◆ getEffectiveArea()

const float IsoPhotonEBSelector::getEffectiveArea ( float  eta) const

Definition at line 71 of file IsoPhotonEBSelector.cc.

References funct::abs(), PVValHelper::eta, l1tPhase2CaloJetEmulator_cfi::iEta, L1TMuonDQMOffline_cfi::nEtaBins, and parallelization::uint.

Referenced by operator()().

71  {
72  float effArea = 0;
73  uint nEtaBins = absEtaMin_.size();
74  for (uint iEta = 0; iEta < nEtaBins; iEta++) {
76  effArea = effectiveAreaValues_[iEta];
77  break;
78  }
79  }
80 
81  return effArea;
82 }
const std::vector< double > absEtaMin_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const std::vector< double > effectiveAreaValues_
const std::vector< double > absEtaMax_

◆ newEvent()

void IsoPhotonEBSelector::newEvent ( const edm::Event ev,
const edm::EventSetup  
)

Definition at line 96 of file IsoPhotonEBSelector.cc.

References makeMEIFBenchmarkPlots::ev, rhoHandle_, and theRhoToken_.

96  {
97  ev.getByToken(theRhoToken_, rhoHandle_);
98 }
edm::Handle< double > rhoHandle_
const edm::EDGetTokenT< double > theRhoToken_

◆ operator()()

bool IsoPhotonEBSelector::operator() ( const reco::Photon ph) const

Definition at line 100 of file IsoPhotonEBSelector.cc.

References ALCARECOEcalPhiSym_cff::float, getEffectiveArea(), hOverECut_, edm::HandleBase::isValid(), WZElectronSkims53X_cff::max, position, edm::Handle< T >::product(), relCombIso_, rho, rhoHandle_, and sigmaIEtaIEtaCut_.

100  {
101  float pt_e = ph.pt();
102  unsigned int ind = 0;
103  float abseta = fabs((ph.superCluster().get())->position().eta());
104 
105  if (ph.isEB()) {
106  if (abseta > 1.479)
107  return false; // check if it is really needed
108  }
109  if (ph.isEE()) {
110  ind = 1;
111  if (abseta <= 1.479 || abseta >= 2.5)
112  return false; // check if it is really needed
113  }
114 
115  if (ph.full5x5_sigmaIetaIeta() > sigmaIEtaIEtaCut_[ind])
116  return false;
117  if (ph.hadronicOverEm() > hOverECut_[ind])
118  return false;
119  const float eA = getEffectiveArea(abseta);
120  const float rho = rhoHandle_.isValid() ? (float)(*rhoHandle_.product()) : 0;
121  if ((ph.getPflowIsolationVariables().chargedHadronIso +
122  std::max(float(0.0),
123  ph.getPflowIsolationVariables().neutralHadronIso + ph.getPflowIsolationVariables().photonIso -
124  eA * rho)) > relCombIso_[ind] * pt_e)
125  return false;
126 
127  return true;
128 }
T const * product() const
Definition: Handle.h:70
edm::Handle< double > rhoHandle_
const vector< double > hOverECut_
const vector< double > relCombIso_
bool isValid() const
Definition: HandleBase.h:70
const float getEffectiveArea(float eta) const
static int position[264][3]
Definition: ReadPGInfo.cc:289
const vector< double > sigmaIEtaIEtaCut_

◆ printEffectiveAreas()

void IsoPhotonEBSelector::printEffectiveAreas ( ) const

Definition at line 64 of file IsoPhotonEBSelector.cc.

References l1tPhase2CaloJetEmulator_cfi::iEta, L1TMuonDQMOffline_cfi::nEtaBins, and parallelization::uint.

64  {
65  printf(" eta_min eta_max effective area\n");
66  uint nEtaBins = absEtaMin_.size();
67  for (uint iEta = 0; iEta < nEtaBins; iEta++) {
68  printf(" %8.4f %8.4f %8.5f\n", absEtaMin_[iEta], absEtaMax_[iEta], effectiveAreaValues_[iEta]);
69  }
70 }
const std::vector< double > absEtaMin_
const std::vector< double > effectiveAreaValues_
const std::vector< double > absEtaMax_

Member Data Documentation

◆ absEtaMax_

const std::vector<double> IsoPhotonEBSelector::absEtaMax_

Definition at line 54 of file IsoPhotonEBSelector.cc.

◆ absEtaMin_

const std::vector<double> IsoPhotonEBSelector::absEtaMin_

Definition at line 53 of file IsoPhotonEBSelector.cc.

◆ effectiveAreaValues_

const std::vector<double> IsoPhotonEBSelector::effectiveAreaValues_

Definition at line 55 of file IsoPhotonEBSelector.cc.

◆ hOverECut_

const vector<double> IsoPhotonEBSelector::hOverECut_

Definition at line 60 of file IsoPhotonEBSelector.cc.

Referenced by operator()().

◆ phIDWP_

const edm::ParameterSet IsoPhotonEBSelector::phIDWP_

Definition at line 57 of file IsoPhotonEBSelector.cc.

◆ relCombIso_

const vector<double> IsoPhotonEBSelector::relCombIso_

Definition at line 61 of file IsoPhotonEBSelector.cc.

Referenced by operator()().

◆ rhoHandle_

edm::Handle<double> IsoPhotonEBSelector::rhoHandle_

Definition at line 51 of file IsoPhotonEBSelector.cc.

Referenced by newEvent(), and operator()().

◆ sigmaIEtaIEtaCut_

const vector<double> IsoPhotonEBSelector::sigmaIEtaIEtaCut_

Definition at line 59 of file IsoPhotonEBSelector.cc.

Referenced by operator()().

◆ theRhoToken_

const edm::EDGetTokenT<double> IsoPhotonEBSelector::theRhoToken_

Definition at line 50 of file IsoPhotonEBSelector.cc.

Referenced by newEvent().