CMS 3D CMS Logo

ZDCQIE10Task.cc
Go to the documentation of this file.
2 using namespace std;
3 using namespace hcaldqm;
4 using namespace hcaldqm::constants;
5 using namespace hcaldqm::filter;
6 
8 
9  : DQTask(ps), hcalDbServiceToken_(esConsumes<HcalDbService, HcalDbRecord, edm::Transition::BeginRun>()) {
10  //tags
11  _tagQIE10 = ps.getUntrackedParameter<edm::InputTag>("tagQIE10", edm::InputTag("hcalDigis", "ZDC"));
12  _tokQIE10 = consumes<QIE10DigiCollection>(_tagQIE10);
13 
14  sumTag = ps.getUntrackedParameter<edm::InputTag>("etSumTag", edm::InputTag("etSumZdcProducer", ""));
15  sumToken_ = consumes<l1t::EtSumBxCollection>(sumTag);
16 
17  htopoToken_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
18  paramsToken_ = esConsumes<HcalLongRecoParams, HcalLongRecoParamsRcd>();
19 }
20 
23  ib.cd();
25  _emap = dbs->getHcalMapping();
26  // Book LED calibration channels from emap
27  std::vector<HcalElectronicsId> eids = _emap->allElectronicsId();
29 
30  // BOOK HISTOGRAMS
31  std::string histoname;
32  histoname = "Crate28";
33  ib.setCurrentFolder("Hcal/ZDCQIE10Task/DigiSize");
34  _cDigiSize_Crate[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 21, -0.5, 20.5);
35  _cDigiSize_Crate[0]->setAxisTitle("DigiSize", 1);
36  _cDigiSize_Crate[0]->setAxisTitle("N", 2);
37 
38  histoname = "FED1136";
39  ib.setCurrentFolder("Hcal/ZDCQIE10Task/DigiSize");
40  _cDigiSize_FED[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 21, -0.5, 20.5);
41  _cDigiSize_FED[0]->setAxisTitle("DigiSize", 1);
42  _cDigiSize_FED[0]->setAxisTitle("N", 2);
43 
44  histoname = "ZDCM";
45  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC");
46  _cADC_PM[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
47  _cADC_PM[0]->setAxisTitle("ADC", 1);
48  _cADC_PM[0]->setAxisTitle("N", 2);
49 
50  histoname = "ZDCP";
51  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC");
52  _cADC_PM[1] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
53  _cADC_PM[1]->setAxisTitle("ADC", 1);
54  _cADC_PM[1]->setAxisTitle("N", 2);
55 
56  histoname = "ZDCM";
57  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADCvsTS");
58  _cADC_vs_TS_PM[0] = ib.book2DD(histoname.c_str(), histoname.c_str(), 6, 0, 6, 256, 0, 256);
59  _cADC_vs_TS_PM[0]->setAxisTitle("TS", 1);
60  _cADC_vs_TS_PM[0]->setAxisTitle("ADC", 2);
61 
62  histoname = "ZDCP";
63  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADCvsTS");
64  _cADC_vs_TS_PM[1] = ib.book2DD(histoname.c_str(), histoname.c_str(), 6, 0, 6, 256, 0, 256);
65  _cADC_vs_TS_PM[1]->setAxisTitle("TS", 1);
66  _cADC_vs_TS_PM[1]->setAxisTitle("ADC", 2);
67 
68  histoname = "Crate28";
69  ib.setCurrentFolder("Hcal/ZDCQIE10Task/Occupancy/Crate");
70  _cOccupancy_Crate[0] = ib.book2DD(histoname.c_str(), histoname.c_str(), 12, 0, 12, 144, 0, 144);
71  _cOccupancy_Crate[0]->setAxisTitle("SlotuTCA", 1);
72  _cOccupancy_Crate[0]->setAxisTitle("FiberuTCAFiberCh", 2);
73 
74  histoname = "Crate28S3";
75  ib.setCurrentFolder("Hcal/ZDCQIE10Task/Occupancy/CrateSlote");
76  _cOccupancy_CrateSlot[0] = ib.book2DD(histoname.c_str(), histoname.c_str(), 24, 0, 24, 6, 0, 6);
77  _cOccupancy_CrateSlot[0]->setAxisTitle("SlotuTCA", 1);
78  _cOccupancy_CrateSlot[0]->setAxisTitle("FiberCh", 2);
79 
80  histoname = "uTCA_for_FED1136";
81  ib.setCurrentFolder("Hcal/ZDCQIE10Task/Occupancy/Electronics");
82  _cOccupancy_ElectronicsuTCA[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 12, 0, 12);
83  _cOccupancy_ElectronicsuTCA[0]->setAxisTitle("N", 1);
84  _cOccupancy_ElectronicsuTCA[0]->setAxisTitle("SlotuTCA", 1);
85 
86  histoname = "ZDCP_Sum";
87  ib.setCurrentFolder("Hcal/ZDCQIE10Task/Sums");
88  _cZDC_SUMS[1] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, -1, 5000);
89  _cZDC_SUMS[1]->setAxisTitle("GeV", 1);
90  _cZDC_SUMS[1]->setAxisTitle("N", 2);
91 
92  histoname = "ZDCM_Sum";
93  ib.setCurrentFolder("Hcal/ZDCQIE10Task/Sums");
94  _cZDC_SUMS[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, -1, 5000);
95  _cZDC_SUMS[0]->setAxisTitle("GeV", 1);
96  _cZDC_SUMS[0]->setAxisTitle("N", 2);
97 
98  histoname = "ZDCM_SumBX";
99  ib.setCurrentFolder("Hcal/ZDCQIE10Task/Sums");
100  _cZDC_BXSUMS[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 3500, 0, 3500);
101  _cZDC_BXSUMS[0]->setAxisTitle("globalBX", 1);
102  _cZDC_BXSUMS[0]->setAxisTitle("GeV", 2);
103 
104  histoname = "ZDCP_SumBX";
105  ib.setCurrentFolder("Hcal/ZDCQIE10Task/Sums");
106  _cZDC_BXSUMS[1] = ib.book1DD(histoname.c_str(), histoname.c_str(), 3500, 0, 3500);
107  _cZDC_BXSUMS[1]->setAxisTitle("globalBX", 1);
108  _cZDC_BXSUMS[1]->setAxisTitle("GeV", 2);
109 
110  histoname = "ZDCM_EmuSumBX";
111  ib.setCurrentFolder("Hcal/ZDCQIE10Task/Sums");
112  _cZDC_BX_EmuSUMS[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 3500, 0, 3500);
113  _cZDC_BX_EmuSUMS[0]->setAxisTitle("globalBX", 1);
114  _cZDC_BX_EmuSUMS[0]->setAxisTitle("0-255 weighted output", 2);
115 
116  histoname = "ZDCP_EmuSumBX";
117  ib.setCurrentFolder("Hcal/ZDCQIE10Task/Sums");
118  _cZDC_BX_EmuSUMS[1] = ib.book1DD(histoname.c_str(), histoname.c_str(), 3500, 0, 3500);
119  _cZDC_BX_EmuSUMS[1]->setAxisTitle("globalBX", 1);
120  _cZDC_BX_EmuSUMS[1]->setAxisTitle("0-255 weighted output", 2);
121 
122  histoname = "CapIDs";
123  ib.setCurrentFolder("Hcal/ZDCQIE10Task");
124  _cZDC_CapIDS[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 4, 0, 4);
125  _cZDC_CapIDS[0]->setAxisTitle("CapID", 1);
126  _cZDC_CapIDS[0]->setAxisTitle("N", 2);
127 
128  histoname = "EM_M_Timings";
129  ib.setCurrentFolder("Hcal/ZDCQIE10Task");
130  _cZDC_EM_TM[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 10, 1, 11);
131  _cZDC_EM_TM[0]->setAxisTitle("Channel", 1);
132  _cZDC_EM_TM[0]->setAxisTitle("N", 2);
133  _cZDC_EM_TM[0]->setBinLabel(1, "EM_M_1 good timing");
134  _cZDC_EM_TM[0]->setBinLabel(2, "EM_M_1 bad timing");
135  _cZDC_EM_TM[0]->setBinLabel(3, "EM_M_2 good timing");
136  _cZDC_EM_TM[0]->setBinLabel(4, "EM_M_2 bad timing");
137  _cZDC_EM_TM[0]->setBinLabel(5, "EM_M_3 good timing");
138  _cZDC_EM_TM[0]->setBinLabel(6, "EM_M_3 bad timing");
139  _cZDC_EM_TM[0]->setBinLabel(7, "EM_M_4 good timing");
140  _cZDC_EM_TM[0]->setBinLabel(8, "EM_M_4 bad timing");
141  _cZDC_EM_TM[0]->setBinLabel(9, "EM_M_5 good timing");
142  _cZDC_EM_TM[0]->setBinLabel(10, "EM_M_5 bad timing");
143 
144  histoname = "EM_P_Timings";
145  ib.setCurrentFolder("Hcal/ZDCQIE10Task");
146  _cZDC_EM_TM[1] = ib.book1DD(histoname.c_str(), histoname.c_str(), 10, 1, 11);
147  _cZDC_EM_TM[1]->setAxisTitle("Channel", 1);
148  _cZDC_EM_TM[1]->setAxisTitle("N", 2);
149  _cZDC_EM_TM[1]->setBinLabel(1, "EM_P_1 good timing");
150  _cZDC_EM_TM[1]->setBinLabel(2, "EM_P_1 bad timing");
151  _cZDC_EM_TM[1]->setBinLabel(3, "EM_P_2 good timing");
152  _cZDC_EM_TM[1]->setBinLabel(4, "EM_P_2 bad timing");
153  _cZDC_EM_TM[1]->setBinLabel(5, "EM_P_3 good timing");
154  _cZDC_EM_TM[1]->setBinLabel(6, "EM_P_3 bad timing");
155  _cZDC_EM_TM[1]->setBinLabel(7, "EM_P_4 good timing");
156  _cZDC_EM_TM[1]->setBinLabel(8, "EM_P_4 bad timing");
157  _cZDC_EM_TM[1]->setBinLabel(9, "EM_P_5 good timing");
158  _cZDC_EM_TM[1]->setBinLabel(10, "EM_P_5 bad timing");
159 
160  histoname = "HAD_M_Timings";
161  ib.setCurrentFolder("Hcal/ZDCQIE10Task");
162  _cZDC_HAD_TM[0] = ib.book1DD(histoname.c_str(), histoname.c_str(), 8, 1, 9);
163  _cZDC_HAD_TM[0]->setAxisTitle("Channel", 1);
164  _cZDC_HAD_TM[0]->setAxisTitle("N", 2);
165  _cZDC_HAD_TM[0]->setBinLabel(1, "HAD_M_1 good timing");
166  _cZDC_HAD_TM[0]->setBinLabel(2, "HAD_M_1 bad timing");
167  _cZDC_HAD_TM[0]->setBinLabel(3, "HAD_M_2 good timing");
168  _cZDC_HAD_TM[0]->setBinLabel(4, "HAD_M_2 bad timing");
169  _cZDC_HAD_TM[0]->setBinLabel(5, "HAD_M_3 good timing");
170  _cZDC_HAD_TM[0]->setBinLabel(6, "HAD_M_3 bad timing");
171  _cZDC_HAD_TM[0]->setBinLabel(7, "HAD_M_4 good timing");
172  _cZDC_HAD_TM[0]->setBinLabel(8, "HAD_M_4 bad timing");
173 
174  histoname = "HAD_P_Timings";
175  ib.setCurrentFolder("Hcal/ZDCQIE10Task");
176  _cZDC_HAD_TM[1] = ib.book1DD(histoname.c_str(), histoname.c_str(), 8, 1, 9);
177  _cZDC_HAD_TM[1]->setAxisTitle("Channel", 1);
178  _cZDC_HAD_TM[1]->setAxisTitle("N", 2);
179  _cZDC_HAD_TM[1]->setBinLabel(1, "HAD_P_1 good timing");
180  _cZDC_HAD_TM[1]->setBinLabel(2, "HAD_P_1 bad timing");
181  _cZDC_HAD_TM[1]->setBinLabel(3, "HAD_P_2 good timing");
182  _cZDC_HAD_TM[1]->setBinLabel(4, "HAD_P_2 bad timing");
183  _cZDC_HAD_TM[1]->setBinLabel(5, "HAD_P_3 good timing");
184  _cZDC_HAD_TM[1]->setBinLabel(6, "HAD_P_3 bad timing");
185  _cZDC_HAD_TM[1]->setBinLabel(7, "HAD_P_4 good timing");
186  _cZDC_HAD_TM[1]->setBinLabel(8, "HAD_P_4 bad timing");
187 
188  //book histos per channel
189  //std::string histoname;
190  for (int channel = 1; channel < 6; channel++) {
191  // EM Pos
192  HcalZDCDetId didp(HcalZDCDetId::EM, true, channel);
193 
194  histoname = "EM_P_" + std::to_string(channel);
195  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
196  _cADC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
197  _cADC_EChannel[didp()]->setAxisTitle("ADC", 1);
198  _cADC_EChannel[didp()]->setAxisTitle("N", 2);
199  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
200  _cADC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
201  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
202  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("sum ADC", 2);
203 
204  histoname = "EM_P_" + std::to_string(channel);
205  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_perChannel");
206  _cfC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, 0, 8000);
207  _cfC_EChannel[didp()]->setAxisTitle("fC", 1);
208  _cfC_EChannel[didp()]->setAxisTitle("N", 2);
209  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_vs_TS_perChannel");
210  _cfC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
211  _cfC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
212  _cfC_vs_TS_EChannel[didp()]->setAxisTitle("sum fC", 2);
213 
214  histoname = "EM_P_" + std::to_string(channel);
215  _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50);
216  _cTDC_EChannel[didp()]->setAxisTitle("TDC", 1);
217  _cTDC_EChannel[didp()]->setAxisTitle("N", 2);
218 
219  // EM Minus
220  HcalZDCDetId didm(HcalZDCDetId::EM, false, channel);
221 
222  histoname = "EM_M_" + std::to_string(channel);
223  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
224  _cADC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
225  _cADC_EChannel[didm()]->setAxisTitle("ADC", 1);
226  _cADC_EChannel[didm()]->setAxisTitle("N", 2);
227  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
228  _cADC_vs_TS_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
229  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
230  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2);
231 
232  histoname = "EM_M_" + std::to_string(channel);
233  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_perChannel");
234  _cfC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, 0, 8000);
235  _cfC_EChannel[didm()]->setAxisTitle("fC", 1);
236  _cfC_EChannel[didm()]->setAxisTitle("N", 2);
237  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_vs_TS_perChannel");
238  _cfC_vs_TS_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
239  _cfC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
240  _cfC_vs_TS_EChannel[didm()]->setAxisTitle("sum fC", 2);
241 
242  histoname = "EM_M_" + std::to_string(channel);
243  _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50);
244  _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1);
245  _cTDC_EChannel[didm()]->setAxisTitle("N", 2);
246  }
247 
248  for (int channel = 1; channel < 5; channel++) {
249  // HAD Pos
250  HcalZDCDetId didp(HcalZDCDetId::HAD, true, channel);
251 
252  histoname = "HAD_P_" + std::to_string(channel);
253  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
254  _cADC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
255  _cADC_EChannel[didp()]->setAxisTitle("ADC", 1);
256  _cADC_EChannel[didp()]->setAxisTitle("N", 2);
257  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
258  _cADC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
259  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
260  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("sum ADC", 2);
261 
262  histoname = "HAD_P_" + std::to_string(channel);
263  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_perChannel");
264  _cfC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, 0, 8000);
265  _cfC_EChannel[didp()]->setAxisTitle("fC", 1);
266  _cfC_EChannel[didp()]->setAxisTitle("N", 2);
267  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_vs_TS_perChannel");
268  _cfC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
269  _cfC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
270  _cfC_vs_TS_EChannel[didp()]->setAxisTitle("sum fC", 2);
271 
272  histoname = "HAD_P_" + std::to_string(channel);
273  _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50);
274  _cTDC_EChannel[didp()]->setAxisTitle("TDC", 1);
275  _cTDC_EChannel[didp()]->setAxisTitle("N", 2);
276 
277  // HAD Minus
278  HcalZDCDetId didm(HcalZDCDetId::HAD, false, channel);
279 
280  histoname = "HAD_M_" + std::to_string(channel);
281  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
282  _cADC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
283  _cADC_EChannel[didm()]->setAxisTitle("ADC", 1);
284  _cADC_EChannel[didm()]->setAxisTitle("N", 2);
285  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
286  _cADC_vs_TS_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
287  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
288  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2);
289 
290  histoname = "HAD_M_" + std::to_string(channel);
291  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_perChannel");
292  _cfC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, 0, 8000);
293  _cfC_EChannel[didm()]->setAxisTitle("fC", 1);
294  _cfC_EChannel[didm()]->setAxisTitle("N", 2);
295  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_vs_TS_perChannel");
296  _cfC_vs_TS_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
297  _cfC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
298  _cfC_vs_TS_EChannel[didm()]->setAxisTitle("sum fC", 2);
299 
300  histoname = "HAD_M_" + std::to_string(channel);
301  _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50);
302  _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1);
303  _cTDC_EChannel[didm()]->setAxisTitle("N", 2);
304  }
305 
306  for (int channel = 1; channel < 17; channel++) {
307  // RPD Pos
308  HcalZDCDetId didp(HcalZDCDetId::RPD, true, channel);
309 
310  histoname = "RPD_P_" + std::to_string(channel);
311  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
312  _cADC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
313  _cADC_EChannel[didp()]->setAxisTitle("ADC", 1);
314  _cADC_EChannel[didp()]->setAxisTitle("N", 2);
315  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
316  _cADC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
317  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
318  _cADC_vs_TS_EChannel[didp()]->setAxisTitle("sum ADC", 2);
319 
320  histoname = "RPD_P_" + std::to_string(channel);
321  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_perChannel");
322  _cfC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, 0, 8000);
323  _cfC_EChannel[didp()]->setAxisTitle("fC", 1);
324  _cfC_EChannel[didp()]->setAxisTitle("N", 2);
325  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_vs_TS_perChannel");
326  _cfC_vs_TS_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
327  _cfC_vs_TS_EChannel[didp()]->setAxisTitle("TS", 1);
328  _cfC_vs_TS_EChannel[didp()]->setAxisTitle("sum fC", 2);
329 
330  histoname = "RPD_P_" + std::to_string(channel);
331  _cTDC_EChannel[didp()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50);
332  _cTDC_EChannel[didp()]->setAxisTitle("TDC", 1);
333  _cTDC_EChannel[didp()]->setAxisTitle("N", 2);
334 
335  // RPD Minus
336  HcalZDCDetId didm(HcalZDCDetId::RPD, false, channel);
337  histoname = "RPD_M_" + std::to_string(channel);
338 
339  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_perChannel");
340  _cADC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 256, 0, 256);
341  _cADC_EChannel[didm()]->setAxisTitle("ADC", 1);
342  _cADC_EChannel[didm()]->setAxisTitle("N", 2);
343  ib.setCurrentFolder("Hcal/ZDCQIE10Task/ADC_vs_TS_perChannel");
344  _cADC_vs_TS_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
345  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
346  _cADC_vs_TS_EChannel[didm()]->setAxisTitle("sum ADC", 2);
347 
348  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_perChannel");
349  _cfC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 100, 0, 8000);
350  _cfC_EChannel[didm()]->setAxisTitle("fC", 1);
351  _cfC_EChannel[didm()]->setAxisTitle("N", 2);
352  ib.setCurrentFolder("Hcal/ZDCQIE10Task/fC_vs_TS_perChannel");
353  _cfC_vs_TS_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 6, 0, 6);
354  _cfC_vs_TS_EChannel[didm()]->setAxisTitle("TS", 1);
355  _cfC_vs_TS_EChannel[didm()]->setAxisTitle("sum fC", 2);
356 
357  histoname = "RPD_M_" + std::to_string(channel);
358  _cTDC_EChannel[didm()] = ib.book1DD(histoname.c_str(), histoname.c_str(), 50, 1, 50);
359  _cTDC_EChannel[didm()]->setAxisTitle("TDC", 1);
360  _cTDC_EChannel[didm()]->setAxisTitle("N", 2);
361  }
362 }
363 
364 /* virtual */
366  const HcalTopology& htopo = es.getData(htopoToken_);
368  longRecoParams_ = std::make_unique<HcalLongRecoParams>(p);
369  longRecoParams_->setTopo(&htopo);
370 
371  int bx = e.bunchCrossing();
372 
374  e.getByToken(sumToken_, sums);
375 
376  int startBX = sums->getFirstBX();
377 
378  for (int ibx = startBX; ibx <= sums->getLastBX(); ++ibx) {
379  for (auto itr = sums->begin(ibx); itr != sums->end(ibx); ++itr) {
380  l1t::EtSum::EtSumType type = itr->getType();
381 
383  if (ibx == 0)
384  _cZDC_BX_EmuSUMS[1]->Fill(bx, itr->hwPt());
385  }
387  if (ibx == 0)
388  _cZDC_BX_EmuSUMS[0]->Fill(bx, itr->hwPt());
389  }
390  }
391  }
392 
394  if (!e.getByToken(_tokQIE10, digis))
395  edm::LogError("Collection QIE10DigiCollection for ZDC isn't available" + _tagQIE10.label() + " " +
396  _tagQIE10.instance());
397 
398  double HADM_sum = 0, HADP_sum = 0, EMM_sum = 0, EMP_sum = 0;
399  double HADM_tot_sum = 0, HADP_tot_sum = 0, EMM_tot_sum = 0, EMP_tot_sum = 0;
400 
401  for (auto it = digis->begin(); it != digis->end(); it++) {
402  const QIE10DataFrame digi = static_cast<const QIE10DataFrame>(*it);
403 
404  HcalZDCDetId const& did = digi.detid();
405 
406  uint32_t rawid = _ehashmap.lookup(did);
407  if (rawid == 0) {
408  continue;
409  }
410  HcalElectronicsId const& eid(rawid);
411 
412  _cDigiSize_Crate[0]->Fill(digi.samples());
413 
414  if (_ptype != fOffline) { // hidefed2crate
415 
416  _cDigiSize_FED[0]->Fill(digi.samples());
417 
418  _cOccupancy_ElectronicsuTCA[0]->Fill(eid.slot());
419  }
420  if (_ptype == fOnline || _ptype == fLocal) {
421  _cOccupancy_Crate[0]->Fill(eid.slot(), eid.fiberIndex());
422  _cOccupancy_CrateSlot[0]->Fill(eid.slot(), eid.fiberChanId());
423  }
424 
425  double sample_ZDCm_TS1 = 0, sample_ZDCp_TS1 = 0, sample_ZDCm_TS2 = 0, sample_ZDCp_TS2 = 0;
426  double sample[2][6] = {{0}};
427 
428  for (int i = 0; i < digi.samples(); i++) {
429  // ZDC Plus
430  if (did.zside() > 0) {
431  _cADC_PM[1]->Fill(digi[i].adc());
432  _cADC_vs_TS_PM[1]->Fill(i, digi[i].adc());
433  sample[1][i] = constants::adc2fC[digi[i].adc()];
434  if (i == 1) {
435  sample_ZDCp_TS1 = constants::adc2fC[digi[i].adc()];
436  }
437  if (i == 2) {
438  sample_ZDCp_TS2 = constants::adc2fC[digi[i].adc()];
439  }
440 
441  }
442  // ZDC Minus
443  else {
444  _cADC_PM[0]->Fill(digi[i].adc());
445  _cADC_vs_TS_PM[0]->Fill(i, digi[i].adc());
446  sample[0][i] = constants::adc2fC[digi[i].adc()];
447  if (i == 1) {
448  sample_ZDCm_TS1 = constants::adc2fC[digi[i].adc()];
449  }
450  if (i == 2) {
451  sample_ZDCm_TS2 = constants::adc2fC[digi[i].adc()];
452  }
453  }
454 
455  // iter over all samples
456  if (_cADC_EChannel.find(did()) != _cADC_EChannel.end()) {
457  _cADC_EChannel[did()]->Fill(digi[i].adc());
458  _cfC_EChannel[did()]->Fill(constants::adc2fC[digi[i].adc()]);
459  _cTDC_EChannel[did()]->Fill(digi[i].le_tdc());
460  }
461  if (_cADC_vs_TS_EChannel.find(did()) != _cADC_vs_TS_EChannel.end()) {
462  _cADC_vs_TS_EChannel[did()]->Fill(i, digi[i].adc());
463  _cfC_vs_TS_EChannel[did()]->Fill(i, constants::adc2fC[digi[i].adc()]);
464  }
465  _cZDC_CapIDS[0]->Fill(digi[i].capid());
466  }
467 
468  if (did.section() == 1) {
469  if ((did.channel() > 0) && (did.channel() < 6)) {
470  EMM_sum += (sample_ZDCm_TS2 - sample_ZDCm_TS1);
471  EMP_sum += (sample_ZDCp_TS2 - sample_ZDCp_TS1);
472  for (int k = 0; k < 6; k++) {
473  EMP_tot_sum += sample[1][k];
474  EMM_tot_sum += sample[0][k];
475  }
476  if (did.zside() == -1) {
477  if (sample[0][2] > (0.0 * EMM_tot_sum)) {
478  _cZDC_EM_TM[0]->Fill((did.channel() * 2) - 1);
479  } else {
480  _cZDC_EM_TM[0]->Fill((did.channel() * 2));
481  }
482  }
483  if (did.zside() == 1) {
484  if (sample[1][2] > (0.0 * EMP_tot_sum)) {
485  _cZDC_EM_TM[1]->Fill((did.channel() * 2) - 1);
486  } else {
487  _cZDC_EM_TM[1]->Fill((did.channel() * 2));
488  }
489  }
490  }
491  }
492  if (did.section() == 2) {
493  if ((did.channel() > 0) && (did.channel() < 5)) {
494  HADP_sum += (sample_ZDCp_TS2 - sample_ZDCp_TS1);
495  HADM_sum += (sample_ZDCm_TS2 - sample_ZDCm_TS1);
496  for (int k = 0; k < 6; k++) {
497  HADP_tot_sum += sample[1][k];
498  HADM_tot_sum += sample[0][k];
499  }
500  if (did.zside() == -1) {
501  if (sample[0][2] > (0.0 * HADM_tot_sum)) {
502  _cZDC_HAD_TM[0]->Fill((did.channel() * 2) - 1);
503  } else {
504  _cZDC_HAD_TM[0]->Fill((did.channel() * 2));
505  }
506  }
507  if (did.zside() == 1) {
508  if (sample[1][2] > (0.0 * HADP_tot_sum)) {
509  _cZDC_HAD_TM[1]->Fill((did.channel() * 2) - 1);
510  } else {
511  _cZDC_HAD_TM[1]->Fill((did.channel() * 2));
512  }
513  }
514  }
515  }
516  }
517 
518  // Hardcoded callibrations currently
519  _cZDC_SUMS[0]->Fill(((EMM_sum * 0.1) + HADM_sum) * 0.5031);
520  _cZDC_SUMS[1]->Fill(((EMP_sum * 0.12) + HADP_sum) * 0.9397);
521  _cZDC_BXSUMS[0]->Fill(bx, ((EMM_sum * 0.1) + HADM_sum) * 0.5031);
522  _cZDC_BXSUMS[1]->Fill(bx, ((EMP_sum * 0.12) + HADP_sum) * 0.9397);
523 }
524 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > htopoToken_
Definition: ZDCQIE10Task.h:44
constexpr DetId detid() const
Get the detector id.
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
std::map< uint32_t, MonitorElement * > _cDigiSize_FED
Definition: ZDCQIE10Task.h:54
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: ZDCQIE10Task.h:48
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::map< uint32_t, MonitorElement * > _cfC_vs_TS_EChannel
Definition: ZDCQIE10Task.h:67
dbs
Find files in dataset.
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
ZDCQIE10Task(edm::ParameterSet const &)
Definition: ZDCQIE10Task.cc:7
std::string const & instance() const
Definition: InputTag.h:37
edm::EDGetToken sumToken_
Definition: ZDCQIE10Task.h:43
std::map< uint32_t, MonitorElement * > _cZDC_CapIDS
Definition: ZDCQIE10Task.h:64
edm::InputTag _tagQIE10
Definition: ZDCQIE10Task.h:39
edm::EDGetTokenT< QIE10DigiCollection > _tokQIE10
Definition: ZDCQIE10Task.h:41
std::string const & label() const
Definition: InputTag.h:36
std::map< uint32_t, MonitorElement * > _cOccupancy_Crate
Definition: ZDCQIE10Task.h:59
static std::string to_string(const XMLCh *ch)
std::map< uint32_t, MonitorElement * > _cZDC_EM_TM
Definition: ZDCQIE10Task.h:69
std::map< uint32_t, MonitorElement * > _cADC_vs_TS_EChannel
Definition: ZDCQIE10Task.h:52
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getUntrackedParameter(std::string const &, T const &) const
ProcessingType _ptype
Definition: DQModule.h:44
std::map< uint32_t, MonitorElement * > _cOccupancy_ElectronicsuTCA
Definition: ZDCQIE10Task.h:58
std::map< uint32_t, MonitorElement * > _cZDC_BXSUMS
Definition: ZDCQIE10Task.h:62
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: ZDCQIE10Task.cc:21
Transition
Definition: Transition.h:12
static const float adc2fC[128]
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::map< uint32_t, MonitorElement * > _cOccupancy_CrateSlot
Definition: ZDCQIE10Task.h:60
void _process(edm::Event const &, edm::EventSetup const &) override
edm::InputTag sumTag
Definition: ZDCQIE10Task.h:40
HcalElectronicsMap const * _emap
Definition: DQTask.h:81
std::vector< HcalElectronicsId > allElectronicsId() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
std::map< uint32_t, MonitorElement * > _cADC_PM
Definition: ZDCQIE10Task.h:55
std::map< uint32_t, MonitorElement * > _cADC_vs_TS_PM
Definition: ZDCQIE10Task.h:56
std::map< uint32_t, MonitorElement * > _cDigiSize_Crate
Definition: ZDCQIE10Task.h:53
std::map< uint32_t, MonitorElement * > _cZDC_BX_EmuSUMS
Definition: ZDCQIE10Task.h:63
const_iterator end() const
std::unique_ptr< HcalLongRecoParams > longRecoParams_
Definition: ZDCQIE10Task.h:71
const_iterator begin() const
The iterator returned can not safely be used across threads.
std::map< uint32_t, MonitorElement * > _cZDC_HAD_TM
Definition: ZDCQIE10Task.h:68
constexpr Section section() const
get the section
Definition: HcalZDCDetId.h:92
std::map< uint32_t, MonitorElement * > _cADC_EChannel
Definition: ZDCQIE10Task.h:51
std::map< uint32_t, MonitorElement * > _cfC_EChannel
Definition: ZDCQIE10Task.h:65
HLT enums.
std::map< uint32_t, MonitorElement * > _cTDC_EChannel
Definition: ZDCQIE10Task.h:66
edm::ESGetToken< HcalLongRecoParams, HcalLongRecoParamsRcd > paramsToken_
Definition: ZDCQIE10Task.h:45
constexpr int32_t channel() const
get the channel
Definition: HcalZDCDetId.h:112
constexpr int32_t zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:90
std::map< uint32_t, MonitorElement * > _cZDC_SUMS
Definition: ZDCQIE10Task.h:61
EtSumType
Definition: EtSum.h:27
Readout chain identification for Hcal.
edm::ESGetToken< HcalDbService, HcalDbRecord > hcalDbServiceToken_
Definition: ZDCQIE10Task.h:42
constexpr int samples() const
total number of samples in the digi
Definition: Run.h:45
uint16_t *__restrict__ uint16_t const *__restrict__ adc
ib
Definition: cuy.py:661