CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
PhoFull5x5SigmaIEtaIEtaValueMapCut Class Reference
Inheritance diagram for PhoFull5x5SigmaIEtaIEtaValueMapCut:
CutApplicatorWithEventContentBase CutApplicatorBase candidate_functions::CandidateCut

Public Member Functions

CandidateType candidateType () const final
 
void getEventContent (const edm::EventBase &) final
 
result_type operator() (const reco::PhotonPtr &) const final
 
 PhoFull5x5SigmaIEtaIEtaValueMapCut (const edm::ParameterSet &c)
 
void setConsumes (edm::ConsumesCollector &) final
 
double value (const reco::CandidatePtr &cand) const final
 
- Public Member Functions inherited from CutApplicatorWithEventContentBase
 CutApplicatorWithEventContentBase ()
 
 CutApplicatorWithEventContentBase (const edm::ParameterSet &c)
 
 CutApplicatorWithEventContentBase (const CutApplicatorWithEventContentBase &)=delete
 
CutApplicatorWithEventContentBaseoperator= (const CutApplicatorWithEventContentBase &)=delete
 
 ~CutApplicatorWithEventContentBase () override
 Destructor. More...
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) const
 
 CutApplicatorBase ()
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
const std::string & name () const override
 
result_type operator() (const argument_type &) const override final
 
virtual result_type operator() (const reco::GsfElectronPtr &) const
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const pat::PhotonPtr &) const
 
virtual result_type operator() (const reco::MuonPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) const
 
CutApplicatorBaseoperator= (const CutApplicatorBase &)=delete
 
 ~CutApplicatorBase () override
 Destructor. More...
 
- Public Member Functions inherited from candidate_functions::CandidateCut
 CandidateCut ()
 
virtual ~CandidateCut ()
 

Private Attributes

const float _barrelCutOff
 
const float _cutValueEB
 
const float _cutValueEE
 
edm::Handle< edm::ValueMap< float > > _full5x5SigmaIEtaIEtaMap
 

Static Private Attributes

static char full5x5SigmaIEtaIEta_ [] = "full5x5SigmaIEtaIEta"
 

Additional Inherited Members

- Public Types inherited from CutApplicatorBase
enum  CandidateType {
  NONE, ELECTRON, MUON, PHOTON,
  TAU, PATELECTRON, PATMUON, PATPHOTON,
  PATTAU
}
 
- Protected Attributes inherited from CutApplicatorWithEventContentBase
std::unordered_map< std::string, edm::InputTagcontentTags_
 
std::unordered_map< std::string, edm::EDGetTokencontentTokens_
 

Detailed Description

Definition at line 4 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Constructor & Destructor Documentation

PhoFull5x5SigmaIEtaIEtaValueMapCut::PhoFull5x5SigmaIEtaIEtaValueMapCut ( const edm::ParameterSet c)

Definition at line 34 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, full5x5SigmaIEtaIEta_, and edm::ParameterSet::getParameter().

34  :
36  _cutValueEB(c.getParameter<double>("cutValueEB")),
37  _cutValueEE(c.getParameter<double>("cutValueEE")),
38  _barrelCutOff(c.getParameter<double>("barrelCutOff")) {
39 
40  edm::InputTag maptag = c.getParameter<edm::InputTag>("full5x5SigmaIEtaIEtaMap");
41  contentTags_.emplace(full5x5SigmaIEtaIEta_,maptag);
42 }
T getParameter(std::string const &) const
std::unordered_map< std::string, edm::InputTag > contentTags_

Member Function Documentation

CandidateType PhoFull5x5SigmaIEtaIEtaValueMapCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 15 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

References CutApplicatorBase::PHOTON.

15  {
16  return PHOTON;
17  }
void PhoFull5x5SigmaIEtaIEtaValueMapCut::getEventContent ( const edm::EventBase ev)
finalvirtual
CutApplicatorBase::result_type PhoFull5x5SigmaIEtaIEtaValueMapCut::operator() ( const reco::PhotonPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 56 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

References _barrelCutOff, _cutValueEB, _cutValueEE, _full5x5SigmaIEtaIEtaMap, funct::abs(), edm::ValueMap< T >::begin(), edm::ValueMap< T >::contains(), reco::Photon::full5x5_sigmaIetaIeta(), edm::Ptr< T >::id(), edm::ValueMap< T >::idSize(), edm::HandleBase::isValid(), edm::Ptr< T >::key(), reco::Photon::superCluster(), and value().

Referenced by getEventContent().

56  {
57 
58  // Figure out the cut value
59  const float cutValue =
60  ( std::abs(cand->superCluster()->eta()) < _barrelCutOff ?
62  float sihihval = -1.0;
64  sihihval = (*_full5x5SigmaIEtaIEtaMap)[cand];
66  cand.id() == edm::ProductID() ) {
67  // in case we have spoofed a ptr
68  //note this must be a 1:1 valuemap (only one product input)
69  sihihval = _full5x5SigmaIEtaIEtaMap->begin()[cand.key()];
70  } else if ( _full5x5SigmaIEtaIEtaMap.isValid() ){ // throw an exception
71  sihihval = (*_full5x5SigmaIEtaIEtaMap)[cand];
72  }
73 
74  // Retrieve the variable value for this particle
75  const float full5x5SigmaIEtaIEta = _full5x5SigmaIEtaIEtaMap.isValid() ? sihihval : cand->full5x5_sigmaIetaIeta();
76 
77  // Apply the cut and return the result
78  return full5x5SigmaIEtaIEta < cutValue;
79 }
key_type key() const
Definition: Ptr.h:185
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
bool contains(ProductID id) const
Definition: ValueMap.h:155
float full5x5_sigmaIetaIeta() const
Definition: Photon.h:243
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
size_t idSize() const
Definition: ValueMap.h:159
const_iterator begin() const
Definition: ValueMap.h:208
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:180
edm::Handle< edm::ValueMap< float > > _full5x5SigmaIEtaIEtaMap
void PhoFull5x5SigmaIEtaIEtaValueMapCut::setConsumes ( edm::ConsumesCollector cc)
finalvirtual
double PhoFull5x5SigmaIEtaIEtaValueMapCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 82 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

References _full5x5SigmaIEtaIEtaMap, edm::ValueMap< T >::begin(), edm::ValueMap< T >::contains(), reco::Photon::full5x5_sigmaIetaIeta(), edm::Ptr< T >::id(), edm::ValueMap< T >::idSize(), edm::HandleBase::isValid(), and edm::Ptr< T >::key().

Referenced by operator()().

82  {
83  reco::PhotonPtr pho(cand);
84  float sihihval = -1.0;
86  sihihval = (*_full5x5SigmaIEtaIEtaMap)[cand];
88  cand.id() == edm::ProductID() ) {
89  // in case we have spoofed a ptr
90  //note this must be a 1:1 valuemap (only one product input)
91  sihihval = _full5x5SigmaIEtaIEtaMap->begin()[cand.key()];
92  } else if ( _full5x5SigmaIEtaIEtaMap.isValid() ){ // throw an exception
93  sihihval = (*_full5x5SigmaIEtaIEtaMap)[cand];
94  }
95 
96  return _full5x5SigmaIEtaIEtaMap.isValid() ? sihihval : pho->full5x5_sigmaIetaIeta();
97 }
key_type key() const
Definition: Ptr.h:185
bool contains(ProductID id) const
Definition: ValueMap.h:155
bool isValid() const
Definition: HandleBase.h:74
size_t idSize() const
Definition: ValueMap.h:159
const_iterator begin() const
Definition: ValueMap.h:208
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:180
edm::Handle< edm::ValueMap< float > > _full5x5SigmaIEtaIEtaMap

Member Data Documentation

const float PhoFull5x5SigmaIEtaIEtaValueMapCut::_barrelCutOff
private

Definition at line 22 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Referenced by operator()().

const float PhoFull5x5SigmaIEtaIEtaValueMapCut::_cutValueEB
private

Definition at line 20 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Referenced by operator()().

const float PhoFull5x5SigmaIEtaIEtaValueMapCut::_cutValueEE
private

Definition at line 21 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Referenced by operator()().

edm::Handle<edm::ValueMap<float> > PhoFull5x5SigmaIEtaIEtaValueMapCut::_full5x5SigmaIEtaIEtaMap
private

Definition at line 23 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Referenced by getEventContent(), operator()(), and value().

char PhoFull5x5SigmaIEtaIEtaValueMapCut::full5x5SigmaIEtaIEta_ = "full5x5SigmaIEtaIEta"
staticprivate