38 #include "TLorentzVector.h" 66 void endJob()
override;
110 eb_trIsoCut_ = iConfig.
getParameter<
double>(
"eb_trIsoCut");
111 eb_ecalIsoCut_ = iConfig.
getParameter<
double>(
"eb_ecalIsoCut");
112 eb_hcalIsoCut_ = iConfig.
getParameter<
double>(
"eb_hcalIsoCut");
116 ee_trIsoCut_ = iConfig.
getParameter<
double>(
"ee_trIsoCut");
117 ee_ecalIsoCut_ = iConfig.
getParameter<
double>(
"ee_ecalIsoCut");
118 ee_hcalIsoCut_ = iConfig.
getParameter<
double>(
"ee_hcalIsoCut");
123 invMassCut_ = iConfig.
getParameter<
double>(
"invMassCut");
192 if (eleRef->
pt()<ptCut_)
return false;
196 if (eleRef->
dr03TkSumPt()/eleRef->
pt()>eb_trIsoCut_)
return false;
202 else if (eleRef->
isEE())
204 if (eleRef->
dr03TkSumPt()/eleRef->
pt()>ee_trIsoCut_)
return false;
221 iEvent.
getByLabel(electronCollection_,gsfElectrons);
230 iEvent.
getByLabel(offlineBSCollection_, pBeamSpot);
235 std::vector<const GsfElectron*> goodElectrons;
238 for(reco::GsfElectronCollection::const_iterator myEle=gsfElectrons->begin();myEle!=gsfElectrons->end();++myEle)
241 if (!electronSelection(&(*myEle),bspotPosition))
continue;
242 goodElectrons.push_back(&(*myEle));
243 if (myEle->pt() >
ptMax )
246 ptMaxEle = &(*myEle);
253 v1.SetPtEtaPhiM(ptMaxEle->
pt(),ptMaxEle->
eta(),ptMaxEle->
phi(),0);
254 if (goodElectrons.size()>1)
256 for (
unsigned int iEle=0; iEle<goodElectrons.size(); ++iEle)
257 if (goodElectrons[iEle]!=ptMaxEle && (goodElectrons[iEle]->
charge() * ptMaxEle->
charge() == -1) )
260 v2.SetPtEtaPhiM(goodElectrons[iEle]->
pt(),goodElectrons[iEle]->
eta(),goodElectrons[iEle]->phi(),0.);
261 if ( (v1+v2).M() > maxInv )
262 maxInv = (v1+v2).M();
267 if (goodElectrons.size()>1 && maxInv > invMassCut_)
274 if (!goodElectrons.empty() && (pfMET->begin()->et()>metCut_))
T getParameter(std::string const &) const
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
T getUntrackedParameter(std::string const &, T const &) const
double eta() const final
momentum pseudorapidity
~WZInterestingEventSelector() override
edm::InputTag pfMetCollection_
double pt() const final
transverse momentum
int charge() const final
electric charge
edm::InputTag electronCollection_
#define DEFINE_FWK_MODULE(type)
float sigmaIetaIeta() const
float hcalOverEcal() const
float dr03TkSumPt() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
bool electronSelection(const GsfElectron *eleRef, const math::XYZPoint &bspotPosition)
XYZPointD XYZPoint
point in space with cartesian internal representation
float dr03EcalRecHitSumEt() const
float dr03HcalTowerSumEt() const
const Point & position() const
position
double phi() const final
momentum azimuthal angle
bool filter(edm::Event &, const edm::EventSetup &) override
edm::InputTag offlineBSCollection_
WZInterestingEventSelector(const edm::ParameterSet &)