CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PhoGenericRhoPtScaledCut Class Reference
Inheritance diagram for PhoGenericRhoPtScaledCut:
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
 
 PhoGenericRhoPtScaledCut (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 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

EBEECutValues constTerm_
 
bool lessThan_
 
EBEECutValues linearPtTerm_
 
EffectiveAreas linearRhoTerm_
 
EBEECutValues quadraticPtTerm_
 
edm::Handle< double > rhoHandle_
 
ThreadSafeStringCut< StringObjectFunction< reco::Photon >, reco::PhotonvarFunc_
 

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 7 of file PhoGenericRhoPtScaledCut.cc.

Constructor & Destructor Documentation

PhoGenericRhoPtScaledCut::PhoGenericRhoPtScaledCut ( const edm::ParameterSet c)

Definition at line 41 of file PhoGenericRhoPtScaledCut.cc.

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

41  :
43  varFunc_(params.getParameter<std::string>("cutVariable")),
44  lessThan_(params.getParameter<bool>("lessThan")),
45  constTerm_(params,"constTerm"),
46  linearRhoTerm_(params.getParameter<edm::FileInPath>("effAreasConfigFile").fullPath()),
47  linearPtTerm_(params,"linearPtTerm"),
48  quadraticPtTerm_(params,"quadPtTerm")
49 {
50  edm::InputTag rhoTag = params.getParameter<edm::InputTag>("rho");
51  contentTags_.emplace("rho",rhoTag);
52 }
std::unordered_map< std::string, edm::InputTag > contentTags_
ThreadSafeStringCut< StringObjectFunction< reco::Photon >, reco::Photon > varFunc_
std::string fullPath() const
Definition: FileInPath.cc:163

Member Function Documentation

CandidateType PhoGenericRhoPtScaledCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 18 of file PhoGenericRhoPtScaledCut.cc.

References CutApplicatorBase::PHOTON.

18  {
19  return PHOTON;
20  }
void PhoGenericRhoPtScaledCut::getEventContent ( const edm::EventBase ev)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 59 of file PhoGenericRhoPtScaledCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, edm::EventBase::getByLabel(), operator()(), and rhoHandle_.

59  {
61 }
edm::Handle< double > rhoHandle_
std::unordered_map< std::string, edm::InputTag > contentTags_
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
CutApplicatorBase::result_type PhoGenericRhoPtScaledCut::operator() ( const reco::PhotonPtr pho) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 65 of file PhoGenericRhoPtScaledCut.cc.

References funct::abs(), constTerm_, stringResolutionProvider_cfi::et, EffectiveAreas::getEffectiveArea(), lessThan_, linearPtTerm_, linearRhoTerm_, quadraticPtTerm_, rho, JetChargeProducer_cfi::var, and varFunc_.

Referenced by getEventContent().

65  {
66  const double rho = (*rhoHandle_);
67 
68  const float var = varFunc_(*pho);
69 
70  const float et = pho->et();
71  const float absEta = std::abs(pho->superCluster()->eta());
72  const float cutValue = constTerm_(pho) + linearRhoTerm_.getEffectiveArea(absEta)*rho +
73  linearPtTerm_(pho)*et + quadraticPtTerm_(pho)*et*et;
74  if(lessThan_) return var < cutValue;
75  else return var>=cutValue;
76 }
const float getEffectiveArea(float eta) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ThreadSafeStringCut< StringObjectFunction< reco::Photon >, reco::Photon > varFunc_
et
define resolution functions of each parameter
void PhoGenericRhoPtScaledCut::setConsumes ( edm::ConsumesCollector cc)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 54 of file PhoGenericRhoPtScaledCut.cc.

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

54  {
55  auto rho = cc.consumes<double>(contentTags_["rho"]);
56  contentTokens_.emplace("rho",rho);
57 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::unordered_map< std::string, edm::InputTag > contentTags_
double PhoGenericRhoPtScaledCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 78 of file PhoGenericRhoPtScaledCut.cc.

References varFunc_.

78  {
79  reco::PhotonPtr pho(cand);
80  return varFunc_(*pho);
81 }
ThreadSafeStringCut< StringObjectFunction< reco::Photon >, reco::Photon > varFunc_

Member Data Documentation

EBEECutValues PhoGenericRhoPtScaledCut::constTerm_
private

Definition at line 28 of file PhoGenericRhoPtScaledCut.cc.

Referenced by operator()().

bool PhoGenericRhoPtScaledCut::lessThan_
private

Definition at line 24 of file PhoGenericRhoPtScaledCut.cc.

Referenced by operator()().

EBEECutValues PhoGenericRhoPtScaledCut::linearPtTerm_
private

Definition at line 30 of file PhoGenericRhoPtScaledCut.cc.

Referenced by operator()().

EffectiveAreas PhoGenericRhoPtScaledCut::linearRhoTerm_
private

Definition at line 29 of file PhoGenericRhoPtScaledCut.cc.

Referenced by operator()().

EBEECutValues PhoGenericRhoPtScaledCut::quadraticPtTerm_
private

Definition at line 31 of file PhoGenericRhoPtScaledCut.cc.

Referenced by operator()().

edm::Handle<double> PhoGenericRhoPtScaledCut::rhoHandle_
private

Definition at line 33 of file PhoGenericRhoPtScaledCut.cc.

Referenced by getEventContent().

ThreadSafeStringCut<StringObjectFunction<reco::Photon>,reco::Photon> PhoGenericRhoPtScaledCut::varFunc_
private

Definition at line 23 of file PhoGenericRhoPtScaledCut.cc.

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