Skip to content

Commit 2ddac7f

Browse files
authored
Merge pull request #49273 from hjbossi/FSCp_DQM_master
[FSC DQMn - master]: Initial commit of FSC plus implementation in DQM.
2 parents eba46b5 + 6a5b57f commit 2ddac7f

File tree

2 files changed

+109
-7
lines changed

2 files changed

+109
-7
lines changed

DQM/HcalTasks/interface/ZDCQIE10Task.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ class ZDCQIE10Task : public hcaldqm::DQTask {
3737

3838
// tags
3939
edm::InputTag _tagQIE10;
40+
edm::InputTag _tagData;
4041
edm::InputTag sumTag;
4142
edm::InputTag sumTagUnpacked;
4243
edm::EDGetTokenT<QIE10DigiCollection> _tokQIE10;
4344
edm::ESGetToken<HcalDbService, HcalDbRecord> hcalDbServiceToken_;
4445
edm::EDGetToken sumToken_;
4546
edm::EDGetToken sumTokenUnpacked_;
47+
edm::EDGetToken sumTokenData_;
4648
edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> htopoToken_;
4749
edm::ESGetToken<HcalLongRecoParams, HcalLongRecoParamsRcd> paramsToken_;
4850

@@ -64,6 +66,8 @@ class ZDCQIE10Task : public hcaldqm::DQTask {
6466
std::map<uint32_t, MonitorElement *> _cZDC_BXSUMS;
6567
std::map<uint32_t, MonitorElement *> _cZDC_BX_EmuSUMS;
6668
std::map<uint32_t, MonitorElement *> _cZDC_EmuSumTP_DataSum;
69+
std::map<uint32_t, MonitorElement *> _cZDC_EmuSumTP_L1rcvdSum;
70+
std::map<uint32_t, MonitorElement *> _cZDC_L1rcvdSumTP_DataSum;
6771
std::map<uint32_t, MonitorElement *> _cZDC_CapIDS;
6872
std::map<uint32_t, MonitorElement *> _cfC_EChannel;
6973
std::map<uint32_t, MonitorElement *> _cTDC_EChannel;
@@ -72,6 +76,11 @@ class ZDCQIE10Task : public hcaldqm::DQTask {
7276
std::map<uint32_t, MonitorElement *> _cZDC_EM_TM;
7377

7478
std::unique_ptr<HcalLongRecoParams> longRecoParams_;
79+
80+
// ZDC params
81+
static constexpr int kZDCAbsIEta = 42;
82+
static constexpr int kZDCiEtSumsIPhi = 99;
83+
static constexpr int kZDCiEtSumMaxValue = 1023;
7584
};
7685

7786
#endif

DQM/HcalTasks/plugins/ZDCQIE10Task.cc

Lines changed: 100 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ using namespace hcaldqm::filter;
77
ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps)
88

99
: DQTask(ps), hcalDbServiceToken_(esConsumes<HcalDbService, HcalDbRecord, edm::Transition::BeginRun>()) {
10-
//tags
10+
//tags data for digis and TPs
1111
_tagQIE10 = ps.getUntrackedParameter<edm::InputTag>("tagQIE10", edm::InputTag("hcalDigis", "ZDC"));
1212
_tokQIE10 = consumes<QIE10DigiCollection>(_tagQIE10);
13+
_tagData = ps.getUntrackedParameter<edm::InputTag>("tagData", edm::InputTag("hcalDigis"));
14+
sumTokenData_ = consumes<HcalTrigPrimDigiCollection>(_tagData);
1315

1416
// emulated sums
1517
sumTag = ps.getUntrackedParameter<edm::InputTag>("etSumTag", edm::InputTag("etSumZdcProducer", ""));
1618
sumToken_ = consumes<l1t::EtSumBxCollection>(sumTag);
1719

1820
// unpacked sums
19-
sumTagUnpacked = ps.getUntrackedParameter<edm::InputTag>("etSumTag", edm::InputTag("gtStage2Digis", "EtSumZDC"));
20-
sumTokenUnpacked_ = consumes<l1t::EtSumBxCollection>(sumTag);
21+
sumTagUnpacked =
22+
ps.getUntrackedParameter<edm::InputTag>("etSumTagUnpacked", edm::InputTag("gtStage2Digis", "EtSumZDC"));
23+
sumTokenUnpacked_ = consumes<l1t::EtSumBxCollection>(sumTagUnpacked);
2124

2225
htopoToken_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
2326
paramsToken_ = esConsumes<HcalLongRecoParams, HcalLongRecoParamsRcd>();
@@ -148,11 +151,13 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps)
148151
varbins.push_back(1023);
149152
varbins.push_back(1024);
150153

151-
histoname = "ZDCM_EmuSumTP_DataSum";
154+
// Emu Sum TP vs. Data Sum TP
155+
histoname = "ZDCM_EmuSumTP_DataSumTP";
152156
ib.setCurrentFolder("Hcal/ZDCQIE10Task/TPs");
153157

154158
TH2D* varBinningTH2D = new TH2D(
155159
histoname.c_str(), histoname.c_str(), varbins.size() - 1, varbins.data(), varbins.size() - 1, varbins.data());
160+
156161
_cZDC_EmuSumTP_DataSum[0] = ib.book2DD(histoname.c_str(), varBinningTH2D);
157162
_cZDC_EmuSumTP_DataSum[0]->setAxisTitle("Emulated TP Sum (Online Counts)", 2);
158163

@@ -162,6 +167,38 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps)
162167
_cZDC_EmuSumTP_DataSum[1]->setAxisTitle("Data TP Sum (Online Counts)", 1);
163168
_cZDC_EmuSumTP_DataSum[1]->setAxisTitle("Emulated TP Sum (Online Counts)", 2);
164169

170+
// Emu Sum TP vs. L1rcvd Sum TP
171+
histoname = "ZDCM_EmuSumTP_L1rcvdSumTP";
172+
ib.setCurrentFolder("Hcal/ZDCQIE10Task/TPs");
173+
174+
TH2D* varBinningTH2D_EmuL1rcvd = new TH2D(
175+
histoname.c_str(), histoname.c_str(), varbins.size() - 1, varbins.data(), varbins.size() - 1, varbins.data());
176+
177+
_cZDC_EmuSumTP_L1rcvdSum[0] = ib.book2DD(histoname.c_str(), varBinningTH2D_EmuL1rcvd);
178+
_cZDC_EmuSumTP_L1rcvdSum[0]->setAxisTitle("Emulated TP Sum (Online Counts)", 2);
179+
180+
histoname = "ZDCP_EmuSumTP_L1rcvdSumTP";
181+
ib.setCurrentFolder("Hcal/ZDCQIE10Task/TPs");
182+
_cZDC_EmuSumTP_L1rcvdSum[1] = ib.book2DD(histoname.c_str(), varBinningTH2D_EmuL1rcvd);
183+
_cZDC_EmuSumTP_L1rcvdSum[1]->setAxisTitle("L1 rcvd TP Sum (Online Counts)", 1);
184+
_cZDC_EmuSumTP_L1rcvdSum[1]->setAxisTitle("Emulated TP Sum (Online Counts)", 2);
185+
186+
// L1rcvd Sum TP vs. Data Sum TP
187+
histoname = "ZDCM_L1rcvdSumTP_DataSumTP";
188+
ib.setCurrentFolder("Hcal/ZDCQIE10Task/TPs");
189+
190+
TH2D* varBinningTH2D_L1rcvdData = new TH2D(
191+
histoname.c_str(), histoname.c_str(), varbins.size() - 1, varbins.data(), varbins.size() - 1, varbins.data());
192+
193+
_cZDC_L1rcvdSumTP_DataSum[0] = ib.book2DD(histoname.c_str(), varBinningTH2D_L1rcvdData);
194+
_cZDC_L1rcvdSumTP_DataSum[0]->setAxisTitle("L1 rcvd TP Sum (Online Counts)", 2);
195+
196+
histoname = "ZDCP_L1rcvdSumTP_DataSumTP";
197+
ib.setCurrentFolder("Hcal/ZDCQIE10Task/TPs");
198+
_cZDC_L1rcvdSumTP_DataSum[1] = ib.book2DD(histoname.c_str(), varBinningTH2D_L1rcvdData);
199+
_cZDC_L1rcvdSumTP_DataSum[1]->setAxisTitle("Data TP Sum (Online Counts)", 1);
200+
_cZDC_L1rcvdSumTP_DataSum[1]->setAxisTitle("L1 rcvd TP Sum (Online Counts)", 2);
201+
165202
histoname = "CapIDs";
166203
ib.setCurrentFolder("Hcal/ZDCQIE10Task");
167204
_cZDC_CapIDS[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 4, 0, 4);
@@ -292,7 +329,7 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps)
292329

293330
// adding 6 FSC channels on z- side (labeled as EM7_minus - EM12_minus)
294331
for (int channel = 7; channel < 13; channel++) {
295-
// EM Minus
332+
// FSC Minus
296333
HcalZDCDetId didm(HcalZDCDetId::EM, false, channel);
297334

298335
std::vector<std::string> stationString = {
@@ -323,6 +360,38 @@ ZDCQIE10Task::ZDCQIE10Task(edm::ParameterSet const& ps)
323360
_cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150, 0, 150);
324361
_cTDC_EChannel[didm()]->setAxisTitle("TDC", 1);
325362
_cTDC_EChannel[didm()]->setAxisTitle("N", 2);
363+
364+
// FSC plus
365+
HcalZDCDetId didp(HcalZDCDetId::EM, true, channel);
366+
367+
std::vector<std::string> stationStringP = {
368+
"2_P_Top", "2_P_Bottom", "3_P_BottomLeft", "3_P_BottomRight", "3_P_TopLeft", "3_P_TopRight"};
369+
370+
histoname = "FSC" + stationStringP.at(channel - 7);
371+
ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
372+
_cADC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
373+
_cADC_EChannel[didp()]->setAxisTitle("ADC", 1);
374+
_cADC_EChannel[didp()]->setAxisTitle("N", 2);
375+
ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
376+
_cADC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
377+
_cADC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
378+
_cADC_vs_TS_EChannel[didp()]->setAxisTitle("sum ADC", 2);
379+
380+
histoname = "FSC" + stationStringP.at(channel - 7);
381+
ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_perChannel");
382+
_cfC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, 0, 8000);
383+
_cfC_EChannel[didp()]->setAxisTitle("fC", 1);
384+
_cfC_EChannel[didp()]->setAxisTitle("N", 2);
385+
ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_vs_TS_perChannel");
386+
_cfC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
387+
_cfC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
388+
_cfC_vs_TS_EChannel[didp()]->setAxisTitle("sum fC", 2);
389+
390+
histoname = "FSC" + stationStringP.at(channel - 7);
391+
ib.setCurrentFolder("Hcal/ZDCQIE10Task/TDC_perChannel");
392+
_cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 150, 0, 150);
393+
_cTDC_EChannel[didp()]->setAxisTitle("TDC", 1);
394+
_cTDC_EChannel[didp()]->setAxisTitle("N", 2);
326395
}
327396

328397
for (int channel = 1; channel < 5; channel++) {
@@ -502,9 +571,33 @@ void ZDCQIE10Task::_process(edm::Event const& e, edm::EventSetup const& es) {
502571
}
503572
}
504573

574+
edm::Handle<HcalTrigPrimDigiCollection> data_sums;
575+
e.getByToken(sumTokenData_, data_sums);
576+
double dataSumP = -1.0;
577+
double dataSumM = -1.0;
578+
for (HcalTrigPrimDigiCollection::const_iterator it = data_sums->begin(); it != data_sums->end(); ++it) {
579+
// Explicit check on the DetIds present in the Collection
580+
HcalTrigTowerDetId tid = it->id();
581+
582+
// ZDCp TP
583+
if (tid.ieta() >= kZDCAbsIEta && tid.iphi() == kZDCiEtSumsIPhi) {
584+
// need to convert to the actual dynamic range of the ZDC sums
585+
dataSumP = it->t0().raw() & kZDCiEtSumMaxValue;
586+
}
587+
// ZDCm TP
588+
if (tid.ieta() <= -kZDCAbsIEta && tid.iphi() == kZDCiEtSumsIPhi) {
589+
// need to convert to the actual dynamic range of the ZDC sums
590+
dataSumM = it->t0().raw() & kZDCiEtSumMaxValue;
591+
}
592+
}
593+
505594
// now fill the unpacked and emulator comparison histogram
506-
_cZDC_EmuSumTP_DataSum[0]->Fill(unpackedSumM, emulatedSumM);
507-
_cZDC_EmuSumTP_DataSum[1]->Fill(unpackedSumP, emulatedSumP);
595+
_cZDC_EmuSumTP_DataSum[0]->Fill(dataSumM, emulatedSumM);
596+
_cZDC_EmuSumTP_DataSum[1]->Fill(dataSumP, emulatedSumP);
597+
_cZDC_EmuSumTP_L1rcvdSum[0]->Fill(unpackedSumM, emulatedSumM);
598+
_cZDC_EmuSumTP_L1rcvdSum[1]->Fill(unpackedSumP, emulatedSumP);
599+
_cZDC_L1rcvdSumTP_DataSum[0]->Fill(dataSumM, unpackedSumM);
600+
_cZDC_L1rcvdSumTP_DataSum[1]->Fill(dataSumP, unpackedSumP);
508601

509602
edm::Handle<QIE10DigiCollection> digis;
510603
if (!e.getByToken(_tokQIE10, digis))

0 commit comments

Comments
 (0)