CMS 3D CMS Logo

Public Member Functions | Private Attributes

RecoDiMuon Class Reference

#include <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 (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_

Detailed Description

This class is an EDFilter choosing reconstructed di-muons

Date:
2010/07/21 04:23:25
Revision:
1.2
Author:
Chang Liu - Purdue University

This class is an EDFilter choosing reconstructed di-muons

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

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

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

{
}

Member Function Documentation

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;

}

Member Data Documentation

double RecoDiMuon::diMuonPtMin_ [private]

Definition at line 39 of file RecoDiMuon.h.

Referenced by filter(), and RecoDiMuon().

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.

Referenced by endJob(), and filter().

unsigned int RecoDiMuon::nEvents_ [private]

Definition at line 40 of file RecoDiMuon.h.

Referenced by endJob(), and filter().

double RecoDiMuon::singleMuonPtMin_ [private]

Definition at line 38 of file RecoDiMuon.h.

Referenced by filter(), and RecoDiMuon().