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::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 ()
 
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

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
 
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

This class is an EDFilter for HWW events

Date:
2009/01/09 10:23:15
Revision:
1.12
Author
Ezio Torassa - INFN Padova

Definition at line 28 of file HiggsToWW2LeptonsSkim.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file HiggsToWW2LeptonsSkim.cc.

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

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

Definition at line 53 of file HiggsToWW2LeptonsSkim.cc.

54 {
55 }

Member Function Documentation

void HiggsToWW2LeptonsSkim::endJob ( void  )
virtual

Reimplemented from edm::EDFilter.

Definition at line 57 of file HiggsToWW2LeptonsSkim.cc.

References nAccepted_, and nEvents_.

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

Implements edm::EDFilter.

Definition at line 67 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.

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

double HiggsToWW2LeptonsSkim::diTrackPtMin_
private

Definition at line 38 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

double HiggsToWW2LeptonsSkim::etaMax_
private

Definition at line 40 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

double HiggsToWW2LeptonsSkim::etaMin_
private

Definition at line 39 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

unsigned int HiggsToWW2LeptonsSkim::nAccepted_
private

Definition at line 42 of file HiggsToWW2LeptonsSkim.h.

Referenced by endJob(), and filter().

unsigned int HiggsToWW2LeptonsSkim::nEvents_
private

Definition at line 41 of file HiggsToWW2LeptonsSkim.h.

Referenced by endJob(), and filter().

edm::InputTag HiggsToWW2LeptonsSkim::recTrackLabel
private

Definition at line 45 of file HiggsToWW2LeptonsSkim.h.

Referenced by HiggsToWW2LeptonsSkim().

double HiggsToWW2LeptonsSkim::singleTrackPtMin_
private

Definition at line 37 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

edm::InputTag HiggsToWW2LeptonsSkim::theGLBMuonLabel
private

Definition at line 46 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().

edm::InputTag HiggsToWW2LeptonsSkim::theGsfELabel
private

Definition at line 47 of file HiggsToWW2LeptonsSkim.h.

Referenced by filter(), and HiggsToWW2LeptonsSkim().