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 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

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

Definition at line 36 of file PhoGenericRhoPtScaledCut.cc.

38  varFunc_(params.getParameter<std::string>("cutVariable")),
39  lessThan_(params.getParameter<bool>("lessThan")),
40  constTerm_(params, "constTerm"),
41  linearRhoTerm_(params.getParameter<edm::FileInPath>("effAreasConfigFile").fullPath()),
42  linearPtTerm_(params, "linearPtTerm"),
43  quadraticPtTerm_(params, "quadPtTerm") {
44  edm::InputTag rhoTag = params.getParameter<edm::InputTag>("rho");
45  contentTags_.emplace("rho", rhoTag);
46 }

References CutApplicatorWithEventContentBase::contentTags_, CalibrationSummaryClient_cfi::params, and HLT_2018_cff::rhoTag.

Member Function Documentation

◆ candidateType()

CandidateType PhoGenericRhoPtScaledCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 18 of file PhoGenericRhoPtScaledCut.cc.

18 { return PHOTON; }

References CutApplicatorBase::PHOTON.

◆ getEventContent()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 53 of file PhoGenericRhoPtScaledCut.cc.

53  {
54  ev.getByLabel(contentTags_["rho"], rhoHandle_);
55 }

References CutApplicatorWithEventContentBase::contentTags_, ev, and rhoHandle_.

◆ operator()()

CutApplicatorBase::result_type PhoGenericRhoPtScaledCut::operator() ( const reco::PhotonPtr pho) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 57 of file PhoGenericRhoPtScaledCut.cc.

57  {
58  const double rho = (*rhoHandle_);
59 
60  const float var = varFunc_(*pho);
61 
62  const float et = pho->et();
63  const float absEta = std::abs(pho->superCluster()->eta());
64  const float cutValue = constTerm_(pho) + linearRhoTerm_.getEffectiveArea(absEta) * rho + linearPtTerm_(pho) * et +
65  quadraticPtTerm_(pho) * et * et;
66  if (lessThan_)
67  return var < cutValue;
68  else
69  return var >= cutValue;
70 }

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

◆ setConsumes()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 48 of file PhoGenericRhoPtScaledCut.cc.

48  {
49  auto rho = cc.consumes<double>(contentTags_["rho"]);
50  contentTokens_.emplace("rho", rho);
51 }

References CutApplicatorWithEventContentBase::contentTags_, CutApplicatorWithEventContentBase::contentTokens_, and rho.

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 72 of file PhoGenericRhoPtScaledCut.cc.

72  {
73  reco::PhotonPtr pho(cand);
74  return varFunc_(*pho);
75 }

References varFunc_.

Member Data Documentation

◆ constTerm_

EBEECutValues PhoGenericRhoPtScaledCut::constTerm_
private

Definition at line 26 of file PhoGenericRhoPtScaledCut.cc.

Referenced by operator()().

◆ lessThan_

bool PhoGenericRhoPtScaledCut::lessThan_
private

Definition at line 22 of file PhoGenericRhoPtScaledCut.cc.

Referenced by operator()().

◆ linearPtTerm_

EBEECutValues PhoGenericRhoPtScaledCut::linearPtTerm_
private

Definition at line 28 of file PhoGenericRhoPtScaledCut.cc.

Referenced by operator()().

◆ linearRhoTerm_

EffectiveAreas PhoGenericRhoPtScaledCut::linearRhoTerm_
private

Definition at line 27 of file PhoGenericRhoPtScaledCut.cc.

Referenced by operator()().

◆ quadraticPtTerm_

EBEECutValues PhoGenericRhoPtScaledCut::quadraticPtTerm_
private

Definition at line 29 of file PhoGenericRhoPtScaledCut.cc.

Referenced by operator()().

◆ rhoHandle_

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

Definition at line 31 of file PhoGenericRhoPtScaledCut.cc.

Referenced by getEventContent().

◆ varFunc_

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

Definition at line 21 of file PhoGenericRhoPtScaledCut.cc.

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

CutApplicatorBase::PHOTON
Definition: CutApplicatorBase.h:47
PhoGenericRhoPtScaledCut::constTerm_
EBEECutValues constTerm_
Definition: PhoGenericRhoPtScaledCut.cc:26
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
HLT_2018_cff.rhoTag
rhoTag
Definition: HLT_2018_cff.py:13606
PhoGenericRhoPtScaledCut::linearRhoTerm_
EffectiveAreas linearRhoTerm_
Definition: PhoGenericRhoPtScaledCut.cc:27
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
edm::FileInPath
Definition: FileInPath.h:64
PhoGenericRhoPtScaledCut::rhoHandle_
edm::Handle< double > rhoHandle_
Definition: PhoGenericRhoPtScaledCut.cc:31
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PhoGenericRhoPtScaledCut::quadraticPtTerm_
EBEECutValues quadraticPtTerm_
Definition: PhoGenericRhoPtScaledCut.cc:29
CutApplicatorWithEventContentBase::CutApplicatorWithEventContentBase
CutApplicatorWithEventContentBase()
Definition: CutApplicatorWithEventContentBase.h:21
cand
Definition: decayParser.h:34
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
cc
edm::Ptr
Definition: AssociationVector.h:31
PhoGenericRhoPtScaledCut::linearPtTerm_
EBEECutValues linearPtTerm_
Definition: PhoGenericRhoPtScaledCut.cc:28
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: CutApplicatorWithEventContentBase.h:40
PhoGenericRhoPtScaledCut::varFunc_
ThreadSafeStringCut< StringObjectFunction< reco::Photon >, reco::Photon > varFunc_
Definition: PhoGenericRhoPtScaledCut.cc:21
EffectiveAreas::getEffectiveArea
const float getEffectiveArea(float eta) const
Definition: EffectiveAreas.cc:44
PhoGenericRhoPtScaledCut::lessThan_
bool lessThan_
Definition: PhoGenericRhoPtScaledCut.cc:22
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::InputTag
Definition: InputTag.h:15
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163