CMS 3D CMS Logo

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

#include <HiggsToZZ4LeptonsSkim.h>

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

Public Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 Get event properties to send to builder to fill seed collection. More...
 
 HiggsToZZ4LeptonsSkim (const edm::ParameterSet &)
 
 ~HiggsToZZ4LeptonsSkim () 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

bool debug
 
int nEvents
 
int nLeptonMin
 
int nSelectedEvents
 
int nStiffLeptonMin
 
float softMinPt
 
float stiffMinPt
 
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
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

Definition at line 31 of file HiggsToZZ4LeptonsSkim.h.

Constructor & Destructor Documentation

HiggsToZZ4LeptonsSkim::HiggsToZZ4LeptonsSkim ( const edm::ParameterSet pset)
explicit

Definition at line 31 of file HiggsToZZ4LeptonsSkim.cc.

References debug, edm::ParameterSet::getParameter(), and nEvents.

31  {
32  // Local Debug flag
33  debug = pset.getParameter<bool>("DebugHiggsToZZ4LeptonsSkim");
34 
35  // Reconstructed objects
36  theGLBMuonToken = consumes<reco::TrackCollection>(pset.getParameter<edm::InputTag>("GlobalMuonCollectionLabel"));
37  theGsfEToken = consumes<reco::GsfElectronCollection>(pset.getParameter<edm::InputTag>("ElectronCollectionLabel"));
38 
39  // Minimum Pt for leptons for skimming
40  stiffMinPt = pset.getParameter<double>("stiffMinimumPt");
41  softMinPt = pset.getParameter<double>("softMinimumPt");
42  nStiffLeptonMin = pset.getParameter<int>("nStiffLeptonMinimum");
43  nLeptonMin = pset.getParameter<int>("nLeptonMinimum");
44 
45  nEvents = 0;
46  nSelectedEvents = 0;
47 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > theGLBMuonToken
edm::EDGetTokenT< reco::GsfElectronCollection > theGsfEToken
HiggsToZZ4LeptonsSkim::~HiggsToZZ4LeptonsSkim ( )
override

Definition at line 50 of file HiggsToZZ4LeptonsSkim.cc.

References nEvents.

50  {
51  edm::LogVerbatim("HiggsToZZ4LeptonsSkim")
52  << " Number_events_read " << nEvents << " Number_events_kept " << nSelectedEvents << " Efficiency "
53  << ((double)nSelectedEvents) / ((double)nEvents + 0.01) << std::endl;
54 }

Member Function Documentation

bool HiggsToZZ4LeptonsSkim::filter ( edm::Event event,
const edm::EventSetup setup 
)
override

Get event properties to send to builder to fill seed collection.

Definition at line 57 of file HiggsToZZ4LeptonsSkim.cc.

References pwdgSkimBPark_cfi::electrons, edm::HandleBase::isValid(), PDWG_BPHSkim_cff::muons, nEvents, and edm::Handle< T >::product().

57  {
58  nEvents++;
59 
61 
62  bool keepEvent = false;
63  int nStiffLeptons = 0;
64  int nLeptons = 0;
65 
66  // First look at muons:
67 
68  // Get the muon track collection from the event
70  event.getByToken(theGLBMuonToken, muTracks);
71 
72  if (muTracks.isValid()) {
73  reco::TrackCollection::const_iterator muons;
74 
75  // Loop over muon collections and count how many muons there are,
76  // and how many are above threshold
77  for (muons = muTracks->begin(); muons != muTracks->end(); ++muons) {
78  if (muons->pt() > stiffMinPt)
79  nStiffLeptons++;
80  if (muons->pt() > softMinPt)
81  nLeptons++;
82  }
83  }
84 
85  // Now look at electrons:
86 
87  // Get the electron track collection from the event
89  event.getByToken(theGsfEToken, pTracks);
90 
91  if (pTracks.isValid()) {
92  const reco::GsfElectronCollection* eTracks = pTracks.product();
93 
94  reco::GsfElectronCollection::const_iterator electrons;
95 
96  // Loop over electron collections and count how many muons there are,
97  // and how many are above threshold
98  for (electrons = eTracks->begin(); electrons != eTracks->end(); ++electrons) {
99  float pt_e = electrons->pt();
100  if (pt_e > stiffMinPt)
101  nStiffLeptons++;
102  if (pt_e > softMinPt)
103  nLeptons++;
104  }
105  }
106 
107  // Make decision:
108  if (nStiffLeptons >= nStiffLeptonMin && nLeptons >= nLeptonMin)
109  keepEvent = true;
110 
111  if (keepEvent)
112  nSelectedEvents++;
113 
114  return keepEvent;
115 }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::EDGetTokenT< reco::TrackCollection > theGLBMuonToken
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
bool isValid() const
Definition: HandleBase.h:70
T const * product() const
Definition: Handle.h:69
edm::EDGetTokenT< reco::GsfElectronCollection > theGsfEToken

Member Data Documentation

bool HiggsToZZ4LeptonsSkim::debug
private
int HiggsToZZ4LeptonsSkim::nEvents
private

Definition at line 43 of file HiggsToZZ4LeptonsSkim.h.

Referenced by looper.Looper::loop().

int HiggsToZZ4LeptonsSkim::nLeptonMin
private

Definition at line 49 of file HiggsToZZ4LeptonsSkim.h.

int HiggsToZZ4LeptonsSkim::nSelectedEvents
private

Definition at line 43 of file HiggsToZZ4LeptonsSkim.h.

int HiggsToZZ4LeptonsSkim::nStiffLeptonMin
private

Definition at line 48 of file HiggsToZZ4LeptonsSkim.h.

float HiggsToZZ4LeptonsSkim::softMinPt
private

Definition at line 47 of file HiggsToZZ4LeptonsSkim.h.

float HiggsToZZ4LeptonsSkim::stiffMinPt
private

Definition at line 46 of file HiggsToZZ4LeptonsSkim.h.

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

Definition at line 52 of file HiggsToZZ4LeptonsSkim.h.

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

Definition at line 53 of file HiggsToZZ4LeptonsSkim.h.