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
HiggsToZZ4LeptonsSkim Class Reference

#include <HiggsToZZ4LeptonsSkim.h>

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

Public Member Functions

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

bool debug
 
int nEvents
 
int nLeptonMin
 
int nSelectedEvents
 
int nStiffLeptonMin
 
edm::InputTag recTrackLabel
 
float softMinPt
 
float stiffMinPt
 
edm::InputTag theGLBMuonLabel
 
edm::InputTag theGsfELabel
 

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

Definition at line 28 of file HiggsToZZ4LeptonsSkim.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file HiggsToZZ4LeptonsSkim.cc.

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

34  {
35 
36  // Local Debug flag
37  debug = pset.getParameter<bool>("DebugHiggsToZZ4LeptonsSkim");
38 
39  // Reconstructed objects
40  recTrackLabel = pset.getParameter<edm::InputTag>("RecoTrackLabel");
41  theGLBMuonLabel = pset.getParameter<edm::InputTag>("GlobalMuonCollectionLabel");
42  theGsfELabel = pset.getParameter<edm::InputTag>("ElectronCollectionLabel");
43 
44  // Minimum Pt for leptons for skimming
45  stiffMinPt = pset.getParameter<double>("stiffMinimumPt");
46  softMinPt = pset.getParameter<double>("softMinimumPt");
47  nStiffLeptonMin = pset.getParameter<int>("nStiffLeptonMinimum");
48  nLeptonMin = pset.getParameter<int>("nLeptonMinimum");
49 
50  nEvents = 0;
51  nSelectedEvents = 0;
52 
53 }
T getParameter(std::string const &) const
HiggsToZZ4LeptonsSkim::~HiggsToZZ4LeptonsSkim ( )

Definition at line 57 of file HiggsToZZ4LeptonsSkim.cc.

References nEvents.

57  {
58 
59  edm::LogVerbatim("HiggsToZZ4LeptonsSkim")
60  << " Number_events_read " << nEvents
61  << " Number_events_kept " << nSelectedEvents
62  << " Efficiency " << ((double)nSelectedEvents)/((double) nEvents + 0.01) << std::endl;
63 }

Member Function Documentation

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

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

Implements edm::EDFilter.

Definition at line 68 of file HiggsToZZ4LeptonsSkim.cc.

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

68  {
69 
70  nEvents++;
71 
73 
74  bool keepEvent = false;
75  int nStiffLeptons = 0;
76  int nLeptons = 0;
77 
78 
79  // First look at muons:
80 
81  // Get the muon track collection from the event
83  event.getByLabel(theGLBMuonLabel.label(), muTracks);
84 
85  if ( muTracks.isValid() ) {
86 
87  reco::TrackCollection::const_iterator muons;
88 
89  // Loop over muon collections and count how many muons there are,
90  // and how many are above threshold
91  for ( muons = muTracks->begin(); muons != muTracks->end(); ++muons ) {
92  if ( muons->pt() > stiffMinPt) nStiffLeptons++;
93  if ( muons->pt() > softMinPt) nLeptons++;
94  }
95  }
96 
97  // Now look at electrons:
98 
99  // Get the electron track collection from the event
101 
102  event.getByLabel(theGsfELabel.label(),pTracks);
103 
104  if ( pTracks.isValid() ) {
105 
106  const reco::GsfElectronCollection* eTracks = pTracks.product();
107 
108  reco::GsfElectronCollection::const_iterator electrons;
109 
110  // Loop over electron collections and count how many muons there are,
111  // and how many are above threshold
112  for ( electrons = eTracks->begin(); electrons != eTracks->end(); ++electrons ) {
113  float pt_e = electrons->pt();
114  if ( pt_e > stiffMinPt) nStiffLeptons++;
115  if ( pt_e > softMinPt) nLeptons++;
116  }
117  }
118 
119  // Make decision:
120  if ( nStiffLeptons >= nStiffLeptonMin && nLeptons >= nLeptonMin) keepEvent = true;
121 
122  if (keepEvent) nSelectedEvents++;
123 
124  return keepEvent;
125 }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
bool isValid() const
Definition: HandleBase.h:76
T const * product() const
Definition: Handle.h:74
std::string const & label() const
Definition: InputTag.h:25
tuple muons
Definition: patZpeak.py:38

Member Data Documentation

bool HiggsToZZ4LeptonsSkim::debug
private

Definition at line 45 of file HiggsToZZ4LeptonsSkim.h.

int HiggsToZZ4LeptonsSkim::nEvents
private

Definition at line 42 of file HiggsToZZ4LeptonsSkim.h.

int HiggsToZZ4LeptonsSkim::nLeptonMin
private

Definition at line 49 of file HiggsToZZ4LeptonsSkim.h.

int HiggsToZZ4LeptonsSkim::nSelectedEvents
private

Definition at line 42 of file HiggsToZZ4LeptonsSkim.h.

int HiggsToZZ4LeptonsSkim::nStiffLeptonMin
private

Definition at line 48 of file HiggsToZZ4LeptonsSkim.h.

edm::InputTag HiggsToZZ4LeptonsSkim::recTrackLabel
private

Definition at line 52 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::InputTag HiggsToZZ4LeptonsSkim::theGLBMuonLabel
private

Definition at line 53 of file HiggsToZZ4LeptonsSkim.h.

edm::InputTag HiggsToZZ4LeptonsSkim::theGsfELabel
private

Definition at line 54 of file HiggsToZZ4LeptonsSkim.h.