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

Member Enumeration Documentation

◆ CutType

Enumerator
LOOSE 
MEDIUM 
TIGHT 
SOFT 
HIGHPT 
NONE 

Definition at line 20 of file MuonPOGStandardCut.cc.

Constructor & Destructor Documentation

◆ MuonPOGStandardCut()

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

Definition at line 26 of file MuonPOGStandardCut.cc.

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 }

References 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 12 of file MuonPOGStandardCut.cc.

12 { return MUON; }

References CutApplicatorBase::MUON.

◆ getEventContent()

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

Implements CutApplicatorWithEventContentBase.

Definition at line 51 of file MuonPOGStandardCut.cc.

51 { 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 54 of file MuonPOGStandardCut.cc.

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 }

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

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

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

◆ value()

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

Implements candidate_functions::CandidateCut.

Definition at line 79 of file MuonPOGStandardCut.cc.

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 }

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 21 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:20
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
MuonPOGStandardCut::TIGHT
Definition: MuonPOGStandardCut.cc:20
muon::isLooseMuon
bool isLooseMuon(const reco::Muon &)
Definition: MuonSelectors.cc:895
MuonPOGStandardCut::SOFT
Definition: MuonPOGStandardCut.cc:20
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
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:20
edm::Ptr< reco::Muon >
MuonPOGStandardCut::cutType_
enum MuonPOGStandardCut::CutType cutType_
MuonPOGStandardCut::HIGHPT
Definition: MuonPOGStandardCut.cc:20
MuonPOGStandardCut::NONE
Definition: MuonPOGStandardCut.cc:20
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:21
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::InputTag
Definition: InputTag.h:15