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 final
 
virtual result_type operator() (const reco::GsfElectronPtr &) const
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const reco::MuonPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) 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
}
 
- Public Types inherited from candidate_functions::CandidateCut
using argument_type = reco::CandidatePtr
 
using result_type = bool
 
- 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 30 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

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

32  _cutValueEB(c.getParameter<double>("cutValueEB")),
33  _cutValueEE(c.getParameter<double>("cutValueEE")),
34  _barrelCutOff(c.getParameter<double>("barrelCutOff")) {
35  edm::InputTag maptag = c.getParameter<edm::InputTag>("full5x5SigmaIEtaIEtaMap");
36  contentTags_.emplace(full5x5SigmaIEtaIEta_, maptag);
37 }
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.

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 48 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().

48  {
49  // Figure out the cut value
50  const float cutValue = (std::abs(cand->superCluster()->eta()) < _barrelCutOff ? _cutValueEB : _cutValueEE);
51  float sihihval = -1.0;
53  sihihval = (*_full5x5SigmaIEtaIEtaMap)[cand];
55  cand.id() == edm::ProductID()) {
56  // in case we have spoofed a ptr
57  //note this must be a 1:1 valuemap (only one product input)
58  sihihval = _full5x5SigmaIEtaIEtaMap->begin()[cand.key()];
59  } else if (_full5x5SigmaIEtaIEtaMap.isValid()) { // throw an exception
60  sihihval = (*_full5x5SigmaIEtaIEtaMap)[cand];
61  }
62 
63  // Retrieve the variable value for this particle
64  const float full5x5SigmaIEtaIEta = _full5x5SigmaIEtaIEtaMap.isValid() ? sihihval : cand->full5x5_sigmaIetaIeta();
65 
66  // Apply the cut and return the result
67  return full5x5SigmaIEtaIEta < cutValue;
68 }
key_type key() const
Definition: Ptr.h:163
bool contains(ProductID id) const
Definition: ValueMap.h:155
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:70
size_t idSize() const
Definition: ValueMap.h:157
const_iterator begin() const
Definition: ValueMap.h:229
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:158
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 70 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().

70  {
71  reco::PhotonPtr pho(cand);
72  float sihihval = -1.0;
74  sihihval = (*_full5x5SigmaIEtaIEtaMap)[cand];
76  cand.id() == edm::ProductID()) {
77  // in case we have spoofed a ptr
78  //note this must be a 1:1 valuemap (only one product input)
79  sihihval = _full5x5SigmaIEtaIEtaMap->begin()[cand.key()];
80  } else if (_full5x5SigmaIEtaIEtaMap.isValid()) { // throw an exception
81  sihihval = (*_full5x5SigmaIEtaIEtaMap)[cand];
82  }
83 
84  return _full5x5SigmaIEtaIEtaMap.isValid() ? sihihval : pho->full5x5_sigmaIetaIeta();
85 }
key_type key() const
Definition: Ptr.h:163
bool contains(ProductID id) const
Definition: ValueMap.h:155
bool isValid() const
Definition: HandleBase.h:70
size_t idSize() const
Definition: ValueMap.h:157
const_iterator begin() const
Definition: ValueMap.h:229
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:158
edm::Handle< edm::ValueMap< float > > _full5x5SigmaIEtaIEtaMap

Member Data Documentation

const float PhoFull5x5SigmaIEtaIEtaValueMapCut::_barrelCutOff
private

Definition at line 20 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Referenced by operator()().

const float PhoFull5x5SigmaIEtaIEtaValueMapCut::_cutValueEB
private

Definition at line 18 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Referenced by operator()().

const float PhoFull5x5SigmaIEtaIEtaValueMapCut::_cutValueEE
private

Definition at line 19 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Referenced by operator()().

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

Definition at line 21 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

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

char PhoFull5x5SigmaIEtaIEtaValueMapCut::full5x5SigmaIEtaIEta_ = "full5x5SigmaIEtaIEta"
staticprivate