59 #include "TLorentzVector.h" 81 typedef std::vector<edm::InputTag> vtag;
86 triggerToken_ = consumes<edm::TriggerResults>(theTriggerResultsCollection);
89 jetLabels_ = ps.
getParameter<std::vector<edm::InputTag> >(
"jetLabels");
90 for (std::vector<edm::InputTag>::const_iterator jetlabel = jetLabels_.begin(), jetlabelEnd = jetLabels_.end();
91 jetlabel != jetlabelEnd;
96 sdjetToken_ = consumes<edm::View<reco::BasicJet> >(sdjetLabel_);
101 jetPtMins_ = ps.
getParameter<std::vector<double> >(
"jetPtMins");
103 allHadRapidityCut_ = ps.
getParameter<
double>(
"allHadRapidityCut");
104 allHadDeltaPhiCut_ = ps.
getParameter<
double>(
"allHadDeltaPhiCut");
106 semiMu_HadJetPtCut_ = ps.
getParameter<
double>(
"semiMu_HadJetPtCut");
107 semiMu_LepJetPtCut_ = ps.
getParameter<
double>(
"semiMu_LepJetPtCut");
108 semiMu_dphiHadCut_ = ps.
getParameter<
double>(
"semiMu_dphiHadCut");
109 semiMu_dRMin_ = ps.
getParameter<
double>(
"semiMu_dRMin");
110 semiMu_ptRel_ = ps.
getParameter<
double>(
"semiMu_ptRel");
111 muonSelect_ = std::make_shared<StringCutObjectSelector<reco::Muon> >(
115 semiE_HadJetPtCut_ = ps.
getParameter<
double>(
"semiE_HadJetPtCut");
116 semiE_LepJetPtCut_ = ps.
getParameter<
double>(
"semiE_LepJetPtCut");
117 semiE_dphiHadCut_ = ps.
getParameter<
double>(
"semiE_dphiHadCut");
120 elecSelect_ = std::make_shared<StringCutObjectSelector<reco::GsfElectron> >(
128 PFMETToken_ = consumes<std::vector<reco::PFMET> >(PFMETLabel_);
148 std::stringstream
ss;
149 ss <<
"Physics/B2G/" << jetLabels_[
icoll].label();
151 pfJet_pt.push_back(bei.
book1D(
"pfJet_pt",
"Pt of PFJet (GeV)", 50, 0.0, 1000));
152 pfJet_y.push_back(bei.
book1D(
"pfJet_y",
"Rapidity of PFJet", 60, -6.0, 6.0));
153 pfJet_phi.push_back(bei.
book1D(
"pfJet_phi",
"#phi of PFJet (radians)", 60, -3.14159, 3.14159));
154 pfJet_m.push_back(bei.
book1D(
"pfJet_m",
"Mass of PFJet (GeV)", 50, 0.0, 500));
155 pfJet_chef.push_back(bei.
book1D(
"pfJet_pfchef",
"PFJetID CHEF", 50, 0.0, 1.0));
156 pfJet_nhef.push_back(bei.
book1D(
"pfJet_pfnhef",
"PFJetID NHEF", 50, 0.0, 1.0));
157 pfJet_cemf.push_back(bei.
book1D(
"pfJet_pfcemf",
"PFJetID CEMF", 50, 0.0, 1.0));
158 pfJet_nemf.push_back(bei.
book1D(
"pfJet_pfnemf",
"PFJetID NEMF", 50, 0.0, 1.0));
160 boostedJet_subjetPt.push_back(bei.
book1D(
"boostedJet_subjetPt",
"Pt of subjets (GeV)", 50, 0.0, 500));
161 boostedJet_subjetY.push_back(bei.
book1D(
"boostedJet_subjetY",
"Rapidity of subjets", 60, -6.0, 6.0));
162 boostedJet_subjetPhi.push_back(
163 bei.
book1D(
"boostedJet_subjetPhi",
"#phi of subjets (radians)", 60, -3.14159, 3.14159));
164 boostedJet_subjetM.push_back(bei.
book1D(
"boostedJet_subjetM",
"Mass of subjets (GeV)", 50, 0.0, 250.));
165 boostedJet_subjetN.push_back(bei.
book1D(
"boostedJet_subjetN",
"Number of subjets", 10, 0, 10));
166 boostedJet_massDrop.push_back(bei.
book1D(
"boostedJet_massDrop",
"Mass drop for W-like jets", 50, 0.0, 1.0));
167 boostedJet_wMass.push_back(bei.
book1D(
"boostedJet_wMass",
"W Mass for top-like jets", 50, 0.0, 250.0));
171 pfMet_pt = bei.
book1D(
"pfMet_pt",
"Pf Missing p_{T}; GeV", 50, 0.0, 500);
172 pfMet_phi = bei.
book1D(
"pfMet_phi",
"Pf Missing p_{T} #phi;#phi (radians)", 35, -3.5, 3.5);
176 semiMu_muPt = bei.
book1D(
"semiMu_muPt",
"Pt of Muon in #mu+Jets Channel (GeV)", 50, 0.0, 1000);
177 semiMu_muEta = bei.
book1D(
"semiMu_muEta",
"#eta of Muon in #mu+Jets Channel", 60, -6.0, 6.0);
178 semiMu_muPhi = bei.
book1D(
"semiMu_muPhi",
"#phi of Muon in #mu+Jets Channel (radians)", 60, -3.14159, 3.14159);
179 semiMu_muDRMin = bei.
book1D(
"semiMu_muDRMin",
"#Delta R(E,nearest jet) in #mu+Jets Channel", 50, 0, 10.0);
180 semiMu_muPtRel = bei.
book1D(
"semiMu_muPtRel",
"p_{T}^{REL} in #mu+Jets Channel", 60, 0, 300.);
181 semiMu_hadJetDR = bei.
book1D(
"semiMu_hadJetDR",
"#Delta R(E,had jet) in #mu+Jets Channel", 50, 0, 10.0);
183 bei.
book1D(
"semiMu_hadJetPt",
"Pt of Leading Hadronic Jet in #mu+Jets Channel (GeV)", 50, 0.0, 1000);
184 semiMu_hadJetY = bei.
book1D(
"semiMu_hadJetY",
"Rapidity of Leading Hadronic Jet in #mu+Jets Channel", 60, -6.0, 6.0);
185 semiMu_hadJetPhi = bei.
book1D(
186 "semiMu_hadJetPhi",
"#phi of Leading Hadronic Jet in #mu+Jets Channel (radians)", 60, -3.14159, 3.14159);
188 bei.
book1D(
"semiMu_hadJetMass",
"Mass of Leading Hadronic Jet in #mu+Jets Channel (GeV)", 50, 0.0, 500);
190 bei.
book1D(
"semiMu_hadJetwMass",
"W Mass for Leading Hadronic Jet in #mu+Jets Channel (GeV)", 50, 0.0, 250.0);
191 semiMu_mttbar = bei.
book1D(
"semiMu_mttbar",
"Mass of #mu+Jets ttbar Candidate", 100, 0., 5000.);
195 semiE_ePt = bei.
book1D(
"semiE_ePt",
"Pt of Electron in e+Jets Channel (GeV)", 50, 0.0, 1000);
196 semiE_eEta = bei.
book1D(
"semiE_eEta",
"#eta of Electron in e+Jets Channel", 60, -6.0, 6.0);
197 semiE_ePhi = bei.
book1D(
"semiE_ePhi",
"#phi of Electron in e+Jets Channel (radians)", 60, -3.14159, 3.14159);
198 semiE_eDRMin = bei.
book1D(
"semiE_eDRMin",
"#Delta R(E,nearest jet) in e+Jets Channel", 50, 0, 10.0);
199 semiE_ePtRel = bei.
book1D(
"semiE_ePtRel",
"p_{T}^{REL} in e+Jets Channel", 60, 0, 300.);
200 semiE_hadJetDR = bei.
book1D(
"semiE_hadJetDR",
"#Delta R(E,had jet) in e+Jets Channel", 50, 0, 10.0);
201 semiE_hadJetPt = bei.
book1D(
"semiE_hadJetPt",
"Pt of Leading Hadronic Jet in e+Jets Channel (GeV)", 50, 0.0, 1000);
202 semiE_hadJetY = bei.
book1D(
"semiE_hadJetY",
"Rapidity of Leading Hadronic Jet in e+Jets Channel", 60, -6.0, 6.0);
204 bei.
book1D(
"semiE_hadJetPhi",
"#phi of Leading Hadronic Jet in e+Jets Channel (radians)", 60, -3.14159, 3.14159);
206 bei.
book1D(
"semiE_hadJetMass",
"Mass of Leading Hadronic Jet in e+Jets Channel (GeV)", 50, 0.0, 500);
208 bei.
book1D(
"semiE_hadJetwMass",
"W Mass for Leading Hadronic Jet in e+Jets Channel (GeV)", 50, 0.0, 250.0);
209 semiE_mttbar = bei.
book1D(
"semiE_mttbar",
"Mass of e+Jets ttbar Candidate", 100, 0., 5000.);
213 allHad_pt0 = bei.
book1D(
"allHad_pt0",
"Pt of Leading All-Hadronic PFJet (GeV)", 50, 0.0, 1000);
214 allHad_y0 = bei.
book1D(
"allHad_y0",
"Rapidity of Leading All-Hadronic PFJet", 60, -6.0, 6.0);
215 allHad_phi0 = bei.
book1D(
"allHad_phi0",
"#phi of Leading All-Hadronic PFJet (radians)", 60, -3.14159, 3.14159);
216 allHad_mass0 = bei.
book1D(
"allHad_mass0",
"Mass of Leading All-Hadronic PFJet (GeV)", 50, 0.0, 500);
217 allHad_wMass0 = bei.
book1D(
"allHad_wMass0",
"W Mass for Leading All-Hadronic PFJet (GeV)", 50, 0.0, 250.0);
218 allHad_pt1 = bei.
book1D(
"allHad_pt1",
"Pt of Subleading All-Hadronic PFJet (GeV)", 50, 0.0, 1000);
219 allHad_y1 = bei.
book1D(
"allHad_y1",
"Rapidity of Subleading All-Hadronic PFJet", 60, -6.0, 6.0);
220 allHad_phi1 = bei.
book1D(
"allHad_phi1",
"#phi of Subleading All-Hadronic PFJet (radians)", 60, -3.14159, 3.14159);
221 allHad_mass1 = bei.
book1D(
"allHad_mass1",
"Mass of Subleading All-Hadronic PFJet (GeV)", 50, 0.0, 500);
222 allHad_wMass1 = bei.
book1D(
"allHad_wMass1",
"W Mass for Subleading All-Hadronic PFJet (GeV)", 50, 0.0, 250.0);
223 allHad_mttbar = bei.
book1D(
"allHad_mttbar",
"Mass of All-Hadronic ttbar Candidate", 100, 0., 5000.);
230 analyzeJets(
iEvent, iSetup);
231 analyzeSemiMu(
iEvent, iSetup);
232 analyzeSemiE(
iEvent, iSetup);
233 analyzeAllHad(
iEvent, iSetup);
258 pfJet_y[
icoll]->Fill(
jet->rapidity());
266 if (pfjet !=
nullptr) {
277 if (basicjet !=
nullptr) {
278 boostedJet_subjetN[
icoll]->Fill(
jet->numberOfDaughters());
280 for (
unsigned int ida = 0; ida <
jet->numberOfDaughters(); ++ida) {
282 boostedJet_subjetPt[
icoll]->Fill(subjet->
pt());
284 boostedJet_subjetPhi[
icoll]->Fill(subjet->
phi());
285 boostedJet_subjetM[
icoll]->Fill(subjet->
mass());
288 if ((jetLabels_[
icoll].
label() ==
"ak8PFJetsPuppiSoftdrop")) {
289 if (
jet->numberOfDaughters() > 1) {
293 boostedJet_wMass[
icoll]->Fill(da0->
mass());
294 boostedJet_massDrop[
icoll]->Fill(da0->
mass() /
jet->mass());
296 boostedJet_wMass[
icoll]->Fill(da1->
mass());
297 boostedJet_massDrop[
icoll]->Fill(da1->
mass() /
jet->mass());
301 boostedJet_massDrop[
icoll]->Fill(-1.0);
334 if (jet0->
pt() < allHadPtCut_ || jet1->
pt() < allHadPtCut_)
341 allHad_pt0->Fill(jet0->
pt());
343 allHad_phi0->Fill(jet0->
phi());
344 allHad_mass0->Fill(jet0->
mass());
348 allHad_wMass0->Fill(
wMass);
350 allHad_wMass0->Fill(-1.0);
353 allHad_pt1->Fill(jet1->
pt());
355 allHad_phi1->Fill(jet1->
phi());
356 allHad_mass1->Fill(jet1->
mass());
360 allHad_wMass1->Fill(
wMass);
362 allHad_wMass1->Fill(-1.0);
365 auto p4cand = (jet0->
p4() + jet1->
p4());
366 allHad_mttbar->Fill(p4cand.mass());
378 if (!(*muonSelect_)(
muon))
389 double dRMin = 999.0;
396 if (ijet->pt() > pt0 && ijet->p() > semiMu_HadJetPtCut_) {
402 else if (ijet->pt() > semiMu_LepJetPtCut_) {
404 if (idRMin <
dRMin) {
413 auto lepJetP4 = lepJet->
p4();
414 const auto& muonP4 =
muon.p4();
416 double tot = lepJetP4.mag2();
417 double ss = muonP4.Dot(lepJet->
p4());
418 double per = muonP4.mag2();
424 bool pass2D =
dRMin > semiMu_dRMin_ ||
ptRel > semiMu_ptRel_;
429 semiMu_muPt->Fill(
muon.pt());
430 semiMu_muEta->Fill(
muon.eta());
431 semiMu_muPhi->Fill(
muon.phi());
432 semiMu_muDRMin->Fill(
dRMin);
433 semiMu_muPtRel->Fill(
ptRel);
436 semiMu_mttbar->Fill(0.0);
438 semiMu_hadJetPt->Fill(hadJet->
pt());
439 semiMu_hadJetY->Fill(hadJet->
rapidity());
440 semiMu_hadJetPhi->Fill(hadJet->
phi());
441 semiMu_hadJetMass->Fill(hadJet->
mass());
445 semiMu_hadJetWMass->Fill(
wMass);
447 semiMu_hadJetWMass->Fill(-1.0);
471 double dRMin = 999.0;
478 if (ijet->pt() > pt0 && ijet->p() > semiE_HadJetPtCut_) {
484 else if (ijet->pt() > semiE_LepJetPtCut_) {
486 if (idRMin <
dRMin) {
495 auto lepJetP4 = lepJet->
p4();
496 const auto& electronP4 =
electron.p4();
498 double tot = lepJetP4.mag2();
499 double ss = electronP4.Dot(lepJet->
p4());
500 double per = electronP4.mag2();
506 bool pass2D =
dRMin > semiE_dRMin_ ||
ptRel > semiE_ptRel_;
514 semiE_eDRMin->Fill(
dRMin);
515 semiE_ePtRel->Fill(
ptRel);
518 semiE_mttbar->Fill(0.0);
520 semiE_hadJetPt->Fill(hadJet->
pt());
521 semiE_hadJetY->Fill(hadJet->
rapidity());
522 semiE_hadJetPhi->Fill(hadJet->
phi());
523 semiE_hadJetMass->Fill(hadJet->
mass());
527 semiE_hadJetWMass->Fill(
wMass);
529 semiE_hadJetWMass->Fill(-1.0);
constexpr double deltaPhi(double phi1, double phi2)
T getParameter(std::string const &) const
float chargedEmEnergyFraction() const
chargedEmEnergyFraction
virtual void analyzeSemiMu(edm::Event const &e, edm::EventSetup const &eSetup)
virtual void analyzeAllHad(edm::Event const &e, edm::EventSetup const &eSetup)
double pt() const final
transverse momentum
virtual void setCurrentFolder(std::string const &fullpath)
virtual double pt() const =0
transverse momentum
virtual double mass() const =0
mass
virtual double rapidity() const =0
rapidity
void bookHistograms(DQMStore::IBooker &bei, edm::Run const &, edm::EventSetup const &) override
Jets made from CaloTowers.
Jets made from PFObjects.
const LorentzVector & p4() const final
four-momentum Lorentz vector
double rapidity() const final
rapidity
Abs< T >::type abs(const T &t)
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction
virtual void analyzeSemiE(edm::Event const &e, edm::EventSetup const &eSetup)
float neutralEmEnergyFraction() const
neutralEmEnergyFraction
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Log< level::Info, false > LogInfo
size_t numberOfDaughters() const override
number of daughters
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction
B2GDQM(const edm::ParameterSet &ps)
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
virtual void analyzeJets(edm::Event const &e, edm::EventSetup const &eSetup)
double mass() const final
mass
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const_iterator begin() const
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
double phi() const final
momentum azimuthal angle
const_iterator end() const
virtual double phi() const =0
momentum azimuthal angle