#include <SUSYBSMAnalysis/CSA07Skims/interface/LepSUSYSkim.h>
Public Member Functions | |
virtual void | endJob () |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
LepSUSYSkim (const edm::ParameterSet &) | |
~LepSUSYSkim () | |
Private Attributes | |
double | CaloJet1Ptmin_ |
double | CaloJet2Ptmin_ |
edm::InputTag | CaloJetsrc_ |
double | CaloMetmin_ |
edm::InputTag | CaloMETsrc_ |
double | ElecPtmin_ |
edm::InputTag | Elecsrc_ |
double | MuonPtmin_ |
edm::InputTag | Muonsrc_ |
unsigned int | nAccepted_ |
unsigned int | nEvents_ |
int | NminCaloJet_ |
int | NminElec_ |
int | NminMuon_ |
Definition at line 31 of file LepSUSYSkim.h.
LepSUSYSkim::LepSUSYSkim | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 51 of file LepSUSYSkim.cc.
References CaloJet1Ptmin_, CaloJet2Ptmin_, CaloJetsrc_, CaloMetmin_, CaloMETsrc_, ElecPtmin_, Elecsrc_, edm::ParameterSet::getParameter(), MuonPtmin_, Muonsrc_, NminCaloJet_, NminElec_, and NminMuon_.
00051 : 00052 nEvents_(0), nAccepted_(0) 00053 { 00054 Muonsrc_ = iConfig.getParameter<InputTag>( "Muonsrc" ); 00055 Elecsrc_ = iConfig.getParameter<InputTag>( "Elecsrc" ); 00056 CaloJetsrc_ = iConfig.getParameter<InputTag>( "CaloJetsrc" ); 00057 CaloMETsrc_ = iConfig.getParameter<InputTag>( "CaloMETsrc" ); 00058 NminMuon_ = iConfig.getParameter<int>( "NminMuon"); 00059 MuonPtmin_ = iConfig.getParameter<double>( "MuonPtmin"); 00060 NminElec_ = iConfig.getParameter<int>( "NminElec"); 00061 ElecPtmin_ = iConfig.getParameter<double>( "ElecPtmin"); 00062 NminCaloJet_ = iConfig.getParameter<int>( "NminCaloJet"); 00063 CaloJet1Ptmin_ = iConfig.getParameter<double>( "CaloJet1Ptmin"); 00064 CaloJet2Ptmin_ = iConfig.getParameter<double>( "CaloJet2Ptmin"); 00065 CaloMetmin_ = iConfig.getParameter<double>( "CaloMetmin" ); 00066 00067 }
LepSUSYSkim::~LepSUSYSkim | ( | ) |
Reimplemented from edm::EDFilter.
Definition at line 201 of file LepSUSYSkim.cc.
References lat::endl(), nAccepted_, and nEvents_.
00202 { 00203 edm::LogVerbatim( "LepSUSYSkim" ) 00204 << "Events read " << nEvents_ 00205 << "\nEvents accepted " << nAccepted_ 00206 << "\nEfficiency " << (double)(nAccepted_)/(double)(nEvents_) 00207 << endl; 00208 }
bool LepSUSYSkim::filter | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDFilter.
Definition at line 76 of file LepSUSYSkim.cc.
References CaloJet1Ptmin_, CaloJet2Ptmin_, CaloJetsrc_, CaloMetmin_, CaloMETsrc_, ElecPtmin_, Elecsrc_, edm::Event::getByLabel(), it, MuonPtmin_, Muonsrc_, nAccepted_, nEvents_, NminCaloJet_, NminElec_, and NminMuon_.
00078 { 00079 nEvents_++; 00080 00081 00082 // Get the muon collection 00083 Handle<MuonCollection> MuonHandle; 00084 // try { 00085 iEvent.getByLabel( Muonsrc_, MuonHandle ); 00086 // } 00087 // catch ( cms::Exception& ex ) { 00088 // edm::LogError( "LepSUSYSkim" ) 00089 // << "Unable to get Muon collection " 00090 // << Muonsrc_.label(); 00091 // return false; 00092 // } 00093 MuonCollection TheMuons = *MuonHandle; 00094 std::stable_sort( TheMuons.begin(), TheMuons.end(), PtSorter() ); 00095 00096 // Get the electron collection 00097 Handle<GsfElectronCollection> ElecHandle; 00098 // try { 00099 iEvent.getByLabel( Elecsrc_, ElecHandle ); 00100 // } 00101 // catch ( cms::Exception& ex ) { 00102 // edm::LogError( "LepSUSYSFOSElecSkim" ) 00103 // << "Unable to get Elec collection " 00104 // << Elecsrc_.label(); 00105 // return false; 00106 // } 00107 GsfElectronCollection TheElecs = *ElecHandle; 00108 std::stable_sort( TheElecs.begin(), TheElecs.end(), PtSorter() ); 00109 00110 00111 // Get the caloJet collection 00112 Handle<CaloJetCollection> CaloJetsHandle; 00113 // try { 00114 iEvent.getByLabel( CaloJetsrc_, CaloJetsHandle ); 00115 // } 00116 // catch ( cms::Exception& ex ) { 00117 // edm::LogError( "LepSUSYSkim" ) 00118 // << "Unable to get CaloJet collection " 00119 // << CaloJetsrc_.label(); 00120 // return false; 00121 // } 00122 CaloJetCollection TheCaloJets = *CaloJetsHandle; 00123 std::stable_sort( TheCaloJets.begin(), TheCaloJets.end(), PtSorter() ); 00124 00125 // Get the caloMetCollection 00126 Handle<CaloMETCollection> METHandle; 00127 // try { 00128 iEvent.getByLabel( CaloMETsrc_, METHandle ); 00129 // } 00130 // catch ( cms::Exception& ex ) { 00131 // edm::LogError( "HadSUSYQCDSkim" ) 00132 // << "Unable to get CaloMET collection " 00133 // << CaloMETsrc_.label(); 00134 // return false; 00135 // } 00136 if ( METHandle->empty() ) return false; 00137 00138 00139 // cout << "****************************************************" << endl; 00140 00141 // Apply cuts on muons 00142 int nMuon = 0; 00143 for ( MuonCollection::const_iterator it = TheMuons.begin(); 00144 it != TheMuons.end(); it++ ) { 00145 // cout << "muon pt = " << it->pt() << endl; 00146 // cout << "muon eta = " << it->eta() << endl; 00147 if ( (it->pt() > MuonPtmin_) && 00148 (fabs(it->eta()) < 3.0) ) { 00149 nMuon++; 00150 } 00151 } 00152 // cout << "nMuon = " << nMuon << endl; 00153 if ( nMuon < NminMuon_ ) return false; 00154 00155 // Apply cuts on electrons 00156 int nElec = 0; 00157 for ( GsfElectronCollection::const_iterator it = TheElecs.begin(); 00158 it != TheElecs.end(); it++ ) { 00159 // cout << "elec pt = " << it->pt() << endl; 00160 // cout << "elec eta = " << it->eta() << endl; 00161 if ( (it->pt() > ElecPtmin_) && 00162 (fabs(it->eta()) < 3.0) ) { 00163 nElec++; 00164 } 00165 } 00166 // cout << "nElec = " << nElec << endl; 00167 if ( nElec < NminElec_ ) return false; 00168 00169 // cout << "-----------------------------------------------------" << endl; 00170 // Apply cuts on Jets 00171 int nJet = 0; 00172 for ( CaloJetCollection::const_iterator it = TheCaloJets.begin(); 00173 it != TheCaloJets.end(); it++ ) { 00174 // cout << "jet pt = " << it->pt() << endl; 00175 // cout << "jet eta = " << it->eta() << endl; 00176 if (fabs(it->eta()) < 3.0) nJet++; 00177 } 00178 // cout << "nJet = " << nJet << endl; 00179 if ( nJet < NminCaloJet_ ) return false; 00180 // cout << "TheCaloJets[0].pt() = " << TheCaloJets[0].pt() << endl; 00181 // cout << "TheCaloJets[1].pt() = " << TheCaloJets[1].pt() << endl; 00182 if(NminCaloJet_ > 0) {if ( TheCaloJets[0].pt() < CaloJet1Ptmin_ ) return false;} 00183 if(NminCaloJet_ > 1) {if ( TheCaloJets[1].pt() < CaloJet2Ptmin_ ) return false;} 00184 00185 00186 // cout << "-----------------------------------------------------" << endl; 00187 00188 00189 //apply cuts on MET 00190 double MetValue = METHandle->begin()->pt(); 00191 // cout << " met = " << MetValue << endl; 00192 if(MetValue < CaloMetmin_ ) return false; 00193 00194 nAccepted_++; 00195 00196 return true; 00197 }
double LepSUSYSkim::CaloJet1Ptmin_ [private] |
double LepSUSYSkim::CaloJet2Ptmin_ [private] |
edm::InputTag LepSUSYSkim::CaloJetsrc_ [private] |
double LepSUSYSkim::CaloMetmin_ [private] |
edm::InputTag LepSUSYSkim::CaloMETsrc_ [private] |
double LepSUSYSkim::ElecPtmin_ [private] |
edm::InputTag LepSUSYSkim::Elecsrc_ [private] |
double LepSUSYSkim::MuonPtmin_ [private] |
edm::InputTag LepSUSYSkim::Muonsrc_ [private] |
unsigned int LepSUSYSkim::nAccepted_ [private] |
unsigned int LepSUSYSkim::nEvents_ [private] |
int LepSUSYSkim::NminCaloJet_ [private] |
int LepSUSYSkim::NminElec_ [private] |
int LepSUSYSkim::NminMuon_ [private] |