CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 overridefinal
 
void getEventContent (const edm::EventBase &) overridefinal
 
result_type operator() (const reco::PhotonPtr &) const overridefinal
 
 PhoFull5x5SigmaIEtaIEtaValueMapCut (const edm::ParameterSet &c)
 
void setConsumes (edm::ConsumesCollector &) overridefinal
 
double value (const reco::CandidatePtr &cand) const overridefinal
 
- Public Member Functions inherited from CutApplicatorWithEventContentBase
 CutApplicatorWithEventContentBase ()
 
 CutApplicatorWithEventContentBase (const edm::ParameterSet &c)
 
 CutApplicatorWithEventContentBase (const CutApplicatorWithEventContentBase &)=delete
 
CutApplicatorWithEventContentBaseoperator= (const CutApplicatorWithEventContentBase &)=delete
 
virtual ~CutApplicatorWithEventContentBase ()
 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
 
virtual const std::string & name () const
 
virtual result_type operator() (const argument_type &) const 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
 
virtual ~CutApplicatorBase ()
 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::InputTag
contentTags_
 
std::unordered_map
< std::string, edm::EDGetToken
contentTokens_
 

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
inlinefinaloverridevirtual

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)
finaloverridevirtual
CutApplicatorBase::result_type PhoFull5x5SigmaIEtaIEtaValueMapCut::operator() ( const reco::PhotonPtr cand) const
finaloverridevirtual

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(), edm::Ptr< T >::id(), edm::ValueMap< T >::idSize(), edm::HandleBase::isValid(), and edm::Ptr< T >::key().

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:186
bool contains(ProductID id) const
Definition: ValueMap.h:154
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:75
size_t idSize() const
Definition: ValueMap.h:158
const_iterator begin() const
Definition: ValueMap.h:209
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:181
edm::Handle< edm::ValueMap< float > > _full5x5SigmaIEtaIEtaMap
void PhoFull5x5SigmaIEtaIEtaValueMapCut::setConsumes ( edm::ConsumesCollector cc)
finaloverridevirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 44 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

References edm::ConsumesCollector::consumes(), CutApplicatorWithEventContentBase::contentTags_, CutApplicatorWithEventContentBase::contentTokens_, and full5x5SigmaIEtaIEta_.

44  {
45  auto full5x5SigmaIEtaIEta =
47  contentTokens_.emplace(full5x5SigmaIEtaIEta_,full5x5SigmaIEtaIEta);
48 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::unordered_map< std::string, edm::InputTag > contentTags_
double PhoFull5x5SigmaIEtaIEtaValueMapCut::value ( const reco::CandidatePtr cand) const
finaloverridevirtual

Implements candidate_functions::CandidateCut.

Definition at line 82 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

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

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:186
bool contains(ProductID id) const
Definition: ValueMap.h:154
bool isValid() const
Definition: HandleBase.h:75
size_t idSize() const
Definition: ValueMap.h:158
const_iterator begin() const
Definition: ValueMap.h:209
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:181
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