CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RecoDiMuon Class Reference

#include <RecoDiMuon.h>

Inheritance diagram for RecoDiMuon:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

This class is an EDFilter choosing reconstructed di-muons

Author
Chang Liu - Purdue University

Definition at line 26 of file RecoDiMuon.h.

Constructor & Destructor Documentation

RecoDiMuon::RecoDiMuon ( const edm::ParameterSet iConfig)
explicit

Definition at line 25 of file RecoDiMuon.cc.

References diMuonPtMin_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), muonLabel_, and singleMuonPtMin_.

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

Definition at line 34 of file RecoDiMuon.cc.

35 {
36 }

Member Function Documentation

void RecoDiMuon::endJob ( void  )
virtual

Reimplemented from edm::EDFilter.

Definition at line 38 of file RecoDiMuon.cc.

References nAccepted_, and nEvents_.

39 {
40  edm::LogVerbatim("RecoDiMuon")
41  << "Events read " << nEvents_
42  << " Events accepted " << nAccepted_
43  << "\nEfficiency " << ((double)nAccepted_)/((double)nEvents_)
44  << std::endl;
45 }
unsigned int nAccepted_
Definition: RecoDiMuon.h:39
unsigned int nEvents_
Definition: RecoDiMuon.h:38
bool RecoDiMuon::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Definition at line 48 of file RecoDiMuon.cc.

References diMuonPtMin_, edm::Event::getByLabel(), edm::HandleBase::isValid(), metsig::muon, muonLabel_, electronCleaner_cfi::muons, nAccepted_, nEvents_, and singleMuonPtMin_.

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

Member Data Documentation

double RecoDiMuon::diMuonPtMin_
private

Definition at line 37 of file RecoDiMuon.h.

Referenced by filter(), and RecoDiMuon().

edm::InputTag RecoDiMuon::muonLabel_
private

Definition at line 35 of file RecoDiMuon.h.

Referenced by filter(), and RecoDiMuon().

unsigned int RecoDiMuon::nAccepted_
private

Definition at line 39 of file RecoDiMuon.h.

Referenced by endJob(), and filter().

unsigned int RecoDiMuon::nEvents_
private

Definition at line 38 of file RecoDiMuon.h.

Referenced by endJob(), and filter().

double RecoDiMuon::singleMuonPtMin_
private

Definition at line 36 of file RecoDiMuon.h.

Referenced by filter(), and RecoDiMuon().