38 #include "TLorentzVector.h"
66 virtual void endJob();
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;
211 if (eleRef->
gsfTrack()->trackerExpectedHitsInner().numberOfHits()>missHitCut_)
return false;
221 iEvent.
getByLabel(electronCollection_,gsfElectrons);
230 iEvent.
getByLabel(offlineBSCollection_, pBeamSpot);
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);
251 thisEvent.run=iEvent.
run();
254 thisEvent.nEle=goodElectrons.size();
258 thisEvent.maxPt=
ptMax;
259 thisEvent.maxPtEleEta=ptMaxEle->
eta();
260 thisEvent.maxPtElePhi=ptMaxEle->
phi();
266 thisEvent.met=pfMET->begin()->et();
267 thisEvent.metPhi=pfMET->begin()->phi();
274 v1.SetPtEtaPhiM(ptMaxEle->
pt(),ptMaxEle->
eta(),ptMaxEle->
phi(),0);
275 if (goodElectrons.size()>1)
277 for (
unsigned int iEle=0; iEle<goodElectrons.size(); ++iEle)
278 if (goodElectrons[iEle]!=ptMaxEle && (goodElectrons[iEle]->
charge() * ptMaxEle->
charge() == -1) )
281 v2.SetPtEtaPhiM(goodElectrons[iEle]->pt(),goodElectrons[iEle]->
eta(),goodElectrons[iEle]->
phi(),0.);
282 if ( (v1+v2).M() > maxInv )
283 maxInv = (v1+v2).M();
287 if (maxInv > invMassCut_)
288 thisEvent.invMass = maxInv;
291 if (goodElectrons.size()>1 && maxInv > invMassCut_)
298 if (goodElectrons.size()>=1 && (pfMET->begin()->et()>metCut_))
virtual bool filter(edm::Event &, const edm::EventSetup &)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag pfMetCollection_
virtual double eta() const
momentum pseudorapidity
edm::InputTag electronCollection_
LuminosityBlockNumber_t luminosityBlock() const
float sigmaIetaIeta() const
tuple WZInterestingEventSelector
bool electronSelection(const GsfElectron *eleRef, math::XYZPoint bspotPosition)
virtual int charge() const
electric charge
float hcalOverEcal() const
float dr03TkSumPt() const
LuminosityBlock const & getLuminosityBlock() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
EventAuxiliary const & eventAuxiliary() const
GsfTrackRef gsfTrack() const
reference to a GsfTrack
DEFINE_FWK_MODULE(CosmicTrackingParticleSelector)
tuple filter
USE THIS FOR SKIMMED TRACKS process.p = cms.Path(process.hltLevel1GTSeed*process.skimming*process.offlineBeamSpot*process.TrackRefitter2) OTHERWISE USE THIS.
virtual double pt() const
transverse momentum
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
float dr03EcalRecHitSumEt() const
~WZInterestingEventSelector()
float dr03HcalTowerSumEt() const
const Point & position() const
position
virtual double phi() const
momentum azimuthal angle
EventNumber_t event() const
edm::InputTag offlineBSCollection_
WZInterestingEventSelector(const edm::ParameterSet &)