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

void endJob () override
 
bool filter (edm::Event &, const edm::EventSetup &) override
 
 RecoDiMuon (const edm::ParameterSet &)
 
 ~RecoDiMuon () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 24 of file RecoDiMuon.cc.

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

24  : nEvents_(0), nAccepted_(0) {
25  muonLabel_ = iConfig.getParameter<InputTag>("MuonLabel");
26  singleMuonPtMin_ = iConfig.getUntrackedParameter<double>("SingleMuonPtMin", 20.);
27  diMuonPtMin_ = iConfig.getUntrackedParameter<double>("DiMuonPtMin", 5.);
28 }
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 ( )
override

Definition at line 30 of file RecoDiMuon.cc.

30 {}

Member Function Documentation

void RecoDiMuon::endJob ( void  )
overridevirtual

Reimplemented from edm::EDFilter.

Definition at line 32 of file RecoDiMuon.cc.

References nAccepted_, and nEvents_.

32  {
33  edm::LogVerbatim("RecoDiMuon") << "Events read " << nEvents_ << " Events accepted " << nAccepted_ << "\nEfficiency "
34  << ((double)nAccepted_) / ((double)nEvents_) << std::endl;
35 }
unsigned int nAccepted_
Definition: RecoDiMuon.h:39
unsigned int nEvents_
Definition: RecoDiMuon.h:38
bool RecoDiMuon::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 38 of file RecoDiMuon.cc.

References cms::dd::accepted(), diMuonPtMin_, edm::Event::getByLabel(), edm::HandleBase::isValid(), HLT_2018_cff::muon, muonLabel_, PDWG_BPHSkim_cff::muons, nAccepted_, nEvents_, and singleMuonPtMin_.

38  {
39  nEvents_++;
40  bool accepted = false;
41  using namespace edm;
42 
44 
45  iEvent.getByLabel(muonLabel_, muons);
46  if (!muons.isValid()) {
47  edm::LogError("RecoDiMuon") << "FAILED to get Muon Track Collection. ";
48  return false;
49  }
50 
51  if (muons->empty()) {
52  return false;
53  }
54 
55  // at least one muons above a pt threshold singleMuonPtMin
56  // or at least 2 muons above a pt threshold diMuonPtMin
57  int nMuonOver2ndCut = 0;
58  for (reco::TrackCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
59  if (muon->pt() > singleMuonPtMin_)
60  accepted = true;
61  if (muon->pt() > diMuonPtMin_)
62  nMuonOver2ndCut++;
63  }
64  if (nMuonOver2ndCut >= 2)
65  accepted = true;
66 
67  if (accepted)
68  nAccepted_++;
69 
70  return accepted;
71 }
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:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
bool accepted(std::vector< std::string_view > const &, std::string_view)
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().