CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
MuonPOGStandardCut Class Reference
Inheritance diagram for MuonPOGStandardCut:
CutApplicatorWithEventContentBase CutApplicatorBase candidate_functions::CandidateCut

Public Member Functions

CandidateType candidateType () const final
 
void getEventContent (const edm::EventBase &) final
 
 MuonPOGStandardCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::MuonPtr &) const final
 
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::PhotonPtr &) const
 
virtual result_type operator() (const pat::PhotonPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) const
 
CutApplicatorBaseoperator= (const CutApplicatorBase &)=delete
 
 ~CutApplicatorBase () override
 Destructor. More...
 
- Public Member Functions inherited from candidate_functions::CandidateCut
 CandidateCut ()
 
virtual ~CandidateCut ()
 

Private Types

enum  CutType {
  LOOSE, MEDIUM, TIGHT, SOFT,
  HIGHPT, NONE
}
 

Private Attributes

enum MuonPOGStandardCut::CutType cutType_
 
edm::Handle< reco::VertexCollectionvtxs_
 

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 MuonPOGStandardCut.cc.

Member Enumeration Documentation

◆ CutType

Constructor & Destructor Documentation

◆ MuonPOGStandardCut()

MuonPOGStandardCut::MuonPOGStandardCut ( const edm::ParameterSet c)

Definition at line 26 of file MuonPOGStandardCut.cc.

References DummyCfis::c, CutApplicatorWithEventContentBase::contentTags_, cutType_, HIGHPT, LOOSE, MEDIUM, NONE, SOFT, AlCaHLTBitMon_QueryRunRegistry::string, and TIGHT.

27  const auto cutTypeName = c.getParameter<std::string>("idName");
28  if (cutTypeName == "loose")
29  cutType_ = LOOSE;
30  else if (cutTypeName == "tight")
31  cutType_ = TIGHT;
32  else if (cutTypeName == "medium")
33  cutType_ = MEDIUM;
34  else if (cutTypeName == "soft")
35  cutType_ = SOFT;
36  else if (cutTypeName == "highpt")
37  cutType_ = HIGHPT;
38  else {
39  edm::LogError("MuonPOGStandardCut") << "Wrong cut id name, " << cutTypeName;
40  cutType_ = NONE;
41  }
42 
43  contentTags_.emplace("vertices", c.getParameter<edm::InputTag>("vertexSrc"));
44 }
std::unordered_map< std::string, edm::InputTag > contentTags_
enum MuonPOGStandardCut::CutType cutType_
Log< level::Error, false > LogError

Member Function Documentation

◆ candidateType()

CandidateType MuonPOGStandardCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 12 of file MuonPOGStandardCut.cc.

References CutApplicatorBase::MUON.

◆ getEventContent()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 51 of file MuonPOGStandardCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, makeMEIFBenchmarkPlots::ev, and vtxs_.

51 { ev.getByLabel(contentTags_["vertices"], vtxs_); }
std::unordered_map< std::string, edm::InputTag > contentTags_
edm::Handle< reco::VertexCollection > vtxs_

◆ operator()()

CutApplicatorBase::result_type MuonPOGStandardCut::operator() ( const reco::MuonPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 54 of file MuonPOGStandardCut.cc.

References cutType_, HIGHPT, muon::isHighPtMuon(), muon::isLooseMuon(), muon::isMediumMuon(), muon::isSoftMuon(), muon::isTightMuon(), LOOSE, MEDIUM, NONE, SOFT, TIGHT, and vtxs_.

54  {
55  switch (cutType_) {
56  case LOOSE:
57  return muon::isLooseMuon(*cand);
58  break;
59  case TIGHT:
60  return muon::isTightMuon(*cand, vtxs_->at(0));
61  break;
62  case MEDIUM:
63  return muon::isMediumMuon(*cand);
64  break;
65  case SOFT:
66  return muon::isSoftMuon(*cand, vtxs_->at(0));
67  break;
68  case HIGHPT:
69  return muon::isHighPtMuon(*cand, vtxs_->at(0));
70  break;
71  case NONE:
72  return false;
73  break;
74  }
75 
76  return true;
77 }
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
enum MuonPOGStandardCut::CutType cutType_
bool isLooseMuon(const reco::Muon &)
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
edm::Handle< reco::VertexCollection > vtxs_
bool isTightMuon(const reco::Muon &, const reco::Vertex &)

◆ setConsumes()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 46 of file MuonPOGStandardCut.cc.

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

46  {
47  auto vtcs = cc.consumes<reco::VertexCollection>(contentTags_["vertices"]);
48  contentTokens_.emplace("vertices", vtcs);
49 }
std::unordered_map< std::string, edm::InputTag > contentTags_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::unordered_map< std::string, edm::EDGetToken > contentTokens_

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 79 of file MuonPOGStandardCut.cc.

References cutType_, HIGHPT, muon::isHighPtMuon(), muon::isLooseMuon(), muon::isMediumMuon(), muon::isSoftMuon(), muon::isTightMuon(), LOOSE, MEDIUM, amptDefaultParameters_cff::mu, NONE, SOFT, TIGHT, and vtxs_.

79  {
81  switch (cutType_) {
82  case LOOSE:
83  return muon::isLooseMuon(*mu);
84  break;
85  case TIGHT:
86  return muon::isTightMuon(*mu, vtxs_->at(0));
87  break;
88  case MEDIUM:
89  return muon::isMediumMuon(*mu);
90  break;
91  case SOFT:
92  return muon::isSoftMuon(*mu, vtxs_->at(0));
93  break;
94  case HIGHPT:
95  return muon::isHighPtMuon(*mu, vtxs_->at(0));
96  break;
97  case NONE:
98  return 0.0;
99  break;
100  }
101  return 1.0;
102 }
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
enum MuonPOGStandardCut::CutType cutType_
bool isLooseMuon(const reco::Muon &)
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
edm::Handle< reco::VertexCollection > vtxs_
bool isTightMuon(const reco::Muon &, const reco::Vertex &)

Member Data Documentation

◆ cutType_

enum MuonPOGStandardCut::CutType MuonPOGStandardCut::cutType_
private

◆ vtxs_

edm::Handle<reco::VertexCollection> MuonPOGStandardCut::vtxs_
private

Definition at line 21 of file MuonPOGStandardCut.cc.

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