16 : electronTag_(ps.getUntrackedParameter<
edm::
InputTag>(
"electronInputTag",
edm::
InputTag(
"gedGsfElectrons"))),
18 bjetsTag_(ps.getUntrackedParameter<
edm::
InputTag>(
"bjetsInputTag",
edm::
InputTag(
"pfDeepCSVJetTags",
"probb"))),
28 maxEtaEle_(ps.getUntrackedParameter<double>(
"maxEta", 2.4)),
29 maxEtaMu_(ps.getUntrackedParameter<double>(
"maxEta", 2.4)),
30 minPt_(ps.getUntrackedParameter<double>(
"minPt", 5)),
33 maxDeltaPhiInEB_(ps.getUntrackedParameter<double>(
"maxDeltaPhiInEB", .15)),
34 maxDeltaEtaInEB_(ps.getUntrackedParameter<double>(
"maxDeltaEtaInEB", .007)),
35 maxHOEEB_(ps.getUntrackedParameter<double>(
"maxHOEEB", .12)),
36 maxSigmaiEiEEB_(ps.getUntrackedParameter<double>(
"maxSigmaiEiEEB", .01)),
37 maxDeltaPhiInEE_(ps.getUntrackedParameter<double>(
"maxDeltaPhiInEE", .1)),
38 maxDeltaEtaInEE_(ps.getUntrackedParameter<double>(
"maxDeltaEtaInEE", .009)),
39 maxHOEEE_(ps.getUntrackedParameter<double>(
"maxHOEEB_", .10)),
40 maxSigmaiEiEEE_(ps.getUntrackedParameter<double>(
"maxSigmaiEiEEE", .03)),
43 minChambers_(ps.getUntrackedParameter<uint32_t>(
"minChambers", 2)),
44 minMatches_(ps.getUntrackedParameter<uint32_t>(
"minMatches", 2)),
45 minMatchedStations_(ps.getUntrackedParameter<double>(
"minMatchedStations", 2)),
48 maxEtaHighest_Jets_(ps.getUntrackedParameter<double>(
"maxEtaHighest_Jets", 2.4)),
49 maxEta_Jets_(ps.getUntrackedParameter<double>(
"maxEta_Jets", 3.0)),
52 btagFactor_(ps.getUntrackedParameter<double>(
"btagFactor", 0.6)),
54 maxNormChi2_(ps.getUntrackedParameter<double>(
"maxNormChi2", 10)),
55 maxD0_(ps.getUntrackedParameter<double>(
"maxD0", 0.02)),
56 maxDz_(ps.getUntrackedParameter<double>(
"maxDz", 20.)),
57 minPixelHits_(ps.getUntrackedParameter<uint32_t>(
"minPixelHits", 1)),
58 minStripHits_(ps.getUntrackedParameter<uint32_t>(
"minStripHits", 8)),
59 maxIsoEle_(ps.getUntrackedParameter<double>(
"maxIso", 0.5)),
60 maxIsoMu_(ps.getUntrackedParameter<double>(
"maxIso", 0.3)),
61 minPtHighestMu_(ps.getUntrackedParameter<double>(
"minPtHighestMu", 24)),
62 minPtHighestEle_(ps.getUntrackedParameter<double>(
"minPtHighestEle", 32)),
63 minPtHighest_Jets_(ps.getUntrackedParameter<double>(
"minPtHighest_Jets", 30)),
64 minPt_Jets_(ps.getUntrackedParameter<double>(
"minPt_Jets", 20)),
65 minInvMass_(ps.getUntrackedParameter<double>(
"minInvMass", 140)),
66 maxInvMass_(ps.getUntrackedParameter<double>(
"maxInvMass", 200)),
67 minMet_(ps.getUntrackedParameter<double>(
"minMet", 50)),
68 maxMet_(ps.getUntrackedParameter<double>(
"maxMet", 80)),
69 minWmass_(ps.getUntrackedParameter<double>(
"minWmass", 50)),
70 maxWmass_(ps.getUntrackedParameter<double>(
"maxWmass", 130)) {}
77 int le = 0, lm = 0, lj = 0, lbj = 0;
82 std::vector<TLorentzVector> list_ele;
83 std::vector<int> chrgeList_ele;
86 for (
auto const& ele : *electronColl) {
87 if (!ele.ecalDriven())
92 if (!(ele.isEB() || ele.isEE()))
95 double hOverE = ele.hadronicOverEm();
96 double sigmaee = ele.sigmaIetaIeta();
97 double deltaPhiIn = ele.deltaPhiSuperClusterTrackAtVtx();
98 double deltaEtaIn = ele.deltaEtaSuperClusterTrackAtVtx();
105 }
else if (ele.isEE()) {
114 double chi2 = trk->chi2();
115 double ndof = trk->ndof();
120 double trkd0 = trk->d0();
122 trkd0 = -(trk->dxy(
beamSpot->position()));
124 edm::LogError(
"ElectronSelector") <<
"Error >> Failed to get BeamSpot for label: " <<
bsTag_;
126 if (std::fabs(trkd0) >=
maxD0_)
145 TLorentzVector lv_ele;
146 lv_ele.SetPtEtaPhiE(ele.pt(), ele.eta(), ele.phi(), ele.energy());
147 list_ele.push_back(lv_ele);
148 chrgeList_ele.push_back(ele.charge());
150 le = list_ele.size();
159 std::vector<TLorentzVector> list_mu;
160 std::vector<int> chrgeList_mu;
162 for (
auto const&
mu : *muonColl) {
163 if (!
mu.isGlobalMuon())
173 double chi2 = gtk->chi2();
174 double ndof = gtk->ndof();
181 double trkd0 = -(tk->dxy(
beamSpot->position()));
182 if (std::fabs(trkd0) >=
maxD0_)
184 double trkdz = tk->dz(
beamSpot->position());
185 if (std::fabs(trkdz) >=
maxDz_)
209 double absiso =
pfIso04.sumChargedHadronPt +
214 TLorentzVector lv_mu;
215 lv_mu.SetPtEtaPhiE(
mu.pt(),
mu.eta(),
mu.phi(),
mu.energy());
216 list_mu.push_back(lv_mu);
217 chrgeList_mu.push_back(
mu.charge());
228 std::vector<TLorentzVector> list_jets;
231 for (
const auto&
jets : *jetColl) {
236 TLorentzVector lv_jets;
238 list_jets.push_back(lv_jets);
240 lj = list_jets.size();
246 std::vector<TLorentzVector> list_bjets;
248 if (!
bTags.empty()) {
249 for (
unsigned bj = 0; bj !=
bTags.size(); ++bj) {
250 TLorentzVector lv_bjets;
251 lv_bjets.SetPtEtaPhiE(
254 list_bjets.push_back(lv_bjets);
256 lbj = list_bjets.size();
265 if ((list_ele[0].Pt() < list_mu[0].Pt()) || (list_ele[1].Pt() < list_mu[0].Pt()))
267 if (chrgeList_ele[0] + chrgeList_ele[1] != 0)
270 double mt1 =
getMt(list_ele[0], pfColl->front());
271 double mt2 =
getMt(list_ele[1], pfColl->front());
272 double mt = mt1 +
mt2;
273 if (mt < 2 * minMet_ || mt > 2 *
maxMet_)
277 <<
"Error >> Failed to get PFMETCollection in dilepton ele-ele channel for label: " <<
pfmetTag_;
283 if ((list_mu[0].Pt() < list_ele[0].Pt()) || (list_mu[1].Pt() < list_ele[0].Pt()))
285 if (chrgeList_mu[0] + chrgeList_mu[1] != 0)
288 double mt1 =
getMt(list_mu[0], pfColl->front());
289 double mt2 =
getMt(list_mu[1], pfColl->front());
290 double mt = mt1 +
mt2;
291 if (mt < 2 * minMet_ || mt > 2 *
maxMet_)
295 <<
"Error >> Failed to get PFMETCollection in dilepton mu-mu channel for label: " <<
pfmetTag_;
299 if ((list_mu[0].Pt() < list_ele[1].Pt()) || (list_ele[0].Pt() < list_mu[1].Pt()))
303 if (chrgeList_mu[0] + chrgeList_ele[0] != 0)
306 double mt1 =
getMt(list_mu[0], pfColl->front());
307 double mt2 =
getMt(list_ele[0], pfColl->front());
308 double mt = mt1 +
mt2;
309 if (mt < 2 * minMet_ || mt > 2 *
maxMet_)
313 <<
"Error >> Failed to get PFMETCollection in dilepton ele-mu channel for label: " <<
pfmetTag_;
345 for (
int i = 0;
i < 4;
i++) {
346 TLorentzVector vjet1;
347 for (
int j =
i + 1;
j < 4;
j++) {
348 TLorentzVector vjet2;
349 vjet1 = list_jets[
i];
350 vjet2 = list_jets[
j];
351 TLorentzVector vjet = vjet1 + vjet2;
364 if ((nEle >= 2 ||
nMu >= 2) &&
nJets > 1 && nbJets > 1) {
365 if (nEle >= 2 &&
nJets < 2)
369 else if (nEle >= 1 &&
nMu >= 1 &&
nJets < 2)
371 }
else if ((nEle >= 1 ||
nMu >= 1) &&
nJets > 3 && nbJets > 2) {
372 if (nEle >= 1 &&
nJets > 1)
376 }
else if ((nEle < 1 &&
nMu < 1) &&
nJets > 5 && nbJets > 1)
390 vmet.SetPxPyPzE(metx, mety, 0.0,
met);
393 TLorentzVector vw = vlep + vmet;
const edm::InputTag pfmetTag_
int numberOfValidPixelHits() const
const edm::EDGetTokenT< reco::MuonCollection > muonToken_
const edm::EDGetTokenT< reco::JetTagCollection > bjetsToken_
bool filter(edm::Event &, edm::EventSetup const &) override
Sin< T >::type sin(const T &t)
const edm::EDGetTokenT< reco::PFJetCollection > jetsToken_
T const * product() const
const edm::EDGetTokenT< reco::PFMETCollection > pfmetToken_
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
const double minPtHighestMu_
const edm::InputTag electronTag_
bool isNonnull() const
Checks for non-null.
JetFloatAssociation::Container JetTagCollection
Log< level::Error, false > LogError
int EventCategory(int &nEle, int &nMu, int &nJets, int &nbJets)
const double maxEta_Jets_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::vector< Muon > MuonCollection
collection of Muon objects
const double maxSigmaiEiEEE_
int numberOfValidStripHits() const
const double maxDeltaPhiInEB_
const edm::InputTag bsTag_
U second(std::pair< T, U > const &p)
const edm::EDGetTokenT< reco::GsfElectronCollection > electronToken_
const double minMatchedStations_
const edm::InputTag muonTag_
const double maxDeltaEtaInEB_
const double maxSigmaiEiEEB_
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 ;
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
double getMt(const TLorentzVector &vlep, const reco::PFMET &obj)
const double minPtHighest_Jets_
const double maxNormChi2_
std::vector< PFJet > PFJetCollection
collection of PFJet objects
const double minChambers_
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
ttbarEventSelector(const edm::ParameterSet &)
const double minPtHighestEle_
const double maxDeltaPhiInEE_
const double maxDeltaEtaInEE_