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 CutApplicatorWithEventContentBase &)=delete
 
 CutApplicatorWithEventContentBase (const edm::ParameterSet &c)
 
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 CutApplicatorBase &)=delete
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
const std::string & name () const override
 
result_type operator() (const argument_type &) const final
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const reco::GsfElectronPtr &) const
 
virtual result_type operator() (const reco::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

constexpr 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::PhoFull5x5SigmaIEtaIEtaValueMapCut ( const edm::ParameterSet c)

Definition at line 30 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

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 }

References c, CutApplicatorWithEventContentBase::contentTags_, and full5x5SigmaIEtaIEta_.

Member Function Documentation

◆ candidateType()

CandidateType PhoFull5x5SigmaIEtaIEtaValueMapCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 15 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

15 { return PHOTON; }

References CutApplicatorBase::PHOTON.

◆ getEventContent()

void PhoFull5x5SigmaIEtaIEtaValueMapCut::getEventContent ( const edm::EventBase ev)
finalvirtual

◆ operator()()

CutApplicatorBase::result_type PhoFull5x5SigmaIEtaIEtaValueMapCut::operator() ( const reco::PhotonPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 48 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

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 }

References _barrelCutOff, _cutValueEB, _cutValueEE, _full5x5SigmaIEtaIEtaMap, funct::abs(), edm::ValueMap< T >::begin(), edm::ValueMap< T >::contains(), edm::ValueMap< T >::idSize(), and edm::HandleBase::isValid().

◆ setConsumes()

void PhoFull5x5SigmaIEtaIEtaValueMapCut::setConsumes ( edm::ConsumesCollector cc)
finalvirtual

◆ value()

double PhoFull5x5SigmaIEtaIEtaValueMapCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 70 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

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 }

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

Member Data Documentation

◆ _barrelCutOff

const float PhoFull5x5SigmaIEtaIEtaValueMapCut::_barrelCutOff
private

Definition at line 20 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Referenced by operator()().

◆ _cutValueEB

const float PhoFull5x5SigmaIEtaIEtaValueMapCut::_cutValueEB
private

Definition at line 18 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Referenced by operator()().

◆ _cutValueEE

const float PhoFull5x5SigmaIEtaIEtaValueMapCut::_cutValueEE
private

Definition at line 19 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

Referenced by operator()().

◆ _full5x5SigmaIEtaIEtaMap

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

Definition at line 21 of file PhoFull5x5SigmaIEtaIEtaValueMapCut.cc.

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

◆ full5x5SigmaIEtaIEta_

constexpr char PhoFull5x5SigmaIEtaIEtaValueMapCut::full5x5SigmaIEtaIEta_ = "full5x5SigmaIEtaIEta"
staticconstexprprivate
CutApplicatorBase::PHOTON
Definition: CutApplicatorBase.h:47
PhoFull5x5SigmaIEtaIEtaValueMapCut::_barrelCutOff
const float _barrelCutOff
Definition: PhoFull5x5SigmaIEtaIEtaValueMapCut.cc:20
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
PhoFull5x5SigmaIEtaIEtaValueMapCut::full5x5SigmaIEtaIEta_
constexpr static char full5x5SigmaIEtaIEta_[]
Definition: PhoFull5x5SigmaIEtaIEtaValueMapCut.cc:23
CutApplicatorWithEventContentBase::CutApplicatorWithEventContentBase
CutApplicatorWithEventContentBase()
Definition: CutApplicatorWithEventContentBase.h:21
edm::ValueMap::begin
const_iterator begin() const
Definition: ValueMap.h:229
PhoFull5x5SigmaIEtaIEtaValueMapCut::_cutValueEB
const float _cutValueEB
Definition: PhoFull5x5SigmaIEtaIEtaValueMapCut.cc:18
cand
Definition: decayParser.h:32
cc
PhoFull5x5SigmaIEtaIEtaValueMapCut::_cutValueEE
const float _cutValueEE
Definition: PhoFull5x5SigmaIEtaIEtaValueMapCut.cc:19
edm::Ptr
Definition: AssociationVector.h:31
edm::ValueMap::idSize
size_t idSize() const
Definition: ValueMap.h:157
edm::ValueMap< float >
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: CutApplicatorWithEventContentBase.h:40
edm::ValueMap::contains
bool contains(ProductID id) const
Definition: ValueMap.h:155
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
PhoFull5x5SigmaIEtaIEtaValueMapCut::_full5x5SigmaIEtaIEtaMap
edm::Handle< edm::ValueMap< float > > _full5x5SigmaIEtaIEtaMap
Definition: PhoFull5x5SigmaIEtaIEtaValueMapCut.cc:21
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
edm::ProductID
Definition: ProductID.h:27