19 #include "TLorentzVector.h"
26 : electronTag_(ps.getUntrackedParameter<edm::
InputTag>(
"electronInputTag", edm::
InputTag(
"gedGsfElectrons"))),
27 bsTag_(ps.getUntrackedParameter<edm::
InputTag>(
"offlineBeamSpot", edm::
InputTag(
"offlineBeamSpot"))),
28 muonTag_(ps.getUntrackedParameter<edm::
InputTag>(
"muonInputTag", edm::
InputTag(
"muons"))),
30 pfmetTag_(ps.getUntrackedParameter<edm::
InputTag>(
"pfmetTag", edm::
InputTag(
"pfMetT1T2Txy"))),
44 std::vector<TLorentzVector> eleList;
46 for (
auto const& ele : *electronColl) {
47 if (!ele.ecalDriven())
50 double hOverE = ele.hadronicOverEm();
51 double sigmaee = ele.sigmaIetaIeta();
52 double deltaPhiIn = ele.deltaPhiSuperClusterTrackAtVtx();
53 double deltaEtaIn = ele.deltaEtaSuperClusterTrackAtVtx();
57 if (std::fabs(deltaPhiIn) >= .15 && std::fabs(deltaEtaIn) >= .007 && hOverE >= .12 && sigmaee >= .01)
59 }
else if (ele.isEE()) {
60 if (std::fabs(deltaPhiIn) >= .10 && std::fabs(deltaEtaIn) >= .009 && hOverE >= .10 && sigmaee >= .03)
67 double chi2 = trk->chi2();
68 double ndof = trk->ndof();
69 double chbyndof = (ndof > 0) ? chi2 / ndof : 0;
70 double trkd0 = trk->d0();
71 double trkdz = trk->dz();
73 trkd0 = -(trk->dxy(beamSpot->position()));
74 trkdz = trk->dz(beamSpot->position());
78 if (chbyndof >= 10 || std::fabs(trkd0) >= 0.02 || std::fabs(trkdz) >= 20)
83 if (nPixelHits < 1 || nStripHits < 8)
90 float eiso = absiso / ele.pt();
95 le.SetPtEtaPhiE(ele.pt(), ele.eta(), ele.phi(), ele.energy());
96 eleList.push_back(le);
106 std::vector<TLorentzVector> muList;
108 for (
auto const&
mu : *muonColl) {
109 if (!
mu.isGlobalMuon() || !
mu.isPFMuon() || std::fabs(
mu.eta()) > 2.1 ||
mu.pt() <= 5)
118 double chbyndof = (ndof > 0) ? chi2 / ndof : 0;
128 double trkd0 = tk->
d0();
129 double trkdz = tk->
dz();
131 trkd0 = -(tk->
dxy(beamSpot->position()));
132 trkdz = tk->
dz(beamSpot->position());
135 int nChambers =
mu.numberOfChambers();
136 int nMatches =
mu.numberOfMatches();
137 int nMatchedStations =
mu.numberOfMatchedStations();
145 if (chbyndof < 10 && std::fabs(trkd0) < 0.02 && std::fabs(trkdz) < 20.0 && nPixelHits > 1 && nStripHits > 8 &&
146 nChambers > 2 && nMatches > 2 && nMatchedStations > 2 && absiso /
mu.pt() < 0.3) {
148 lm.SetPtEtaPhiE(
mu.pt(),
mu.eta(),
mu.phi(),
mu.energy());
149 muList.push_back(lm);
157 if (eleList.empty() && muList.empty())
161 if ((!eleList.empty() && eleList[0].Pt() > 20) && (!muList.empty() && muList[0].Pt() > 20))
166 if (!eleList.empty() && !muList.empty()) {
167 vlep = (eleList[0].Pt() > muList[0].Pt()) ? eleList[0] : muList[0];
168 }
else if (!eleList.empty()) {
180 double mt =
getMt(vlep, pfColl->front());
181 if (mt < 60 || mt > 80)
191 double met = obj.
et();
197 vmet.SetPxPyPzE(metx, mety, 0.0, met);
200 TLorentzVector vw = vlep + vmet;
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
double getMt(const TLorentzVector &vlep, const reco::PFMET &obj)
bool isNonnull() const
Checks for non-null.
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
int numberOfValidStripHits() const
const edm::InputTag electronTag_
const edm::EDGetTokenT< reco::GsfElectronCollection > electronToken_
Log< level::Error, false > LogError
float sumPhotonEt
sum pt of PF photons
WtoLNuSelector(const edm::ParameterSet &)
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::vector< Muon > MuonCollection
collection of Muon objects
float sumNeutralHadronEt
sum pt of neutral hadrons
float sumChargedParticlePt
sum-pt of charged Particles(inludes e/mu)
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
const edm::EDGetTokenT< reco::MuonCollection > muonToken_
double chi2() const
chi-squared of the fit
double ndof() const
number of degrees of freedom of the fit
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Cos< T >::type cos(const T &t)
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
const edm::InputTag bsTag_
bool filter(edm::Event &, edm::EventSetup const &) override
const edm::InputTag muonTag_
double et() const final
transverse energy
int numberOfValidPixelHits() const
const edm::InputTag pfmetTag_
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
double phi() const final
momentum azimuthal angle
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
const edm::EDGetTokenT< reco::PFMETCollection > pfmetToken_