CMS 3D CMS Logo

TeVdiMuonSkim Class Reference

a skim for TeV dimuon analyses requires 2 muon with a selectable Pt cut More...

#include <SUSYBSMAnalysis/CSA07Skims/interface/TeVdiMuonSkim.h>

Inheritance diagram for TeVdiMuonSkim:

edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void endJob ()
virtual bool filter (edm::Event &, const edm::EventSetup &)
 TeVdiMuonSkim (const edm::ParameterSet &)
 ~TeVdiMuonSkim ()

Private Attributes

double MuonPtmin_
edm::InputTag Muonsrc_
unsigned int nAccepted_
unsigned int nEvents_


Detailed Description

a skim for TeV dimuon analyses requires 2 muon with a selectable Pt cut

Date
2007/08/06 17:33:13
Revision
1.1

Author:
Piotr Traczyk - SINS Warsaw
Date
2007/09/25 17:54:51
Revision
1.4

Author:
Piotr Traczyk - SINS Warsaw

Definition at line 23 of file TeVdiMuonSkim.h.


Constructor & Destructor Documentation

TeVdiMuonSkim::TeVdiMuonSkim ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 32 of file TeVdiMuonSkim.cc.

References edm::ParameterSet::getParameter(), MuonPtmin_, and Muonsrc_.

00032                                                              :
00033   nEvents_(0), nAccepted_(0)
00034 {
00035   Muonsrc_ = iConfig.getParameter<InputTag>( "Muonsrc" );
00036   MuonPtmin_ = iConfig.getParameter<double>( "MuonPtmin");
00037 }

TeVdiMuonSkim::~TeVdiMuonSkim (  ) 

Definition at line 41 of file TeVdiMuonSkim.cc.

00042 {}


Member Function Documentation

void TeVdiMuonSkim::endJob ( void   )  [virtual]

Reimplemented from edm::EDFilter.

Definition at line 71 of file TeVdiMuonSkim.cc.

References lat::endl(), nAccepted_, and nEvents_.

00072 {
00073   edm::LogVerbatim("TeVdiMuonSkim") 
00074     << "Events read " << nEvents_
00075     << " Events accepted " << nAccepted_
00076     << "\nEfficiency " << (double)(nAccepted_)/(double)(nEvents_) 
00077     << endl;
00078 }

bool TeVdiMuonSkim::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDFilter.

Definition at line 46 of file TeVdiMuonSkim.cc.

References edm::Event::getByLabel(), it, MuonPtmin_, Muonsrc_, nAccepted_, and nEvents_.

00048 {
00049   nEvents_++;
00050 
00051   Handle<MuonCollection> MuonHandle;
00052   iEvent.getByLabel(Muonsrc_, MuonHandle);
00053 
00054   if (MuonHandle->empty()) return false;
00055   
00056   MuonCollection theMuonC = *MuonHandle;
00057   
00058   int nMuons=0;
00059   for ( MuonCollection::const_iterator it=theMuonC.begin(); it!=theMuonC.end(); it++ )
00060     if (it->pt()>MuonPtmin_) nMuons++;
00061   
00062   if (nMuons<2) return false;
00063 
00064   nAccepted_++;
00065 
00066   return true;
00067 }


Member Data Documentation

double TeVdiMuonSkim::MuonPtmin_ [private]

Definition at line 34 of file TeVdiMuonSkim.h.

Referenced by filter(), and TeVdiMuonSkim().

edm::InputTag TeVdiMuonSkim::Muonsrc_ [private]

Definition at line 32 of file TeVdiMuonSkim.h.

Referenced by filter(), and TeVdiMuonSkim().

unsigned int TeVdiMuonSkim::nAccepted_ [private]

Definition at line 36 of file TeVdiMuonSkim.h.

Referenced by endJob(), and filter().

unsigned int TeVdiMuonSkim::nEvents_ [private]

Definition at line 35 of file TeVdiMuonSkim.h.

Referenced by endJob(), and filter().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:33:22 2009 for CMSSW by  doxygen 1.5.4