CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::VertexCollection
vtxs_
 

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::InputTag
contentTags_
 
std::unordered_map
< std::string, edm::EDGetToken
contentTokens_
 

Detailed Description

Definition at line 7 of file MuonPOGStandardCut.cc.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 26 of file MuonPOGStandardCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, cutType_, edm::ParameterSet::getParameter(), 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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

CandidateType MuonPOGStandardCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 12 of file MuonPOGStandardCut.cc.

References CutApplicatorBase::MUON.

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

Implements CutApplicatorWithEventContentBase.

Definition at line 51 of file MuonPOGStandardCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, edm::EventBase::getByLabel(), and vtxs_.

51 { ev.getByLabel(contentTags_["vertices"], vtxs_); }
std::unordered_map< std::string, edm::InputTag > contentTags_
edm::Handle< reco::VertexCollection > vtxs_
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
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 &)
void MuonPOGStandardCut::setConsumes ( edm::ConsumesCollector cc)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 46 of file MuonPOGStandardCut.cc.

References edm::ConsumesCollector::consumes(), CutApplicatorWithEventContentBase::contentTags_, and CutApplicatorWithEventContentBase::contentTokens_.

46  {
47  auto vtcs = cc.consumes<reco::VertexCollection>(contentTags_["vertices"]);
48  contentTokens_.emplace("vertices", vtcs);
49 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::InputTag > contentTags_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
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, RPCpg::mu, NONE, SOFT, TIGHT, and vtxs_.

Referenced by Types.int32::__nonzero__(), Types.uint32::__nonzero__(), Types.int64::__nonzero__(), Types.uint64::__nonzero__(), Types.double::__nonzero__(), Types.bool::__nonzero__(), Types.string::__nonzero__(), Types.string::configValue(), Types.FileInPath::configValue(), Types.int32::insertInto(), Types.uint32::insertInto(), Types.int64::insertInto(), Types.uint64::insertInto(), Types.double::insertInto(), Types.bool::insertInto(), Types.string::insertInto(), Types.FileInPath::insertInto(), Types.vint32::insertInto(), Types.vuint32::insertInto(), Types.vint64::insertInto(), Types.vuint64::insertInto(), Types.vdouble::insertInto(), Types.vbool::insertInto(), and Types.vstring::insertInto().

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 &)
const int mu
Definition: Constants.h:22
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

enum MuonPOGStandardCut::CutType MuonPOGStandardCut::cutType_
private
edm::Handle<reco::VertexCollection> MuonPOGStandardCut::vtxs_
private

Definition at line 21 of file MuonPOGStandardCut.cc.

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