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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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_
 
double singleTrackPtMin_
 
edm::EDGetTokenT
< reco::TrackCollection
theGLBMuonToken
 
edm::EDGetTokenT
< reco::GsfElectronCollection
theGsfEToken
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
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 &)
 
- 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 29 of file HiggsToWW2LeptonsSkim.h.

Constructor & Destructor Documentation

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

Definition at line 32 of file HiggsToWW2LeptonsSkim.cc.

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

32  :
33  nEvents_(0), nAccepted_(0)
34 {
35 
36  // Reconstructed objects
37  theGLBMuonToken = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("GlobalMuonCollectionLabel"));
38  theGsfEToken = consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("ElectronCollectionLabel"));
39 
40  singleTrackPtMin_ = iConfig.getParameter<double>("SingleTrackPtMin");
41  diTrackPtMin_ = iConfig.getParameter<double>("DiTrackPtMin");
42  etaMin_ = iConfig.getParameter<double>("etaMin");
43  etaMax_ = iConfig.getParameter<double>("etaMax");
44 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > theGLBMuonToken
edm::EDGetTokenT< reco::GsfElectronCollection > theGsfEToken
HiggsToWW2LeptonsSkim::~HiggsToWW2LeptonsSkim ( )

Definition at line 47 of file HiggsToWW2LeptonsSkim.cc.

48 {
49 }

Member Function Documentation

void HiggsToWW2LeptonsSkim::endJob ( void  )
virtual

Reimplemented from edm::EDFilter.

Definition at line 51 of file HiggsToWW2LeptonsSkim.cc.

References nAccepted_, and nEvents_.

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

Implements edm::EDFilter.

Definition at line 61 of file HiggsToWW2LeptonsSkim.cc.

References diTrackPtMin_, etaMax_, etaMin_, edm::HandleBase::isValid(), patZpeak::muons, nAccepted_, nEvents_, edm::Handle< T >::product(), singleTrackPtMin_, theGLBMuonToken, and theGsfEToken.

62 {
63 
64  nEvents_++;
65  bool accepted = false;
66  bool accepted1 = false;
67  int nTrackOver2ndCut = 0;
68 
69 
70  // Handle<CandidateCollection> tracks;
71 
73 
74  // Get the muon track collection from the event
76  event.getByToken(theGLBMuonToken, muTracks);
77 
78  if ( muTracks.isValid() ) {
79 
80  reco::TrackCollection::const_iterator muons;
81 
82  // Loop over muon collections and count how many muons there are,
83  // and how many are above threshold
84  for ( muons = muTracks->begin(); muons != muTracks->end(); ++muons ) {
85  if ( muons->eta() > etaMin_ && muons->eta() < etaMax_ ) {
86  if ( muons->pt() > singleTrackPtMin_ ) accepted1 = true;
87  if ( muons->pt() > diTrackPtMin_ ) nTrackOver2ndCut++;
88  }
89  }
90  }
91 
92  // Now look at electrons:
93 
94  // Get the electron track collection from the event
96 
97  event.getByToken(theGsfEToken,pTracks);
98 
99  if ( pTracks.isValid() ) {
100 
101  const reco::GsfElectronCollection* eTracks = pTracks.product();
102 
103  reco::GsfElectronCollection::const_iterator electrons;
104 
105  // Loop over electron collections and count how many muons there are,
106  // and how many are above threshold
107  for ( electrons = eTracks->begin(); electrons != eTracks->end(); ++electrons ) {
108  if ( electrons->eta() > etaMin_ && electrons->eta() < etaMax_ ) {
109  if ( electrons->pt() > singleTrackPtMin_ ) accepted1 = true;
110  if ( electrons->pt() > diTrackPtMin_ ) nTrackOver2ndCut++;
111  }
112  }
113  }
114 
115 
116  if ( accepted1 && nTrackOver2ndCut >= 2 ) accepted = true;
117 
118  if ( accepted ) nAccepted_++;
119 
120  return accepted;
121 
122 }
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
bool isValid() const
Definition: HandleBase.h:75
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< reco::TrackCollection > theGLBMuonToken
tuple muons
Definition: patZpeak.py:38
edm::EDGetTokenT< reco::GsfElectronCollection > theGsfEToken

Member Data Documentation

double HiggsToWW2LeptonsSkim::diTrackPtMin_
private

Definition at line 39 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

double HiggsToWW2LeptonsSkim::etaMax_
private

Definition at line 41 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

double HiggsToWW2LeptonsSkim::etaMin_
private

Definition at line 40 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

unsigned int HiggsToWW2LeptonsSkim::nAccepted_
private

Definition at line 43 of file HiggsToWW2LeptonsSkim.h.

Referenced by endJob(), and filter().

unsigned int HiggsToWW2LeptonsSkim::nEvents_
private

Definition at line 42 of file HiggsToWW2LeptonsSkim.h.

Referenced by endJob(), and filter().

double HiggsToWW2LeptonsSkim::singleTrackPtMin_
private

Definition at line 38 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

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

Definition at line 46 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

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

Definition at line 47 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().