CMS 3D CMS Logo

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

EBEECutValues constTerm_
 
bool lessThan_
 
EBEECutValues linearPtTerm_
 
EBEECutValues quadraticPtTerm_
 
EffectiveAreas rhoEA_
 
edm::Handle< double > rhoHandle_
 
ThreadSafeFunctor< StringObjectFunction< reco::Photon > > varFunc_
 

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

Constructor & Destructor Documentation

◆ PhoGenericQuadraticRhoPtScaledCut()

PhoGenericQuadraticRhoPtScaledCut::PhoGenericQuadraticRhoPtScaledCut ( const edm::ParameterSet c)

Definition at line 37 of file PhoGenericQuadraticRhoPtScaledCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, submitPVValidationJobs::params, and HLT_2024v14_cff::rhoTag.

39  varFunc_(params.getParameter<std::string>("cutVariable")),
40  lessThan_(params.getParameter<bool>("lessThan")),
41  constTerm_(params, "constTerm"),
42  rhoEA_(params.getParameter<edm::FileInPath>("effAreasConfigFile").fullPath(),
43  params.getParameter<bool>("quadEAflag")),
44  linearPtTerm_(params, "linearPtTerm"),
45  quadraticPtTerm_(params, "quadraticPtTerm") {
46  edm::InputTag rhoTag = params.getParameter<edm::InputTag>("rho");
47  contentTags_.emplace("rho", rhoTag);
48 }
std::unordered_map< std::string, edm::InputTag > contentTags_
std::string fullPath() const
Definition: FileInPath.cc:161
ThreadSafeFunctor< StringObjectFunction< reco::Photon > > varFunc_

Member Function Documentation

◆ candidateType()

CandidateType PhoGenericQuadraticRhoPtScaledCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 19 of file PhoGenericQuadraticRhoPtScaledCut.cc.

References CutApplicatorBase::PHOTON.

◆ getEventContent()

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

◆ operator()()

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

Reimplemented from CutApplicatorBase.

Definition at line 59 of file PhoGenericQuadraticRhoPtScaledCut.cc.

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

59  {
60  const double rho = (*rhoHandle_);
61 
62  const float var = varFunc_(*pho);
63 
64  const float et = pho->et();
65  const float absEta = std::abs(pho->superCluster()->eta());
66  const float cutValue = constTerm_(pho) + rhoEA_.getLinearEA(absEta) * rho +
67  rhoEA_.getQuadraticEA(absEta) * rho * rho + linearPtTerm_(pho) * et +
68  quadraticPtTerm_(pho) * et * et;
69  if (lessThan_)
70  return var < cutValue;
71  else
72  return var >= cutValue;
73 }
ThreadSafeFunctor< StringObjectFunction< reco::Photon > > varFunc_
const float getQuadraticEA(float eta) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const float getLinearEA(float eta) const

◆ setConsumes()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 50 of file PhoGenericQuadraticRhoPtScaledCut.cc.

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

50  {
51  auto rho = cc.consumes<double>(contentTags_["rho"]);
52  contentTokens_.emplace("rho", rho);
53 }
std::unordered_map< std::string, edm::InputTag > contentTags_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
std::unordered_map< std::string, edm::EDGetToken > contentTokens_

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 75 of file PhoGenericQuadraticRhoPtScaledCut.cc.

References varFunc_.

75  {
76  reco::PhotonPtr pho(cand);
77  return varFunc_(*pho);
78 }
ThreadSafeFunctor< StringObjectFunction< reco::Photon > > varFunc_

Member Data Documentation

◆ constTerm_

EBEECutValues PhoGenericQuadraticRhoPtScaledCut::constTerm_
private

Definition at line 27 of file PhoGenericQuadraticRhoPtScaledCut.cc.

Referenced by operator()().

◆ lessThan_

bool PhoGenericQuadraticRhoPtScaledCut::lessThan_
private

Definition at line 23 of file PhoGenericQuadraticRhoPtScaledCut.cc.

Referenced by operator()().

◆ linearPtTerm_

EBEECutValues PhoGenericQuadraticRhoPtScaledCut::linearPtTerm_
private

Definition at line 29 of file PhoGenericQuadraticRhoPtScaledCut.cc.

Referenced by operator()().

◆ quadraticPtTerm_

EBEECutValues PhoGenericQuadraticRhoPtScaledCut::quadraticPtTerm_
private

Definition at line 30 of file PhoGenericQuadraticRhoPtScaledCut.cc.

Referenced by operator()().

◆ rhoEA_

EffectiveAreas PhoGenericQuadraticRhoPtScaledCut::rhoEA_
private

Definition at line 28 of file PhoGenericQuadraticRhoPtScaledCut.cc.

Referenced by operator()().

◆ rhoHandle_

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

Definition at line 32 of file PhoGenericQuadraticRhoPtScaledCut.cc.

Referenced by getEventContent().

◆ varFunc_

ThreadSafeFunctor<StringObjectFunction<reco::Photon> > PhoGenericQuadraticRhoPtScaledCut::varFunc_
private

Definition at line 22 of file PhoGenericQuadraticRhoPtScaledCut.cc.

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