CMS 3D CMS Logo

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

#include <HiggsToWW2LeptonsSkim.h>

Inheritance diagram for HiggsToWW2LeptonsSkim:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void endJob () override
 
bool filter (edm::Event &, const edm::EventSetup &) override
 
 HiggsToWW2LeptonsSkim (const edm::ParameterSet &)
 
 ~HiggsToWW2LeptonsSkim () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 diTrackPtMin_
 
double etaMax_
 
double etaMin_
 
unsigned int nAccepted_
 
unsigned int nEvents_
 
double singleTrackPtMin_
 
edm::EDGetTokenT< reco::TrackCollectiontheGLBMuonToken
 
edm::EDGetTokenT< reco::GsfElectronCollectiontheGsfEToken
 

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
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

This class is an EDFilter for HWW events

Author
Ezio Torassa - INFN Padova

Definition at line 29 of file HiggsToWW2LeptonsSkim.h.

Constructor & Destructor Documentation

◆ HiggsToWW2LeptonsSkim()

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

Definition at line 31 of file HiggsToWW2LeptonsSkim.cc.

31  : nEvents_(0), nAccepted_(0) {
32  // Reconstructed objects
33  theGLBMuonToken = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("GlobalMuonCollectionLabel"));
34  theGsfEToken = consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("ElectronCollectionLabel"));
35 
36  singleTrackPtMin_ = iConfig.getParameter<double>("SingleTrackPtMin");
37  diTrackPtMin_ = iConfig.getParameter<double>("DiTrackPtMin");
38  etaMin_ = iConfig.getParameter<double>("etaMin");
39  etaMax_ = iConfig.getParameter<double>("etaMax");
40 }

References diTrackPtMin_, etaMax_, etaMin_, edm::ParameterSet::getParameter(), singleTrackPtMin_, theGLBMuonToken, and theGsfEToken.

◆ ~HiggsToWW2LeptonsSkim()

HiggsToWW2LeptonsSkim::~HiggsToWW2LeptonsSkim ( )
override

Definition at line 42 of file HiggsToWW2LeptonsSkim.cc.

42 {}

Member Function Documentation

◆ endJob()

void HiggsToWW2LeptonsSkim::endJob ( void  )
overridevirtual

Reimplemented from edm::EDFilter.

Definition at line 44 of file HiggsToWW2LeptonsSkim.cc.

44  {
45  edm::LogVerbatim("HiggsToWW2LeptonsSkim")
46  << "Events read " << nEvents_ << " Events accepted " << nAccepted_ << "\nEfficiency "
47  << ((double)nAccepted_) / ((double)nEvents_) << std::endl;
48 }

References nAccepted_, and nEvents_.

◆ filter()

bool HiggsToWW2LeptonsSkim::filter ( edm::Event event,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDFilter.

Definition at line 50 of file HiggsToWW2LeptonsSkim.cc.

50  {
51  nEvents_++;
52  bool accepted = false;
53  bool accepted1 = false;
54  int nTrackOver2ndCut = 0;
55 
56  // Handle<CandidateCollection> tracks;
57 
59 
60  // Get the muon track collection from the event
62  event.getByToken(theGLBMuonToken, muTracks);
63 
64  if (muTracks.isValid()) {
65  reco::TrackCollection::const_iterator muons;
66 
67  // Loop over muon collections and count how many muons there are,
68  // and how many are above threshold
69  for (muons = muTracks->begin(); muons != muTracks->end(); ++muons) {
70  if (muons->eta() > etaMin_ && muons->eta() < etaMax_) {
71  if (muons->pt() > singleTrackPtMin_)
72  accepted1 = true;
73  if (muons->pt() > diTrackPtMin_)
74  nTrackOver2ndCut++;
75  }
76  }
77  }
78 
79  // Now look at electrons:
80 
81  // Get the electron track collection from the event
83 
84  event.getByToken(theGsfEToken, pTracks);
85 
86  if (pTracks.isValid()) {
87  const reco::GsfElectronCollection* eTracks = pTracks.product();
88 
89  reco::GsfElectronCollection::const_iterator electrons;
90 
91  // Loop over electron collections and count how many muons there are,
92  // and how many are above threshold
93  for (electrons = eTracks->begin(); electrons != eTracks->end(); ++electrons) {
94  if (electrons->eta() > etaMin_ && electrons->eta() < etaMax_) {
95  if (electrons->pt() > singleTrackPtMin_)
96  accepted1 = true;
97  if (electrons->pt() > diTrackPtMin_)
98  nTrackOver2ndCut++;
99  }
100  }
101  }
102 
103  if (accepted1 && nTrackOver2ndCut >= 2)
104  accepted = true;
105 
106  if (accepted)
107  nAccepted_++;
108 
109  return accepted;
110 }

References cms::dd::accepted(), diTrackPtMin_, pwdgSkimBPark_cfi::electrons, etaMax_, etaMin_, edm::HandleBase::isValid(), PDWG_BPHSkim_cff::muons, nAccepted_, nEvents_, edm::Handle< T >::product(), singleTrackPtMin_, theGLBMuonToken, and theGsfEToken.

Member Data Documentation

◆ diTrackPtMin_

double HiggsToWW2LeptonsSkim::diTrackPtMin_
private

Definition at line 39 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

◆ etaMax_

double HiggsToWW2LeptonsSkim::etaMax_
private

Definition at line 41 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

◆ etaMin_

double HiggsToWW2LeptonsSkim::etaMin_
private

Definition at line 40 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

◆ nAccepted_

unsigned int HiggsToWW2LeptonsSkim::nAccepted_
private

Definition at line 43 of file HiggsToWW2LeptonsSkim.h.

Referenced by endJob(), and filter().

◆ nEvents_

unsigned int HiggsToWW2LeptonsSkim::nEvents_
private

Definition at line 42 of file HiggsToWW2LeptonsSkim.h.

Referenced by endJob(), and filter().

◆ singleTrackPtMin_

double HiggsToWW2LeptonsSkim::singleTrackPtMin_
private

Definition at line 38 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

◆ theGLBMuonToken

edm::EDGetTokenT<reco::TrackCollection> HiggsToWW2LeptonsSkim::theGLBMuonToken
private

Definition at line 46 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

◆ theGsfEToken

edm::EDGetTokenT<reco::GsfElectronCollection> HiggsToWW2LeptonsSkim::theGsfEToken
private

Definition at line 47 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
edm::Handle::product
T const * product() const
Definition: Handle.h:70
HiggsToWW2LeptonsSkim::singleTrackPtMin_
double singleTrackPtMin_
Definition: HiggsToWW2LeptonsSkim.h:38
reco::GsfElectronCollection
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
Definition: GsfElectronFwd.h:14
edm::Handle< reco::TrackCollection >
HiggsToWW2LeptonsSkim::theGLBMuonToken
edm::EDGetTokenT< reco::TrackCollection > theGLBMuonToken
Definition: HiggsToWW2LeptonsSkim.h:46
cms::dd::accepted
bool accepted(std::vector< std::regex > const &, std::string_view)
HiggsToWW2LeptonsSkim::diTrackPtMin_
double diTrackPtMin_
Definition: HiggsToWW2LeptonsSkim.h:39
HiggsToWW2LeptonsSkim::theGsfEToken
edm::EDGetTokenT< reco::GsfElectronCollection > theGsfEToken
Definition: HiggsToWW2LeptonsSkim.h:47
edm::LogVerbatim
Definition: MessageLogger.h:297
HiggsToWW2LeptonsSkim::etaMin_
double etaMin_
Definition: HiggsToWW2LeptonsSkim.h:40
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
HiggsToWW2LeptonsSkim::etaMax_
double etaMax_
Definition: HiggsToWW2LeptonsSkim.h:41
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
HiggsToWW2LeptonsSkim::nAccepted_
unsigned int nAccepted_
Definition: HiggsToWW2LeptonsSkim.h:43
HiggsToWW2LeptonsSkim::nEvents_
unsigned int nEvents_
Definition: HiggsToWW2LeptonsSkim.h:42