#include <SUSYBSMAnalysis/CSA07Skims/interface/HadSUSYdiMuonSkim.h>
Public Member Functions | |
virtual void | endJob () |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
HadSUSYdiMuonSkim (const edm::ParameterSet &) | |
~HadSUSYdiMuonSkim () | |
Private Attributes | |
double | MuonPtmin_ |
edm::InputTag | Muonsrc_ |
unsigned int | nAccepted_ |
unsigned int | nEvents_ |
int | NminMuon_ |
double | PtmindiMuon_ |
Definition at line 24 of file HadSUSYdiMuonSkim.h.
HadSUSYdiMuonSkim::HadSUSYdiMuonSkim | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 40 of file HadSUSYdiMuonSkim.cc.
References edm::ParameterSet::getParameter(), MuonPtmin_, Muonsrc_, NminMuon_, and PtmindiMuon_.
00040 : 00041 nEvents_(0), nAccepted_(0) 00042 { 00043 Muonsrc_ = iConfig.getParameter<InputTag>( "Muonsrc" ); 00044 NminMuon_ = iConfig.getParameter<int>( "NminMuon"); 00045 MuonPtmin_ = iConfig.getParameter<double>( "MuonPtmin"); 00046 PtmindiMuon_ = iConfig.getParameter<double>( "PtmindiMuon"); 00047 }
HadSUSYdiMuonSkim::~HadSUSYdiMuonSkim | ( | ) |
Reimplemented from edm::EDFilter.
Definition at line 101 of file HadSUSYdiMuonSkim.cc.
References lat::endl(), nAccepted_, and nEvents_.
00102 { 00103 edm::LogVerbatim( "HadSUSYdiMuonSkim" ) 00104 << "Events read " << nEvents_ 00105 << " Events accepted " << nAccepted_ 00106 << "\nEfficiency " << (double)(nAccepted_)/(double)(nEvents_) 00107 << endl; 00108 }
bool HadSUSYdiMuonSkim::filter | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDFilter.
Definition at line 56 of file HadSUSYdiMuonSkim.cc.
References funct::cos(), edm::Event::getByLabel(), it, MuonPtmin_, Muonsrc_, nAccepted_, nEvents_, NminMuon_, PtmindiMuon_, funct::sin(), and funct::sqrt().
00058 { 00059 nEvents_++; 00060 00061 Handle<MuonCollection> MuonHandle; 00062 // try { 00063 iEvent.getByLabel( Muonsrc_, MuonHandle ); 00064 // } 00065 // catch ( cms::Exception& ex ) { 00066 // edm::LogError( "HadSUSYdiMuonSkim" ) 00067 // << "Unable to get Muon collection " 00068 // << Muonsrc_.label(); 00069 // return false; 00070 // } 00071 if ( MuonHandle->empty() ) return false; 00072 MuonCollection TheMuons = *MuonHandle; 00073 std::stable_sort( TheMuons.begin(), TheMuons.end(), PtSorter() ); 00074 00075 int nMuon = 0; 00076 double Pxdimuon = 0., Pydimuon = 0.; 00077 for ( MuonCollection::const_iterator it = TheMuons.begin(); 00078 it != TheMuons.end(); it++ ) { 00079 if ( (it->pt() > MuonPtmin_) 00080 && (fabs(it->eta()) < 3.0) ) { 00081 if ( nMuon < 2 ) { 00082 Pxdimuon += it->p()*sin(it->theta())*cos(it->phi()); 00083 Pydimuon += it->p()*sin(it->theta())*sin(it->phi()); 00084 } 00085 nMuon++; 00086 } 00087 } 00088 00089 if ( nMuon < NminMuon_ ) return false; 00090 00091 double PtdiMuon = sqrt( Pxdimuon*Pxdimuon + Pydimuon*Pydimuon ); 00092 if ( PtdiMuon < PtmindiMuon_ ) return false; 00093 00094 nAccepted_++; 00095 00096 return true; 00097 }
double HadSUSYdiMuonSkim::MuonPtmin_ [private] |
edm::InputTag HadSUSYdiMuonSkim::Muonsrc_ [private] |
unsigned int HadSUSYdiMuonSkim::nAccepted_ [private] |
unsigned int HadSUSYdiMuonSkim::nEvents_ [private] |
int HadSUSYdiMuonSkim::NminMuon_ [private] |
double HadSUSYdiMuonSkim::PtmindiMuon_ [private] |