#include <SUSYBSMAnalysis/CSA07Skims/interface/SUSYControlHighPtPhotonSkim.h>
Public Member Functions | |
virtual void | endJob () |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
SUSYControlHighPtPhotonSkim (const edm::ParameterSet &) | |
~SUSYControlHighPtPhotonSkim () | |
Private Attributes | |
double | ElectronPtmin_ |
edm::InputTag | Electronsrc_ |
bool | IsIsolated_ |
double | IsolationCut_ |
unsigned int | nAccepted_ |
unsigned int | nEvents_ |
double | PhotonPtmin_ |
edm::InputTag | Photonsrc_ |
Definition at line 23 of file SUSYControlHighPtPhotonSkim.h.
SUSYControlHighPtPhotonSkim::SUSYControlHighPtPhotonSkim | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 37 of file SUSYControlHighPtPhotonSkim.cc.
References ElectronPtmin_, Electronsrc_, edm::ParameterSet::getParameter(), IsIsolated_, IsolationCut_, PhotonPtmin_, and Photonsrc_.
00037 : 00038 nEvents_(0), nAccepted_(0) 00039 { 00040 Photonsrc_ = iConfig.getParameter<InputTag>( "Photonsrc" ); 00041 Electronsrc_ = iConfig.getParameter<InputTag>( "Electronsrc" ); 00042 PhotonPtmin_ = 00043 iConfig.getParameter<double>( "PhotonPtmin"); 00044 ElectronPtmin_ = 00045 iConfig.getParameter<double>( "ElectronPtmin"); 00046 IsIsolated_ = iConfig.getParameter<bool>( "IsIsolated"); 00047 IsolationCut_ = iConfig.getParameter<double>( "IsolationCut"); 00048 }
SUSYControlHighPtPhotonSkim::~SUSYControlHighPtPhotonSkim | ( | ) |
Reimplemented from edm::EDFilter.
Definition at line 119 of file SUSYControlHighPtPhotonSkim.cc.
References lat::endl(), nAccepted_, and nEvents_.
00120 { 00121 edm::LogVerbatim( "SUSYControlHighPtPhotonSkim" ) 00122 << "Events read " << nEvents_ 00123 << " Events accepted " << nAccepted_ 00124 << "\nEfficiency " << (double)(nAccepted_)/(double)(nEvents_) 00125 << endl; 00126 }
bool SUSYControlHighPtPhotonSkim::filter | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDFilter.
Definition at line 57 of file SUSYControlHighPtPhotonSkim.cc.
References ElectronPtmin_, Electronsrc_, edm::Event::getByLabel(), IsIsolated_, IsolationCut_, it, nAccepted_, nEvents_, PhotonPtmin_, Photonsrc_, funct::pow(), and funct::sqrt().
00059 { 00060 nEvents_++; 00061 00062 typedef AssociationVector<RefProd<CandidateCollection>, vector<double> > PhotonMapCollection; 00063 Handle<PhotonMapCollection> PhotonHandle; 00064 00065 iEvent.getByLabel( Photonsrc_, PhotonHandle ); 00066 00067 if ( PhotonHandle->empty() ) return false; 00068 00069 Handle<GsfElectronCollection> ElectronHandle; 00070 00071 iEvent.getByLabel( Electronsrc_, ElectronHandle ); 00072 00073 if ( ElectronHandle->empty() ) return false; 00074 00075 int nPhoton = 0; 00076 int nElectron = 0; 00077 00078 for ( PhotonMapCollection::const_iterator it = PhotonHandle->begin(); 00079 it != PhotonHandle->end(); it++ ) { 00080 00081 bool iso = it->second < IsolationCut_; 00082 if(!IsIsolated_) iso = 1; 00083 00084 if (iso && fabs(it->first->eta()) < 1.479 && it->first->pt() > PhotonPtmin_) { 00085 00086 int overlap(0); 00087 for ( GsfElectronCollection::const_iterator itel = ElectronHandle->begin(); 00088 itel != ElectronHandle->end(); itel++ ) { 00089 00090 if( itel->pt() > ElectronPtmin_ ){ 00091 double dr = sqrt( pow(it->first->eta() - itel->eta(),2) + 00092 pow(it->first->phi() - itel->phi(),2) ); 00093 if ( dr<0.1 ) overlap = 1; 00094 } 00095 } 00096 if (!overlap) nPhoton++; 00097 00098 } 00099 00100 } 00101 00102 for ( GsfElectronCollection::const_iterator itel = ElectronHandle->begin(); 00103 itel != ElectronHandle->end(); itel++ ) { 00104 00105 if (fabs(itel->eta()) < 1.479 && itel->pt() > ElectronPtmin_) 00106 nElectron++; 00107 } 00108 00109 if (!nPhoton) return false; 00110 if (!nElectron) return false; 00111 00112 nAccepted_++; 00113 00114 return true; 00115 }
double SUSYControlHighPtPhotonSkim::ElectronPtmin_ [private] |
Definition at line 35 of file SUSYControlHighPtPhotonSkim.h.
Referenced by filter(), and SUSYControlHighPtPhotonSkim().
Definition at line 33 of file SUSYControlHighPtPhotonSkim.h.
Referenced by filter(), and SUSYControlHighPtPhotonSkim().
bool SUSYControlHighPtPhotonSkim::IsIsolated_ [private] |
Definition at line 36 of file SUSYControlHighPtPhotonSkim.h.
Referenced by filter(), and SUSYControlHighPtPhotonSkim().
double SUSYControlHighPtPhotonSkim::IsolationCut_ [private] |
Definition at line 37 of file SUSYControlHighPtPhotonSkim.h.
Referenced by filter(), and SUSYControlHighPtPhotonSkim().
unsigned int SUSYControlHighPtPhotonSkim::nAccepted_ [private] |
unsigned int SUSYControlHighPtPhotonSkim::nEvents_ [private] |
double SUSYControlHighPtPhotonSkim::PhotonPtmin_ [private] |
Definition at line 34 of file SUSYControlHighPtPhotonSkim.h.
Referenced by filter(), and SUSYControlHighPtPhotonSkim().
Definition at line 32 of file SUSYControlHighPtPhotonSkim.h.
Referenced by filter(), and SUSYControlHighPtPhotonSkim().