28 #include "TLorentzVector.h" 62 : electronTag_(ps.getUntrackedParameter<
edm::
InputTag>(
"electronInputTag",
edm::
InputTag(
"gedGsfElectrons"))),
79 std::vector<TLorentzVector> eleList;
81 for (
auto const& ele : *electronColl) {
82 if (!ele.ecalDriven())
85 double hOverE = ele.hadronicOverEm();
86 double sigmaee = ele.sigmaIetaIeta();
87 double deltaPhiIn = ele.deltaPhiSuperClusterTrackAtVtx();
88 double deltaEtaIn = ele.deltaEtaSuperClusterTrackAtVtx();
94 }
else if (ele.isEE()) {
102 double chi2 = trk->chi2();
103 double ndof = trk->ndof();
105 double trkd0 = trk->d0();
106 double trkdz = trk->dz();
108 trkd0 = -(trk->dxy(
beamSpot->position()));
109 trkdz = trk->dz(
beamSpot->position());
111 edm::LogError(
"WtoLNuSelector") <<
"Error >> Failed to get BeamSpot for label: " <<
bsTag_;
113 if (chbyndof >= 10 || std::fabs(trkd0) >= 0.02 || std::fabs(trkdz) >= 20)
118 if (nPixelHits < 1 || nStripHits < 8)
125 float eiso = absiso / ele.pt();
130 le.SetPtEtaPhiE(ele.pt(), ele.eta(), ele.phi(), ele.energy());
131 eleList.push_back(le);
141 std::vector<TLorentzVector> muList;
143 for (
auto const&
mu : *muonColl) {
144 if (!
mu.isGlobalMuon() || !
mu.isPFMuon() || std::fabs(
mu.eta()) > 2.1 ||
mu.pt() <= 5)
163 double trkd0 = tk->
d0();
164 double trkdz = tk->
dz();
170 int nChambers =
mu.numberOfChambers();
171 int nMatches =
mu.numberOfMatches();
172 int nMatchedStations =
mu.numberOfMatchedStations();
176 double absiso =
pfIso04.sumChargedParticlePt +
180 if (chbyndof < 10 && std::fabs(trkd0) < 0.02 && std::fabs(trkdz) < 20.0 && nPixelHits > 1 && nStripHits > 8 &&
181 nChambers > 2 && nMatches > 2 && nMatchedStations > 2 && absiso /
mu.pt() < 0.3) {
183 lm.SetPtEtaPhiE(
mu.pt(),
mu.eta(),
mu.phi(),
mu.energy());
184 muList.push_back(lm);
192 if (eleList.empty() && muList.empty())
196 if ((!eleList.empty() && eleList[0].Pt() > 20) && (!muList.empty() && muList[0].Pt() > 20))
201 if (!eleList.empty() && !muList.empty()) {
202 vlep = (eleList[0].Pt() > muList[0].Pt()) ? eleList[0] : muList[0];
203 }
else if (!eleList.empty()) {
215 double mt =
getMt(vlep, pfColl->front());
216 if (mt < 60 || mt > 80)
232 vmet.SetPxPyPzE(metx, mety, 0.0,
met);
235 TLorentzVector vw = vlep + vmet;
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
int numberOfValidPixelHits() const
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
double getMt(const TLorentzVector &vlep, const reco::PFMET &obj)
Sin< T >::type sin(const T &t)
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
bool isNonnull() const
Checks for non-null.
const edm::InputTag electronTag_
const edm::EDGetTokenT< reco::GsfElectronCollection > electronToken_
Log< level::Error, false > LogError
WtoLNuSelector(const edm::ParameterSet &)
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::vector< Muon > MuonCollection
collection of Muon objects
int numberOfValidStripHits() const
double ndof() const
number of degrees of freedom of the fit
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 edm::EDGetTokenT< reco::MuonCollection > muonToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Cos< T >::type cos(const T &t)
#define DEFINE_FWK_MODULE(type)
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
double chi2() const
chi-squared of the fit
const edm::InputTag bsTag_
bool filter(edm::Event &, edm::EventSetup const &) override
const edm::InputTag muonTag_
const edm::InputTag pfmetTag_
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
const edm::EDGetTokenT< reco::PFMETCollection > pfmetToken_
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...