CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 overridefinal
 
void getEventContent (const edm::EventBase &) overridefinal
 
 MuonPOGStandardCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::MuonPtr &) const overridefinal
 
void setConsumes (edm::ConsumesCollector &) overridefinal
 
double value (const reco::CandidatePtr &cand) const overridefinal
 
- Public Member Functions inherited from CutApplicatorWithEventContentBase
 CutApplicatorWithEventContentBase (const edm::ParameterSet &c)
 
 CutApplicatorWithEventContentBase (const CutApplicatorWithEventContentBase &)=delete
 
CutApplicatorWithEventContentBaseoperator= (const CutApplicatorWithEventContentBase &)=delete
 
virtual ~CutApplicatorWithEventContentBase ()
 Destructor. More...
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) const
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
const std::string & name () const
 
virtual 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
 
virtual ~CutApplicatorBase ()
 Destructor. More...
 
- Public Member Functions inherited from candidate_functions::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
}
 
- 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 6 of file MuonPOGStandardCut.cc.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 30 of file MuonPOGStandardCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, cutType_, edm::ParameterSet::getParameter(), HIGHPT, LOOSE, MEDIUM, NONE, SOFT, AlCaHLTBitMon_QueryRunRegistry::string, and TIGHT.

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

Member Function Documentation

CandidateType MuonPOGStandardCut::candidateType ( ) const
inlinefinaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 12 of file MuonPOGStandardCut.cc.

References CutApplicatorBase::MUON.

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

Implements CutApplicatorWithEventContentBase.

Definition at line 54 of file MuonPOGStandardCut.cc.

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

55 {
56  ev.getByLabel(contentTags_["vertices"], vtxs_);
57 }
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
finaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 60 of file MuonPOGStandardCut.cc.

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

61 {
62  switch( cutType_ ){
63  case LOOSE:
64  return muon::isLooseMuon(*cand);
65  break;
66  case TIGHT:
67  return muon::isTightMuon(*cand, vtxs_->at(0));
68  break;
69  case MEDIUM:
70  return muon::isMediumMuon(*cand);
71  break;
72  case SOFT:
73  return muon::isSoftMuon(*cand, vtxs_->at(0));
74  break;
75  case HIGHPT:
76  return muon::isHighPtMuon(*cand, vtxs_->at(0));
77  break;
78  case NONE:
79  return false;
80  break;
81  }
82 
83  return true;
84 }
enum MuonPOGStandardCut::CutType cutType_
bool isMediumMuon(const reco::Muon &)
bool isLooseMuon(const reco::Muon &)
bool isSoftMuon(const reco::Muon &, const reco::Vertex &)
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)
finaloverridevirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 48 of file MuonPOGStandardCut.cc.

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

49 {
50  auto vtcs = cc.consumes<reco::VertexCollection>(contentTags_["vertices"]);
51  contentTokens_.emplace("vertices", vtcs);
52 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::unordered_map< std::string, edm::InputTag > contentTags_
double MuonPOGStandardCut::value ( const reco::CandidatePtr cand) const
finaloverridevirtual

Implements candidate_functions::CandidateCut.

Definition at line 86 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_.

86  {
88  switch( cutType_ ){
89  case LOOSE:
90  return muon::isLooseMuon(*mu);
91  break;
92  case TIGHT:
93  return muon::isTightMuon(*mu, vtxs_->at(0));
94  break;
95  case MEDIUM:
96  return muon::isMediumMuon(*mu);
97  break;
98  case SOFT:
99  return muon::isSoftMuon(*mu, vtxs_->at(0));
100  break;
101  case HIGHPT:
102  return muon::isHighPtMuon(*mu, vtxs_->at(0));
103  break;
104  case NONE:
105  return false;
106  break;
107  }
108  return 1.0;
109  }
enum MuonPOGStandardCut::CutType cutType_
bool isMediumMuon(const reco::Muon &)
bool isLooseMuon(const reco::Muon &)
bool isSoftMuon(const reco::Muon &, const reco::Vertex &)
const int mu
Definition: Constants.h:22
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 24 of file MuonPOGStandardCut.cc.

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