CMS 3D CMS Logo

L1TStage2CaloLayer2Offline.cc
Go to the documentation of this file.
4 
7 // Geometry
11 #include "TLorentzVector.h"
12 
13 
14 const std::map<std::string, unsigned int> L1TStage2CaloLayer2Offline::PlotConfigNames = {
15  {"nVertex", PlotConfig::nVertex},
16  {"ETvsET", PlotConfig::ETvsET},
17  {"PHIvsPHI", PlotConfig::PHIvsPHI}
18 };
19 
20 //
21 // -------------------------------------- Constructor --------------------------------------------
22 //
24  : thePFJetCollection_(consumes<reco::PFJetCollection>(ps.getParameter<edm::InputTag>("pfJetCollection"))),
25  thecaloMETCollection_(consumes<reco::CaloMETCollection>(ps.getParameter<edm::InputTag>("caloMETCollection"))),
26  thecaloETMHFCollection_(consumes<reco::CaloMETCollection>(ps.getParameter<edm::InputTag>("caloETMHFCollection"))),
27  thePFMETNoMuCollection_(consumes<reco::PFMETCollection>(ps.getParameter<edm::InputTag>("pfMETNoMuCollection"))),
28  thePVCollection_(consumes<reco::VertexCollection>(ps.getParameter<edm::InputTag>("PVCollection"))),
29  theBSCollection_(consumes<reco::BeamSpot>(ps.getParameter<edm::InputTag>("beamSpotCollection"))),
30  triggerInputTag_(consumes<trigger::TriggerEvent>(ps.getParameter<edm::InputTag>("triggerInputTag"))),
31  triggerResultsInputTag_(consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("triggerResults"))),
32  triggerProcess_(ps.getParameter<std::string>("triggerProcess")),
33  triggerNames_(ps.getParameter<std::vector<std::string>>("triggerNames")),
34  histFolderEtSum_(ps.getParameter<std::string>("histFolderEtSum")),
35  histFolderJet_(ps.getParameter<std::string>("histFolderJet")),
36  efficiencyFolderEtSum_(histFolderEtSum_ + "/efficiency_raw"),
37  efficiencyFolderJet_(histFolderJet_ + "/efficiency_raw"),
38  stage2CaloLayer2JetToken_(
39  consumes<l1t::JetBxCollection>(ps.getParameter<edm::InputTag>("stage2CaloLayer2JetSource"))),
40  stage2CaloLayer2EtSumToken_(
41  consumes<l1t::EtSumBxCollection>(ps.getParameter<edm::InputTag>("stage2CaloLayer2EtSumSource"))),
42  jetEfficiencyThresholds_(ps.getParameter<std::vector<double>>("jetEfficiencyThresholds")),
43  metEfficiencyThresholds_(ps.getParameter<std::vector<double>>("metEfficiencyThresholds")),
44  mhtEfficiencyThresholds_(ps.getParameter<std::vector<double>>("mhtEfficiencyThresholds")),
45  ettEfficiencyThresholds_(ps.getParameter<std::vector<double>>("ettEfficiencyThresholds")),
46  httEfficiencyThresholds_(ps.getParameter<std::vector<double>>("httEfficiencyThresholds")),
47  jetEfficiencyBins_(ps.getParameter<std::vector<double>>("jetEfficiencyBins")),
48  metEfficiencyBins_(ps.getParameter<std::vector<double>>("metEfficiencyBins")),
49  mhtEfficiencyBins_(ps.getParameter<std::vector<double>>("mhtEfficiencyBins")),
50  ettEfficiencyBins_(ps.getParameter<std::vector<double>>("ettEfficiencyBins")),
51  httEfficiencyBins_(ps.getParameter<std::vector<double>>("httEfficiencyBins")),
52  recoHTTMaxEta_(ps.getParameter<double>("recoHTTMaxEta")),
53  recoMHTMaxEta_(ps.getParameter<double>("recoMHTMaxEta")),
54  hltConfig_(),
55  triggerIndices_(),
56  triggerResults_(),
57  triggerEvent_(),
58  histDefinitions_(dqmoffline::l1t::readHistDefinitions(ps.getParameterSet("histDefinitions"), PlotConfigNames)),
59  h_nVertex_(),
60  h_controlPlots_(),
61  h_L1METvsCaloMET_(),
62  h_L1ETMHFvsCaloETMHF_(),
63  h_L1METvsPFMetNoMu_(),
64  h_L1MHTvsRecoMHT_(),
65  h_L1METTvsCaloETT_(),
66  h_L1HTTvsRecoHTT_(),
67  h_L1METPhivsCaloMETPhi_(),
68  h_L1ETMHFPhivsCaloETMHFPhi_(),
69  h_L1METPhivsPFMetNoMuPhi_(),
70  h_L1MHTPhivsRecoMHTPhi_(),
71  h_resolutionMET_(),
72  h_resolutionETMHF_(),
73  h_resolutionPFMetNoMu_(),
74  h_resolutionMHT_(),
75  h_resolutionETT_(),
76  h_resolutionHTT_(),
77  h_resolutionMETPhi_(),
78  h_resolutionETMHFPhi_(),
79  h_resolutionPFMetNoMuPhi_(),
80  h_resolutionMHTPhi_(),
81  h_efficiencyMET_pass_(),
82  h_efficiencyETMHF_pass_(),
83  h_efficiencyPFMetNoMu_pass_(),
84  h_efficiencyMHT_pass_(),
85  h_efficiencyETT_pass_(),
86  h_efficiencyHTT_pass_(),
87  h_efficiencyMET_total_(),
88  h_efficiencyETMHF_total_(),
89  h_efficiencyPFMetNoMu_total_(),
90  h_efficiencyMHT_total_(),
91  h_efficiencyETT_total_(),
92  h_efficiencyHTT_total_(),
93  h_L1JetETvsPFJetET_HB_(),
94  h_L1JetETvsPFJetET_HE_(),
95  h_L1JetETvsPFJetET_HF_(),
96  h_L1JetETvsPFJetET_HB_HE_(),
97  h_L1JetPhivsPFJetPhi_HB_(),
98  h_L1JetPhivsPFJetPhi_HE_(),
99  h_L1JetPhivsPFJetPhi_HF_(),
100  h_L1JetPhivsPFJetPhi_HB_HE_(),
101  h_L1JetEtavsPFJetEta_(),
102  h_resolutionJetET_HB_(),
103  h_resolutionJetET_HE_(),
104  h_resolutionJetET_HF_(),
105  h_resolutionJetET_HB_HE_(),
106  h_resolutionJetPhi_HB_(),
107  h_resolutionJetPhi_HE_(),
108  h_resolutionJetPhi_HF_(),
109  h_resolutionJetPhi_HB_HE_(),
110  h_resolutionJetEta_(),
111  h_efficiencyJetEt_HB_pass_(),
112  h_efficiencyJetEt_HE_pass_(),
113  h_efficiencyJetEt_HF_pass_(),
114  h_efficiencyJetEt_HB_HE_pass_(),
115  h_efficiencyJetEt_HB_total_(),
116  h_efficiencyJetEt_HE_total_(),
117  h_efficiencyJetEt_HF_total_(),
118  h_efficiencyJetEt_HB_HE_total_()
119 {
120  edm::LogInfo("L1TStage2CaloLayer2Offline") << "Constructor "
121  << "L1TStage2CaloLayer2Offline::L1TStage2CaloLayer2Offline "
122  << std::endl;
123 }
124 
125 //
126 // -- Destructor
127 //
129 {
130  edm::LogInfo("L1TStage2CaloLayer2Offline") << "Destructor L1TStage2CaloLayer2Offline::~L1TStage2CaloLayer2Offline "
131  << std::endl;
132 }
133 
134 //
135 // -------------------------------------- beginRun --------------------------------------------
136 //
138  edm::LogInfo("L1TStage2CaloLayer2Offline")
139  << "L1TStage2CaloLayer2Offline::beginRun" << std::endl;
140  bool changed(true);
141  if (!hltConfig_.init(iRun, iSetup, triggerProcess_, changed)) {
142  edm::LogError("L1TStage2CaloLayer2Offline")
143  << " HLT config extraction failure with process name "
144  << triggerProcess_<< std::endl;
145  triggerNames_.clear();
146  } else {
148  }
149 }
150 //
151 // -------------------------------------- bookHistos --------------------------------------------
152 //
154 {
155  edm::LogInfo("L1TStage2CaloLayer2Offline") << "L1TStage2CaloLayer2Offline::bookHistograms" << std::endl;
156 
157  //book at beginRun
158  bookHistos(ibooker_);
159 }
160 //
161 // -------------------------------------- Analyze --------------------------------------------
162 //
164 {
165  edm::LogInfo("L1TStage2CaloLayer2Offline") << "L1TStage2CaloLayer2Offline::analyze" << std::endl;
166 
167  edm::Handle<edm::TriggerResults> triggerResultHandle;
168  e.getByToken(triggerResultsInputTag_, triggerResultHandle);
169  if (!triggerResultHandle.isValid()) {
170  edm::LogWarning("L1TStage2CaloLayer2Offline") << "invalid edm::TriggerResults handle" << std::endl;
171  return;
172  }
173  triggerResults_ = *triggerResultHandle;
174 
175  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
176  e.getByToken(triggerInputTag_, triggerEventHandle);
177  if (!triggerEventHandle.isValid()) {
178  edm::LogWarning("L1TStage2CaloLayer2Offline") << "invalid trigger::TriggerEvent handle" << std::endl;
179  return;
180  }
181  triggerEvent_ = *triggerEventHandle;
182 
184  e.getByToken(thePVCollection_, vertexHandle);
185  if (!vertexHandle.isValid()) {
186  edm::LogWarning("L1TStage2CaloLayer2Offline") << "invalid collection: vertex " << std::endl;
187  return;
188  }
189 
190  unsigned int nVertex = vertexHandle->size();
192 
193  // L1T
195  return;
196  }
197  fillEnergySums(e, nVertex);
198  fillJets(e, nVertex);
199 }
200 
202 {
205 
207  e.getByToken(thePFJetCollection_, pfJets);
208 
210  e.getByToken(thecaloMETCollection_, caloMETs);
211 
213  e.getByToken(thecaloETMHFCollection_, caloETMHFs);
214 
216  e.getByToken(thePFMETNoMuCollection_, pfMETNoMus);
217 
218  if (!pfJets.isValid()) {
219  edm::LogWarning("L1TStage2CaloLayer2Offline") << "invalid collection: PF jets " << std::endl;
220  return;
221  }
222  if (!caloMETs.isValid()) {
223  edm::LogWarning("L1TStage2CaloLayer2Offline") << "invalid collection: Offline E_{T}^{miss} " << std::endl;
224  return;
225  }
226  if (!caloETMHFs.isValid()) {
227  edm::LogWarning("L1TStage2CaloLayer2Offline") << "invalid collection: Offline E_{T}^{miss} (HF) " << std::endl;
228  return;
229  }
230  if (!pfMETNoMus.isValid()) {
231  edm::LogWarning("L1TStage2CaloLayer2Offline") << "invalid collection: Offline PF E_{T}^{miss} No Mu" << std::endl;
232  return;
233  }
234  if (!l1EtSums.isValid()) {
235  edm::LogWarning("L1TStage2CaloLayer2Offline") << "invalid collection: L1 ET sums " << std::endl;
236  return;
237  }
238 
239  int bunchCrossing = 0;
240 
241  double l1MET(0);
242  double l1METPhi(0);
243  double l1ETMHF(0);
244  double l1ETMHFPhi(0);
245  double l1MHT(0);
246  double l1MHTPhi(0);
247  double l1ETT(0);
248  double l1HTT(0);
249 
250  for (auto etSum = l1EtSums->begin(bunchCrossing); etSum != l1EtSums->end(bunchCrossing); ++etSum) {
251  double et = etSum->et();
252  double phi = etSum->phi();
253 
254  switch (etSum->getType()) {
256  l1MET = et;
257  l1METPhi = phi;
258  break;
260  l1ETMHF = et;
261  l1ETMHFPhi = phi;
262  break;
264  l1ETT = et;
265  break;
267  l1MHT = et;
268  l1MHTPhi = phi;
269  break;
271  l1HTT = et;
272  default:
273  break;
274  }
275 
276  }
277 
278  double recoMET(caloMETs->front().et());
279  double recoMETPhi(caloMETs->front().phi());
280  double recoETMHF(caloETMHFs->front().et());
281  double recoETMHFPhi(caloETMHFs->front().phi());
282  double recoPFMetNoMu(pfMETNoMus->front().et());
283  double recoPFMetNoMuPhi(pfMETNoMus->front().phi());
284  double recoMHT(0);
285  double recoMHTPhi(0);
286  double recoETT(caloMETs->front().sumEt());
287  double recoHTT(0);
288 
289  TVector2 mht(0., 0.);
290 
291  for (auto jet = pfJets->begin(); jet != pfJets->end(); ++jet) {
292  double et = jet->et();
293  if (et < 30) {
294  continue;
295  }
296  TVector2 jetVec(et * cos(jet->phi()), et * sin(jet->phi()));
297  if(std::abs(jet->eta()) < recoHTTMaxEta_){
298  recoHTT += et;
299  }
300  if(std::abs(jet->eta()) < recoMHTMaxEta_){
301  mht -= jetVec;
302  }
303  }
304  recoMHT = mht.Mod();
305  // phi in cms is defined between -pi and pi
306  recoMHTPhi = TVector2::Phi_mpi_pi(mht.Phi());
307 
308  // if no reco value, relative resolution does not make sense -> sort to overflow
309  double outOfBounds = 9999;
310 
311  double resolutionMET = recoMET > 0 ? (l1MET - recoMET) / recoMET : outOfBounds;
312  double resolutionMETPhi = reco::deltaPhi(l1METPhi, recoMETPhi);
313 
314  double resolutionETMHF = recoETMHF > 0 ? (l1ETMHF - recoETMHF) / recoETMHF : outOfBounds;
315  double resolutionETMHFPhi = reco::deltaPhi(l1ETMHFPhi, recoETMHFPhi);
316 
317  double resolutionPFMetNoMu = recoETMHF > 0 ? (l1MET - recoPFMetNoMu) / recoPFMetNoMu : outOfBounds;
318  double resolutionPFMetNoMuPhi = reco::deltaPhi(l1METPhi, recoPFMetNoMuPhi);
319 
320  double resolutionMHT = recoMHT > 0 ? (l1MHT - recoMHT) / recoMHT : outOfBounds;
321  double resolutionMHTPhi = reco::deltaPhi(l1MHTPhi, recoMHTPhi);
322 
323  double resolutionETT = recoETT > 0 ? (l1ETT - recoETT) / recoETT : outOfBounds;
324  double resolutionHTT = recoHTT > 0 ? (l1HTT - recoHTT) / recoHTT : outOfBounds;
325 
326  using namespace dqmoffline::l1t;
327  // control plots
328  fillWithinLimits(h_controlPlots_[ControlPlots::L1MET], l1MET);
329  fillWithinLimits(h_controlPlots_[ControlPlots::L1ETMHF], l1ETMHF);
330  fillWithinLimits(h_controlPlots_[ControlPlots::L1MHT], l1MHT);
331  fillWithinLimits(h_controlPlots_[ControlPlots::L1ETT], l1ETT);
332  fillWithinLimits(h_controlPlots_[ControlPlots::L1HTT], l1HTT);
333  fillWithinLimits(h_controlPlots_[ControlPlots::OfflineMET], recoMET);
334  fillWithinLimits(h_controlPlots_[ControlPlots::OfflineETMHF], recoETMHF);
335  fillWithinLimits(h_controlPlots_[ControlPlots::OfflinePFMetNoMu], recoPFMetNoMu);
336  fillWithinLimits(h_controlPlots_[ControlPlots::OfflineMHT], recoMHT);
337  fillWithinLimits(h_controlPlots_[ControlPlots::OfflineETT], recoETT);
338  fillWithinLimits(h_controlPlots_[ControlPlots::OfflineHTT], recoHTT);
339 
340  fill2DWithinLimits(h_L1METvsCaloMET_, recoMET, l1MET);
341  fill2DWithinLimits(h_L1ETMHFvsCaloETMHF_, recoETMHF, l1ETMHF);
342  fill2DWithinLimits(h_L1METvsPFMetNoMu_, recoPFMetNoMu, l1MET);
343  fill2DWithinLimits(h_L1MHTvsRecoMHT_, recoMHT, l1MHT);
344  fill2DWithinLimits(h_L1METTvsCaloETT_, recoETT, l1ETT);
345  fill2DWithinLimits(h_L1HTTvsRecoHTT_, recoHTT, l1HTT);
346 
347  fill2DWithinLimits(h_L1METPhivsCaloMETPhi_, recoMETPhi, l1METPhi);
348  fill2DWithinLimits(h_L1ETMHFPhivsCaloETMHFPhi_, recoETMHFPhi, l1ETMHFPhi);
349  fill2DWithinLimits(h_L1METPhivsPFMetNoMuPhi_, recoPFMetNoMuPhi, l1METPhi);
350  fill2DWithinLimits(h_L1MHTPhivsRecoMHTPhi_, recoMHTPhi, l1MHTPhi);
351 
352  fillWithinLimits(h_resolutionMET_, resolutionMET);
353  fillWithinLimits(h_resolutionETMHF_, resolutionETMHF);
354  fillWithinLimits(h_resolutionPFMetNoMu_, resolutionPFMetNoMu);
355  fillWithinLimits(h_resolutionMHT_, resolutionMHT);
356  fillWithinLimits(h_resolutionETT_, resolutionETT);
357  if (resolutionMHT < outOfBounds){
358  fillWithinLimits(h_resolutionMHT_, resolutionMHT);
359  }
360  if(resolutionHTT < outOfBounds){
361  fillWithinLimits(h_resolutionHTT_, resolutionHTT);
362  }
363 
364  fillWithinLimits(h_resolutionMETPhi_, resolutionMETPhi);
365  fillWithinLimits(h_resolutionETMHFPhi_, resolutionETMHFPhi);
366  fillWithinLimits(h_resolutionPFMetNoMuPhi_, resolutionPFMetNoMuPhi);
367  fillWithinLimits(h_resolutionMHTPhi_, resolutionMHTPhi);
368 
369  // efficiencies
370  for (auto threshold : metEfficiencyThresholds_) {
372  fillWithinLimits(h_efficiencyETMHF_total_[threshold], recoETMHF);
373  fillWithinLimits(h_efficiencyPFMetNoMu_total_[threshold], recoPFMetNoMu);
374  if (l1MET > threshold){
375  fillWithinLimits(h_efficiencyMET_pass_[threshold], recoMET);
376  fillWithinLimits(h_efficiencyETMHF_pass_[threshold], recoETMHF);
377  fillWithinLimits(h_efficiencyPFMetNoMu_pass_[threshold], recoPFMetNoMu);
378  }
379  }
380 
381  for (auto threshold : mhtEfficiencyThresholds_) {
383  if (l1MHT > threshold)
384  fillWithinLimits(h_efficiencyMHT_pass_[threshold], recoMHT);
385  }
386 
387  for (auto threshold : ettEfficiencyThresholds_) {
389  if (l1ETT > threshold)
390  fillWithinLimits(h_efficiencyETT_pass_[threshold], recoETT);
391  }
392 
393  for (auto threshold : httEfficiencyThresholds_) {
395  if (l1HTT > threshold)
396  fillWithinLimits(h_efficiencyHTT_pass_[threshold], recoHTT);
397  }
398 
399 }
400 
402 {
405 
407  e.getByToken(thePFJetCollection_, pfJets);
408 
409  if (!pfJets.isValid()) {
410  edm::LogWarning("L1TStage2CaloLayer2Offline") << "invalid collection: PF jets " << std::endl;
411  return;
412  }
413  if (!l1Jets.isValid()) {
414  edm::LogWarning("L1TStage2CaloLayer2Offline") << "invalid collection: L1 jets " << std::endl;
415  return;
416  }
417 
418  if (pfJets->empty()) {
419  LogDebug("L1TStage2CaloLayer2Offline") << "no PF jets found" << std::endl;
420  return;
421  }
422 
423  auto leadingRecoJet = pfJets->front();
424 
425  // find corresponding L1 jet
426  double minDeltaR = 0.3;
427  l1t::Jet closestL1Jet;
428  bool foundMatch = false;
429 
430 // for (int bunchCrossing = l1Jets->getFirstBX(); bunchCrossing <= l1Jets->getLastBX(); ++bunchCrossing) {
431  int bunchCrossing = 0;
432  for (auto jet = l1Jets->begin(bunchCrossing); jet != l1Jets->end(bunchCrossing); ++jet) {
433  double currentDeltaR = deltaR(jet->eta(), jet->phi(), leadingRecoJet.eta(), leadingRecoJet.phi());
434  if (currentDeltaR >= minDeltaR) {
435  continue;
436  } else {
437  minDeltaR = currentDeltaR;
438  closestL1Jet = *jet;
439  foundMatch = true;
440  break;
441  }
442 
443  }
444 // }
445 
446  if (!foundMatch) {
447  LogDebug("L1TStage2CaloLayer2Offline") << "Could not find a matching L1 Jet " << std::endl;
448  }
449 
450  if(!doesNotOverlapWithHLTObjects(closestL1Jet)){
451  return;
452  }
453 
454  double recoEt = leadingRecoJet.et();
455  double recoEta = leadingRecoJet.eta();
456  double recoPhi = leadingRecoJet.phi();
457 
458  double outOfBounds = 9999;
459  double l1Et = foundMatch ? closestL1Jet.et() : 0;
460  double l1Eta = foundMatch ? closestL1Jet.eta() : outOfBounds;
461  double l1Phi = foundMatch ? closestL1Jet.phi() : outOfBounds;
462 
463  double resolutionEt = recoEt > 0 ? (l1Et - recoEt) / recoEt : outOfBounds;
464  double resolutionEta = l1Eta - recoEta;
465  double resolutionPhi = l1Phi < outOfBounds ? reco::deltaPhi(l1Phi, recoPhi) : outOfBounds;
466 
467  using namespace dqmoffline::l1t;
468  // fill efficiencies regardless of matched jet found
469  fillJetEfficiencies(recoEt, l1Et, recoEta);
470  // control plots
471  fillWithinLimits(h_controlPlots_[ControlPlots::L1JetET], l1Et);
472  fillWithinLimits(h_controlPlots_[ControlPlots::OfflineJetET], recoEt);
473  // don't fill anything else if no matched L1 jet is found
474  if (!foundMatch){
475  return;
476  }
477 
478  // eta
479  fill2DWithinLimits(h_L1JetEtavsPFJetEta_, recoEta, l1Eta);
480  fillWithinLimits(h_resolutionJetEta_, resolutionEta);
481 
482  if (std::abs(recoEta) <= 1.479) { // barrel
483  // et
486  //resolution
489  // phi
492  // resolution
495  } else if (std::abs(recoEta) <= 3.0) { // end-cap
496  // et
499  //resolution
502  // phi
505  // resolution
508  } else { // forward jets
509  // et
511  // resolution
513  // phi
515  // resolution
517  }
518 }
519 
520 
522  const double &l1Et,
523  const double &recoEta) {
524  using namespace dqmoffline::l1t;
525  if (std::abs(recoEta) <= 1.479) { // barrel
526  for (auto threshold : jetEfficiencyThresholds_) {
529  if (l1Et > threshold) {
530  fillWithinLimits(h_efficiencyJetEt_HB_pass_[threshold], recoEt);
532  }
533  }
534  } else if (std::abs(recoEta) <= 3.0) { // end-cap
535  for (auto threshold : jetEfficiencyThresholds_) {
538  if (l1Et > threshold) {
539  fillWithinLimits(h_efficiencyJetEt_HE_pass_[threshold], recoEt);
541  }
542  }
543  } else {
544  for (auto threshold : jetEfficiencyThresholds_) {
546  if (l1Et > threshold) {
547  fillWithinLimits(h_efficiencyJetEt_HF_pass_[threshold], recoEt);
548  }
549  } // forward jets
550  }
551 }
552 
553 //
554 // -------------------------------------- endRun --------------------------------------------
555 //
557 {
558  edm::LogInfo("L1TStage2CaloLayer2Offline") << "L1TStage2CaloLayer2Offline::endRun" << std::endl;
559 }
560 
561 //
562 // -------------------------------------- book histograms --------------------------------------------
563 //
565 {
566  bookEnergySumHistos(ibooker);
567  bookJetHistos(ibooker);
568 }
569 
571 {
572  ibooker.cd();
574 
575  dqmoffline::l1t::HistDefinition nVertexDef = histDefinitions_[PlotConfig::nVertex];
576  h_nVertex_ = ibooker.book1D(
577  nVertexDef.name, nVertexDef.title, nVertexDef.nbinsX, nVertexDef.xmin, nVertexDef.xmax
578  );
579 
580  // energy sums control plots (monitor beyond the limits of the 2D histograms)
581  h_controlPlots_[ControlPlots::L1MET] = ibooker.book1D("L1MET", "L1 E_{T}^{miss}; L1 E_{T}^{miss} (GeV); events", 500,
582  -0.5, 4999.5);
583  h_controlPlots_[ControlPlots::L1ETMHF] = ibooker.book1D("L1ETMHF",
584  "L1 E_{T}^{miss} (HF); L1 E_{T}^{miss} (HF) (GeV); events", 500, -0.5, 4999.5);
585  h_controlPlots_[ControlPlots::L1MHT] = ibooker.book1D("L1MHT", "L1 MHT; L1 MHT (GeV); events", 500, -0.5, 4999.5);
586  h_controlPlots_[ControlPlots::L1ETT] = ibooker.book1D("L1ETT", "L1 ETT; L1 ETT (GeV); events", 500, -0.5, 4999.5);
587  h_controlPlots_[ControlPlots::L1HTT] = ibooker.book1D("L1HTT", "L1 HTT; L1 HTT (GeV); events", 500, -0.5, 4999.5);
588 
589  h_controlPlots_[ControlPlots::OfflineMET] = ibooker.book1D("OfflineMET",
590  "Offline E_{T}^{miss}; Offline E_{T}^{miss} (GeV); events", 500, -0.5, 4999.5);
591  h_controlPlots_[ControlPlots::OfflineETMHF] = ibooker.book1D("OfflineETMHF",
592  "Offline E_{T}^{miss} (HF); Offline E_{T}^{miss} (HF) (GeV); events", 500, -0.5, 4999.5);
593  h_controlPlots_[ControlPlots::OfflinePFMetNoMu] = ibooker.book1D("OfflinePFMetNoMu",
594  "Offline E_{T}^{miss} (PFMetNoMu); Offline E_{T}^{miss} (PFMetNoMu) (GeV); events", 500, -0.5, 4999.5);
595  h_controlPlots_[ControlPlots::OfflineMHT] = ibooker.book1D("OfflineMHT", "Offline MHT; Offline MHT (GeV); events",
596  500, -0.5, 4999.5);
597  h_controlPlots_[ControlPlots::OfflineETT] = ibooker.book1D("OfflineETT", "Offline ETT; Offline ETT (GeV); events",
598  500, -0.5, 4999.5);
599  h_controlPlots_[ControlPlots::OfflineHTT] = ibooker.book1D("OfflineHTT", "Offline HTT; Offline HTT (GeV); events",
600  500, -0.5, 4999.5);
601 
602  // energy sums reco vs L1
603  dqmoffline::l1t::HistDefinition templateETvsET = histDefinitions_[PlotConfig::ETvsET];
604  h_L1METvsCaloMET_ = ibooker.book2D("L1METvsCaloMET",
605  "L1 E_{T}^{miss} vs Offline E_{T}^{miss};Offline E_{T}^{miss} (GeV);L1 E_{T}^{miss} (GeV)",
606  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
607  h_L1ETMHFvsCaloETMHF_ = ibooker.book2D("L1ETMHFvsCaloETMHF",
608  "L1 E_{T}^{miss} vs Offline E_{T}^{miss} (HF);Offline E_{T}^{miss} (HF) (GeV);L1 E_{T}^{miss} (HF) (GeV)",
609  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
610  h_L1METvsPFMetNoMu_ = ibooker.book2D("L1METvsPFMetNoMu",
611  "L1 E_{T}^{miss} vs Offline E_{T}^{miss} (PFMetNoMu);Offline E_{T}^{miss} (PFMetNoMu) (GeV);L1 E_{T}^{miss} (GeV)",
612  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
613  h_L1MHTvsRecoMHT_ = ibooker.book2D("L1MHTvsRecoMHT", "L1 MHT vs reco MHT;reco MHT (GeV);L1 MHT (GeV)",
614  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
615  h_L1METTvsCaloETT_ = ibooker.book2D("L1ETTvsCaloETT", "L1 ETT vs calo ETT;calo ETT (GeV);L1 ETT (GeV)",
616  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
617  h_L1HTTvsRecoHTT_ = ibooker.book2D("L1HTTvsRecoHTT",
618  "L1 Total H_{T} vs Offline Total H_{T};Offline Total H_{T} (GeV);L1 Total H_{T} (GeV)",
619  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
620 
621  dqmoffline::l1t::HistDefinition templatePHIvsPHI = histDefinitions_[PlotConfig::PHIvsPHI];
622  h_L1METPhivsCaloMETPhi_ = ibooker.book2D("L1METPhivsCaloMETPhi",
623  "L1 E_{T}^{miss} #phi vs Offline E_{T}^{miss} #phi;Offline E_{T}^{miss} #phi;L1 E_{T}^{miss} #phi",
624  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax,
625  templatePHIvsPHI.nbinsY, templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
626  h_L1ETMHFPhivsCaloETMHFPhi_ = ibooker.book2D("L1ETMHFPhivsCaloETMHFPhi",
627  "L1 E_{T}^{miss} #phi vs Offline E_{T}^{miss} (HF) #phi;Offline E_{T}^{miss} (HF) #phi;L1 E_{T}^{miss} #phi",
628  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax,
629  templatePHIvsPHI.nbinsY, templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
630  h_L1METPhivsPFMetNoMuPhi_ = ibooker.book2D("L1METPhivsPFMetNoMuPhi",
631  "L1 E_{T}^{miss} #phi vs Offline E_{T}^{miss} (PFMetNoMu) #phi;Offline E_{T}^{miss} (PFMetNoMu) #phi;L1 E_{T}^{miss} #phi",
632  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax,
633  templatePHIvsPHI.nbinsY, templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
634  h_L1MHTPhivsRecoMHTPhi_ = ibooker.book2D("L1MHTPhivsRecoMHTPhi",
635  "L1 MHT #phi vs reco MHT #phi;reco MHT #phi;L1 MHT #phi",
636  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax,
637  templatePHIvsPHI.nbinsY, templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
638 
639  // energy sum resolutions
640  h_resolutionMET_ = ibooker.book1D("resolutionMET",
641  "MET resolution; (L1 E_{T}^{miss} - Offline E_{T}^{miss})/Offline E_{T}^{miss}; events", 70, -1.0, 2.5);
642  h_resolutionETMHF_ = ibooker.book1D("resolutionETMHF",
643  "MET resolution (HF); (L1 E_{T}^{miss} - Offline E_{T}^{miss})/Offline E_{T}^{miss} (HF); events", 70, -1.0, 2.5);
644  h_resolutionPFMetNoMu_ = ibooker.book1D("resolutionPFMetNoMu",
645  "PFMetNoMu resolution; (L1 E_{T}^{miss} - Offline E_{T}^{miss})/Offline E_{T}^{miss} (PFMetNoMu); events", 70, -1.0, 2.5);
646  h_resolutionMHT_ = ibooker.book1D("resolutionMHT", "MHT resolution; (L1 MHT - reco MHT)/reco MHT; events", 70, -1.0, 2.5);
647  h_resolutionETT_ = ibooker.book1D("resolutionETT", "ETT resolution; (L1 ETT - calo ETT)/calo ETT; events", 70, -1.0, 2.5);
648  h_resolutionHTT_ = ibooker.book1D("resolutionHTT",
649  "HTT resolution; (L1 Total H_{T} - Offline Total H_{T})/Offline Total H_{T}; events", 70, -1.0, 2.5);
650 
651  h_resolutionMETPhi_ = ibooker.book1D("resolutionMETPhi",
652  "MET #phi resolution; (L1 E_{T}^{miss} #phi - reco MET #phi); events", 200, -1, 1);
653  h_resolutionETMHFPhi_ = ibooker.book1D("resolutionETMHFPhi",
654  "MET #phi resolution (HF); (L1 E_{T}^{miss} #phi - reco MET #phi) (HF); events", 200, -1, 1);
655  h_resolutionPFMetNoMuPhi_ = ibooker.book1D("resolutionPFMetNoMuPhi",
656  "MET #phi resolution (PFMetNoMu); (L1 E_{T}^{miss} #phi - reco MET #phi) (PFMetNoMu); events", 200, -1, 1);
657  h_resolutionMHTPhi_ = ibooker.book1D("resolutionMHTPhi",
658  "MET #phi resolution; (L1 MHT #phi - reco MHT #phi); events", 200, -1, 1);
659 
660  // energy sum turn ons
662 
663  std::vector<float> metBins(metEfficiencyBins_.begin(), metEfficiencyBins_.end());
664  std::vector<float> mhtBins(mhtEfficiencyBins_.begin(), mhtEfficiencyBins_.end());
665  std::vector<float> ettBins(ettEfficiencyBins_.begin(), ettEfficiencyBins_.end());
666  std::vector<float> httBins(httEfficiencyBins_.begin(), httEfficiencyBins_.end());
667 
668  for (auto threshold : metEfficiencyThresholds_) {
669  std::string str_threshold = std::to_string(int(threshold));
670  h_efficiencyMET_pass_[threshold] = ibooker.book1D("efficiencyMET_threshold_" + str_threshold + "_Num",
671  "MET efficiency (numerator); Offline E_{T}^{miss} (GeV);", metBins.size() - 1, &(metBins[0]));
672  h_efficiencyMET_total_[threshold] = ibooker.book1D("efficiencyMET_threshold_" + str_threshold + "_Den",
673  "MET efficiency (denominator); Offline E_{T}^{miss} (GeV);", metBins.size() - 1, &(metBins[0]));
674 
675  h_efficiencyETMHF_pass_[threshold] = ibooker.book1D("efficiencyETMHF_threshold_" + str_threshold + "_Num",
676  "MET efficiency (numerator); Offline E_{T}^{miss} (GeV) (HF);", metBins.size() - 1, &(metBins[0]));
677  h_efficiencyETMHF_total_[threshold] = ibooker.book1D("efficiencyETMHF_threshold_" + str_threshold + "_Den",
678  "MET efficiency (denominator); Offline E_{T}^{miss} (GeV) (HF);", metBins.size() - 1, &(metBins[0]));
679 
680  h_efficiencyPFMetNoMu_pass_[threshold] = ibooker.book1D("efficiencyPFMetNoMu_threshold_" + str_threshold + "_Num",
681  "MET efficiency (numerator); Offline E_{T}^{miss} (GeV) (PFMetNoMu);", metBins.size() - 1, &(metBins[0]));
682  h_efficiencyPFMetNoMu_total_[threshold] = ibooker.book1D("efficiencyPFMetNoMu_threshold_" + str_threshold + "_Den",
683  "MET efficiency (denominator); Offline E_{T}^{miss} (GeV) (PFMetNoMu);", metBins.size() - 1, &(metBins[0]));
684  }
685 
686  for (auto threshold : mhtEfficiencyThresholds_) {
687  std::string str_threshold = std::to_string(int(threshold));
688  h_efficiencyMHT_pass_[threshold] = ibooker.book1D("efficiencyMHT_threshold_" + str_threshold + "_Num",
689  "MHT efficiency (numerator); Offline MHT (GeV);", mhtBins.size() - 1, &(mhtBins[0]));
690  h_efficiencyMHT_total_[threshold] = ibooker.book1D("efficiencyMHT_threshold_" + str_threshold + "_Den",
691  "MHT efficiency (denominator); Offline MHT (GeV);", mhtBins.size() - 1, &(mhtBins[0]));
692  }
693 
694  for (auto threshold : ettEfficiencyThresholds_) {
695  std::string str_threshold = std::to_string(int(threshold));
696  h_efficiencyETT_pass_[threshold] = ibooker.book1D("efficiencyETT_threshold_" + str_threshold + "_Num",
697  "ETT efficiency (numerator); Offline ETT (GeV);", ettBins.size() - 1, &(ettBins[0]));
698  h_efficiencyETT_total_[threshold] = ibooker.book1D("efficiencyETT_threshold_" + str_threshold + "_Den",
699  "ETT efficiency (denominator); Offline ETT (GeV);", ettBins.size() - 1, &(ettBins[0]));
700  }
701  for (auto threshold : httEfficiencyThresholds_) {
702  std::string str_threshold = std::to_string(int(threshold));
703  h_efficiencyHTT_pass_[threshold] = ibooker.book1D("efficiencyHTT_threshold_" + str_threshold + "_Num",
704  "HTT efficiency (numerator); Offline Total H_{T} (GeV);", httBins.size() - 1, &(httBins[0]));
705  h_efficiencyHTT_total_[threshold] = ibooker.book1D("efficiencyHTT_threshold_" + str_threshold + "_Den",
706  "HTT efficiency (denominator); Offline Total H_{T} (GeV);", httBins.size() - 1, &(httBins[0]));
707  }
708 
709  ibooker.cd();
710 }
711 
713 {
714  ibooker.cd();
716  // jets control plots (monitor beyond the limits of the 2D histograms)
717  h_controlPlots_[ControlPlots::L1JetET] = ibooker.book1D("L1JetET", "L1 Jet E_{T}; L1 Jet E_{T} (GeV); events", 500, 0,
718  5e3);
719  h_controlPlots_[ControlPlots::OfflineJetET] = ibooker.book1D("OfflineJetET",
720  "Offline Jet E_{T}; Offline Jet E_{T} (GeV); events", 500, 0, 5e3);
721  // jet reco vs L1
722  dqmoffline::l1t::HistDefinition templateETvsET = histDefinitions_[PlotConfig::ETvsET];
723  h_L1JetETvsPFJetET_HB_ = ibooker.book2D("L1JetETvsPFJetET_HB",
724  "L1 Jet E_{T} vs Offline Jet E_{T} (HB); Offline Jet E_{T} (GeV); L1 Jet E_{T} (GeV)",
725  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
726  h_L1JetETvsPFJetET_HE_ = ibooker.book2D("L1JetETvsPFJetET_HE",
727  "L1 Jet E_{T} vs Offline Jet E_{T} (HE); Offline Jet E_{T} (GeV); L1 Jet E_{T} (GeV)",
728  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
729  h_L1JetETvsPFJetET_HF_ = ibooker.book2D("L1JetETvsPFJetET_HF",
730  "L1 Jet E_{T} vs Offline Jet E_{T} (HF); Offline Jet E_{T} (GeV); L1 Jet E_{T} (GeV)",
731  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
732  h_L1JetETvsPFJetET_HB_HE_ = ibooker.book2D("L1JetETvsPFJetET_HB_HE",
733  "L1 Jet E_{T} vs Offline Jet E_{T} (HB+HE); Offline Jet E_{T} (GeV); L1 Jet E_{T} (GeV)",
734  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
735 
736  dqmoffline::l1t::HistDefinition templatePHIvsPHI = histDefinitions_[PlotConfig::PHIvsPHI];
737  h_L1JetPhivsPFJetPhi_HB_ = ibooker.book2D("L1JetPhivsPFJetPhi_HB",
738  "#phi_{jet}^{L1} vs #phi_{jet}^{offline} (HB); #phi_{jet}^{offline}; #phi_{jet}^{L1}",
739  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax,
740  templatePHIvsPHI.nbinsY, templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
741  h_L1JetPhivsPFJetPhi_HE_ = ibooker.book2D("L1JetPhivsPFJetPhi_HE",
742  "#phi_{jet}^{L1} vs #phi_{jet}^{offline} (HE); #phi_{jet}^{offline}; #phi_{jet}^{L1}",
743  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax,
744  templatePHIvsPHI.nbinsY, templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
745  h_L1JetPhivsPFJetPhi_HF_ = ibooker.book2D("L1JetPhivsPFJetPhi_HF",
746  "#phi_{jet}^{L1} vs #phi_{jet}^{offline} (HF); #phi_{jet}^{offline}; #phi_{jet}^{L1}",
747  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax,
748  templatePHIvsPHI.nbinsY, templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
749  h_L1JetPhivsPFJetPhi_HB_HE_ = ibooker.book2D("L1JetPhivsPFJetPhi_HB_HE",
750  "#phi_{jet}^{L1} vs #phi_{jet}^{offline} (HB+HE); #phi_{jet}^{offline}; #phi_{jet}^{L1}",
751  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax,
752  templatePHIvsPHI.nbinsY, templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
753 
754  h_L1JetEtavsPFJetEta_ = ibooker.book2D("L1JetEtavsPFJetEta_HB",
755  "L1 Jet #eta vs Offline Jet #eta; Offline Jet #eta; L1 Jet #eta", 100, -10, 10, 100, -10, 10);
756 
757  // jet resolutions
758  h_resolutionJetET_HB_ = ibooker.book1D("resolutionJetET_HB",
759  "jet ET resolution (HB); (L1 Jet E_{T} - Offline Jet E_{T})/Offline Jet E_{T}; events", 50, -1, 1.5);
760  h_resolutionJetET_HE_ = ibooker.book1D("resolutionJetET_HE",
761  "jet ET resolution (HE); (L1 Jet E_{T} - Offline Jet E_{T})/Offline Jet E_{T}; events", 50, -1, 1.5);
762  h_resolutionJetET_HF_ = ibooker.book1D("resolutionJetET_HF",
763  "jet ET resolution (HF); (L1 Jet E_{T} - Offline Jet E_{T})/Offline Jet E_{T}; events", 50, -1, 1.5);
764  h_resolutionJetET_HB_HE_ = ibooker.book1D("resolutionJetET_HB_HE",
765  "jet ET resolution (HB+HE); (L1 Jet E_{T} - Offline Jet E_{T})/Offline Jet E_{T}; events", 50, -1, 1.5);
766 
767  h_resolutionJetPhi_HB_ = ibooker.book1D("resolutionJetPhi_HB",
768  "#phi_{jet} resolution (HB); (#phi_{jet}^{L1} - #phi_{jet}^{offline}); events", 120, -0.3,
769  0.3);
770  h_resolutionJetPhi_HE_ = ibooker.book1D("resolutionJetPhi_HE",
771  "jet #phi resolution (HE); (#phi_{jet}^{L1} - #phi_{jet}^{offline}); events", 120, -0.3,
772  0.3);
773  h_resolutionJetPhi_HF_ = ibooker.book1D("resolutionJetPhi_HF",
774  "jet #phi resolution (HF); (#phi_{jet}^{L1} - #phi_{jet}^{offline}); events", 120, -0.3,
775  0.3);
776  h_resolutionJetPhi_HB_HE_ = ibooker.book1D("resolutionJetPhi_HB_HE",
777  "jet #phi resolution (HB+HE); (#phi_{jet}^{L1} - #phi_{jet}^{offline}); events", 120, -0.3,
778  0.3);
779 
780  h_resolutionJetEta_ = ibooker.book1D("resolutionJetEta",
781  "jet #eta resolution (HB); (L1 Jet #eta - Offline Jet #eta); events", 120, -0.3, 0.3);
782 
783  // jet turn-ons
785  std::vector<float> jetBins(jetEfficiencyBins_.begin(), jetEfficiencyBins_.end());
786  int nBins = jetBins.size() - 1;
787  float* jetBinArray = &(jetBins[0]);
788 
789  for (auto threshold : jetEfficiencyThresholds_) {
790  std::string str_threshold = std::to_string(int(threshold));
791  h_efficiencyJetEt_HB_pass_[threshold] = ibooker.book1D("efficiencyJetEt_HB_threshold_" + str_threshold + "_Num",
792  "jet efficiency (HB) (numerator); Offline Jet E_{T} (GeV); events", nBins, jetBinArray);
793  h_efficiencyJetEt_HE_pass_[threshold] = ibooker.book1D("efficiencyJetEt_HE_threshold_" + str_threshold + "_Num",
794  "jet efficiency (HE) (numerator); Offline Jet E_{T} (GeV); events", nBins, jetBinArray);
795  h_efficiencyJetEt_HF_pass_[threshold] = ibooker.book1D("efficiencyJetEt_HF_threshold_" + str_threshold + "_Num",
796  "jet efficiency (HF) (numerator); Offline Jet E_{T} (GeV); events", nBins, jetBinArray);
798  "efficiencyJetEt_HB_HE_threshold_" + str_threshold + "_Num",
799  "jet efficiency (HB+HE) (numerator); Offline Jet E_{T} (GeV); events", nBins, jetBinArray);
800 
801  h_efficiencyJetEt_HB_total_[threshold] = ibooker.book1D("efficiencyJetEt_HB_threshold_" + str_threshold + "_Den",
802  "jet efficiency (HB) (denominator); Offline Jet E_{T} (GeV); events", nBins, jetBinArray);
803  h_efficiencyJetEt_HE_total_[threshold] = ibooker.book1D("efficiencyJetEt_HE_threshold_" + str_threshold + "_Den",
804  "jet efficiency (HE) (denominator); Offline Jet E_{T} (GeV); events", nBins, jetBinArray);
805  h_efficiencyJetEt_HF_total_[threshold] = ibooker.book1D("efficiencyJetEt_HF_threshold_" + str_threshold + "_Den",
806  "jet efficiency (HF) (denominator); Offline Jet E_{T} (GeV); events", nBins, jetBinArray);
808  "efficiencyJetEt_HB_HE_threshold_" + str_threshold + "_Den",
809  "jet efficiency (HB+HE) (denominator); Offline Jet E_{T} (GeV); events", nBins, jetBinArray);
810  }
811 
812  ibooker.cd();
813 }
814 
816  // get HLT objects of fired triggers
817  using namespace dqmoffline::l1t;
818  std::vector<bool> results = getTriggerResults(triggerIndices_, triggerResults_);
819  std::vector<unsigned int> firedTriggers = getFiredTriggerIndices(triggerIndices_, results);
820  std::vector<edm::InputTag> hltFilters = getHLTFilters(firedTriggers, hltConfig_, triggerProcess_);
821  const trigger::TriggerObjectCollection hltObjects = getTriggerObjects(hltFilters, triggerEvent_);
822  // only take objects with et() > 27 GeV
823  trigger::TriggerObjectCollection filteredHltObjects;
824  std::copy_if(hltObjects.begin(), hltObjects.end(),
825  std::back_inserter(filteredHltObjects),
826  [](auto obj) { return obj.et() > 27; });
827  double l1Eta = jet.eta();
828  double l1Phi = jet.phi();
829  const trigger::TriggerObjectCollection matchedObjects = getMatchedTriggerObjects(l1Eta, l1Phi, 0.3, hltObjects);
830 
831  return matchedObjects.empty();
832 }
833 
836 }
837 
839  std::vector<MonitorElement *> monElementstoNormalize = {
850 };
851 
852  for (auto mon : monElementstoNormalize) {
853  if (mon != nullptr) {
854  auto h = mon->getTH2F();
855  if (h != nullptr) {
856  h->Scale(1, "width");
857  }
858  }
859  }
860 }
861 
862 //define this as a plug-in
#define LogDebug(id)
std::vector< float > binsX
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
const_iterator end(int bx) const
std::vector< double > ettEfficiencyBins_
edm::EDGetTokenT< l1t::JetBxCollection > stage2CaloLayer2JetToken_
std::vector< std::string > triggerNames_
void fillJetEfficiencies(const double &recoEt, const double &l1Et, const double &recoEta)
double eta() const final
momentum pseudorapidity
std::map< double, MonitorElement * > h_efficiencyJetEt_HB_pass_
trigger::TriggerObjectCollection getMatchedTriggerObjects(double eta, double phi, double maxDeltaR, const trigger::TriggerObjectCollection triggerObjects)
Definition: L1TCommon.cc:121
edm::EDGetTokenT< l1t::EtSumBxCollection > stage2CaloLayer2EtSumToken_
std::map< double, MonitorElement * > h_efficiencyHTT_pass_
std::map< double, MonitorElement * > h_efficiencyETT_pass_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< double > mhtEfficiencyBins_
std::map< double, MonitorElement * > h_efficiencyPFMetNoMu_pass_
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
static const std::map< std::string, unsigned int > PlotConfigNames
std::vector< double > metEfficiencyThresholds_
dqmoffline::l1t::HistDefinitions histDefinitions_
void bookEnergySumHistos(DQMStore::IBooker &)
ParameterSet const & getParameterSet(ParameterSetID const &id)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const std::vector< std::string > & triggerNames() const
names of trigger paths
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
void fillJets(edm::Event const &e, const unsigned int nVertex)
std::map< double, MonitorElement * > h_efficiencyJetEt_HB_total_
trigger::TriggerObjectCollection getTriggerObjects(const std::vector< edm::InputTag > &hltFilters, const trigger::TriggerEvent &triggerEvent)
Definition: L1TCommon.cc:80
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
L1TStage2CaloLayer2Offline(const edm::ParameterSet &ps)
delete x;
Definition: CaloConfig.h:22
std::map< double, MonitorElement * > h_efficiencyETMHF_total_
std::vector< unsigned int > getTriggerIndices(const std::vector< std::string > &requestedTriggers, const std::vector< std::string > &triggersInEvent)
Definition: L1TCommon.cc:11
void fillEnergySums(edm::Event const &e, const unsigned int nVertex)
void bookJetHistos(DQMStore::IBooker &)
std::map< double, MonitorElement * > h_efficiencyJetEt_HE_total_
Collection of Calo MET.
std::vector< double > mhtEfficiencyThresholds_
Definition: Jet.h:21
std::map< double, MonitorElement * > h_efficiencyJetEt_HF_total_
std::map< double, MonitorElement * > h_efficiencyJetEt_HB_HE_pass_
BXVector< EtSum > EtSumBxCollection
Definition: EtSum.h:11
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
double et() const final
transverse energy
std::vector< double > httEfficiencyBins_
edm::EDGetTokenT< reco::VertexCollection > thePVCollection_
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< edm::InputTag > getHLTFilters(const std::vector< unsigned int > &triggers, const HLTConfigProvider &hltConfig, const std::string triggerProcess)
Definition: L1TCommon.cc:106
std::map< double, MonitorElement * > h_efficiencyETT_total_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool doesNotOverlapWithHLTObjects(const l1t::Jet &jet) const
std::vector< double > ettEfficiencyThresholds_
std::map< double, MonitorElement * > h_efficiencyMET_pass_
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< trigger::TriggerEvent > triggerInputTag_
std::map< double, MonitorElement * > h_efficiencyHTT_total_
std::map< double, MonitorElement * > h_efficiencyMHT_pass_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
edm::EDGetTokenT< edm::TriggerResults > triggerResultsInputTag_
HistDefinitions readHistDefinitions(const edm::ParameterSet &ps, const std::map< std::string, unsigned int > &mapping)
std::vector< double > jetEfficiencyThresholds_
std::map< double, MonitorElement * > h_efficiencyJetEt_HF_pass_
std::vector< double > metEfficiencyBins_
std::vector< double > httEfficiencyThresholds_
BXVector< Jet > JetBxCollection
Definition: Jet.h:11
std::map< double, MonitorElement * > h_efficiencyJetEt_HE_pass_
std::vector< float > binsY
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
edm::EDGetTokenT< reco::PFJetCollection > thePFJetCollection_
std::map< double, MonitorElement * > h_efficiencyETMHF_pass_
std::vector< bool > getTriggerResults(const std::vector< unsigned int > &triggers, const edm::TriggerResults &triggerResults)
Definition: L1TCommon.cc:35
std::vector< unsigned int > triggerIndices_
std::map< double, MonitorElement * > h_efficiencyMET_total_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
void fill2DWithinLimits(MonitorElement *mon, double valueX, double valueY, double weight=1.)
edm::EDGetTokenT< reco::CaloMETCollection > thecaloMETCollection_
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
et
define resolution functions of each parameter
std::map< double, MonitorElement * > h_efficiencyJetEt_HB_HE_total_
void fillWithinLimits(MonitorElement *mon, double value, double weight=1.)
std::vector< PFJet > PFJetCollection
collection of PFJet objects
fixed size matrix
HLT enums.
edm::EDGetTokenT< reco::CaloMETCollection > thecaloETMHFCollection_
void bookHistos(DQMStore::IBooker &)
std::map< double, MonitorElement * > h_efficiencyMHT_total_
edm::EDGetTokenT< reco::PFMETCollection > thePFMETNoMuCollection_
const_iterator begin(int bx) const
double phi() const final
momentum azimuthal angle
std::map< double, MonitorElement * > h_efficiencyPFMetNoMu_total_
std::vector< double > jetEfficiencyBins_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< unsigned int > getFiredTriggerIndices(const std::vector< unsigned int > &triggers, const std::vector< bool > &triggerResults)
Definition: L1TCommon.cc:57
Definition: Run.h:45
bool passesAnyTriggerFromList(const std::vector< unsigned int > &triggers, const edm::TriggerResults &triggerResults)
Definition: L1TCommon.cc:69
Collection of PF MET.