CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
WSelectorFast Class Reference

#include <WSelectorFast.h>

Inheritance diagram for WSelectorFast:
EventSelector

Public Member Functions

pat::MET const & met () const
 return MET of W boson More...
 
virtual bool operator() (edm::EventBase const &event, pat::strbitset &ret)
 here is where the selection occurs More...
 
pat::Muon const & wMuon () const
 return muon candidate of W boson More...
 
 WSelectorFast (edm::ParameterSet const &params)
 constructor More...
 
virtual ~WSelectorFast ()
 destructor More...
 
- Public Member Functions inherited from EventSelector
const std::vector< std::string > & description ()
 
 EventSelector ()
 
 EventSelector (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
 
 EventSelector (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC)
 
const std::string & name () const
 name of the module (from configuration) More...
 
virtual bool select (const edm::Event &) const =0
 decision of the selector module More...
 
virtual ~EventSelector ()
 

Protected Attributes

pat::MET const * met_
 MET from W boson. More...
 
index_type metIndex_
 index for MET cut More...
 
edm::InputTag metSrc_
 met input More...
 
index_type muonPtIndex_
 index for muon Pt cut More...
 
edm::InputTag muonSrc_
 muon input More...
 
pat::Muon const * wMuon_
 muon candidate from W boson More...
 
- Protected Attributes inherited from EventSelector
std::vector< std::string > description_
 
std::string name_
 

Detailed Description

Definition at line 16 of file WSelectorFast.h.

Constructor & Destructor Documentation

◆ WSelectorFast()

WSelectorFast::WSelectorFast ( edm::ParameterSet const &  params)
inline

constructor

Definition at line 19 of file WSelectorFast.h.

20  : muonSrc_(params.getParameter<edm::InputTag>("muonSrc")), metSrc_(params.getParameter<edm::InputTag>("metSrc")) {
21  double muonPtMin = params.getParameter<double>("muonPtMin");
22  double metMin = params.getParameter<double>("metMin");
23  push_back("Muon Pt", muonPtMin);
24  push_back("MET", metMin);
25  set("Muon Pt");
26  set("MET");
27  wMuon_ = 0;
28  met_ = 0;
29  if (params.exists("cutsToIgnore")) {
30  setIgnoredCuts(params.getParameter<std::vector<std::string> >("cutsToIgnore"));
31  }
32  retInternal_ = getBitTemplate();
33  }

References met_, wplusjetsAnalysis_cfi::metMin, mhtProducer_cfi::muonPtMin, CalibrationSummaryClient_cfi::params, and wMuon_.

◆ ~WSelectorFast()

virtual WSelectorFast::~WSelectorFast ( )
inlinevirtual

destructor

Definition at line 35 of file WSelectorFast.h.

35 {}

Member Function Documentation

◆ met()

pat::MET const& WSelectorFast::met ( ) const
inline

return MET of W boson

Definition at line 39 of file WSelectorFast.h.

39 { return *met_; }

References met_.

Referenced by objects.METAnalyzer.METAnalyzer::applyDeltaMet(), and operator()().

◆ operator()()

virtual bool WSelectorFast::operator() ( edm::EventBase const &  event,
pat::strbitset ret 
)
inlinevirtual

here is where the selection occurs

Definition at line 42 of file WSelectorFast.h.

42  {
43  ret.set(false);
44  // Handle to the muon collection
46  // Handle to the MET collection
48  // get the objects from the event
49  bool gotMuons = event.getByLabel(muonSrc_, muons);
50  bool gotMET = event.getByLabel(metSrc_, met);
51  // get the MET, require to be > minimum
52  if (gotMET) {
53  met_ = &met->at(0);
54  if (met_->pt() > cut(metIndex_, double()) || ignoreCut(metIndex_))
55  passCut(ret, metIndex_);
56  }
57  // get the highest pt muon, require to have pt > minimum
58  if (gotMuons) {
59  if (!ignoreCut(muonPtIndex_)) {
60  if (muons->size() > 0) {
61  wMuon_ = &muons->at(0);
62  if (wMuon_->pt() > cut(muonPtIndex_, double()) || ignoreCut(muonPtIndex_))
63  passCut(ret, muonPtIndex_);
64  }
65  } else {
66  passCut(ret, muonPtIndex_);
67  }
68  }
69  setIgnored(ret);
70  return (bool)ret;
71  }

References PA_MinBiasSkim_cff::cut, met(), met_, metIndex_, metSrc_, muonPtIndex_, PDWG_BPHSkim_cff::muons, muonSrc_, reco::LeafCandidate::pt(), runTheMatrix::ret, and wMuon_.

◆ wMuon()

pat::Muon const& WSelectorFast::wMuon ( ) const
inline

return muon candidate of W boson

Definition at line 37 of file WSelectorFast.h.

37 { return *wMuon_; }

References wMuon_.

Member Data Documentation

◆ met_

pat::MET const* WSelectorFast::met_
protected

MET from W boson.

Definition at line 81 of file WSelectorFast.h.

Referenced by met(), operator()(), and WSelectorFast().

◆ metIndex_

index_type WSelectorFast::metIndex_
protected

index for MET cut

Definition at line 85 of file WSelectorFast.h.

Referenced by operator()().

◆ metSrc_

edm::InputTag WSelectorFast::metSrc_
protected

met input

Definition at line 77 of file WSelectorFast.h.

Referenced by operator()().

◆ muonPtIndex_

index_type WSelectorFast::muonPtIndex_
protected

index for muon Pt cut

Definition at line 83 of file WSelectorFast.h.

Referenced by operator()().

◆ muonSrc_

edm::InputTag WSelectorFast::muonSrc_
protected

muon input

Definition at line 75 of file WSelectorFast.h.

Referenced by operator()().

◆ wMuon_

pat::Muon const* WSelectorFast::wMuon_
protected

muon candidate from W boson

Definition at line 79 of file WSelectorFast.h.

Referenced by operator()(), wMuon(), and WSelectorFast().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
WSelectorFast::metIndex_
index_type metIndex_
index for MET cut
Definition: WSelectorFast.h:85
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
WSelectorFast::metSrc_
edm::InputTag metSrc_
met input
Definition: WSelectorFast.h:77
WSelectorFast::wMuon_
pat::Muon const * wMuon_
muon candidate from W boson
Definition: WSelectorFast.h:79
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
edm::Handle
Definition: AssociativeIterator.h:50
mhtProducer_cfi.muonPtMin
muonPtMin
Definition: mhtProducer_cfi.py:20
WSelectorFast::met_
pat::MET const * met_
MET from W boson.
Definition: WSelectorFast.h:81
WSelectorFast::met
pat::MET const & met() const
return MET of W boson
Definition: WSelectorFast.h:39
wplusjetsAnalysis_cfi.metMin
metMin
Definition: wplusjetsAnalysis_cfi.py:89
WSelectorFast::muonSrc_
edm::InputTag muonSrc_
muon input
Definition: WSelectorFast.h:75
PA_MinBiasSkim_cff.cut
cut
Definition: PA_MinBiasSkim_cff.py:13
WSelectorFast::muonPtIndex_
index_type muonPtIndex_
index for muon Pt cut
Definition: WSelectorFast.h:83
edm::InputTag
Definition: InputTag.h:15