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 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 pat::PhotonPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) const
 
virtual result_type operator() (const reco::GsfElectronPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const reco::PhotonPtr &) 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 6 of file MuonPOGStandardCut.cc.

Member Enumeration Documentation

◆ CutType

Enumerator
LOOSE 
MEDIUM 
TIGHT 
SOFT 
HIGHPT 
NONE 

Definition at line 19 of file MuonPOGStandardCut.cc.

Constructor & Destructor Documentation

◆ MuonPOGStandardCut()

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

Definition at line 25 of file MuonPOGStandardCut.cc.

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

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

Member Function Documentation

◆ candidateType()

CandidateType MuonPOGStandardCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 11 of file MuonPOGStandardCut.cc.

11 { return MUON; }

References CutApplicatorBase::MUON.

◆ getEventContent()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 50 of file MuonPOGStandardCut.cc.

50 { ev.getByLabel(contentTags_["vertices"], vtxs_); }

References CutApplicatorWithEventContentBase::contentTags_, ev, and vtxs_.

◆ operator()()

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

Reimplemented from CutApplicatorBase.

Definition at line 53 of file MuonPOGStandardCut.cc.

53  {
54  switch (cutType_) {
55  case LOOSE:
56  return muon::isLooseMuon(*cand);
57  break;
58  case TIGHT:
59  return muon::isTightMuon(*cand, vtxs_->at(0));
60  break;
61  case MEDIUM:
62  return muon::isMediumMuon(*cand);
63  break;
64  case SOFT:
65  return muon::isSoftMuon(*cand, vtxs_->at(0));
66  break;
67  case HIGHPT:
68  return muon::isHighPtMuon(*cand, vtxs_->at(0));
69  break;
70  case NONE:
71  return false;
72  break;
73  }
74 
75  return true;
76 }

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

◆ setConsumes()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 45 of file MuonPOGStandardCut.cc.

45  {
46  auto vtcs = cc.consumes<reco::VertexCollection>(contentTags_["vertices"]);
47  contentTokens_.emplace("vertices", vtcs);
48 }

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

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 78 of file MuonPOGStandardCut.cc.

78  {
80  switch (cutType_) {
81  case LOOSE:
82  return muon::isLooseMuon(*mu);
83  break;
84  case TIGHT:
85  return muon::isTightMuon(*mu, vtxs_->at(0));
86  break;
87  case MEDIUM:
88  return muon::isMediumMuon(*mu);
89  break;
90  case SOFT:
91  return muon::isSoftMuon(*mu, vtxs_->at(0));
92  break;
93  case HIGHPT:
94  return muon::isHighPtMuon(*mu, vtxs_->at(0));
95  break;
96  case NONE:
97  return 0.0;
98  break;
99  }
100  return 1.0;
101 }

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

Member Data Documentation

◆ cutType_

enum MuonPOGStandardCut::CutType MuonPOGStandardCut::cutType_
private

◆ vtxs_

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

Definition at line 20 of file MuonPOGStandardCut.cc.

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

muon::isSoftMuon
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
Definition: MuonSelectors.cc:916
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
MuonPOGStandardCut::MEDIUM
Definition: MuonPOGStandardCut.cc:19
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
MuonPOGStandardCut::TIGHT
Definition: MuonPOGStandardCut.cc:19
muon::isLooseMuon
bool isLooseMuon(const reco::Muon &)
Definition: MuonSelectors.cc:895
MuonPOGStandardCut::SOFT
Definition: MuonPOGStandardCut.cc:19
CutApplicatorBase::MUON
Definition: CutApplicatorBase.h:47
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
muon::isHighPtMuon
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
Definition: MuonSelectors.cc:933
CutApplicatorWithEventContentBase::CutApplicatorWithEventContentBase
CutApplicatorWithEventContentBase()
Definition: CutApplicatorWithEventContentBase.h:21
muon::isTightMuon
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
Definition: MuonSelectors.cc:880
cand
Definition: decayParser.h:32
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
muon::isMediumMuon
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
Definition: MuonSelectors.cc:899
cc
MuonPOGStandardCut::LOOSE
Definition: MuonPOGStandardCut.cc:19
edm::Ptr< reco::Muon >
MuonPOGStandardCut::cutType_
enum MuonPOGStandardCut::CutType cutType_
MuonPOGStandardCut::HIGHPT
Definition: MuonPOGStandardCut.cc:19
MuonPOGStandardCut::NONE
Definition: MuonPOGStandardCut.cc:19
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: CutApplicatorWithEventContentBase.h:40
MuonPOGStandardCut::vtxs_
edm::Handle< reco::VertexCollection > vtxs_
Definition: MuonPOGStandardCut.cc:20
edm::InputTag
Definition: InputTag.h:15