CMS 3D CMS Logo

TopMonitor.cc
Go to the documentation of this file.
31 
32 #include <string>
33 #include <vector>
34 #include <memory>
35 #include <map>
36 
37 class TopMonitor : public DQMEDAnalyzer, public TriggerDQMBase {
38 public:
41 
43  ~TopMonitor() throw() override;
44  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
45 
46 protected:
48  void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) override;
49 
50  struct JetRefCompare {
51  inline bool operator()(const edm::RefToBase<reco::Jet>& j1, const edm::RefToBase<reco::Jet>& j2) const {
52  return (j1.id() < j2.id()) || ((j1.id() == j2.id()) && (j1.key() < j2.key()));
53  }
54  };
55  typedef std::map<edm::RefToBase<reco::Jet>, float, JetRefCompare> JetTagMap;
56 
57 private:
59 
62 
69  std::vector<edm::EDGetTokenT<reco::JetTagCollection> > jetTagTokens_;
71 
72  struct PVcut {
73  double dxy;
74  double dz;
75  };
76 
87 
88  std::vector<double> met_variable_binning_;
89  std::vector<double> HT_variable_binning_;
90  std::vector<double> jetPt_variable_binning_;
91  std::vector<double> muPt_variable_binning_;
92  std::vector<double> elePt_variable_binning_;
93  std::vector<double> jetEta_variable_binning_;
94  std::vector<double> muEta_variable_binning_;
95  std::vector<double> eleEta_variable_binning_;
96  std::vector<double> invMass_mumu_variable_binning_;
97  std::vector<double> MHT_variable_binning_;
98 
99  std::vector<double> HT_variable_binning_2D_;
100  std::vector<double> jetPt_variable_binning_2D_;
101  std::vector<double> muPt_variable_binning_2D_;
102  std::vector<double> elePt_variable_binning_2D_;
103  std::vector<double> phoPt_variable_binning_2D_;
104  std::vector<double> jetEta_variable_binning_2D_;
105  std::vector<double> muEta_variable_binning_2D_;
106  std::vector<double> eleEta_variable_binning_2D_;
107  std::vector<double> phoEta_variable_binning_2D_;
108  std::vector<double> phi_variable_binning_2D_;
109 
110  ObjME metME_;
112  ObjME metVsLS_;
113  ObjME metPhiME_;
114 
115  ObjME jetVsLS_;
116  ObjME muVsLS_;
117  ObjME eleVsLS_;
118  ObjME phoVsLS_;
119  ObjME bjetVsLS_;
120  ObjME htVsLS_;
121 
122  ObjME jetEtaPhi_HEP17_; // for HEP17 monitoring
123 
124  ObjME jetMulti_;
125  ObjME eleMulti_;
126  ObjME muMulti_;
127  ObjME phoMulti_;
128  ObjME bjetMulti_;
129 
132 
137  ObjME elePt_muPt_;
140  ObjME eventMHT_;
143  ObjME muPt_phoPt_;
145 
147 
148  ObjME eventHT_;
150 
151  std::vector<ObjME> muPhi_;
152  std::vector<ObjME> muEta_;
153  std::vector<ObjME> muPt_;
154 
155  std::vector<ObjME> elePhi_;
156  std::vector<ObjME> eleEta_;
157  std::vector<ObjME> elePt_;
158 
159  std::vector<ObjME> jetPhi_;
160  std::vector<ObjME> jetEta_;
161  std::vector<ObjME> jetPt_;
162 
163  std::vector<ObjME> phoPhi_;
164  std::vector<ObjME> phoEta_;
165  std::vector<ObjME> phoPt_;
166 
167  std::vector<ObjME> bjetPhi_;
168  std::vector<ObjME> bjetEta_;
169  std::vector<ObjME> bjetPt_;
170  std::vector<ObjME> bjetCSV_;
171  std::vector<ObjME> muPt_variableBinning_;
172  std::vector<ObjME> elePt_variableBinning_;
173  std::vector<ObjME> jetPt_variableBinning_;
174  std::vector<ObjME> bjetPt_variableBinning_;
175 
176  std::vector<ObjME> muEta_variableBinning_;
177  std::vector<ObjME> eleEta_variableBinning_;
178  std::vector<ObjME> jetEta_variableBinning_;
179  std::vector<ObjME> bjetEta_variableBinning_;
180 
181  // 2D distributions
182  std::vector<ObjME> jetPtEta_;
183  std::vector<ObjME> jetEtaPhi_;
184 
185  std::vector<ObjME> elePtEta_;
186  std::vector<ObjME> eleEtaPhi_;
187 
188  std::vector<ObjME> muPtEta_;
189  std::vector<ObjME> muEtaPhi_;
190 
191  std::vector<ObjME> phoPtEta_;
192  std::vector<ObjME> phoEtaPhi_;
193 
194  std::vector<ObjME> bjetPtEta_;
195  std::vector<ObjME> bjetEtaPhi_;
196  std::vector<ObjME> bjetCSVHT_;
197 
198  std::unique_ptr<GenericTriggerEventFlag> num_genTriggerEventFlag_;
199  std::unique_ptr<GenericTriggerEventFlag> den_genTriggerEventFlag_;
200 
207 
209 
211 
212  unsigned int njets_;
213  unsigned int nelectrons_;
214  unsigned int nmuons_;
215  unsigned int nphotons_;
219  double HTcut_;
220  unsigned int nbjets_;
225 
226  bool applyMETcut_ = false;
227 
230  bool opsign_;
232  double MHTcut_;
233 
235 
238 };
239 
241  : folderName_(iConfig.getParameter<std::string>("FolderName")),
242  requireValidHLTPaths_(iConfig.getParameter<bool>("requireValidHLTPaths")),
243  hltPathsAreValid_(false),
244  vtxToken_(mayConsume<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertices"))),
245  muoToken_(mayConsume<reco::MuonCollection>(iConfig.getParameter<edm::InputTag>("muons"))),
246  eleToken_(mayConsume<edm::View<reco::GsfElectron> >(iConfig.getParameter<edm::InputTag>("electrons"))),
247  elecIDToken_(consumes<edm::ValueMap<bool> >(iConfig.getParameter<edm::InputTag>("elecID"))),
248  phoToken_(mayConsume<reco::PhotonCollection>(iConfig.getParameter<edm::InputTag>("photons"))),
249  jetToken_(mayConsume<reco::PFJetCollection>(iConfig.getParameter<edm::InputTag>("jets"))),
250  jetTagTokens_(
251  edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >("btagAlgos"),
252  [this](edm::InputTag const& tag) { return mayConsume<reco::JetTagCollection>(tag); })),
253  metToken_(consumes<reco::PFMETCollection>(iConfig.getParameter<edm::InputTag>("met"))),
254  met_binning_(getHistoPSet(
255  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("metPSet"))),
256  ls_binning_(
257  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("lsPSet"))),
258  phi_binning_(getHistoPSet(
259  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("phiPSet"))),
260  pt_binning_(
261  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("ptPSet"))),
262  eta_binning_(getHistoPSet(
263  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("etaPSet"))),
264  HT_binning_(
265  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("htPSet"))),
266  DR_binning_(
267  getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("DRPSet"))),
268  csv_binning_(getHistoPSet(
269  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("csvPSet"))),
270  invMass_mumu_binning_(getHistoPSet(
271  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("invMassPSet"))),
272  MHT_binning_(getHistoPSet(
273  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("MHTPSet"))),
274  met_variable_binning_(
275  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("metBinning")),
276  HT_variable_binning_(
277  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("HTBinning")),
278  jetPt_variable_binning_(
279  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("jetPtBinning")),
280  muPt_variable_binning_(
281  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("muPtBinning")),
282  elePt_variable_binning_(
283  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("elePtBinning")),
284  jetEta_variable_binning_(
285  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("jetEtaBinning")),
286  muEta_variable_binning_(
287  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("muEtaBinning")),
288  eleEta_variable_binning_(
289  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("eleEtaBinning")),
290  invMass_mumu_variable_binning_(iConfig.getParameter<edm::ParameterSet>("histoPSet")
291  .getParameter<std::vector<double> >("invMassVariableBinning")),
292  MHT_variable_binning_(
293  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("MHTVariableBinning")),
294  HT_variable_binning_2D_(
295  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("HTBinning2D")),
296  jetPt_variable_binning_2D_(
297  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("jetPtBinning2D")),
298  muPt_variable_binning_2D_(
299  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("muPtBinning2D")),
300  elePt_variable_binning_2D_(
301  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("elePtBinning2D")),
302  phoPt_variable_binning_2D_(
303  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("phoPtBinning2D")),
304  jetEta_variable_binning_2D_(
305  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("jetEtaBinning2D")),
306  muEta_variable_binning_2D_(
307  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("muEtaBinning2D")),
308  eleEta_variable_binning_2D_(
309  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("eleEtaBinning2D")),
310  phoEta_variable_binning_2D_(
311  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("phoEtaBinning2D")),
312  phi_variable_binning_2D_(
313  iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("phiBinning2D")),
314  num_genTriggerEventFlag_(new GenericTriggerEventFlag(
315  iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"), consumesCollector(), *this)),
316  den_genTriggerEventFlag_(new GenericTriggerEventFlag(
317  iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"), consumesCollector(), *this)),
318  metSelection_(iConfig.getParameter<std::string>("metSelection")),
319  jetSelection_(iConfig.getParameter<std::string>("jetSelection")),
320  eleSelection_(iConfig.getParameter<std::string>("eleSelection")),
321  muoSelection_(iConfig.getParameter<std::string>("muoSelection")),
322  phoSelection_(iConfig.getParameter<std::string>("phoSelection")),
323  HTdefinition_(iConfig.getParameter<std::string>("HTdefinition")),
324  vtxSelection_(iConfig.getParameter<std::string>("vertexSelection")),
325  bjetSelection_(iConfig.getParameter<std::string>("bjetSelection")),
326  njets_(iConfig.getParameter<unsigned int>("njets")),
327  nelectrons_(iConfig.getParameter<unsigned int>("nelectrons")),
328  nmuons_(iConfig.getParameter<unsigned int>("nmuons")),
329  nphotons_(iConfig.getParameter<unsigned int>("nphotons")),
330  leptJetDeltaRmin_(iConfig.getParameter<double>("leptJetDeltaRmin")),
331  bJetMuDeltaRmax_(iConfig.getParameter<double>("bJetMuDeltaRmax")),
332  bJetDeltaEtaMax_(iConfig.getParameter<double>("bJetDeltaEtaMax")),
333  HTcut_(iConfig.getParameter<double>("HTcut")),
334  nbjets_(iConfig.getParameter<unsigned int>("nbjets")),
335  workingpoint_(iConfig.getParameter<double>("workingpoint")),
336  applyLeptonPVcuts_(iConfig.getParameter<bool>("applyLeptonPVcuts")),
337  invMassUppercut_(iConfig.getParameter<double>("invMassUppercut")),
338  invMassLowercut_(iConfig.getParameter<double>("invMassLowercut")),
339  opsign_(iConfig.getParameter<bool>("oppositeSignMuons")),
340  MHTdefinition_(iConfig.getParameter<std::string>("MHTdefinition")),
341  MHTcut_(iConfig.getParameter<double>("MHTcut")),
342  invMassCutInAllMuPairs_(iConfig.getParameter<bool>("invMassCutInAllMuPairs")),
343  enablePhotonPlot_(iConfig.getParameter<bool>("enablePhotonPlot")),
344  enableMETPlot_(iConfig.getParameter<bool>("enableMETPlot")) {
345  ObjME empty;
346 
347  muPhi_ = std::vector<ObjME>(nmuons_, empty);
348  muEta_ = std::vector<ObjME>(nmuons_, empty);
349  muPt_ = std::vector<ObjME>(nmuons_, empty);
350  muEta_variableBinning_ = std::vector<ObjME>(nmuons_, empty);
351  muPt_variableBinning_ = std::vector<ObjME>(nmuons_, empty);
352  muPtEta_ = std::vector<ObjME>(nmuons_, empty);
353  muEtaPhi_ = std::vector<ObjME>(nmuons_, empty);
354 
355  elePhi_ = std::vector<ObjME>(nelectrons_, empty);
356  eleEta_ = std::vector<ObjME>(nelectrons_, empty);
357  elePt_ = std::vector<ObjME>(nelectrons_, empty);
358  eleEta_variableBinning_ = std::vector<ObjME>(nelectrons_, empty);
359  elePt_variableBinning_ = std::vector<ObjME>(nelectrons_, empty);
360  elePtEta_ = std::vector<ObjME>(nelectrons_, empty);
361  eleEtaPhi_ = std::vector<ObjME>(nelectrons_, empty);
362 
363  jetPhi_ = std::vector<ObjME>(njets_, empty);
364  jetEta_ = std::vector<ObjME>(njets_, empty);
365  jetPt_ = std::vector<ObjME>(njets_, empty);
366  jetEta_variableBinning_ = std::vector<ObjME>(njets_, empty);
367  jetPt_variableBinning_ = std::vector<ObjME>(njets_, empty);
368  jetPtEta_ = std::vector<ObjME>(njets_, empty);
369  jetEtaPhi_ = std::vector<ObjME>(njets_, empty);
370 
371  //Menglei Sun
372  phoPhi_ = std::vector<ObjME>(nphotons_, empty);
373  phoEta_ = std::vector<ObjME>(nphotons_, empty);
374  phoPt_ = std::vector<ObjME>(nphotons_, empty);
375  phoPtEta_ = std::vector<ObjME>(nphotons_, empty);
376  phoEtaPhi_ = std::vector<ObjME>(nphotons_, empty);
377 
378  // Marina
379  bjetPhi_ = std::vector<ObjME>(nbjets_, empty);
380  bjetEta_ = std::vector<ObjME>(nbjets_, empty);
381  bjetPt_ = std::vector<ObjME>(nbjets_, empty);
382  bjetCSV_ = std::vector<ObjME>(nbjets_, empty);
383  bjetEta_variableBinning_ = std::vector<ObjME>(nbjets_, empty);
384  bjetPt_variableBinning_ = std::vector<ObjME>(nbjets_, empty);
385  bjetPtEta_ = std::vector<ObjME>(nbjets_, empty);
386  bjetEtaPhi_ = std::vector<ObjME>(nbjets_, empty);
387  bjetCSVHT_ = std::vector<ObjME>(nbjets_, empty);
388  //Suvankar
389  lepPVcuts_.dxy = (iConfig.getParameter<edm::ParameterSet>("leptonPVcuts")).getParameter<double>("dxy");
390  lepPVcuts_.dz = (iConfig.getParameter<edm::ParameterSet>("leptonPVcuts")).getParameter<double>("dz");
391 }
392 
395  num_genTriggerEventFlag_.reset();
397  den_genTriggerEventFlag_.reset();
398 }
399 
400 void TopMonitor::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) {
401  // Initialize the GenericTriggerEventFlag
403  num_genTriggerEventFlag_->initRun(iRun, iSetup);
405  den_genTriggerEventFlag_->initRun(iRun, iSetup);
406 
407  // check if every HLT path specified in numerator and denominator has a valid match in the HLT Menu
409  den_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->allHLTPathsAreValid() &&
410  den_genTriggerEventFlag_->allHLTPathsAreValid());
411 
412  // if valid HLT paths are required,
413  // create DQM outputs only if all paths are valid
415  return;
416  }
417 
418  std::string histname, histtitle;
419 
420  std::string currentFolder = folderName_;
421  ibooker.setCurrentFolder(currentFolder);
422 
423  if (enableMETPlot_) {
424  histname = "met";
425  histtitle = "PFMET";
426  bookME(ibooker, metME_, histname, histtitle, met_binning_.nbins, met_binning_.xmin, met_binning_.xmax);
427  setMETitle(metME_, "PF MET [GeV]", "events / [GeV]");
428 
429  histname = "metPhi";
430  histtitle = "PFMET phi";
431  bookME(ibooker, metPhiME_, histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
432  setMETitle(metPhiME_, "PF MET #phi", "events / 0.1 rad");
433 
434  histname = "met_variable";
435  histtitle = "PFMET";
436  bookME(ibooker, metME_variableBinning_, histname, histtitle, met_variable_binning_);
437  setMETitle(metME_variableBinning_, "PF MET [GeV]", "events / [GeV]");
438 
439  histname = "metVsLS";
440  histtitle = "PFMET vs LS";
441  bookME(ibooker,
442  metVsLS_,
443  histname,
444  histtitle,
450  setMETitle(metVsLS_, "LS", "PF MET [GeV]");
451  }
452 
453  if (njets_ > 0) {
454  histname = "jetVsLS";
455  histtitle = "jet pt vs LS";
456  bookME(ibooker,
457  jetVsLS_,
458  histname,
459  histtitle,
464  pt_binning_.xmax);
465  setMETitle(jetVsLS_, "LS", "jet pt [GeV]");
466 
467  histname = "jetEtaPhi_HEP17";
468  histtitle = "jet #eta-#phi for HEP17";
469  bookME(ibooker, jetEtaPhi_HEP17_, histname, histtitle, 10, -2.5, 2.5, 18, -3.1415, 3.1415); // for HEP17 monitoring
470  setMETitle(jetEtaPhi_HEP17_, "jet #eta", "jet #phi");
471 
472  histname = "jetMulti";
473  histtitle = "jet multiplicity";
474  bookME(ibooker, jetMulti_, histname, histtitle, 11, -.5, 10.5);
475  setMETitle(jetMulti_, "jet multiplicity", "events");
476  }
477 
478  if (nmuons_ > 0) {
479  histname = "muVsLS";
480  histtitle = "muon pt vs LS";
481  bookME(ibooker,
482  muVsLS_,
483  histname,
484  histtitle,
489  pt_binning_.xmax);
490  setMETitle(muVsLS_, "LS", "muon pt [GeV]");
491 
492  histname = "muMulti";
493  histtitle = "muon multiplicity";
494  bookME(ibooker, muMulti_, histname, histtitle, 6, -.5, 5.5);
495  setMETitle(muMulti_, "muon multiplicity", "events");
496 
497  if (njets_ > 0) {
498  histname = "DeltaR_jet_Mu";
499  histtitle = "#DeltaR(jet,mu)";
500  bookME(ibooker, DeltaR_jet_Mu_, histname, histtitle, DR_binning_.nbins, DR_binning_.xmin, DR_binning_.xmax);
501  setMETitle(DeltaR_jet_Mu_, "#DeltaR(jet,mu)", "events");
502  }
503  }
504 
505  if (nelectrons_ > 0) {
506  histname = "eleVsLS";
507  histtitle = "electron pt vs LS";
508  bookME(ibooker,
509  eleVsLS_,
510  histname,
511  histtitle,
516  pt_binning_.xmax);
517  setMETitle(eleVsLS_, "LS", "electron pt [GeV]");
518 
519  histname = "eleMulti";
520  histtitle = "electron multiplicity";
521  bookME(ibooker, eleMulti_, histname, histtitle, 6, -.5, 5.5);
522  setMETitle(eleMulti_, "electron multiplicity", "events");
523 
524  if (njets_ > 0) {
525  histname = "elePt_jetPt";
526  histtitle = "electron pt vs jet pt";
528  setMETitle(elePt_jetPt_, "leading electron pt", "leading jet pt");
529  }
530 
531  if (nmuons_ > 0) {
532  histname = "elePt_muPt";
533  histtitle = "electron pt vs muon pt";
535  setMETitle(elePt_muPt_, "electron pt [GeV]", "muon pt [GeV]");
536 
537  histname = "eleEta_muEta";
538  histtitle = "electron #eta vs muon #eta";
540  setMETitle(eleEta_muEta_, "electron #eta", "muon #eta");
541  }
542  }
543 
544  //Menglei
545  if (enablePhotonPlot_) {
546  if (nphotons_ > 0) {
547  histname = "photonVsLS";
548  histtitle = "photon pt vs LS";
549  bookME(ibooker,
550  phoVsLS_,
551  histname,
552  histtitle,
557  pt_binning_.xmax);
558  setMETitle(phoVsLS_, "LS", "photon pt [GeV]");
559  }
560  }
561 
562  // Marina
563  if (nbjets_ > 0) {
564  histname = "bjetVsLS";
565  histtitle = "b-jet pt vs LS";
566  bookME(ibooker,
567  bjetVsLS_,
568  histname,
569  histtitle,
574  pt_binning_.xmax);
575  setMETitle(bjetVsLS_, "LS", "b-jet pt [GeV]");
576 
577  histname = "bjetMulti";
578  histtitle = "b-jet multiplicity";
579  bookME(ibooker, bjetMulti_, histname, histtitle, 6, -.5, 5.5);
580  setMETitle(bjetMulti_, "b-jet multiplicity", "events");
581  }
582 
583  if (nelectrons_ > 1) {
584  histname = "ele1Pt_ele2Pt";
585  histtitle = "electron-1 pt vs electron-2 pt";
587  setMETitle(ele1Pt_ele2Pt_, "electron-1 pt [GeV]", "electron-2 pt [GeV]");
588 
589  histname = "ele1Eta_ele2Eta";
590  histtitle = "electron-1 #eta vs electron-2 #eta";
592  setMETitle(ele1Eta_ele2Eta_, "electron-1 #eta", "electron-2 #eta");
593  }
594 
595  if (nmuons_ > 1) {
596  histname = "mu1Pt_mu2Pt";
597  histtitle = "muon-1 pt vs muon-2 pt";
599  setMETitle(mu1Pt_mu2Pt_, "muon-1 pt [GeV]", "muon-2 pt [GeV]");
600 
601  histname = "mu1Eta_mu2Eta";
602  histtitle = "muon-1 #eta vs muon-2 #eta";
604  setMETitle(mu1Eta_mu2Eta_, "muon-1 #eta", "muon-2 #eta");
605  //george
606  histname = "invMass";
607  histtitle = "M mu1 mu2";
608  bookME(ibooker,
610  histname,
611  histtitle,
615  setMETitle(invMass_mumu_, "M(mu1,mu2) [GeV]", "events");
616  histname = "invMass_variable";
617  histtitle = "M mu1 mu2 variable";
619  setMETitle(invMass_mumu_variableBinning_, "M(mu1,mu2) [GeV]", "events / [GeV]");
620  }
621 
622  if (HTcut_ > 0) {
623  histname = "htVsLS";
624  histtitle = "event HT vs LS";
625  bookME(ibooker,
626  htVsLS_,
627  histname,
628  histtitle,
633  pt_binning_.xmax);
634  setMETitle(htVsLS_, "LS", "event HT [GeV]");
635 
636  histname = "eventHT";
637  histtitle = "event HT";
638  bookME(ibooker, eventHT_, histname, histtitle, HT_binning_.nbins, HT_binning_.xmin, HT_binning_.xmax);
639  setMETitle(eventHT_, " event HT [GeV]", "events");
640  histname.append("_variableBinning");
641  bookME(ibooker, eventHT_variableBinning_, histname, histtitle, HT_variable_binning_);
642  setMETitle(eventHT_variableBinning_, "event HT [GeV]", "events");
643 
644  if (nelectrons_ > 0) {
645  histname = "elePt_eventHT";
646  histtitle = "electron pt vs event HT";
648  setMETitle(elePt_eventHT_, "leading electron pt", "event HT");
649  }
650  }
651 
652  if (MHTcut_ > 0) {
653  //george
654  histname = "eventMHT";
655  histtitle = "event MHT";
656  bookME(ibooker, eventMHT_, histname, histtitle, MHT_binning_.nbins, MHT_binning_.xmin, MHT_binning_.xmax);
657  setMETitle(eventMHT_, " event MHT [GeV]", "events");
658 
659  histname = "eventMHT_variable";
660  histtitle = "event MHT variable";
661  bookME(ibooker, eventMHT_variableBinning_, histname, histtitle, MHT_variable_binning_);
662  setMETitle(eventMHT_variableBinning_, "event MHT [GeV]", "events / [GeV]");
663  }
664 
665  //Menglei
666  if (enablePhotonPlot_) {
667  if ((nmuons_ > 0) && (nphotons_ > 0)) {
668  histname = "muPt_phoPt", histtitle = "muon pt vs photon pt";
670  setMETitle(muPt_phoPt_, "muon pt [GeV]", "photon pt [GeV]");
671 
672  histname = "muEta_phoEta", histtitle = "muon #eta vs photon #eta";
674  setMETitle(muEta_phoEta_, "muon #eta", "photon #eta");
675  }
676  }
677 
678  for (unsigned int iMu = 0; iMu < nmuons_; ++iMu) {
679  std::string index = std::to_string(iMu + 1);
680 
681  histname = "muPt_";
682  histtitle = "muon p_{T} - ";
683  histname.append(index);
684  histtitle.append(index);
685  bookME(ibooker, muPt_.at(iMu), histname, histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax);
686  setMETitle(muPt_.at(iMu), "muon p_{T} [GeV]", "events");
687  histname.append("_variableBinning");
688  bookME(ibooker, muPt_variableBinning_.at(iMu), histname, histtitle, muPt_variable_binning_);
689  setMETitle(muPt_variableBinning_.at(iMu), "muon p_{T} [GeV]", "events");
690 
691  histname = "muEta_";
692  histtitle = "muon #eta - ";
693  histname.append(index);
694  histtitle.append(index);
695  bookME(ibooker, muEta_.at(iMu), histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
696  setMETitle(muEta_.at(iMu), " muon #eta", "events");
697  histname.append("_variableBinning");
698  bookME(ibooker, muEta_variableBinning_.at(iMu), histname, histtitle, muEta_variable_binning_);
699  setMETitle(muEta_variableBinning_.at(iMu), " muon #eta", "events");
700 
701  histname = "muPhi_";
702  histtitle = "muon #phi - ";
703  histname.append(index);
704  histtitle.append(index);
705  bookME(ibooker, muPhi_.at(iMu), histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
706  setMETitle(muPhi_.at(iMu), " muon #phi", "events");
707 
708  histname = "muPtEta_";
709  histtitle = "muon p_{T} - #eta - ";
710  histname.append(index);
711  histtitle.append(index);
712  bookME(ibooker, muPtEta_.at(iMu), histname, histtitle, muPt_variable_binning_2D_, muEta_variable_binning_2D_);
713  setMETitle(muPtEta_.at(iMu), "muon p_{T} [GeV]", "muon #eta");
714 
715  histname = "muEtaPhi_";
716  histtitle = "muon #eta - #phi - ";
717  histname.append(index);
718  histtitle.append(index);
719  bookME(ibooker, muEtaPhi_.at(iMu), histname, histtitle, muEta_variable_binning_2D_, phi_variable_binning_2D_);
720  setMETitle(muEtaPhi_.at(iMu), "muon #eta", "muon #phi");
721  }
722 
723  for (unsigned int iEle = 0; iEle < nelectrons_; ++iEle) {
724  std::string index = std::to_string(iEle + 1);
725 
726  histname = "elePt_";
727  histtitle = "electron p_{T} - ";
728  histname.append(index);
729  histtitle.append(index);
730  bookME(ibooker, elePt_.at(iEle), histname, histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax);
731  setMETitle(elePt_.at(iEle), "electron p_{T} [GeV]", "events");
732  histname.append("_variableBinning");
733  bookME(ibooker, elePt_variableBinning_.at(iEle), histname, histtitle, elePt_variable_binning_);
734  setMETitle(elePt_variableBinning_.at(iEle), "electron p_{T} [GeV]", "events");
735 
736  histname = "eleEta_";
737  histtitle = "electron #eta - ";
738  histname.append(index);
739  histtitle.append(index);
740  bookME(ibooker, eleEta_.at(iEle), histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
741  setMETitle(eleEta_.at(iEle), " electron #eta", "events");
742  histname.append("_variableBinning");
743  bookME(ibooker, eleEta_variableBinning_.at(iEle), histname, histtitle, eleEta_variable_binning_);
744  setMETitle(eleEta_variableBinning_.at(iEle), "electron #eta", "events");
745 
746  histname = "elePhi_";
747  histtitle = "electron #phi - ";
748  histname.append(index);
749  histtitle.append(index);
750  bookME(ibooker, elePhi_.at(iEle), histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
751  setMETitle(elePhi_.at(iEle), " electron #phi", "events");
752 
753  histname = "elePtEta_";
754  histtitle = "electron p_{T} - #eta - ";
755  histname.append(index);
756  histtitle.append(index);
757  bookME(ibooker, elePtEta_.at(iEle), histname, histtitle, elePt_variable_binning_2D_, eleEta_variable_binning_2D_);
758  setMETitle(elePtEta_.at(iEle), "electron p_{T} [GeV]", "electron #eta");
759 
760  histname = "eleEtaPhi_";
761  histtitle = "electron #eta - #phi - ";
762  histname.append(index);
763  histtitle.append(index);
764  bookME(ibooker, eleEtaPhi_.at(iEle), histname, histtitle, eleEta_variable_binning_2D_, phi_variable_binning_2D_);
765  setMETitle(eleEtaPhi_.at(iEle), "electron #eta", "electron #phi");
766  }
767 
768  //Menglei
769  if (enablePhotonPlot_) {
770  for (unsigned int iPho(0); iPho < nphotons_; iPho++) {
771  std::string index = std::to_string(iPho + 1);
772 
773  histname = "phoPt_";
774  histtitle = "photon p_{T} - ";
775  histname.append(index);
776  histtitle.append(index);
777  bookME(ibooker, phoPt_[iPho], histname, histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax);
778  setMETitle(phoPt_[iPho], "photon p_{T} [GeV]", "events");
779 
780  histname = "phoEta_";
781  histtitle = "photon #eta - ";
782  histname.append(index);
783  histtitle.append(index);
784  bookME(ibooker, phoEta_[iPho], histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
785  setMETitle(phoEta_[iPho], "photon #eta", "events");
786 
787  histname = "phoPhi_";
788  histtitle = "photon #phi - ";
789  histname.append(index);
790  histtitle.append(index);
791  bookME(ibooker, phoPhi_[iPho], histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
792  setMETitle(phoPhi_[iPho], "photon #phi", "events");
793 
794  histname = "phoPtEta_";
795  histtitle = "photon p_{T} - #eta - ";
796  histname.append(index);
797  histtitle.append(index);
798  bookME(ibooker, phoPtEta_[iPho], histname, histtitle, phoPt_variable_binning_2D_, phoEta_variable_binning_2D_);
799  setMETitle(phoPtEta_[iPho], "photon p_{T} [GeV]", "photon #eta");
800 
801  histname = "phoEtaPhi_";
802  histtitle = "photon #eta - #phi - ";
803  histname.append(index);
804  histtitle.append(index);
805  bookME(ibooker, phoEtaPhi_[iPho], histname, histtitle, phoEta_variable_binning_2D_, phi_variable_binning_2D_);
806  setMETitle(phoEtaPhi_[iPho], "photon #eta", "photon #phi");
807  }
808  }
809 
810  for (unsigned int iJet = 0; iJet < njets_; ++iJet) {
811  std::string index = std::to_string(iJet + 1);
812 
813  histname = "jetPt_";
814  histtitle = "jet p_{T} - ";
815  histname.append(index);
816  histtitle.append(index);
817  bookME(ibooker, jetPt_.at(iJet), histname, histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax);
818  setMETitle(jetPt_.at(iJet), "jet p_{T} [GeV]", "events");
819  histname.append("_variableBinning");
820  bookME(ibooker, jetPt_variableBinning_.at(iJet), histname, histtitle, jetPt_variable_binning_);
821  setMETitle(jetPt_variableBinning_.at(iJet), "jet p_{T} [GeV]", "events");
822 
823  histname = "jetEta_";
824  histtitle = "jet #eta - ";
825  histname.append(index);
826  histtitle.append(index);
827  bookME(ibooker, jetEta_.at(iJet), histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
828  setMETitle(jetEta_.at(iJet), "jet #eta", "events");
829  histname.append("_variableBinning");
830  bookME(ibooker, jetEta_variableBinning_.at(iJet), histname, histtitle, jetEta_variable_binning_);
831  setMETitle(jetEta_variableBinning_.at(iJet), "jet #eta", "events");
832 
833  histname = "jetPhi_";
834  histtitle = "jet #phi - ";
835  histname.append(index);
836  histtitle.append(index);
837  bookME(ibooker, jetPhi_.at(iJet), histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
838  setMETitle(jetPhi_.at(iJet), "jet #phi", "events");
839 
840  histname = "jetPtEta_";
841  histtitle = "jet p_{T} - #eta - ";
842  histname.append(index);
843  histtitle.append(index);
844  bookME(ibooker, jetPtEta_.at(iJet), histname, histtitle, jetPt_variable_binning_2D_, jetEta_variable_binning_2D_);
845  setMETitle(jetPtEta_.at(iJet), "jet p_{T} [GeV]", "jet #eta");
846 
847  histname = "jetEtaPhi_";
848  histtitle = "jet #eta - #phi - ";
849  histname.append(index);
850  histtitle.append(index);
851  bookME(ibooker, jetEtaPhi_.at(iJet), histname, histtitle, jetEta_variable_binning_2D_, phi_variable_binning_2D_);
852  setMETitle(jetEtaPhi_.at(iJet), "jet #eta", "jet #phi");
853  }
854 
855  // Marina
856  for (unsigned int iBJet = 0; iBJet < nbjets_; ++iBJet) {
857  std::string index = std::to_string(iBJet + 1);
858 
859  histname = "bjetPt_";
860  histtitle = "b-jet p_{T} - ";
861  histname.append(index);
862  histtitle.append(index);
863  bookME(ibooker, bjetPt_.at(iBJet), histname, histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax);
864  setMETitle(bjetPt_.at(iBJet), "b-jet p_{T} [GeV]", "events");
865  histname.append("_variableBinning");
866  bookME(ibooker, bjetPt_variableBinning_.at(iBJet), histname, histtitle, jetPt_variable_binning_);
867  setMETitle(bjetPt_variableBinning_.at(iBJet), "b-jet p_{T} [GeV]", "events");
868 
869  histname = "bjetEta_";
870  histtitle = "b-jet #eta - ";
871  histname.append(index);
872  histtitle.append(index);
873  bookME(ibooker, bjetEta_.at(iBJet), histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
874  setMETitle(bjetEta_.at(iBJet), "b-jet #eta", "events");
875  histname.append("_variableBinning");
876  bookME(ibooker, bjetEta_variableBinning_.at(iBJet), histname, histtitle, jetEta_variable_binning_);
877  setMETitle(bjetEta_variableBinning_.at(iBJet), "b-jet #eta", "events");
878 
879  histname = "bjetPhi_";
880  histtitle = "b-jet #phi - ";
881  histname.append(index);
882  histtitle.append(index);
883  bookME(ibooker, bjetPhi_.at(iBJet), histname, histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
884  setMETitle(bjetPhi_.at(iBJet), "b-jet #phi", "events");
885 
886  histname = "bjetCSV_";
887  histtitle = "b-jet CSV - ";
888  histname.append(index);
889  histtitle.append(index);
890  bookME(ibooker, bjetCSV_.at(iBJet), histname, histtitle, csv_binning_.nbins, csv_binning_.xmin, csv_binning_.xmax);
891  setMETitle(bjetCSV_.at(iBJet), "b-jet CSV", "events");
892 
893  histname = "bjetPtEta_";
894  histtitle = "b-jet p_{T} - #eta - ";
895  histname.append(index);
896  histtitle.append(index);
897  bookME(ibooker, bjetPtEta_.at(iBJet), histname, histtitle, jetPt_variable_binning_2D_, jetEta_variable_binning_2D_);
898  setMETitle(bjetPtEta_.at(iBJet), "b-jet p_{T} [GeV]", "b-jet #eta");
899 
900  histname = "bjetEtaPhi_";
901  histtitle = "b-jet #eta - #phi - ";
902  histname.append(index);
903  histtitle.append(index);
904  bookME(ibooker, bjetEtaPhi_.at(iBJet), histname, histtitle, jetEta_variable_binning_2D_, phi_variable_binning_2D_);
905  setMETitle(bjetEtaPhi_.at(iBJet), "b-jet #eta", "b-jet #phi");
906 
907  histname = "bjetCSVHT_";
908  histtitle = "HT - b-jet CSV - ";
909  histname.append(index);
910  histtitle.append(index);
911  bookME(ibooker,
912  bjetCSVHT_.at(iBJet),
913  histname,
914  histtitle,
920  HT_binning_.xmax);
921  setMETitle(bjetCSVHT_.at(iBJet), "b-jet CSV", "event HT [GeV]");
922  }
923 }
924 
926  // if valid HLT paths are required,
927  // analyze event only if all paths are valid
929  return;
930  }
931 
932  // Filter out events if Trigger Filtering is requested
933  if (den_genTriggerEventFlag_->on() && !den_genTriggerEventFlag_->accept(iEvent, iSetup)) {
934  return;
935  }
936 
938  iEvent.getByToken(vtxToken_, primaryVertices);
939  //Primary Vertex selection
940  const reco::Vertex* pv = nullptr;
941  for (auto const& v : *primaryVertices) {
942  if (!vtxSelection_(v)) {
943  continue;
944  }
945  pv = &v;
946  break;
947  }
948  if (applyLeptonPVcuts_ && (pv == nullptr)) {
949  edm::LogWarning("TopMonitor") << "Invalid handle to reco::VertexCollection, event will be skipped";
950  return;
951  }
952 
954  iEvent.getByToken(metToken_, metHandle);
955  if ((not metHandle.isValid()) && enableMETPlot_) {
956  edm::LogWarning("TopMonitor") << "MET handle not valid \n";
957  return;
958  }
959 
960  double met_pt(-99.);
961  double met_phi(-99.);
962 
963  if (enableMETPlot_) {
964  const reco::PFMET& pfmet = metHandle->front();
965 
966  if (!metSelection_(pfmet)) {
967  return;
968  }
969 
970  met_pt = pfmet.pt();
971  met_phi = pfmet.phi();
972  }
973 
975  iEvent.getByToken(eleToken_, eleHandle);
976  if (!eleHandle.isValid() && nelectrons_ > 0) {
977  edm::LogWarning("TopMonitor") << "Electron handle not valid \n";
978  return;
979  }
980 
981  edm::Handle<edm::ValueMap<bool> > eleIDHandle;
982  iEvent.getByToken(elecIDToken_, eleIDHandle);
983  if (!eleIDHandle.isValid() && nelectrons_ > 0) {
984  edm::LogWarning("TopMonitor") << "Electron ID handle not valid \n";
985  return;
986  }
987 
988  std::vector<reco::GsfElectron> electrons;
989  if (nelectrons_ > 0) {
990  if (eleHandle->size() < nelectrons_) {
991  return;
992  }
993 
994  for (size_t index = 0; index < eleHandle->size(); index++) {
995  const auto e = eleHandle->at(index);
996  const auto el = eleHandle->ptrAt(index);
997 
998  bool pass_id = (*eleIDHandle)[el];
999 
1000  if (eleSelection_(e) && pass_id) {
1001  electrons.push_back(e);
1002  }
1003 
1004  if (applyLeptonPVcuts_ && ((std::fabs(e.gsfTrack()->dxy(pv->position())) >= lepPVcuts_.dxy) ||
1005  (std::fabs(e.gsfTrack()->dz(pv->position())) >= lepPVcuts_.dz))) {
1006  continue;
1007  }
1008  }
1009 
1010  if (electrons.size() < nelectrons_) {
1011  return;
1012  }
1013  }
1014 
1016  iEvent.getByToken(muoToken_, muoHandle);
1017  if (!muoHandle.isValid() && nmuons_ > 0) {
1018  edm::LogWarning("TopMonitor") << "Muon handle not valid \n";
1019  return;
1020  }
1021 
1022  if (muoHandle->size() < nmuons_) {
1023  return;
1024  }
1025 
1026  std::vector<reco::Muon> muons;
1027  if (nmuons_ > 0) {
1028  for (auto const& m : *muoHandle) {
1029  if (muoSelection_(m)) {
1030  muons.push_back(m);
1031  }
1032 
1033  if (applyLeptonPVcuts_ && ((std::fabs(m.muonBestTrack()->dxy(pv->position())) >= lepPVcuts_.dxy) ||
1034  (std::fabs(m.muonBestTrack()->dz(pv->position())) >= lepPVcuts_.dz))) {
1035  continue;
1036  }
1037  }
1038 
1039  if (muons.size() < nmuons_) {
1040  return;
1041  }
1042  }
1043 
1044  double mll(-2);
1045  if (nmuons_ > 1) {
1046  mll = (muons[0].p4() + muons[1].p4()).M();
1047 
1048  if ((invMassUppercut_ > -1) && (invMassLowercut_ > -1) && ((mll > invMassUppercut_) || (mll < invMassLowercut_))) {
1049  return;
1050  }
1051  if (opsign_ && (muons[0].charge() == muons[1].charge())) {
1052  return;
1053  }
1054  }
1055 
1057  iEvent.getByToken(phoToken_, phoHandle);
1058  if (!phoHandle.isValid()) {
1059  edm::LogWarning("TopMonitor") << "Photon handle not valid \n";
1060  return;
1061  }
1062  if (phoHandle->size() < nphotons_) {
1063  return;
1064  }
1065 
1066  std::vector<reco::Photon> photons;
1067  for (auto const& p : *phoHandle) {
1068  if (phoSelection_(p)) {
1069  photons.push_back(p);
1070  }
1071  }
1072  if (photons.size() < nphotons_) {
1073  return;
1074  }
1075 
1076  double eventHT(0.);
1077  math::XYZTLorentzVector eventMHT(0., 0., 0., 0.);
1078 
1080  iEvent.getByToken(jetToken_, jetHandle);
1081  if (!jetHandle.isValid() && njets_ > 0) {
1082  edm::LogWarning("TopMonitor") << "Jet handle not valid \n";
1083  return;
1084  }
1085  std::vector<reco::PFJet> jets;
1086  if (njets_ > 0) {
1087  if (jetHandle->size() < njets_)
1088  return;
1089  for (auto const& j : *jetHandle) {
1090  if (HTdefinition_(j)) {
1091  eventHT += j.pt();
1092  }
1093  if (MHTdefinition_(j)) {
1094  eventMHT += j.p4();
1095  }
1096  if (jetSelection_(j)) {
1097  bool isJetOverlappedWithLepton = false;
1098  if (nmuons_ > 0) {
1099  for (auto const& m : muons) {
1100  if (deltaR(j, m) < leptJetDeltaRmin_) {
1101  isJetOverlappedWithLepton = true;
1102  break;
1103  }
1104  }
1105  }
1106  if (isJetOverlappedWithLepton)
1107  continue;
1108  if (nelectrons_ > 0) {
1109  for (auto const& e : electrons) {
1110  if (deltaR(j, e) < leptJetDeltaRmin_) {
1111  isJetOverlappedWithLepton = true;
1112  break;
1113  }
1114  }
1115  }
1116  if (isJetOverlappedWithLepton)
1117  continue;
1118  jets.push_back(j);
1119  }
1120  }
1121  if (jets.size() < njets_)
1122  return;
1123  }
1124 
1125  if (eventHT < HTcut_) {
1126  return;
1127  }
1128 
1129  if ((MHTcut_ > 0) && (eventMHT.pt() < MHTcut_)) {
1130  return;
1131  }
1132 
1133  bool allpairs = false;
1134  if (nmuons_ > 2) {
1135  double mumu_mass;
1136  for (unsigned int idx = 0; idx < muons.size(); idx++) {
1137  for (unsigned int idx2 = idx + 1; idx2 < muons.size(); idx2++) {
1138  //compute inv mass of two different leptons
1139  mumu_mass = (muons[idx2].p4() + muons[idx2].p4()).M();
1140  if (mumu_mass < invMassLowercut_ || mumu_mass > invMassUppercut_)
1141  allpairs = true;
1142  }
1143  }
1144  }
1145  //cut only if enabled and the event has a pair that failed the mll range
1146  if (allpairs && invMassCutInAllMuPairs_) {
1147  return;
1148  }
1149 
1150  JetTagMap bjets;
1151 
1152  if (nbjets_ > 0) {
1153  // map of Jet,btagValues (for all jets passing bJetSelection_)
1154  // - btagValue of each jet is calculated as sum of values from InputTags in jetTagTokens_
1155  JetTagMap allJetBTagVals;
1156 
1157  for (const auto& jetTagToken : jetTagTokens_) {
1159  iEvent.getByToken(jetTagToken, bjetHandle);
1160  if (not bjetHandle.isValid()) {
1161  edm::LogWarning("TopMonitor") << "B-Jet handle not valid, will skip event \n";
1162  return;
1163  }
1164 
1165  const reco::JetTagCollection& bTags = *(bjetHandle.product());
1166 
1167  for (const auto& i_jetTag : bTags) {
1168  const auto& jetRef = i_jetTag.first;
1169 
1170  if (not bjetSelection_(*dynamic_cast<const reco::Jet*>(jetRef.get()))) {
1171  continue;
1172  }
1173 
1174  const auto btagVal = i_jetTag.second;
1175 
1176  if (not std::isfinite(btagVal)) {
1177  continue;
1178  }
1179 
1180  if (allJetBTagVals.find(jetRef) != allJetBTagVals.end()) {
1181  allJetBTagVals.at(jetRef) += btagVal;
1182  } else {
1183  allJetBTagVals.insert(JetTagMap::value_type(jetRef, btagVal));
1184  }
1185  }
1186  }
1187 
1188  for (const auto& jetBTagVal : allJetBTagVals) {
1189  if (jetBTagVal.second < workingpoint_) {
1190  continue;
1191  }
1192 
1193  bjets.insert(JetTagMap::value_type(jetBTagVal.first, jetBTagVal.second));
1194  }
1195 
1196  if (bjets.size() < nbjets_) {
1197  return;
1198  }
1199  }
1200 
1201  if (nbjets_ > 1) {
1202  double deltaEta = std::abs(bjets.begin()->first->eta() - (++bjets.begin())->first->eta());
1203  if (deltaEta > bJetDeltaEtaMax_)
1204  return;
1205  }
1206 
1207  if ((nbjets_ > 0) && (nmuons_ > 0)) {
1208  bool foundMuonInsideJet = false;
1209  for (auto const& bjet : bjets) {
1210  for (auto const& mu : muons) {
1211  double dR = deltaR(*bjet.first, mu);
1212  if (dR < bJetMuDeltaRmax_) {
1213  foundMuonInsideJet = true;
1214  break;
1215  }
1216  }
1217  if (foundMuonInsideJet)
1218  break;
1219  }
1220 
1221  if (!foundMuonInsideJet)
1222  return;
1223  }
1224 
1225  const int ls = iEvent.id().luminosityBlock();
1226 
1227  // numerator condition
1228  const bool trg_passed = (num_genTriggerEventFlag_->on() && num_genTriggerEventFlag_->accept(iEvent, iSetup));
1229 
1230  if (enableMETPlot_) {
1231  metME_.fill(trg_passed, met_pt);
1232  metME_variableBinning_.fill(trg_passed, met_pt);
1233  metPhiME_.fill(trg_passed, met_phi);
1234  metVsLS_.fill(trg_passed, ls, met_pt);
1235  }
1236  if (HTcut_ > 0) {
1237  eventHT_.fill(trg_passed, eventHT);
1238  eventHT_variableBinning_.fill(trg_passed, eventHT);
1239  htVsLS_.fill(trg_passed, ls, eventHT);
1240  }
1241  //george
1242  if (MHTcut_ > 0) {
1243  eventMHT_.fill(trg_passed, eventMHT.pt());
1244  eventMHT_variableBinning_.fill(trg_passed, eventMHT.pt());
1245  }
1246 
1247  if (njets_ > 0) {
1248  jetMulti_.fill(trg_passed, jets.size());
1249  jetEtaPhi_HEP17_.fill(trg_passed, jets.at(0).eta(), jets.at(0).phi()); // for HEP17 monitorning
1250  jetVsLS_.fill(trg_passed, ls, jets.at(0).pt());
1251  }
1252 
1253  if (enablePhotonPlot_) {
1254  phoMulti_.fill(trg_passed, photons.size());
1255  }
1256 
1257  // Marina
1258  if (nbjets_ > 0) {
1259  bjetMulti_.fill(trg_passed, bjets.size());
1260  bjetVsLS_.fill(trg_passed, ls, bjets.begin()->first->pt());
1261  }
1262 
1263  if (nmuons_ > 0) {
1264  muMulti_.fill(trg_passed, muons.size());
1265  muVsLS_.fill(trg_passed, ls, muons.at(0).pt());
1266  if (nmuons_ > 1) {
1267  mu1Pt_mu2Pt_.fill(trg_passed, muons.at(0).pt(), muons.at(1).pt());
1268  mu1Eta_mu2Eta_.fill(trg_passed, muons.at(0).eta(), muons.at(1).eta());
1269  invMass_mumu_.fill(trg_passed, mll);
1270  invMass_mumu_variableBinning_.fill(trg_passed, mll);
1271  }
1272  if (njets_ > 0) {
1273  DeltaR_jet_Mu_.fill(trg_passed, deltaR(jets.at(0), muons.at(0)));
1274  }
1275  }
1276 
1277  if (nelectrons_ > 0) {
1278  eleMulti_.fill(trg_passed, electrons.size());
1279  eleVsLS_.fill(trg_passed, ls, electrons.at(0).pt());
1280  if (HTcut_ > 0)
1281  elePt_eventHT_.fill(trg_passed, electrons.at(0).pt(), eventHT);
1282  if (njets_ > 0)
1283  elePt_jetPt_.fill(trg_passed, electrons.at(0).pt(), jets.at(0).pt());
1284  if (nmuons_ > 0) {
1285  elePt_muPt_.fill(trg_passed, electrons.at(0).pt(), muons.at(0).pt());
1286  eleEta_muEta_.fill(trg_passed, electrons.at(0).eta(), muons.at(0).eta());
1287  }
1288  if (nelectrons_ > 1) {
1289  ele1Pt_ele2Pt_.fill(trg_passed, electrons.at(0).pt(), electrons.at(1).pt());
1290  ele1Eta_ele2Eta_.fill(trg_passed, electrons.at(0).eta(), electrons.at(1).eta());
1291  }
1292  }
1293 
1294  if (enablePhotonPlot_) {
1295  if (nphotons_ > 0) {
1296  phoVsLS_.fill(trg_passed, ls, photons.at(0).pt());
1297  if (nmuons_ > 0) {
1298  muPt_phoPt_.fill(trg_passed, muons.at(0).pt(), photons.at(0).pt());
1299  muEta_phoEta_.fill(trg_passed, muons.at(0).eta(), photons.at(0).eta());
1300  }
1301  }
1302  }
1303 
1304  for (unsigned int iMu = 0; iMu < muons.size(); ++iMu) {
1305  if (iMu >= nmuons_)
1306  break;
1307  muPhi_.at(iMu).fill(trg_passed, muons.at(iMu).phi());
1308  muEta_.at(iMu).fill(trg_passed, muons.at(iMu).eta());
1309  muPt_.at(iMu).fill(trg_passed, muons.at(iMu).pt());
1310  muEta_variableBinning_.at(iMu).fill(trg_passed, muons.at(iMu).eta());
1311  muPt_variableBinning_.at(iMu).fill(trg_passed, muons.at(iMu).pt());
1312  muPtEta_.at(iMu).fill(trg_passed, muons.at(iMu).pt(), muons.at(iMu).eta());
1313  muEtaPhi_.at(iMu).fill(trg_passed, muons.at(iMu).eta(), muons.at(iMu).phi());
1314  }
1315  for (unsigned int iEle = 0; iEle < electrons.size(); ++iEle) {
1316  if (iEle >= nelectrons_)
1317  break;
1318  elePhi_.at(iEle).fill(trg_passed, electrons.at(iEle).phi());
1319  eleEta_.at(iEle).fill(trg_passed, electrons.at(iEle).eta());
1320  elePt_.at(iEle).fill(trg_passed, electrons.at(iEle).pt());
1321  eleEta_variableBinning_.at(iEle).fill(trg_passed, electrons.at(iEle).eta());
1322  elePt_variableBinning_.at(iEle).fill(trg_passed, electrons.at(iEle).pt());
1323  elePtEta_.at(iEle).fill(trg_passed, electrons.at(iEle).pt(), electrons.at(iEle).eta());
1324  eleEtaPhi_.at(iEle).fill(trg_passed, electrons.at(iEle).eta(), electrons.at(iEle).phi());
1325  }
1326  //Menglei
1327  if (enablePhotonPlot_) {
1328  for (unsigned int iPho = 0; iPho < photons.size(); ++iPho) {
1329  if (iPho >= nphotons_)
1330  break;
1331  phoPhi_[iPho].fill(trg_passed, photons[iPho].phi());
1332  phoEta_[iPho].fill(trg_passed, photons[iPho].eta());
1333  phoPt_[iPho].fill(trg_passed, photons[iPho].pt());
1334  phoPtEta_[iPho].fill(trg_passed, photons[iPho].pt(), photons[iPho].eta());
1335  phoEtaPhi_[iPho].fill(trg_passed, photons[iPho].eta(), photons[iPho].phi());
1336  }
1337  }
1338 
1339  for (unsigned int iJet = 0; iJet < jets.size(); ++iJet) {
1340  if (iJet >= njets_)
1341  break;
1342  jetPhi_.at(iJet).fill(trg_passed, jets.at(iJet).phi());
1343  jetEta_.at(iJet).fill(trg_passed, jets.at(iJet).eta());
1344  jetPt_.at(iJet).fill(trg_passed, jets.at(iJet).pt());
1345  jetEta_variableBinning_.at(iJet).fill(trg_passed, jets.at(iJet).eta());
1346  jetPt_variableBinning_.at(iJet).fill(trg_passed, jets.at(iJet).pt());
1347  jetPtEta_.at(iJet).fill(trg_passed, jets.at(iJet).pt(), jets.at(iJet).eta());
1348  jetEtaPhi_.at(iJet).fill(trg_passed, jets.at(iJet).eta(), jets.at(iJet).phi());
1349  }
1350 
1351  // Marina
1352  unsigned int iBJet = 0;
1353  for (auto& bjet : bjets) {
1354  if (iBJet >= nbjets_)
1355  break;
1356 
1357  bjetPhi_.at(iBJet).fill(trg_passed, bjet.first->phi());
1358  bjetEta_.at(iBJet).fill(trg_passed, bjet.first->eta());
1359  bjetPt_.at(iBJet).fill(trg_passed, bjet.first->pt());
1360  bjetCSV_.at(iBJet).fill(trg_passed, std::fmax(0.0, bjet.second));
1361  bjetEta_variableBinning_.at(iBJet).fill(trg_passed, bjet.first->eta());
1362  bjetPt_variableBinning_.at(iBJet).fill(trg_passed, bjet.first->pt());
1363  bjetPtEta_.at(iBJet).fill(trg_passed, bjet.first->pt(), bjet.first->eta());
1364  bjetEtaPhi_.at(iBJet).fill(trg_passed, bjet.first->eta(), bjet.first->phi());
1365  bjetCSVHT_.at(iBJet).fill(trg_passed, std::fmax(0.0, bjet.second), eventHT);
1366 
1367  iBJet++;
1368  }
1369 }
1370 
1373  desc.add<std::string>("FolderName", "HLT/TOP");
1374 
1375  desc.add<bool>("requireValidHLTPaths", true);
1376 
1377  desc.add<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
1378  desc.add<edm::InputTag>("muons", edm::InputTag("muons"));
1379  desc.add<edm::InputTag>("electrons", edm::InputTag("gedGsfElectrons"));
1380  desc.add<edm::InputTag>("elecID", edm::InputTag("egmGsfElectronIDsForDQM:cutBasedElectronID-Fall17-94X-V1-tight"));
1381  desc.add<edm::InputTag>("photons", edm::InputTag("photons"));
1382  desc.add<edm::InputTag>("jets", edm::InputTag("ak4PFJetsCHS"));
1383  desc.add<std::vector<edm::InputTag> >(
1384  "btagAlgos", {edm::InputTag("pfDeepCSVJetTags:probb"), edm::InputTag("pfDeepCSVJetTags:probbb")});
1385  desc.add<edm::InputTag>("met", edm::InputTag("pfMet"));
1386 
1387  desc.add<std::string>("metSelection", "pt > 0");
1388  desc.add<std::string>("jetSelection", "pt > 0");
1389  desc.add<std::string>("eleSelection", "pt > 0");
1390  desc.add<std::string>("muoSelection", "pt > 0");
1391  desc.add<std::string>("phoSelection", "pt > 0");
1392  desc.add<std::string>("HTdefinition", "pt > 0");
1393  desc.add<std::string>("vertexSelection", "!isFake");
1394  desc.add<std::string>("bjetSelection", "pt > 0");
1395  desc.add<unsigned int>("njets", 0);
1396  desc.add<unsigned int>("nelectrons", 0);
1397  desc.add<unsigned int>("nmuons", 0);
1398  desc.add<unsigned int>("nphotons", 0);
1399  desc.add<double>("leptJetDeltaRmin", 0);
1400  desc.add<double>("bJetMuDeltaRmax", 9999.);
1401  desc.add<double>("bJetDeltaEtaMax", 9999.);
1402  desc.add<double>("HTcut", 0);
1403 
1404  desc.add<unsigned int>("nbjets", 0);
1405  desc.add<double>("workingpoint", 0.4941); // DeepCSV Medium wp
1406  desc.add<bool>("applyLeptonPVcuts", false);
1407  desc.add<double>("invMassUppercut", -1.0);
1408  desc.add<double>("invMassLowercut", -1.0);
1409  desc.add<bool>("oppositeSignMuons", false);
1410  desc.add<std::string>("MHTdefinition", "pt > 0");
1411  desc.add<double>("MHTcut", -1);
1412  desc.add<bool>("invMassCutInAllMuPairs", false);
1413  desc.add<bool>("enablePhotonPlot", false);
1414  desc.add<bool>("enableMETPlot", false);
1415 
1417  genericTriggerEventPSet.add<bool>("andOr");
1418  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi"));
1419  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions", {});
1420  genericTriggerEventPSet.add<bool>("andOrDcs", false);
1421  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
1422  genericTriggerEventPSet.add<std::string>("dbLabel", "");
1423  genericTriggerEventPSet.add<bool>("andOrHlt", true);
1424  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT"));
1425  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths", {});
1426  genericTriggerEventPSet.add<std::string>("hltDBKey", "");
1427  genericTriggerEventPSet.add<bool>("errorReplyHlt", false);
1428  genericTriggerEventPSet.add<unsigned int>("verbosityLevel", 1);
1429 
1430  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
1431  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
1432 
1459  histoPSet.add<edm::ParameterSetDescription>("invMassPSet", invMassPSet);
1461 
1462  std::vector<double> bins = {0., 20., 40., 60., 80., 90., 100., 110., 120., 130., 140., 150., 160.,
1463  170., 180., 190., 200., 220., 240., 260., 280., 300., 350., 400., 450., 1000.};
1464  std::vector<double> eta_bins = {-3., -2.5, -2., -1.5, -1., -.5, 0., .5, 1., 1.5, 2., 2.5, 3.};
1465  histoPSet.add<std::vector<double> >("metBinning", bins);
1466  histoPSet.add<std::vector<double> >("HTBinning", bins);
1467  histoPSet.add<std::vector<double> >("jetPtBinning", bins);
1468  histoPSet.add<std::vector<double> >("elePtBinning", bins);
1469  histoPSet.add<std::vector<double> >("muPtBinning", bins);
1470  histoPSet.add<std::vector<double> >("jetEtaBinning", eta_bins);
1471  histoPSet.add<std::vector<double> >("eleEtaBinning", eta_bins);
1472  histoPSet.add<std::vector<double> >("muEtaBinning", eta_bins);
1473  histoPSet.add<std::vector<double> >("invMassVariableBinning", bins);
1474  histoPSet.add<std::vector<double> >("MHTVariableBinning", bins);
1475 
1476  std::vector<double> bins_2D = {0., 40., 80., 100., 120., 140., 160., 180., 200., 240., 280., 350., 450., 1000.};
1477  std::vector<double> eta_bins_2D = {-3., -2., -1., 0., 1., 2., 3.};
1478  std::vector<double> phi_bins_2D = {
1479  -3.1415, -2.5132, -1.8849, -1.2566, -0.6283, 0, 0.6283, 1.2566, 1.8849, 2.5132, 3.1415};
1480  histoPSet.add<std::vector<double> >("HTBinning2D", bins_2D);
1481  histoPSet.add<std::vector<double> >("jetPtBinning2D", bins_2D);
1482  histoPSet.add<std::vector<double> >("elePtBinning2D", bins_2D);
1483  histoPSet.add<std::vector<double> >("muPtBinning2D", bins_2D);
1484  histoPSet.add<std::vector<double> >("phoPtBinning2D", bins_2D);
1485  histoPSet.add<std::vector<double> >("jetEtaBinning2D", eta_bins_2D);
1486  histoPSet.add<std::vector<double> >("eleEtaBinning2D", eta_bins_2D);
1487  histoPSet.add<std::vector<double> >("muEtaBinning2D", eta_bins_2D);
1488  histoPSet.add<std::vector<double> >("phoEtaBinning2D", eta_bins_2D);
1489  histoPSet.add<std::vector<double> >("phiBinning2D", phi_bins_2D);
1490 
1494 
1495  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
1496 
1497  edm::ParameterSetDescription lPVcutPSet;
1498  lPVcutPSet.add<double>("dxy", 9999.);
1499  lPVcutPSet.add<double>("dz", 9999.);
1500  desc.add<edm::ParameterSetDescription>("leptonPVcuts", lPVcutPSet);
1501 
1502  descriptions.add("topMonitoring", desc);
1503 }
1504 
1505 // Define this as a plug-in
TopMonitor::phoEta_variable_binning_2D_
std::vector< double > phoEta_variable_binning_2D_
Definition: TopMonitor.cc:107
ConfigurationDescriptions.h
TopMonitor::jetEta_variable_binning_
std::vector< double > jetEta_variable_binning_
Definition: TopMonitor.cc:93
TopMonitor::leptJetDeltaRmin_
double leptJetDeltaRmin_
Definition: TopMonitor.cc:216
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
TopMonitor::muEta_variableBinning_
std::vector< ObjME > muEta_variableBinning_
Definition: TopMonitor.cc:176
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
TopMonitor::phoMulti_
ObjME phoMulti_
Definition: TopMonitor.cc:127
TopMonitor::metSelection_
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: TopMonitor.cc:201
JetTag.h
V0Monitor_cfi.ptPSet
ptPSet
Definition: V0Monitor_cfi.py:25
TopMonitor::num_genTriggerEventFlag_
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: TopMonitor.cc:198
electrons_cff.bool
bool
Definition: electrons_cff.py:366
TopMonitor::folderName_
const std::string folderName_
Definition: TopMonitor.cc:58
TopMonitor::HTdefinition_
StringCutObjectSelector< reco::PFJet, true > HTdefinition_
Definition: TopMonitor.cc:206
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
TopMonitor::metME_
ObjME metME_
Definition: TopMonitor.cc:110
TopMonitor::eleEta_variable_binning_2D_
std::vector< double > eleEta_variable_binning_2D_
Definition: TopMonitor.cc:106
Muon.h
BTaggingMonitor_cfi.MHTPSet
MHTPSet
Definition: BTaggingMonitor_cfi.py:55
TopMonitor::PVcut::dz
double dz
Definition: TopMonitor.cc:74
MessageLogger.h
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
TriggerDQMBase::MEbinning
Definition: TriggerDQMBase.h:16
TopMonitor::DeltaR_jet_Mu_
ObjME DeltaR_jet_Mu_
Definition: TopMonitor.cc:146
funct::false
false
Definition: Factorize.h:29
TopMonitor::applyLeptonPVcuts_
bool applyLeptonPVcuts_
Definition: TopMonitor.cc:224
edm::Handle::product
T const * product() const
Definition: Handle.h:70
BTaggingMonitor_cfi.DRPSet
DRPSet
Definition: BTaggingMonitor_cfi.py:45
TopMonitor::csv_binning_
MEbinning csv_binning_
Definition: TopMonitor.cc:84
TopMonitor::jetPt_variable_binning_
std::vector< double > jetPt_variable_binning_
Definition: TopMonitor.cc:90
TopMonitor::muPt_
std::vector< ObjME > muPt_
Definition: TopMonitor.cc:153
TopMonitor::elePt_variable_binning_
std::vector< double > elePt_variable_binning_
Definition: TopMonitor.cc:92
TopMonitor::invMass_mumu_binning_
MEbinning invMass_mumu_binning_
Definition: TopMonitor.cc:85
TopMonitor::bJetMuDeltaRmax_
double bJetMuDeltaRmax_
Definition: TopMonitor.cc:217
edm::RefToBase::key
size_t key() const
Definition: RefToBase.h:219
sistrip::View
View
Definition: ConstantsForView.h:26
TopMonitor::MHTdefinition_
StringCutObjectSelector< reco::PFJet, true > MHTdefinition_
Definition: TopMonitor.cc:231
BTaggingMonitor_cfi.invMassPSet
invMassPSet
Definition: BTaggingMonitor_cfi.py:50
TopMonitor::phoPt_variable_binning_2D_
std::vector< double > phoPt_variable_binning_2D_
Definition: TopMonitor.cc:103
TopMonitor::muPhi_
std::vector< ObjME > muPhi_
Definition: TopMonitor.cc:151
TopMonitor::bjetPt_variableBinning_
std::vector< ObjME > bjetPt_variableBinning_
Definition: TopMonitor.cc:174
TopMonitor::enablePhotonPlot_
bool enablePhotonPlot_
Definition: TopMonitor.cc:236
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
edm::Run
Definition: Run.h:45
V0Monitor_cfi.etaPSet
etaPSet
Definition: V0Monitor_cfi.py:30
edm::EDGetTokenT< reco::VertexCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
TopMonitor::jetVsLS_
ObjME jetVsLS_
Definition: TopMonitor.cc:115
TopMonitor::eleToken_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > eleToken_
Definition: TopMonitor.cc:65
TopMonitor::njets_
unsigned int njets_
Definition: TopMonitor.cc:212
TopMonitor::nmuons_
unsigned int nmuons_
Definition: TopMonitor.cc:214
PFJet.h
TopMonitor::elePt_variableBinning_
std::vector< ObjME > elePt_variableBinning_
Definition: TopMonitor.cc:172
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
PFJetCollection.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TopMonitor::opsign_
bool opsign_
Definition: TopMonitor.cc:230
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
TopMonitor::bjetPtEta_
std::vector< ObjME > bjetPtEta_
Definition: TopMonitor.cc:194
TopMonitor::HT_binning_
MEbinning HT_binning_
Definition: TopMonitor.cc:82
SiStripSourceConfigTier0_cff.genericTriggerEventPSet
genericTriggerEventPSet
Definition: SiStripSourceConfigTier0_cff.py:96
DQMStore.h
TopMonitor::requireValidHLTPaths_
const bool requireValidHLTPaths_
Definition: TopMonitor.cc:60
PhotonFwd.h
TopMonitor::eleMulti_
ObjME eleMulti_
Definition: TopMonitor.cc:125
TopMonitor::muEta_phoEta_
ObjME muEta_phoEta_
Definition: TopMonitor.cc:144
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
PFMETCollection.h
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
TopMonitor::hltPathsAreValid_
bool hltPathsAreValid_
Definition: TopMonitor.cc:61
findQualityFiles.v
v
Definition: findQualityFiles.py:179
TopMonitor::nelectrons_
unsigned int nelectrons_
Definition: TopMonitor.cc:213
TopMonitor::phoEtaPhi_
std::vector< ObjME > phoEtaPhi_
Definition: TopMonitor.cc:192
TopMonitor::muEta_variable_binning_2D_
std::vector< double > muEta_variable_binning_2D_
Definition: TopMonitor.cc:105
watchdog.const
const
Definition: watchdog.py:83
edm::Handle< reco::VertexCollection >
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
TopMonitor::met_variable_binning_
std::vector< double > met_variable_binning_
Definition: TopMonitor.cc:88
TopMonitor::~TopMonitor
~TopMonitor() override
Definition: TopMonitor.cc:393
TopMonitor::invMassCutInAllMuPairs_
bool invMassCutInAllMuPairs_
Definition: TopMonitor.cc:234
TopMonitor::bjetPt_
std::vector< ObjME > bjetPt_
Definition: TopMonitor.cc:169
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
TopMonitor::btagalgoName_
std::string btagalgoName_
Definition: TopMonitor.cc:222
TopMonitor::eventMHT_variableBinning_
ObjME eventMHT_variableBinning_
Definition: TopMonitor.cc:142
BTaggingMonitor_cfi.htPSet
htPSet
Definition: BTaggingMonitor_cfi.py:35
TopMonitor::jetPt_variableBinning_
std::vector< ObjME > jetPt_variableBinning_
Definition: TopMonitor.cc:173
TopMonitor::muMulti_
ObjME muMulti_
Definition: TopMonitor.cc:126
TopMonitor::lepPVcuts_
PVcut lepPVcuts_
Definition: TopMonitor.cc:223
TopMonitor::muEta_variable_binning_
std::vector< double > muEta_variable_binning_
Definition: TopMonitor.cc:94
TopMonitor::eleEtaPhi_
std::vector< ObjME > eleEtaPhi_
Definition: TopMonitor.cc:186
MakerMacros.h
TopMonitor::muoToken_
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: TopMonitor.cc:64
Photon.h
TopMonitor::HT_variable_binning_
std::vector< double > HT_variable_binning_
Definition: TopMonitor.cc:89
TopMonitor::ele1Pt_ele2Pt_
ObjME ele1Pt_ele2Pt_
Definition: TopMonitor.cc:133
TopMonitor::jetPtEta_
std::vector< ObjME > jetPtEta_
Definition: TopMonitor.cc:182
TriggerDQMBase::ObjME::fill
void fill(const bool pass_num, Args... args)
Definition: TriggerDQMBase.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
dqm::legacy::DQMStore
Definition: DQMStore.h:728
TopMonitor::ele1Eta_ele2Eta_
ObjME ele1Eta_ele2Eta_
Definition: TopMonitor.cc:134
LumiMonitor_cff.lsPSet
lsPSet
Definition: LumiMonitor_cff.py:33
spr::deltaEta
static const double deltaEta
Definition: CaloConstants.h:8
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
TopMonitor::invMass_mumu_variableBinning_
ObjME invMass_mumu_variableBinning_
Definition: TopMonitor.cc:141
TopMonitor::bjetCSV_
std::vector< ObjME > bjetCSV_
Definition: TopMonitor.cc:170
Service.h
TopMonitor::nphotons_
unsigned int nphotons_
Definition: TopMonitor.cc:215
PVValHelper::eta
Definition: PVValidationHelpers.h:70
TriggerDQMBase.h
TriggerDQMBase::setMETitle
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
Definition: TriggerDQMBase.cc:3
TopMonitor::elePt_jetPt_
ObjME elePt_jetPt_
Definition: TopMonitor.cc:130
GenericTriggerEventFlag.h
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
TopMonitor::vtxToken_
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: TopMonitor.cc:63
MuonFwd.h
reco::MuonCollection
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
TriggerDQMBase::MEbinning::xmax
double xmax
Definition: TriggerDQMBase.h:19
BTaggingMonitor_cfi.csvPSet
csvPSet
Definition: BTaggingMonitor_cfi.py:40
TopMonitor::muPt_variable_binning_
std::vector< double > muPt_variable_binning_
Definition: TopMonitor.cc:91
Event
TriggerDQMBase::bookME
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, const uint nbins, const double xmin, const double xmax, const bool bookDen=true)
Definition: TriggerDQMBase.cc:15
TopMonitor::phoPt_
std::vector< ObjME > phoPt_
Definition: TopMonitor.cc:165
TopMonitor::MHT_variable_binning_
std::vector< double > MHT_variable_binning_
Definition: TopMonitor.cc:97
TopMonitor::HT_variable_binning_2D_
std::vector< double > HT_variable_binning_2D_
Definition: TopMonitor.cc:99
ParameterSetDescription.h
TopMonitor::jetPt_
std::vector< ObjME > jetPt_
Definition: TopMonitor.cc:161
TriggerDQMBase
Definition: TriggerDQMBase.h:8
EDGetToken.h
TopMonitor::TopMonitor
TopMonitor(const edm::ParameterSet &)
Definition: TopMonitor.cc:240
TopMonitor::bjetVsLS_
ObjME bjetVsLS_
Definition: TopMonitor.cc:119
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
TopMonitor::elePt_muPt_
ObjME elePt_muPt_
Definition: TopMonitor.cc:137
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
DQMEDAnalyzer.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
TopMonitor::bjetMulti_
ObjME bjetMulti_
Definition: TopMonitor.cc:128
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
TopMonitor::eleEta_
std::vector< ObjME > eleEta_
Definition: TopMonitor.cc:156
TopMonitor::elecIDToken_
edm::EDGetTokenT< edm::ValueMap< bool > > elecIDToken_
Definition: TopMonitor.cc:66
edm::AssociationVector
Definition: AssociationVector.h:67
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
TopMonitor::muEta_
std::vector< ObjME > muEta_
Definition: TopMonitor.cc:152
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
TriggerDQMBase::fillHistoPSetDescription
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
Definition: TriggerDQMBase.cc:108
TopMonitor::muPt_variable_binning_2D_
std::vector< double > muPt_variable_binning_2D_
Definition: TopMonitor.cc:101
TopMonitor::metPhiME_
ObjME metPhiME_
Definition: TopMonitor.cc:113
reco::PFMET
Definition: PFMET.h:18
TopMonitor::elePt_eventHT_
ObjME elePt_eventHT_
Definition: TopMonitor.cc:131
GsfElectronFwd.h
edm::ParameterSet
Definition: ParameterSet.h:47
TopMonitor::jetEta_
std::vector< ObjME > jetEta_
Definition: TopMonitor.cc:160
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Event.h
TopMonitor::MHTcut_
double MHTcut_
Definition: TopMonitor.cc:232
deltaR.h
TopMonitor::applyMETcut_
bool applyMETcut_
Definition: TopMonitor.cc:226
GenericTriggerEventFlag
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Definition: GenericTriggerEventFlag.h:42
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
TopMonitor::pt_binning_
MEbinning pt_binning_
Definition: TopMonitor.cc:80
TopMonitor::htVsLS_
ObjME htVsLS_
Definition: TopMonitor.cc:120
TopMonitor::muPtEta_
std::vector< ObjME > muPtEta_
Definition: TopMonitor.cc:188
TopMonitor::bjetEtaPhi_
std::vector< ObjME > bjetEtaPhi_
Definition: TopMonitor.cc:195
TopMonitor::metToken_
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: TopMonitor.cc:70
BTaggingMonitor_cfi.metPSet
metPSet
Definition: BTaggingMonitor_cfi.py:12
PFMET.h
TtFullHadKinFitProducer_cfi.bTags
bTags
Definition: TtFullHadKinFitProducer_cfi.py:40
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
iEvent
int iEvent
Definition: GenABIO.cc:224
TopMonitor::muoSelection_
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: TopMonitor.cc:204
TopMonitor::muEtaPhi_
std::vector< ObjME > muEtaPhi_
Definition: TopMonitor.cc:189
TopMonitor::bjetEta_variableBinning_
std::vector< ObjME > bjetEta_variableBinning_
Definition: TopMonitor.cc:179
LumiMonitor_cff.histoPSet
histoPSet
Definition: LumiMonitor_cff.py:12
GsfTrack.h
TopMonitor::eventHT_variableBinning_
ObjME eventHT_variableBinning_
Definition: TopMonitor.cc:149
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
TopMonitor::mu1Pt_mu2Pt_
ObjME mu1Pt_mu2Pt_
Definition: TopMonitor.cc:135
TopMonitor::phoEta_
std::vector< ObjME > phoEta_
Definition: TopMonitor.cc:164
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
TopMonitor::jetSelection_
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: TopMonitor.cc:202
edm::EventSetup
Definition: EventSetup.h:58
TopMonitor::elePt_
std::vector< ObjME > elePt_
Definition: TopMonitor.cc:157
TopMonitor::invMass_mumu_
ObjME invMass_mumu_
Definition: TopMonitor.cc:139
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
TopMonitor::metME_variableBinning_
ObjME metME_variableBinning_
Definition: TopMonitor.cc:111
TopMonitor::JetRefCompare::operator()
bool operator()(const edm::RefToBase< reco::Jet > &j1, const edm::RefToBase< reco::Jet > &j2) const
Definition: TopMonitor.cc:51
TopMonitor::muPt_variableBinning_
std::vector< ObjME > muPt_variableBinning_
Definition: TopMonitor.cc:171
TopMonitor::phoPhi_
std::vector< ObjME > phoPhi_
Definition: TopMonitor.cc:163
TopMonitor::jetPhi_
std::vector< ObjME > jetPhi_
Definition: TopMonitor.cc:159
TopMonitor::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: TopMonitor.cc:400
TopMonitor::phoPtEta_
std::vector< ObjME > phoPtEta_
Definition: TopMonitor.cc:191
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TopMonitor
Definition: TopMonitor.cc:37
edm::RefToBase::id
ProductID id() const
Definition: RefToBase.h:214
ValueMap.h
TopMonitor::workingpoint_
double workingpoint_
Definition: TopMonitor.cc:221
TopMonitor::jetToken_
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: TopMonitor.cc:68
VertexFwd.h
TopMonitor::jetEtaPhi_HEP17_
ObjME jetEtaPhi_HEP17_
Definition: TopMonitor.cc:122
DDAxes::phi
TopMonitor::metVsLS_
ObjME metVsLS_
Definition: TopMonitor.cc:112
Registry.h
TopMonitor::invMassUppercut_
double invMassUppercut_
Definition: TopMonitor.cc:228
TopMonitor::den_genTriggerEventFlag_
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: TopMonitor.cc:199
TopMonitor::eleSelection_
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: TopMonitor.cc:203
TopMonitor::mu1Eta_mu2Eta_
ObjME mu1Eta_mu2Eta_
Definition: TopMonitor.cc:136
TopMonitor::eventHT_
ObjME eventHT_
Definition: TopMonitor.cc:148
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
TopMonitor::bjetSelection_
StringCutObjectSelector< reco::Jet, true > bjetSelection_
Definition: TopMonitor.cc:210
ConfigurationDescriptions
StringCutObjectSelector.h
TopMonitor::jetEta_variableBinning_
std::vector< ObjME > jetEta_variableBinning_
Definition: TopMonitor.cc:178
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
reco::PFJetCollection
std::vector< PFJet > PFJetCollection
collection of PFJet objects
Definition: PFJetCollection.h:14
TopMonitor::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TopMonitor.cc:1371
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
Frameworkfwd.h
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
transform.h
TopMonitor::bjetEta_
std::vector< ObjME > bjetEta_
Definition: TopMonitor.cc:168
StringCutObjectSelector< reco::MET, true >
TopMonitor::phoToken_
edm::EDGetTokenT< reco::PhotonCollection > phoToken_
Definition: TopMonitor.cc:67
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
BPHMonitor_cff.phiPSet
phiPSet
Definition: BPHMonitor_cff.py:631
l1t::VertexCollection
std::vector< Vertex > VertexCollection
Definition: Vertex.h:12
TopMonitor::invMassLowercut_
double invMassLowercut_
Definition: TopMonitor.cc:229
TopMonitor::enableMETPlot_
bool enableMETPlot_
Definition: TopMonitor.cc:237
TopMonitor::phoSelection_
StringCutObjectSelector< reco::Photon, true > phoSelection_
Definition: TopMonitor.cc:205
TopMonitor::nbjets_
unsigned int nbjets_
Definition: TopMonitor.cc:220
TriggerDQMBase::MEbinning::nbins
uint nbins
Definition: TriggerDQMBase.h:17
TriggerDQMBase::MEbinning::xmin
double xmin
Definition: TriggerDQMBase.h:18
TopMonitor::jetMulti_
ObjME jetMulti_
Definition: TopMonitor.cc:124
TopMonitor::invMass_mumu_variable_binning_
std::vector< double > invMass_mumu_variable_binning_
Definition: TopMonitor.cc:96
TopMonitor::analyze
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
Definition: TopMonitor.cc:925
TopMonitor::eleEta_muEta_
ObjME eleEta_muEta_
Definition: TopMonitor.cc:138
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::RefToBase< reco::Jet >
TopMonitor::muPt_phoPt_
ObjME muPt_phoPt_
Definition: TopMonitor.cc:143
dqm::implementation::IBooker
Definition: DQMStore.h:43
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
TopMonitor::bjetPhi_
std::vector< ObjME > bjetPhi_
Definition: TopMonitor.cc:167
TopMonitor::elePtEta_
std::vector< ObjME > elePtEta_
Definition: TopMonitor.cc:185
TopMonitor::MHT_binning_
MEbinning MHT_binning_
Definition: TopMonitor.cc:86
ALCARECOPromptCalibProdSiPixelAli0T_cff.throw
throw
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:9
TopMonitor::vtxSelection_
StringCutObjectSelector< reco::Vertex, true > vtxSelection_
Definition: TopMonitor.cc:208
reco::PhotonCollection
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
TopMonitor::phi_variable_binning_2D_
std::vector< double > phi_variable_binning_2D_
Definition: TopMonitor.cc:108
TopMonitor::PVcut
Definition: TopMonitor.cc:72
TopMonitor::bjetCSVHT_
std::vector< ObjME > bjetCSVHT_
Definition: TopMonitor.cc:196
TopMonitor::eleEta_variable_binning_
std::vector< double > eleEta_variable_binning_
Definition: TopMonitor.cc:95
TopMonitor::phi_binning_
MEbinning phi_binning_
Definition: TopMonitor.cc:79
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
trigObjTnPSource_cfi.bins
bins
Definition: trigObjTnPSource_cfi.py:20
TopMonitor::PVcut::dxy
double dxy
Definition: TopMonitor.cc:73
EventSetup
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
TopMonitor::muVsLS_
ObjME muVsLS_
Definition: TopMonitor.cc:116
ParameterSet.h
TopMonitor::eta_binning_
MEbinning eta_binning_
Definition: TopMonitor.cc:81
TopMonitor::eleVsLS_
ObjME eleVsLS_
Definition: TopMonitor.cc:117
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
TopMonitor::DR_binning_
MEbinning DR_binning_
Definition: TopMonitor.cc:83
TopMonitor::JetTagMap
std::map< edm::RefToBase< reco::Jet >, float, JetRefCompare > JetTagMap
Definition: TopMonitor.cc:55
TopMonitor::jetPt_variable_binning_2D_
std::vector< double > jetPt_variable_binning_2D_
Definition: TopMonitor.cc:100
TriggerDQMBase::fillHistoLSPSetDescription
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
Definition: TriggerDQMBase.cc:114
TopMonitor::ls_binning_
MEbinning ls_binning_
Definition: TopMonitor.cc:78
TopMonitor::jetEtaPhi_
std::vector< ObjME > jetEtaPhi_
Definition: TopMonitor.cc:183
HLT_FULL_cff.primaryVertices
primaryVertices
Definition: HLT_FULL_cff.py:51946
edm::InputTag
Definition: InputTag.h:15
TopMonitor::phoVsLS_
ObjME phoVsLS_
Definition: TopMonitor.cc:118
reco::Vertex
Definition: Vertex.h:35
TopMonitor::eleEta_variableBinning_
std::vector< ObjME > eleEta_variableBinning_
Definition: TopMonitor.cc:177
TopMonitor::DQMStore
dqm::reco::DQMStore DQMStore
Definition: TopMonitor.cc:40
TopMonitor::jetTagTokens_
std::vector< edm::EDGetTokenT< reco::JetTagCollection > > jetTagTokens_
Definition: TopMonitor.cc:69
TopMonitor::MonitorElement
dqm::reco::MonitorElement MonitorElement
Definition: TopMonitor.cc:39
TopMonitor::HTcut_
double HTcut_
Definition: TopMonitor.cc:219
TopMonitor::elePhi_
std::vector< ObjME > elePhi_
Definition: TopMonitor.cc:155
TopMonitor::elePt_variable_binning_2D_
std::vector< double > elePt_variable_binning_2D_
Definition: TopMonitor.cc:102
TopMonitor::met_binning_
MEbinning met_binning_
Definition: TopMonitor.cc:77
TopMonitor::jetEta_variable_binning_2D_
std::vector< double > jetEta_variable_binning_2D_
Definition: TopMonitor.cc:104
TopMonitor::JetRefCompare
Definition: TopMonitor.cc:50
TopMonitor::bJetDeltaEtaMax_
double bJetDeltaEtaMax_
Definition: TopMonitor.cc:218
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
TopMonitor::eventMHT_
ObjME eventMHT_
Definition: TopMonitor.cc:140
Run