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 Attributes
RecoDiMuon Class Reference

#include <RecoDiMuon.h>

Inheritance diagram for RecoDiMuon:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void endJob ()
 
virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 RecoDiMuon (const edm::ParameterSet &)
 
 ~RecoDiMuon ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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

27  :
28  nEvents_(0), nAccepted_(0)
29 {
30  muonLabel_ = iConfig.getParameter<InputTag>("MuonLabel");
31  singleMuonPtMin_ = iConfig.getUntrackedParameter<double>("SingleMuonPtMin",20.);
32  diMuonPtMin_ = iConfig.getUntrackedParameter<double>("DiMuonPtMin",5.);
33 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int nAccepted_
Definition: RecoDiMuon.h:41
edm::InputTag muonLabel_
Definition: RecoDiMuon.h:37
unsigned int nEvents_
Definition: RecoDiMuon.h:40
double singleMuonPtMin_
Definition: RecoDiMuon.h:38
double diMuonPtMin_
Definition: RecoDiMuon.h:39
RecoDiMuon::~RecoDiMuon ( )

Definition at line 36 of file RecoDiMuon.cc.

37 {
38 }

Member Function Documentation

void RecoDiMuon::endJob ( void  )
virtual

Reimplemented from edm::EDFilter.

Definition at line 40 of file RecoDiMuon.cc.

References nAccepted_, and nEvents_.

41 {
42  edm::LogVerbatim("RecoDiMuon")
43  << "Events read " << nEvents_
44  << " Events accepted " << nAccepted_
45  << "\nEfficiency " << ((double)nAccepted_)/((double)nEvents_)
46  << std::endl;
47 }
unsigned int nAccepted_
Definition: RecoDiMuon.h:41
unsigned int nEvents_
Definition: RecoDiMuon.h:40
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_.

51 {
52 
53  nEvents_++;
54  bool accepted = false;
55  using namespace edm;
56 
58 
59  iEvent.getByLabel(muonLabel_, muons);
60  if (!muons.isValid()) {
61  edm::LogError("RecoDiMuon") << "FAILED to get Muon Track Collection. ";
62  return false;
63  }
64 
65  if ( muons->empty() ) {
66  return false;
67  }
68 
69  // at least one muons above a pt threshold singleMuonPtMin
70  // or at least 2 muons above a pt threshold diMuonPtMin
71  int nMuonOver2ndCut = 0;
72  for(reco::TrackCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++ muon ) {
73 
74  if ( muon->pt() > singleMuonPtMin_ ) accepted = true;
75  if ( muon->pt() > diMuonPtMin_ ) nMuonOver2ndCut++;
76  }
77  if ( nMuonOver2ndCut >= 2 ) accepted = true;
78 
79  if ( accepted ) nAccepted_++;
80 
81  return accepted;
82 
83 }
unsigned int nAccepted_
Definition: RecoDiMuon.h:41
edm::InputTag muonLabel_
Definition: RecoDiMuon.h:37
unsigned int nEvents_
Definition: RecoDiMuon.h:40
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
double singleMuonPtMin_
Definition: RecoDiMuon.h:38
tuple muons
Definition: patZpeak.py:38
double diMuonPtMin_
Definition: RecoDiMuon.h:39

Member Data Documentation

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.

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().