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

#include <HiggsToWW2LeptonsSkim.h>

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

Public Member Functions

virtual void endJob ()
 
virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 HiggsToWW2LeptonsSkim (const edm::ParameterSet &)
 
 ~HiggsToWW2LeptonsSkim ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

double diTrackPtMin_
 
double etaMax_
 
double etaMin_
 
unsigned int nAccepted_
 
unsigned int nEvents_
 
edm::InputTag recTrackLabel
 
double singleTrackPtMin_
 
edm::InputTag theGLBMuonLabel
 
edm::InputTag theGsfELabel
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 for HWW events

Author
Ezio Torassa - INFN Padova

Definition at line 26 of file HiggsToWW2LeptonsSkim.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file HiggsToWW2LeptonsSkim.cc.

References diTrackPtMin_, etaMax_, etaMin_, edm::ParameterSet::getParameter(), recTrackLabel, singleTrackPtMin_, theGLBMuonLabel, and theGsfELabel.

35  :
36  nEvents_(0), nAccepted_(0)
37 {
38 
39  // Reconstructed objects
40  recTrackLabel = iConfig.getParameter<edm::InputTag>("RecoTrackLabel");
41  theGLBMuonLabel = iConfig.getParameter<edm::InputTag>("GlobalMuonCollectionLabel");
42  theGsfELabel = iConfig.getParameter<edm::InputTag>("ElectronCollectionLabel");
43 
44  singleTrackPtMin_ = iConfig.getParameter<double>("SingleTrackPtMin");
45  diTrackPtMin_ = iConfig.getParameter<double>("DiTrackPtMin");
46  etaMin_ = iConfig.getParameter<double>("etaMin");
47  etaMax_ = iConfig.getParameter<double>("etaMax");
48 }
T getParameter(std::string const &) const
HiggsToWW2LeptonsSkim::~HiggsToWW2LeptonsSkim ( )

Definition at line 51 of file HiggsToWW2LeptonsSkim.cc.

52 {
53 }

Member Function Documentation

void HiggsToWW2LeptonsSkim::endJob ( void  )
virtual

Reimplemented from edm::EDFilter.

Definition at line 55 of file HiggsToWW2LeptonsSkim.cc.

References nAccepted_, and nEvents_.

56 {
57  edm::LogVerbatim("HiggsToWW2LeptonsSkim")
58  << "Events read " << nEvents_
59  << " Events accepted " << nAccepted_
60  << "\nEfficiency " << ((double)nAccepted_)/((double)nEvents_)
61  << std::endl;
62 }
bool HiggsToWW2LeptonsSkim::filter ( edm::Event event,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDFilter.

Definition at line 65 of file HiggsToWW2LeptonsSkim.cc.

References diTrackPtMin_, HI_PhotonSkim_cff::electrons, etaMax_, etaMin_, edm::HandleBase::isValid(), edm::InputTag::label(), patZpeak::muons, nAccepted_, nEvents_, edm::Handle< T >::product(), singleTrackPtMin_, theGLBMuonLabel, and theGsfELabel.

66 {
67 
68  nEvents_++;
69  bool accepted = false;
70  bool accepted1 = false;
71  int nTrackOver2ndCut = 0;
72 
73 
74  // Handle<CandidateCollection> tracks;
75 
77 
78  // Get the muon track collection from the event
80  event.getByLabel(theGLBMuonLabel.label(), muTracks);
81 
82  if ( muTracks.isValid() ) {
83 
84  reco::TrackCollection::const_iterator muons;
85 
86  // Loop over muon collections and count how many muons there are,
87  // and how many are above threshold
88  for ( muons = muTracks->begin(); muons != muTracks->end(); ++muons ) {
89  if ( muons->eta() > etaMin_ && muons->eta() < etaMax_ ) {
90  if ( muons->pt() > singleTrackPtMin_ ) accepted1 = true;
91  if ( muons->pt() > diTrackPtMin_ ) nTrackOver2ndCut++;
92  }
93  }
94  }
95 
96  // Now look at electrons:
97 
98  // Get the electron track collection from the event
100 
101  event.getByLabel(theGsfELabel.label(),pTracks);
102 
103  if ( pTracks.isValid() ) {
104 
105  const reco::GsfElectronCollection* eTracks = pTracks.product();
106 
107  reco::GsfElectronCollection::const_iterator electrons;
108 
109  // Loop over electron collections and count how many muons there are,
110  // and how many are above threshold
111  for ( electrons = eTracks->begin(); electrons != eTracks->end(); ++electrons ) {
112  if ( electrons->eta() > etaMin_ && electrons->eta() < etaMax_ ) {
113  if ( electrons->pt() > singleTrackPtMin_ ) accepted1 = true;
114  if ( electrons->pt() > diTrackPtMin_ ) nTrackOver2ndCut++;
115  }
116  }
117  }
118 
119 
120  if ( accepted1 && nTrackOver2ndCut >= 2 ) accepted = true;
121 
122  if ( accepted ) nAccepted_++;
123 
124  return accepted;
125 
126 }
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:81
std::string const & label() const
Definition: InputTag.h:42
tuple muons
Definition: patZpeak.py:38

Member Data Documentation

double HiggsToWW2LeptonsSkim::diTrackPtMin_
private

Definition at line 36 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

double HiggsToWW2LeptonsSkim::etaMax_
private

Definition at line 38 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

double HiggsToWW2LeptonsSkim::etaMin_
private

Definition at line 37 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

unsigned int HiggsToWW2LeptonsSkim::nAccepted_
private

Definition at line 40 of file HiggsToWW2LeptonsSkim.h.

Referenced by endJob(), and filter().

unsigned int HiggsToWW2LeptonsSkim::nEvents_
private

Definition at line 39 of file HiggsToWW2LeptonsSkim.h.

Referenced by endJob(), and filter().

edm::InputTag HiggsToWW2LeptonsSkim::recTrackLabel
private

Definition at line 43 of file HiggsToWW2LeptonsSkim.h.

Referenced by HiggsToWW2LeptonsSkim().

double HiggsToWW2LeptonsSkim::singleTrackPtMin_
private

Definition at line 35 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

edm::InputTag HiggsToWW2LeptonsSkim::theGLBMuonLabel
private

Definition at line 44 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

edm::InputTag HiggsToWW2LeptonsSkim::theGsfELabel
private

Definition at line 45 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().