#include <RecoDiMuon.h>
Public Member Functions | |
virtual void | endJob () |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
RecoDiMuon (const edm::ParameterSet &) | |
~RecoDiMuon () | |
Private Attributes | |
double | diMuonPtMin_ |
edm::InputTag | muonLabel_ |
unsigned int | nAccepted_ |
unsigned int | nEvents_ |
double | singleMuonPtMin_ |
This class is an EDFilter choosing reconstructed di-muons
This class is an EDFilter choosing reconstructed di-muons
Definition at line 28 of file RecoDiMuon.h.
RecoDiMuon::RecoDiMuon | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 27 of file RecoDiMuon.cc.
References diMuonPtMin_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), muonLabel_, and singleMuonPtMin_.
: nEvents_(0), nAccepted_(0) { muonLabel_ = iConfig.getParameter<InputTag>("MuonLabel"); singleMuonPtMin_ = iConfig.getUntrackedParameter<double>("SingleMuonPtMin",20.); diMuonPtMin_ = iConfig.getUntrackedParameter<double>("DiMuonPtMin",5.); }
RecoDiMuon::~RecoDiMuon | ( | ) |
Definition at line 36 of file RecoDiMuon.cc.
{ }
void RecoDiMuon::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDFilter.
Definition at line 40 of file RecoDiMuon.cc.
References nAccepted_, and nEvents_.
{ edm::LogVerbatim("RecoDiMuon") << "Events read " << nEvents_ << " Events accepted " << nAccepted_ << "\nEfficiency " << ((double)nAccepted_)/((double)nEvents_) << std::endl; }
bool RecoDiMuon::filter | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDFilter.
Definition at line 50 of file RecoDiMuon.cc.
References diMuonPtMin_, edm::Event::getByLabel(), metsig::muon, muonLabel_, patZpeak::muons, nAccepted_, nEvents_, and singleMuonPtMin_.
{ nEvents_++; bool accepted = false; using namespace edm; Handle<reco::TrackCollection> muons; iEvent.getByLabel(muonLabel_, muons); if (!muons.isValid()) { edm::LogError("RecoDiMuon") << "FAILED to get Muon Track Collection. "; return false; } if ( muons->empty() ) { return false; } // at least one muons above a pt threshold singleMuonPtMin // or at least 2 muons above a pt threshold diMuonPtMin int nMuonOver2ndCut = 0; for(reco::TrackCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++ muon ) { if ( muon->pt() > singleMuonPtMin_ ) accepted = true; if ( muon->pt() > diMuonPtMin_ ) nMuonOver2ndCut++; } if ( nMuonOver2ndCut >= 2 ) accepted = true; if ( accepted ) nAccepted_++; return accepted; }
double RecoDiMuon::diMuonPtMin_ [private] |
Definition at line 39 of file RecoDiMuon.h.
Referenced by filter(), and RecoDiMuon().
edm::InputTag RecoDiMuon::muonLabel_ [private] |
Definition at line 37 of file RecoDiMuon.h.
Referenced by filter(), and RecoDiMuon().
unsigned int RecoDiMuon::nAccepted_ [private] |
Definition at line 41 of file RecoDiMuon.h.
unsigned int RecoDiMuon::nEvents_ [private] |
Definition at line 40 of file RecoDiMuon.h.
double RecoDiMuon::singleMuonPtMin_ [private] |
Definition at line 38 of file RecoDiMuon.h.
Referenced by filter(), and RecoDiMuon().