From 0315feb779037236b97aae2ea42b499996959e53 Mon Sep 17 00:00:00 2001 From: Hannah Date: Tue, 23 Sep 2025 23:19:03 +0200 Subject: [PATCH 1/5] [DQM]: Changes to ZDC DQM. --- DQM/HcalTasks/plugins/ZDCQIE10Task.cc | 36 +++++++++++++++++++-------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/DQM/HcalTasks/plugins/ZDCQIE10Task.cc b/DQM/HcalTasks/plugins/ZDCQIE10Task.cc index 0af1b328c1ab3..3a0b63370f1d2 100644 --- a/DQM/HcalTasks/plugins/ZDCQIE10Task.cc +++ b/DQM/HcalTasks/plugins/ZDCQIE10Task.cc @@ -212,7 +212,8 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cfC_vs_TS_EChannel[didp()]->setAxisTitle("sum fC", 2); histoname = "EM_P_" + std::to_string(channel); - _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50); + ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); + _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150,0,150); _cTDC_EChannel[didp()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didp()]->setAxisTitle("N", 2); @@ -240,7 +241,8 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cfC_vs_TS_EChannel[didm()]->setAxisTitle("sum fC", 2); histoname = "EM_M_" + std::to_string(channel); - _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50); + ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); + _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150,0,150); _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didm()]->setAxisTitle("N", 2); } @@ -250,7 +252,9 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) // EM Minus HcalZDCDetId didm(HcalZDCDetId::EM, false, channel); - histoname = "EM_M_" + std::to_string(channel); + std::vector stationString = {"Station2_Top", "Station2_Bottom", "Station3_BottomLeft","Station3_BottomRight", "Station3_TopLeft", "Station3_TopRight"}; + + histoname = "FSC_M_" + stationString.at(channel-7); ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel"); _cADC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256); _cADC_EChannel[didm()]->setAxisTitle("ADC", 1); @@ -260,7 +264,7 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1); _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2); - histoname = "EM_M_" + std::to_string(channel); + histoname = "FSC_M_" + stationString.at(channel-7); ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_perChannel"); _cfC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, 0, 8000); _cfC_EChannel[didm()]->setAxisTitle("fC", 1); @@ -270,8 +274,9 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cfC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1); _cfC_vs_TS_EChannel[didm()]->setAxisTitle("sum fC", 2); - histoname = "EM_M_" + std::to_string(channel); - _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50); + histoname = "FSC_M_" + stationString.at(channel-7); + ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); + _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150,0,150); _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didm()]->setAxisTitle("N", 2); } @@ -301,7 +306,8 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cfC_vs_TS_EChannel[didp()]->setAxisTitle("sum fC", 2); histoname = "HAD_P_" + std::to_string(channel); - _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50); + ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); + _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150,0,150); _cTDC_EChannel[didp()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didp()]->setAxisTitle("N", 2); @@ -329,7 +335,7 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cfC_vs_TS_EChannel[didm()]->setAxisTitle("sum fC", 2); histoname = "HAD_M_" + std::to_string(channel); - _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50); + _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150,0,150); _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didm()]->setAxisTitle("N", 2); } @@ -359,7 +365,8 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cfC_vs_TS_EChannel[didp()]->setAxisTitle("sum fC", 2); histoname = "RPD_P_" + std::to_string(channel); - _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50); + ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); + _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150, 1, 150); _cTDC_EChannel[didp()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didp()]->setAxisTitle("N", 2); @@ -386,7 +393,8 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cfC_vs_TS_EChannel[didm()]->setAxisTitle("sum fC", 2); histoname = "RPD_M_" + std::to_string(channel); - _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50); + ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); + _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150, 1, 150); _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didm()]->setAxisTitle("N", 2); } @@ -488,7 +496,13 @@ void ZDCQIE10Task::_process(edm::Event const& e, edm::EventSetup const& es) { if (_cADC_EChannel.find(did()) != _cADC_EChannel.end()) { _cADC_EChannel[did()]->Fill(digi[i].adc()); _cfC_EChannel[did()]->Fill(constants::adc2fC[digi[i].adc()]); - _cTDC_EChannel[did()]->Fill(digi[i].le_tdc()); + // fill the tdc time the same way as in the reco + float tmp_tdctime = 0; + // TDC error codes will be 60=-1, 61 = -2, 62 = -3, 63 = -4 + // assume max amplitude should occur in TS2 + if (digi[i].le_tdc() >= 60) tmp_tdctime = -1 * (digi[i].le_tdc() - 59); + else tmp_tdctime = 50. + (digi[i].le_tdc() / 2); + _cTDC_EChannel[did()]->Fill(tmp_tdctime); } if (_cADC_vs_TS_EChannel.find(did()) != _cADC_vs_TS_EChannel.end()) { _cADC_vs_TS_EChannel[did()]->Fill(i, digi[i].adc()); From a19ff6d839861329b49962f758e8370f5439b6e3 Mon Sep 17 00:00:00 2001 From: Hannah Date: Wed, 24 Sep 2025 04:15:39 +0200 Subject: [PATCH 2/5] Fix code format --- DQM/HcalTasks/plugins/ZDCQIE10Task.cc | 31 ++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/DQM/HcalTasks/plugins/ZDCQIE10Task.cc b/DQM/HcalTasks/plugins/ZDCQIE10Task.cc index 3a0b63370f1d2..719628c848bb5 100644 --- a/DQM/HcalTasks/plugins/ZDCQIE10Task.cc +++ b/DQM/HcalTasks/plugins/ZDCQIE10Task.cc @@ -213,7 +213,7 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) histoname = "EM_P_" + std::to_string(channel); ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); - _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150,0,150); + _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150, 0, 150); _cTDC_EChannel[didp()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didp()]->setAxisTitle("N", 2); @@ -242,7 +242,7 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) histoname = "EM_M_" + std::to_string(channel); ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); - _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150,0,150); + _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150, 0, 150); _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didm()]->setAxisTitle("N", 2); } @@ -252,9 +252,14 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) // EM Minus HcalZDCDetId didm(HcalZDCDetId::EM, false, channel); - std::vector stationString = {"Station2_Top", "Station2_Bottom", "Station3_BottomLeft","Station3_BottomRight", "Station3_TopLeft", "Station3_TopRight"}; - - histoname = "FSC_M_" + stationString.at(channel-7); + std::vector stationString = {"Station2_Top", + "Station2_Bottom", + "Station3_BottomLeft", + "Station3_BottomRight", + "Station3_TopLeft", + "Station3_TopRight"}; + + histoname = "FSC_M_" + stationString.at(channel - 7); ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel"); _cADC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256); _cADC_EChannel[didm()]->setAxisTitle("ADC", 1); @@ -264,7 +269,7 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1); _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2); - histoname = "FSC_M_" + stationString.at(channel-7); + histoname = "FSC_M_" + stationString.at(channel - 7); ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_perChannel"); _cfC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, 0, 8000); _cfC_EChannel[didm()]->setAxisTitle("fC", 1); @@ -274,9 +279,9 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cfC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1); _cfC_vs_TS_EChannel[didm()]->setAxisTitle("sum fC", 2); - histoname = "FSC_M_" + stationString.at(channel-7); + histoname = "FSC_M_" + stationString.at(channel - 7); ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); - _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150,0,150); + _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150, 0, 150); _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didm()]->setAxisTitle("N", 2); } @@ -307,7 +312,7 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) histoname = "HAD_P_" + std::to_string(channel); ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); - _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150,0,150); + _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150, 0, 150); _cTDC_EChannel[didp()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didp()]->setAxisTitle("N", 2); @@ -335,7 +340,7 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cfC_vs_TS_EChannel[didm()]->setAxisTitle("sum fC", 2); histoname = "HAD_M_" + std::to_string(channel); - _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150,0,150); + _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150, 0, 150); _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1); _cTDC_EChannel[didm()]->setAxisTitle("N", 2); } @@ -500,8 +505,10 @@ void ZDCQIE10Task::_process(edm::Event const& e, edm::EventSetup const& es) { float tmp_tdctime = 0; // TDC error codes will be 60=-1, 61 = -2, 62 = -3, 63 = -4 // assume max amplitude should occur in TS2 - if (digi[i].le_tdc() >= 60) tmp_tdctime = -1 * (digi[i].le_tdc() - 59); - else tmp_tdctime = 50. + (digi[i].le_tdc() / 2); + if (digi[i].le_tdc() >= 60) + tmp_tdctime = -1 * (digi[i].le_tdc() - 59); + else + tmp_tdctime = 50. + (digi[i].le_tdc() / 2); _cTDC_EChannel[did()]->Fill(tmp_tdctime); } if (_cADC_vs_TS_EChannel.find(did()) != _cADC_vs_TS_EChannel.end()) { From 4b5a2ad88e667e5117247f31fdfcd89a8c2eeea0 Mon Sep 17 00:00:00 2001 From: Hannah Date: Thu, 25 Sep 2025 04:42:44 +0200 Subject: [PATCH 3/5] Change naming convention to match request from FSC team. --- DQM/HcalTasks/plugins/ZDCQIE10Task.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/DQM/HcalTasks/plugins/ZDCQIE10Task.cc b/DQM/HcalTasks/plugins/ZDCQIE10Task.cc index 719628c848bb5..e3ad88ee69adf 100644 --- a/DQM/HcalTasks/plugins/ZDCQIE10Task.cc +++ b/DQM/HcalTasks/plugins/ZDCQIE10Task.cc @@ -252,14 +252,14 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) // EM Minus HcalZDCDetId didm(HcalZDCDetId::EM, false, channel); - std::vector stationString = {"Station2_Top", - "Station2_Bottom", - "Station3_BottomLeft", - "Station3_BottomRight", - "Station3_TopLeft", - "Station3_TopRight"}; - - histoname = "FSC_M_" + stationString.at(channel - 7); + std::vector stationString = {"2_M_Top", + "2_M_Bottom", + "3_M_BottomLeft", + "3_M_BottomRight", + "3_M_TopLeft", + "3_M_TopRight"}; + + histoname = "FSC" + stationString.at(channel - 7); ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel"); _cADC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256); _cADC_EChannel[didm()]->setAxisTitle("ADC", 1); @@ -269,7 +269,7 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1); _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2); - histoname = "FSC_M_" + stationString.at(channel - 7); + histoname = "FSC" + stationString.at(channel - 7); ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_perChannel"); _cfC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, 0, 8000); _cfC_EChannel[didm()]->setAxisTitle("fC", 1); @@ -279,7 +279,7 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cfC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1); _cfC_vs_TS_EChannel[didm()]->setAxisTitle("sum fC", 2); - histoname = "FSC_M_" + stationString.at(channel - 7); + histoname = "FSC" + stationString.at(channel - 7); ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel"); _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150, 0, 150); _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1); From f003106f722f3179d455a07549a4465838fe0597 Mon Sep 17 00:00:00 2001 From: Hannah Date: Thu, 25 Sep 2025 23:32:58 +0200 Subject: [PATCH 4/5] Add emulated vs. unpacked info. --- DQM/HcalTasks/interface/ZDCQIE10Task.h | 3 ++ DQM/HcalTasks/plugins/ZDCQIE10Task.cc | 75 +++++++++++++++++++++++--- 2 files changed, 70 insertions(+), 8 deletions(-) diff --git a/DQM/HcalTasks/interface/ZDCQIE10Task.h b/DQM/HcalTasks/interface/ZDCQIE10Task.h index ee80cc3dcdbca..3d1326b16713c 100644 --- a/DQM/HcalTasks/interface/ZDCQIE10Task.h +++ b/DQM/HcalTasks/interface/ZDCQIE10Task.h @@ -38,9 +38,11 @@ class ZDCQIE10Task : public hcaldqm::DQTask { // tags edm::InputTag _tagQIE10; edm::InputTag sumTag; + edm::InputTag sumTagUnpacked; edm::EDGetTokenT _tokQIE10; edm::ESGetToken hcalDbServiceToken_; edm::EDGetToken sumToken_; + edm::EDGetToken sumTokenUnpacked_; edm::ESGetToken htopoToken_; edm::ESGetToken paramsToken_; @@ -61,6 +63,7 @@ class ZDCQIE10Task : public hcaldqm::DQTask { std::map _cZDC_SUMS; std::map _cZDC_BXSUMS; std::map _cZDC_BX_EmuSUMS; + std::map _cZDC_EmuSumTP_DataSum; std::map _cZDC_CapIDS; std::map _cfC_EChannel; std::map _cTDC_EChannel; diff --git a/DQM/HcalTasks/plugins/ZDCQIE10Task.cc b/DQM/HcalTasks/plugins/ZDCQIE10Task.cc index e3ad88ee69adf..7b549eaf5e4f5 100644 --- a/DQM/HcalTasks/plugins/ZDCQIE10Task.cc +++ b/DQM/HcalTasks/plugins/ZDCQIE10Task.cc @@ -11,9 +11,14 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _tagQIE10 = ps.getUntrackedParameter("tagQIE10", edm::InputTag("hcalDigis", "ZDC")); _tokQIE10 = consumes(_tagQIE10); + // emulated sums sumTag = ps.getUntrackedParameter("etSumTag", edm::InputTag("etSumZdcProducer", "")); sumToken_ = consumes(sumTag); + // unpacked sums + sumTagUnpacked = ps.getUntrackedParameter("etSumTag", edm::InputTag("gtStage2Digis", "EtSumZDC")); + sumTokenUnpacked_ = consumes(sumTag); + htopoToken_ = esConsumes(); paramsToken_ = esConsumes(); } @@ -119,6 +124,31 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) _cZDC_BX_EmuSUMS[1]->setAxisTitle("globalBX", 1); _cZDC_BX_EmuSUMS[1]->setAxisTitle("0-255 weighted output", 2); + // create variable binning for TP sum histograms + std::vector varbins; + // -1 - 100 : 101 1-unit bins + // 100 - 700 :100 6-unit bins + // 700 - 1024 : 18 18-unit bins + for (int i = -1; i < 100; i += 1) + varbins.push_back(i); + for (int i = 100; i < 700; i += 6) + varbins.push_back(i); + for (int i = 700; i < 1024; i += 18) + varbins.push_back(i); + TH2D* varBinningTH2D = new TH2D( + histoname.c_str(), histoname.c_str(), varbins.size() - 1, varbins.data(), varbins.size() - 1, varbins.data()); + _cZDC_EmuSumTP_DataSum[0] = ib.book2DD(histoname.c_str(), varBinningTH2D); + + histoname = "ZDCM_EmuSumTP_DataSum"; + ib.setCurrentFolder("Hcal/ZDCQIE10Task/Sums"); + _cZDC_EmuSumTP_DataSum[0]->setAxisTitle("Emulated TP Sum (Online Counts)", 2); + + histoname = "ZDCP_EmuSumTP_DataSum"; + ib.setCurrentFolder("Hcal/ZDCQIE10Task/Sums"); + _cZDC_EmuSumTP_DataSum[1] = ib.book2DD(histoname.c_str(), varBinningTH2D); + _cZDC_EmuSumTP_DataSum[1]->setAxisTitle("Data TP Sum (Online Counts)", 1); + _cZDC_EmuSumTP_DataSum[1]->setAxisTitle("Emulated TP Sum (Online Counts)", 2); + histoname = "CapIDs"; ib.setCurrentFolder("Hcal/ZDCQIE10Task"); _cZDC_CapIDS[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 4, 0, 4); @@ -252,12 +282,8 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) // EM Minus HcalZDCDetId didm(HcalZDCDetId::EM, false, channel); - std::vector stationString = {"2_M_Top", - "2_M_Bottom", - "3_M_BottomLeft", - "3_M_BottomRight", - "3_M_TopLeft", - "3_M_TopRight"}; + std::vector stationString = { + "2_M_Top", "2_M_Bottom", "3_M_BottomLeft", "3_M_BottomRight", "3_M_TopLeft", "3_M_TopRight"}; histoname = "FSC" + stationString.at(channel - 7); ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel"); @@ -419,21 +445,54 @@ void ZDCQIE10Task::_process(edm::Event const& e, edm::EventSetup const& es) { int startBX = sums->getFirstBX(); + // to-do: if the TP is missing, this fills with -1 + double emulatedSumP = -1.0; + double emulatedSumM = -1.0; for (int ibx = startBX; ibx <= sums->getLastBX(); ++ibx) { for (auto itr = sums->begin(ibx); itr != sums->end(ibx); ++itr) { l1t::EtSum::EtSumType type = itr->getType(); if (type == l1t::EtSum::EtSumType::kZDCP) { - if (ibx == 0) + if (ibx == 0) { _cZDC_BX_EmuSUMS[1]->Fill(bx, itr->hwPt()); + emulatedSumP = itr->hwPt(); + } } if (type == l1t::EtSum::EtSumType::kZDCM) { - if (ibx == 0) + if (ibx == 0) { _cZDC_BX_EmuSUMS[0]->Fill(bx, itr->hwPt()); + emulatedSumM = itr->hwPt(); + } } } } + edm::Handle > unpacked_sums; + e.getByToken(sumTokenUnpacked_, unpacked_sums); + int startBX_Unpacked = unpacked_sums->getFirstBX(); + double unpackedSumP = -1.0; + double unpackedSumM = -1.0; + for (int ibx = startBX_Unpacked; ibx <= unpacked_sums->getLastBX(); ++ibx) { + for (auto itr = unpacked_sums->begin(ibx); itr != unpacked_sums->end(ibx); ++itr) { + l1t::EtSum::EtSumType type = itr->getType(); + + if (type == l1t::EtSum::EtSumType::kZDCP) { + if (ibx == 0) { + unpackedSumP = itr->hwPt(); + } + } + if (type == l1t::EtSum::EtSumType::kZDCM) { + if (ibx == 0) { + unpackedSumM = itr->hwPt(); + } + } + } + } + + // now fill the unpacked and emulator comparison histogram + _cZDC_EmuSumTP_DataSum[0]->Fill(unpackedSumM, emulatedSumM); + _cZDC_EmuSumTP_DataSum[1]->Fill(unpackedSumP, emulatedSumP); + edm::Handle digis; if (!e.getByToken(_tokQIE10, digis)) edm::LogError("Collection QIE10DigiCollection for ZDC isn't available" + _tagQIE10.label() + " " + From 5ee436a19840146e289d95cd72b5d571c78e8837 Mon Sep 17 00:00:00 2001 From: Hannah Date: Mon, 29 Sep 2025 18:01:08 +0200 Subject: [PATCH 5/5] Binning changes and additional comment from HCAL review. --- DQM/HcalTasks/plugins/ZDCQIE10Task.cc | 33 +++++++++++++++++++-------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/DQM/HcalTasks/plugins/ZDCQIE10Task.cc b/DQM/HcalTasks/plugins/ZDCQIE10Task.cc index 7b549eaf5e4f5..9db594dbeae6e 100644 --- a/DQM/HcalTasks/plugins/ZDCQIE10Task.cc +++ b/DQM/HcalTasks/plugins/ZDCQIE10Task.cc @@ -126,25 +126,38 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps) // create variable binning for TP sum histograms std::vector varbins; - // -1 - 100 : 101 1-unit bins - // 100 - 700 :100 6-unit bins - // 700 - 1024 : 18 18-unit bins - for (int i = -1; i < 100; i += 1) + // -1 - 64 : 65 1-unit bins + // 64 - 128 : 32 2-unit bins + // 128 - 256 : 32 4-unit bins + // 256 - 512 : 32 8-unit bins + // 512 - 1008 : 31 16-unit bins + // 1008 - 1023: 1 bin + // 1023 - 1024: 1 bin + for (int i = -1; i < 64; i += 1) varbins.push_back(i); - for (int i = 100; i < 700; i += 6) + for (int i = 64; i < 128; i += 2) varbins.push_back(i); - for (int i = 700; i < 1024; i += 18) + for (int i = 128; i < 256; i += 4) varbins.push_back(i); + for (int i = 256; i < 512; i += 8) + varbins.push_back(i); + for (int i = 512; i <= 1008; i += 16) + varbins.push_back(i); + + // add additional bins + varbins.push_back(1023); + varbins.push_back(1024); + + histoname = "ZDCM_EmuSumTP_DataSum"; + ib.setCurrentFolder("Hcal/ZDCQIE10Task/TPs"); + TH2D* varBinningTH2D = new TH2D( histoname.c_str(), histoname.c_str(), varbins.size() - 1, varbins.data(), varbins.size() - 1, varbins.data()); _cZDC_EmuSumTP_DataSum[0] = ib.book2DD(histoname.c_str(), varBinningTH2D); - - histoname = "ZDCM_EmuSumTP_DataSum"; - ib.setCurrentFolder("Hcal/ZDCQIE10Task/Sums"); _cZDC_EmuSumTP_DataSum[0]->setAxisTitle("Emulated TP Sum (Online Counts)", 2); histoname = "ZDCP_EmuSumTP_DataSum"; - ib.setCurrentFolder("Hcal/ZDCQIE10Task/Sums"); + ib.setCurrentFolder("Hcal/ZDCQIE10Task/TPs"); _cZDC_EmuSumTP_DataSum[1] = ib.book2DD(histoname.c_str(), varBinningTH2D); _cZDC_EmuSumTP_DataSum[1]->setAxisTitle("Data TP Sum (Online Counts)", 1); _cZDC_EmuSumTP_DataSum[1]->setAxisTitle("Emulated TP Sum (Online Counts)", 2);