#include <SUSYBSMAnalysis/CSA07Skims/interface/HadSUSYdiElecSkim.h>
Public Member Functions | |
virtual void | endJob () |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
HadSUSYdiElecSkim (const edm::ParameterSet &) | |
~HadSUSYdiElecSkim () | |
Private Attributes | |
double | ElecPtmin_ |
edm::InputTag | Elecsrc_ |
unsigned int | nAccepted_ |
unsigned int | nEvents_ |
int | NminElec_ |
double | PtmindiElec_ |
all hadronic SUSY Skim >= 2 barrel muons 30 GeV, Pt(2muons)>150 Z-Candle, dimuon/Z trigger path
Definition at line 24 of file HadSUSYdiElecSkim.h.
HadSUSYdiElecSkim::HadSUSYdiElecSkim | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 40 of file HadSUSYdiElecSkim.cc.
References ElecPtmin_, Elecsrc_, edm::ParameterSet::getParameter(), NminElec_, and PtmindiElec_.
00040 : 00041 nEvents_(0), nAccepted_(0) 00042 { 00043 Elecsrc_ = iConfig.getParameter<InputTag>( "Elecsrc" ); 00044 NminElec_ = iConfig.getParameter<int>( "NminElec"); 00045 ElecPtmin_ = iConfig.getParameter<double>( "ElecPtmin"); 00046 PtmindiElec_ = iConfig.getParameter<double>( "PtmindiElec"); 00047 }
HadSUSYdiElecSkim::~HadSUSYdiElecSkim | ( | ) |
Reimplemented from edm::EDFilter.
Definition at line 101 of file HadSUSYdiElecSkim.cc.
References lat::endl(), nAccepted_, and nEvents_.
00102 { 00103 edm::LogVerbatim( "HadSUSYdiElecSkim" ) 00104 << "Events read " << nEvents_ 00105 << " Events accepted " << nAccepted_ 00106 << "\nEfficiency " << (double)(nAccepted_)/(double)(nEvents_) 00107 << endl; 00108 }
bool HadSUSYdiElecSkim::filter | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDFilter.
Definition at line 56 of file HadSUSYdiElecSkim.cc.
References funct::cos(), ElecPtmin_, Elecsrc_, edm::Event::getByLabel(), it, nAccepted_, nEvents_, NminElec_, PtmindiElec_, funct::sin(), and funct::sqrt().
00058 { 00059 nEvents_++; 00060 00061 Handle<GsfElectronCollection> ElecHandle; 00062 // try { 00063 iEvent.getByLabel( Elecsrc_, ElecHandle ); 00064 // } 00065 // catch ( cms::Exception& ex ) { 00066 // edm::LogError( "HadSUSYdiElecSkim" ) 00067 // << "Unable to get Elec collection " 00068 // << Elecsrc_.label(); 00069 // return false; 00070 // } 00071 if ( ElecHandle->empty() ) return false; 00072 GsfElectronCollection TheElecs = *ElecHandle; 00073 std::stable_sort( TheElecs.begin(), TheElecs.end(), PtSorter() ); 00074 00075 int nElec = 0; 00076 double Pxdielec = 0., Pydielec = 0.; 00077 for ( GsfElectronCollection::const_iterator it = TheElecs.begin(); 00078 it != TheElecs.end(); it++ ) { 00079 if ( (it->pt() > ElecPtmin_) 00080 && (fabs(it->eta()) < 3.0) ) { 00081 if ( nElec < 2 ) { 00082 Pxdielec += it->p()*sin(it->theta())*cos(it->phi()); 00083 Pydielec += it->p()*sin(it->theta())*sin(it->phi()); 00084 } 00085 nElec++; 00086 } 00087 } 00088 00089 if ( nElec < NminElec_ ) return false; 00090 00091 double PtdiElec = sqrt( Pxdielec*Pxdielec + Pydielec*Pydielec ); 00092 if ( PtdiElec < PtmindiElec_ ) return false; 00093 00094 nAccepted_++; 00095 00096 return true; 00097 }
double HadSUSYdiElecSkim::ElecPtmin_ [private] |
edm::InputTag HadSUSYdiElecSkim::Elecsrc_ [private] |
unsigned int HadSUSYdiElecSkim::nAccepted_ [private] |
unsigned int HadSUSYdiElecSkim::nEvents_ [private] |
int HadSUSYdiElecSkim::NminElec_ [private] |
double HadSUSYdiElecSkim::PtmindiElec_ [private] |