CMS 3D CMS Logo

RecoDiMuon Class Reference

This class is an EDFilter choosing reconstructed di-muons. More...

#include <GeneratorInterface/GenFilters/interface/RecoDiMuon.h>

Inheritance diagram for RecoDiMuon:

edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void endJob ()
virtual bool filter (Event &, const EventSetup &)
 RecoDiMuon (const edm::ParameterSet &)
 ~RecoDiMuon ()

Private Attributes

double diMuonPtMin_
InputTag muonLabel_
unsigned int nAccepted_
unsigned int nEvents_
double singleMuonPtMin_


Detailed Description

This class is an EDFilter choosing reconstructed di-muons.

Date
2007/03/28 14:04:44
Revision
1.1

Author:
Chang Liu - Purdue University
Date
2008/01/22 20:58:38
Revision
1.4

Author:
Chang Liu - Purdue University

Definition at line 32 of file RecoDiMuon.h.


Constructor & Destructor Documentation

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_.

00027                                                      :
00028   nEvents_(0), nAccepted_(0)
00029 {
00030   muonLabel_ = iConfig.getParameter<InputTag>("MuonLabel");
00031   singleMuonPtMin_ = iConfig.getUntrackedParameter<double>("SingleMuonPtMin",20.);
00032   diMuonPtMin_ = iConfig.getUntrackedParameter<double>("DiMuonPtMin",5.);
00033 }

RecoDiMuon::~RecoDiMuon (  ) 

Definition at line 36 of file RecoDiMuon.cc.

00037 {
00038 }


Member Function Documentation

void RecoDiMuon::endJob ( void   )  [virtual]

Reimplemented from edm::EDFilter.

Definition at line 40 of file RecoDiMuon.cc.

References lat::endl(), nAccepted_, and nEvents_.

00041 {
00042   edm::LogVerbatim("RecoDiMuon") 
00043             << "Events read " << nEvents_ 
00044             << " Events accepted " << nAccepted_ 
00045             << "\nEfficiency " << ((double)nAccepted_)/((double)nEvents_) 
00046             << std::endl;
00047 }

bool RecoDiMuon::filter ( edm::Event iEvent,
const EventSetup iSetup 
) [virtual]

Implements edm::EDFilter.

Definition at line 50 of file RecoDiMuon.cc.

References diMuonPtMin_, edm::Event::getByLabel(), edm::Handle< T >::isValid(), metsig::muon, muonLabel_, muons_cfi::muons, nAccepted_, nEvents_, and singleMuonPtMin_.

00051 {
00052 
00053   nEvents_++;
00054   bool accepted = false;
00055   using namespace edm;
00056 
00057   Handle<reco::TrackCollection> muons;
00058 
00059   iEvent.getByLabel(muonLabel_, muons);
00060   if (!muons.isValid()) {
00061     edm::LogError("RecoDiMuon") << "FAILED to get Muon Track Collection. ";
00062     return false;
00063   }
00064 
00065   if ( muons->empty() ) {
00066     return false;
00067   }
00068 
00069   // at least one muons above a pt threshold singleMuonPtMin 
00070   // or at least 2 muons above a pt threshold diMuonPtMin
00071   int nMuonOver2ndCut = 0;
00072   for(reco::TrackCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++ muon ) {
00073 
00074     if ( muon->pt() > singleMuonPtMin_ ) accepted = true;
00075     if ( muon->pt() > diMuonPtMin_ )  nMuonOver2ndCut++;
00076   }
00077   if ( nMuonOver2ndCut >= 2 ) accepted = true;
00078 
00079   if ( accepted ) nAccepted_++;
00080 
00081   return accepted;
00082 
00083 }


Member Data Documentation

double RecoDiMuon::diMuonPtMin_ [private]

Definition at line 43 of file RecoDiMuon.h.

Referenced by filter(), and RecoDiMuon().

InputTag RecoDiMuon::muonLabel_ [private]

Definition at line 41 of file RecoDiMuon.h.

Referenced by filter(), and RecoDiMuon().

unsigned int RecoDiMuon::nAccepted_ [private]

Definition at line 45 of file RecoDiMuon.h.

Referenced by endJob(), and filter().

unsigned int RecoDiMuon::nEvents_ [private]

Definition at line 44 of file RecoDiMuon.h.

Referenced by endJob(), and filter().

double RecoDiMuon::singleMuonPtMin_ [private]

Definition at line 42 of file RecoDiMuon.h.

Referenced by filter(), and RecoDiMuon().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:40 2009 for CMSSW by  doxygen 1.5.4