From 21d37ef56e2bdb77de39556141fef78f0173559d Mon Sep 17 00:00:00 2001 From: kreczko Date: Mon, 21 May 2018 09:55:03 -0400 Subject: [PATCH 1/5] dropped "events" y axis label for efficiency plots --- .../src/L1TStage2CaloLayer2Offline.cc | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc b/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc index ad0e5d5f04b10..9ef50859b2b27 100644 --- a/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc @@ -585,37 +585,37 @@ void L1TStage2CaloLayer2Offline::bookEnergySumHistos(DQMStore::IBooker & ibooker for (auto threshold : metEfficiencyThresholds_) { std::string str_threshold = std::to_string(int(threshold)); h_efficiencyMET_pass_[threshold] = ibooker.book1D("efficiencyMET_threshold_" + str_threshold + "_Num", - "MET efficiency (numerator); Offline E_{T}^{miss} (GeV); events", metBins.size() - 1, &(metBins[0])); + "MET efficiency (numerator); Offline E_{T}^{miss} (GeV);", metBins.size() - 1, &(metBins[0])); h_efficiencyMET_total_[threshold] = ibooker.book1D("efficiencyMET_threshold_" + str_threshold + "_Den", - "MET efficiency (denominator); Offline E_{T}^{miss} (GeV); events", metBins.size() - 1, &(metBins[0])); + "MET efficiency (denominator); Offline E_{T}^{miss} (GeV);", metBins.size() - 1, &(metBins[0])); h_efficiencyETMHF_pass_[threshold] = ibooker.book1D("efficiencyETMHF_threshold_" + str_threshold + "_Num", - "MET efficiency (numerator); Offline E_{T}^{miss} (GeV) (HF); events", metBins.size() - 1, &(metBins[0])); + "MET efficiency (numerator); Offline E_{T}^{miss} (GeV) (HF);", metBins.size() - 1, &(metBins[0])); h_efficiencyETMHF_total_[threshold] = ibooker.book1D("efficiencyETMHF_threshold_" + str_threshold + "_Den", - "MET efficiency (denominator); Offline E_{T}^{miss} (GeV) (HF); events", metBins.size() - 1, &(metBins[0])); + "MET efficiency (denominator); Offline E_{T}^{miss} (GeV) (HF);", metBins.size() - 1, &(metBins[0])); } for (auto threshold : mhtEfficiencyThresholds_) { std::string str_threshold = std::to_string(int(threshold)); h_efficiencyMHT_pass_[threshold] = ibooker.book1D("efficiencyMHT_threshold_" + str_threshold + "_Num", - "MHT efficiency (numerator); Offline MHT (GeV); events", mhtBins.size() - 1, &(mhtBins[0])); + "MHT efficiency (numerator); Offline MHT (GeV);", mhtBins.size() - 1, &(mhtBins[0])); h_efficiencyMHT_total_[threshold] = ibooker.book1D("efficiencyMHT_threshold_" + str_threshold + "_Den", - "MHT efficiency (denominator); Offline MHT (GeV); events", mhtBins.size() - 1, &(mhtBins[0])); + "MHT efficiency (denominator); Offline MHT (GeV);", mhtBins.size() - 1, &(mhtBins[0])); } for (auto threshold : ettEfficiencyThresholds_) { std::string str_threshold = std::to_string(int(threshold)); h_efficiencyETT_pass_[threshold] = ibooker.book1D("efficiencyETT_threshold_" + str_threshold + "_Num", - "ETT efficiency (numerator); Offline ETT (GeV); events", ettBins.size() - 1, &(ettBins[0])); + "ETT efficiency (numerator); Offline ETT (GeV);", ettBins.size() - 1, &(ettBins[0])); h_efficiencyETT_total_[threshold] = ibooker.book1D("efficiencyETT_threshold_" + str_threshold + "_Den", - "ETT efficiency (denominator); Offline ETT (GeV); events", ettBins.size() - 1, &(ettBins[0])); + "ETT efficiency (denominator); Offline ETT (GeV);", ettBins.size() - 1, &(ettBins[0])); } for (auto threshold : httEfficiencyThresholds_) { std::string str_threshold = std::to_string(int(threshold)); h_efficiencyHTT_pass_[threshold] = ibooker.book1D("efficiencyHTT_threshold_" + str_threshold + "_Num", - "HTT efficiency (numerator); Offline Total H_{T} (GeV); events", httBins.size() - 1, &(httBins[0])); + "HTT efficiency (numerator); Offline Total H_{T} (GeV);", httBins.size() - 1, &(httBins[0])); h_efficiencyHTT_total_[threshold] = ibooker.book1D("efficiencyHTT_threshold_" + str_threshold + "_Den", - "HTT efficiency (denominator); Offline Total H_{T} (GeV); events", httBins.size() - 1, &(httBins[0])); + "HTT efficiency (denominator); Offline Total H_{T} (GeV);", httBins.size() - 1, &(httBins[0])); } ibooker.cd(); From 5a02dc9608c48eb8b7007c1687e681f229b8c86d Mon Sep 17 00:00:00 2001 From: kreczko Date: Mon, 21 May 2018 09:59:12 -0400 Subject: [PATCH 2/5] phi & eta resolution no longer divides by reco quantity --- DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc b/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc index 9ef50859b2b27..ba9240d4b2c14 100644 --- a/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc @@ -393,8 +393,8 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in // if no reco value, relative resolution does not make sense -> sort to overflow double outOfBounds = 9999; double resolutionEt = recoEt > 0 ? (l1Et - recoEt) / recoEt : outOfBounds; - double resolutionEta = std::abs(recoEta) > 0 ? (l1Eta - recoEta) / recoEta : outOfBounds; - double resolutionPhi = std::abs(recoPhi) > 0 ? (l1Phi - recoPhi) / recoPhi : outOfBounds; + double resolutionEta = l1Eta - recoEta; + double resolutionPhi = l1Phi - recoPhi; using namespace dqmoffline::l1t; // eta From 6e4f19735b235cf2c6fd5cd6bf999e43688c7dea Mon Sep 17 00:00:00 2001 From: kreczko Date: Mon, 21 May 2018 10:00:46 -0400 Subject: [PATCH 3/5] changed "currentDeltaR > minDeltaR" to "currentDeltaR >= minDeltaR" --- DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc b/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc index ba9240d4b2c14..f4a86bd36d5b0 100644 --- a/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc @@ -362,7 +362,7 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in int bunchCrossing = 0; for (auto jet = l1Jets->begin(bunchCrossing); jet != l1Jets->end(bunchCrossing); ++jet) { double currentDeltaR = deltaR(jet->eta(), jet->phi(), leadingRecoJet.eta(), leadingRecoJet.phi()); - if (currentDeltaR > minDeltaR) { + if (currentDeltaR >= minDeltaR) { continue; } else { minDeltaR = currentDeltaR; From 9eb460643c862ea4b678f2f4c174ae1615b98857 Mon Sep 17 00:00:00 2001 From: kreczko Date: Mon, 21 May 2018 10:19:38 -0400 Subject: [PATCH 4/5] moved filling jet efficiencies into separate function and fill even if no matched L1 jet is found --- .../interface/L1TStage2CaloLayer2Offline.h | 1 + .../src/L1TStage2CaloLayer2Offline.cc | 70 ++++++++++--------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/DQMOffline/L1Trigger/interface/L1TStage2CaloLayer2Offline.h b/DQMOffline/L1Trigger/interface/L1TStage2CaloLayer2Offline.h index 1de3982a97503..f5d1deebb2121 100644 --- a/DQMOffline/L1Trigger/interface/L1TStage2CaloLayer2Offline.h +++ b/DQMOffline/L1Trigger/interface/L1TStage2CaloLayer2Offline.h @@ -106,6 +106,7 @@ class L1TStage2CaloLayer2Offline: public DQMEDAnalyzer { void fillEnergySums(edm::Event const& e, const unsigned int nVertex); void fillJets(edm::Event const& e, const unsigned int nVertex); + void fillJetEfficiencies(const double & recoEt, const double & l1Et, const double & recoEta); bool doesNotOverlapWithHLTObjects(const l1t::Jet & jet) const; diff --git a/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc b/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc index f4a86bd36d5b0..4cd56753bfae4 100644 --- a/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc @@ -346,11 +346,6 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in return; } - if (l1Jets->size() == 0) { - LogDebug("L1TStage2CaloLayer2Offline") << "no L1 jets found" << std::endl; - return; - } - auto leadingRecoJet = caloJets->front(); // find corresponding L1 jet @@ -375,7 +370,6 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in if (!foundMatch) { LogDebug("L1TStage2CaloLayer2Offline") << "Could not find a matching L1 Jet " << std::endl; - return; } if(!doesNotOverlapWithHLTObjects(closestL1Jet)){ @@ -386,9 +380,9 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in double recoEta = leadingRecoJet.eta(); double recoPhi = leadingRecoJet.phi(); - double l1Et = closestL1Jet.et(); - double l1Eta = closestL1Jet.eta(); - double l1Phi = closestL1Jet.phi(); + double l1Et = foundMatch ? closestL1Jet.et() : 0; + double l1Eta = foundMatch ? closestL1Jet.eta() : 9999; + double l1Phi = foundMatch ? closestL1Jet.phi() : 9999; // if no reco value, relative resolution does not make sense -> sort to overflow double outOfBounds = 9999; @@ -397,6 +391,13 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in double resolutionPhi = l1Phi - recoPhi; using namespace dqmoffline::l1t; + // fill efficiencies regardless of matched jet found + fillJetEfficiencies(recoEt, l1Et, recoEta); + // don't fill anything else if no matched L1 jet is found + if (!foundMatch){ + return; + } + // eta fill2DWithinLimits(h_L1JetEtavsCaloJetEta_, recoEta, l1Eta); fillWithinLimits(h_resolutionJetEta_, resolutionEta); @@ -417,17 +418,6 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in // resolution fillWithinLimits(h_resolutionJetPhi_HB_, resolutionPhi); fillWithinLimits(h_resolutionJetPhi_HB_HE_, resolutionPhi); - - // efficiencies - for (auto threshold : jetEfficiencyThresholds_) { - fillWithinLimits(h_efficiencyJetEt_HB_total_[threshold], recoEt); - fillWithinLimits(h_efficiencyJetEt_HB_HE_total_[threshold], recoEt); - if (l1Et > threshold) { - fillWithinLimits(h_efficiencyJetEt_HB_pass_[threshold], recoEt); - fillWithinLimits(h_efficiencyJetEt_HB_HE_pass_[threshold], recoEt); - } - } - } else if (std::abs(recoEta) <= 3.0) { // end-cap // et fill2DWithinLimits(h_L1JetETvsCaloJetET_HE_, recoEt, l1Et); @@ -441,16 +431,6 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in // resolution fillWithinLimits(h_resolutionJetPhi_HE_, resolutionPhi); fillWithinLimits(h_resolutionJetPhi_HB_HE_, resolutionPhi); - - // efficiencies - for (auto threshold : jetEfficiencyThresholds_) { - fillWithinLimits(h_efficiencyJetEt_HE_total_[threshold], recoEt); - fillWithinLimits(h_efficiencyJetEt_HB_HE_total_[threshold], recoEt); - if (l1Et > threshold) { - fillWithinLimits(h_efficiencyJetEt_HE_pass_[threshold], recoEt); - fillWithinLimits(h_efficiencyJetEt_HB_HE_pass_[threshold], recoEt); - } - } } else { // forward jets // et fill2DWithinLimits(h_L1JetETvsCaloJetET_HF_, recoEt, l1Et); @@ -460,13 +440,39 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in fill2DWithinLimits(h_L1JetPhivsCaloJetPhi_HF_, recoPhi, l1Phi); // resolution fillWithinLimits(h_resolutionJetPhi_HF_, resolutionPhi); - // efficiencies + } +} + + +void L1TStage2CaloLayer2Offline::fillJetEfficiencies(const double &recoEt, + const double &l1Et, + const double &recoEta) { + using namespace dqmoffline::l1t; + if (std::abs(recoEta) <= 1.479) { // barrel + for (auto threshold : jetEfficiencyThresholds_) { + fillWithinLimits(h_efficiencyJetEt_HB_total_[threshold], recoEt); + fillWithinLimits(h_efficiencyJetEt_HB_HE_total_[threshold], recoEt); + if (l1Et > threshold) { + fillWithinLimits(h_efficiencyJetEt_HB_pass_[threshold], recoEt); + fillWithinLimits(h_efficiencyJetEt_HB_HE_pass_[threshold], recoEt); + } + } + } else if (std::abs(recoEta) <= 3.0) { // end-cap + for (auto threshold : jetEfficiencyThresholds_) { + fillWithinLimits(h_efficiencyJetEt_HE_total_[threshold], recoEt); + fillWithinLimits(h_efficiencyJetEt_HB_HE_total_[threshold], recoEt); + if (l1Et > threshold) { + fillWithinLimits(h_efficiencyJetEt_HE_pass_[threshold], recoEt); + fillWithinLimits(h_efficiencyJetEt_HB_HE_pass_[threshold], recoEt); + } + } + } else { for (auto threshold : jetEfficiencyThresholds_) { fillWithinLimits(h_efficiencyJetEt_HF_total_[threshold], recoEt); if (l1Et > threshold) { fillWithinLimits(h_efficiencyJetEt_HF_pass_[threshold], recoEt); } - } + } // forward jets } } From 14a5672bec7b24d0ca0e01350a188037c6beb1ce Mon Sep 17 00:00:00 2001 From: kreczko Date: Tue, 22 May 2018 06:49:38 -0400 Subject: [PATCH 5/5] resolutionPhi now using reco::deltaPhi and control plots are filled even if no L1Jet is matched --- .../src/L1TStage2CaloLayer2Offline.cc | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc b/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc index 4cd56753bfae4..f02f263ab3189 100644 --- a/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TStage2CaloLayer2Offline.cc @@ -251,13 +251,13 @@ void L1TStage2CaloLayer2Offline::fillEnergySums(edm::Event const& e, const unsig double outOfBounds = 9999; double resolutionMET = recoMET > 0 ? (l1MET - recoMET) / recoMET : outOfBounds; - double resolutionMETPhi = std::abs(recoMETPhi) > 0 ? (l1METPhi - recoMETPhi) / recoMETPhi : outOfBounds; + double resolutionMETPhi = reco::deltaPhi(l1METPhi, recoMETPhi); double resolutionETMHF = recoETMHF > 0 ? (l1ETMHF - recoETMHF) / recoETMHF : outOfBounds; - double resolutionETMHFPhi = std::abs(recoETMHFPhi) > 0 ? (l1ETMHFPhi - recoETMHFPhi) / recoETMHFPhi : outOfBounds; + double resolutionETMHFPhi = reco::deltaPhi(l1ETMHFPhi, recoETMHFPhi); double resolutionMHT = recoMHT > 0 ? (l1MHT - recoMHT) / recoMHT : outOfBounds; - double resolutionMHTPhi = std::abs(recoMHTPhi) > 0 ? (l1MHTPhi - recoMHTPhi) / recoMHTPhi : outOfBounds; + double resolutionMHTPhi = reco::deltaPhi(l1MHTPhi, recoMHTPhi); double resolutionETT = recoETT > 0 ? (l1ETT - recoETT) / recoETT : outOfBounds; double resolutionHTT = recoHTT > 0 ? (l1HTT - recoHTT) / recoHTT : outOfBounds; @@ -380,19 +380,21 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in double recoEta = leadingRecoJet.eta(); double recoPhi = leadingRecoJet.phi(); + double outOfBounds = 9999; double l1Et = foundMatch ? closestL1Jet.et() : 0; - double l1Eta = foundMatch ? closestL1Jet.eta() : 9999; - double l1Phi = foundMatch ? closestL1Jet.phi() : 9999; + double l1Eta = foundMatch ? closestL1Jet.eta() : outOfBounds; + double l1Phi = foundMatch ? closestL1Jet.phi() : outOfBounds; - // if no reco value, relative resolution does not make sense -> sort to overflow - double outOfBounds = 9999; double resolutionEt = recoEt > 0 ? (l1Et - recoEt) / recoEt : outOfBounds; double resolutionEta = l1Eta - recoEta; - double resolutionPhi = l1Phi - recoPhi; + double resolutionPhi = l1Phi < outOfBounds ? reco::deltaPhi(l1Phi, recoPhi) : outOfBounds; using namespace dqmoffline::l1t; // fill efficiencies regardless of matched jet found fillJetEfficiencies(recoEt, l1Et, recoEta); + // control plots + fillWithinLimits(h_controlPlots_[ControlPlots::L1JetET], l1Et); + fillWithinLimits(h_controlPlots_[ControlPlots::OfflineJetET], recoEt); // don't fill anything else if no matched L1 jet is found if (!foundMatch){ return; @@ -401,9 +403,6 @@ void L1TStage2CaloLayer2Offline::fillJets(edm::Event const& e, const unsigned in // eta fill2DWithinLimits(h_L1JetEtavsCaloJetEta_, recoEta, l1Eta); fillWithinLimits(h_resolutionJetEta_, resolutionEta); - // control plots - fillWithinLimits(h_controlPlots_[ControlPlots::L1JetET], l1Et); - fillWithinLimits(h_controlPlots_[ControlPlots::OfflineJetET], recoEt); if (std::abs(recoEta) <= 1.479) { // barrel // et