CMS 3D CMS Logo

L1TdeStage2CaloLayer2.cc
Go to the documentation of this file.
2 
4  : monitorDir(ps.getUntrackedParameter<std::string>("monitorDir", "")),
5  calol2JetCollectionData(consumes <l1t::JetBxCollection>(
6  ps.getParameter<edm::InputTag>(
7  "calol2JetCollectionData"))),
8  calol2JetCollectionEmul(consumes <l1t::JetBxCollection>(
9  ps.getParameter<edm::InputTag>(
10  "calol2JetCollectionEmul"))),
11  calol2EGammaCollectionData(consumes <l1t::EGammaBxCollection>(
12  ps.getParameter<edm::InputTag>(
13  "calol2EGammaCollectionData"))),
14  calol2EGammaCollectionEmul(consumes <l1t::EGammaBxCollection>(
15  ps.getParameter<edm::InputTag>(
16  "calol2EGammaCollectionEmul"))),
17  calol2TauCollectionData(consumes <l1t::TauBxCollection>(
18  ps.getParameter<edm::InputTag>(
19  "calol2TauCollectionData"))),
20  calol2TauCollectionEmul(consumes <l1t::TauBxCollection>(
21  ps.getParameter<edm::InputTag>(
22  "calol2TauCollectionEmul"))),
23  calol2EtSumCollectionData(consumes <l1t::EtSumBxCollection>(
24  ps.getParameter<edm::InputTag>(
25  "calol2EtSumCollectionData"))),
26  calol2EtSumCollectionEmul(consumes <l1t::EtSumBxCollection>(
27  ps.getParameter<edm::InputTag>(
28  "calol2EtSumCollectionEmul"))),
29  verbose(ps.getUntrackedParameter<bool> ("verbose", false)),
30  enable2DComp(ps.getUntrackedParameter<bool> ("enable2DComp", false)) // When true eta-phi comparison plots are also produced
31 {}
32 
34  DQMStore::IBooker &ibooker,
35  edm::Run const &,
36  edm::EventSetup const&) {
37 
38  // DQM directory to store histograms with problematic jets
39  ibooker.setCurrentFolder(monitorDir + "/Problematic Jets candidates");
40 
41  jetEtData = ibooker.book1D("Problematic Data Jet iEt", "Jet iE_{T}",
42  1400, 0, 1399);
43  jetEtaData = ibooker.book1D("Problematic Data Jet iEta", "Jet i#eta",
44  227, -113.5, 113.5);
45  jetPhiData = ibooker.book1D("Problematic Data Jet iPhi", "Jet i#phi",
46  288, -0.5, 143.5);
47  jetEtEmul = ibooker.book1D("Problematic Emul Jet iEt", "Jet iE_{T}",
48  1400, 0, 1399);
49  jetEtaEmul = ibooker.book1D("Problematic Emul Jet iEta", "Jet i#eta",
50  227, -113.5, 113.5);
51  jetPhiEmul = ibooker.book1D("Problematic Emul Jet iPhi", "Jet i#phi",
52  288, -0.5, 143.5);
53  //if enable2DComp is true book also 2D eta-phi plots
54  if(enable2DComp){
55  jet2DEtaPhiData = ibooker.book2D("Problematic Data Jet Eta - Phi","Jet #eta - #phi map",
56  50,-5.,5.,25,-3.2,3.2);
57  jet2DEtaPhiData->setAxisTitle("#eta", 1);
58  jet2DEtaPhiData->setAxisTitle("#phi", 2);
59 
60  jet2DEtaPhiEmul = ibooker.book2D("Problematic Emul Jet Eta - Phi","Jet #eta - #phi map",
61  50,-5.,5.,25,-3.2,3.2);
62  jet2DEtaPhiEmul->setAxisTitle("#eta", 1);
63  jet2DEtaPhiEmul->setAxisTitle("#phi", 2);
64  }
65 
66  // DQM directory to store histograms with problematic e/gs
67  ibooker.setCurrentFolder(monitorDir + "/Problematic EG candidates");
68 
69  egEtData = ibooker.book1D("Problematic Data Eg iEt", "Eg iE_{T}",
70  1400, 0, 1399);
71  egEtaData = ibooker.book1D("Problematic Data Eg iEta", "Eg i#eta",
72  227, -113.5, 113.5);
73  egPhiData = ibooker.book1D("Problematic Data Eg iPhi", "Eg i#phi",
74  288, -0.5, 143.5);
75  egEtEmul = ibooker.book1D("Problematic Emul Eg iEt", "Eg iE_{T}",
76  1400, 0, 1399);
77  egEtaEmul = ibooker.book1D("Problematic Emul Eg iEta", "Eg i#eta",
78  227, -113.5, 113.5);
79  egPhiEmul = ibooker.book1D("Problematic Emul Eg iPhi", "Eg i#phi",
80  288, -0.5, 143.5);
81  //if enable2DComp is true book also 2D eta-phi plots
82  if(enable2DComp){
83  eg2DEtaPhiData = ibooker.book2D("Problematic Data Eg Eta - Phi","Eg #eta - #phi map",
84  30,-3.,3.,25,-3.2,3.2);
85  eg2DEtaPhiData->setAxisTitle("#eta", 1);
86  eg2DEtaPhiData->setAxisTitle("#phi", 2);
87 
88  eg2DEtaPhiEmul = ibooker.book2D("Problematic Emul Eg Eta - Phi","Eg #eta - #phi map",
89  30,-3.,3.,25,-3.2,3.2);
90  eg2DEtaPhiEmul->setAxisTitle("#eta", 1);
91  eg2DEtaPhiEmul->setAxisTitle("#phi", 2);
92  }
93  isoEgEtData = ibooker.book1D("Problematic Isolated Data Eg iEt",
94  "Iso Eg iE_{T}", 1400, 0, 1399);
95  isoEgEtaData = ibooker.book1D("Problematic Isolated Data Eg iEta",
96  "Iso Eg i#eta", 227, -113.5, 113.5);
97  isoEgPhiData = ibooker.book1D("Problematic Isolated Data Eg iPhi",
98  "Iso Eg i#phi", 288, -0.5, 143.5);
99  isoEgEtEmul = ibooker.book1D("Problematic Isolated Emul Eg iEt",
100  "Iso Eg iE_{T}", 1400, 0, 1399);
101  isoEgEtaEmul = ibooker.book1D("Problematic Isolated Emul Eg iEta",
102  "Iso Eg i#eta", 227, -113.5, 113.5);
103  isoEgPhiEmul = ibooker.book1D("Problematic Isolated Emul Eg iPhi",
104  "Iso Eg i#phi", 288, -0.5, 143.5);
105  // enable2DComp is true book also 2D eta-phi plots
106  if(enable2DComp){
107  isoEg2DEtaPhiData = ibooker.book2D("Problematic Isolated Data Eg Eta - Phi","Iso Eg #eta - #phi map",
108  30,-3.,3.,25,-3.2,3.2);
109  isoEg2DEtaPhiData->setAxisTitle("#eta", 1);
110  isoEg2DEtaPhiData->setAxisTitle("#phi", 2);
111 
112  isoEg2DEtaPhiEmul = ibooker.book2D("Problematic Isolated Emul Eg Eta - Phi","Iso Eg #eta - #phi map",
113  30,-3.,3.,25,-3.2,3.2);
114  isoEg2DEtaPhiEmul->setAxisTitle("#eta", 1);
115  isoEg2DEtaPhiEmul->setAxisTitle("#phi", 2);
116  }
117  // DQM directory to store histograms with problematic taus
118  ibooker.setCurrentFolder(monitorDir + "/Problematic Tau candidates");
119 
120  tauEtData = ibooker.book1D("Problematic Data Tau iEt", "Tau iE_{T}",
121  1400, 0, 1399);
122  tauEtaData = ibooker.book1D("Problematic Data Tau iEta", "Tau i#eta",
123  227, -113.5, 113.5);
124  tauPhiData = ibooker.book1D("Problematic Data Tau iPhi", "Tau i#phi",
125  288, -0.5, 143.5);
126  tauEtEmul = ibooker.book1D("Problematic Emul Tau iEt", "Tau iE_{T}",
127  1400, 0, 1399);
128  tauEtaEmul = ibooker.book1D("Problematic Emul Tau iEta", "Tau i#eta",
129  227, -113.5, 113.5);
130  tauPhiEmul = ibooker.book1D("Problematic Emul Tau iPhi", "Tau i#phi",
131  288, -0.5, 143.5);
132  // enable2DComp is true book also 2D eta-phi plots
133  if(enable2DComp){
134  tau2DEtaPhiData = ibooker.book2D("Problematic Data Tau Eta - Phi","Tau #eta - #phi map",
135  30,-3.,3.,25,-3.2,3.2);
136  tau2DEtaPhiData->setAxisTitle("#eta", 1);
137  tau2DEtaPhiData->setAxisTitle("#phi", 2);
138 
139  tau2DEtaPhiEmul = ibooker.book2D("Problematic Emul Tau Eta - Phi","Tau #eta - #phi map",
140  30,-3.,3.,25,-3.2,3.2);
141  tau2DEtaPhiEmul->setAxisTitle("#eta", 1);
142  tau2DEtaPhiEmul->setAxisTitle("#phi", 2);
143  }
144  isoTauEtData = ibooker.book1D("Problematic Isolated Data Tau iEt",
145  "Iso Tau iE_{T}", 1400, 0, 1399);
146  isoTauEtaData = ibooker.book1D("Problematic Isolated Data Tau iEta",
147  "Iso Tau i#eta", 227, -113.5, 113.5);
148  isoTauPhiData = ibooker.book1D("Problematic Isolated Data Tau iPhi",
149  "Iso Tau i#phi", 288, -0.5, 143.5);
150  isoTauEtEmul = ibooker.book1D("Problematic Isolated Emul Tau iEt",
151  "Iso Tau iE_{T}", 1400, 0, 1399);
152  isoTauEtaEmul = ibooker.book1D("Problematic Isolated Emul Tau iEta",
153  "Iso Tau i#eta", 227, -113.5, 113.5);
154  isoTauPhiEmul = ibooker.book1D("Problematic Isolated Emul Tau iPhi",
155  "Iso Tau i#phi", 288, -0.5, 143.5);
156  // enable2DComp is true book also 2D eta-phi plots
157  if(enable2DComp){
158  isoTau2DEtaPhiData = ibooker.book2D("Problematic Isolated Data Tau Eta - Phi","Iso Tau #eta - #phi map",
159  30,-3.,3.,25,-3.2,3.2);
160  isoTau2DEtaPhiData->setAxisTitle("#eta", 1);
161  isoTau2DEtaPhiData->setAxisTitle("#phi", 2);
162 
163  isoTau2DEtaPhiEmul = ibooker.book2D("Problematic Isolated Emul Tau Eta - Phi","Iso Tau #eta - #phi map",
164  30,-3.,3.,25,-3.2,3.2);
165  isoTau2DEtaPhiEmul->setAxisTitle("#eta", 1);
166  isoTau2DEtaPhiEmul->setAxisTitle("#phi", 2);
167  }
168  // DQM directory to store histograms with problematic sums
169  ibooker.setCurrentFolder(monitorDir + "/Problematic Sums");
170 
171  // book ETT type sums
172  ettData = ibooker.book1D("Problematic ETT Sum - Data", "ETT iE_{T}",
173  7000, -0.5, 6999.5);
174  ettEmul = ibooker.book1D("Problematic ETT Sum - Emulator", "ETT iE_{T}",
175  7000, -0.5, 6999.5);
176  ettHFData = ibooker.book1D("Problematic ETTHF Sum - Data", "ETTHF iE_{T}",
177  7000, -0.5, 6999.5);
178  ettHFEmul = ibooker.book1D("Problematic ETTHF Sum - Emulator", "ETTHF iE_{T}",
179  7000, -0.5, 6999.5);
180  ettEmData = ibooker.book1D("Problematic ETTEM Sum - Data", "ETTEM iE_{T}",
181  7000, -0.5, 6999.5);
182  ettEmEmul = ibooker.book1D("Problematic ETTEM Sum - Emulator", "ETTEM iE_{T}",
183  7000, -0.5, 6999.5);
184 
185  // book HTT type sums
186  httData = ibooker.book1D("Problematic HTT Sum - Data", "HTT iE_{T}",
187  7000, -0.5, 6999.5);
188  httEmul = ibooker.book1D("Problematic HTT Sum - Emulator", "HTT iE_{T}",
189  7000, -0.5, 6999.5);
190  httHFData = ibooker.book1D("Problematic HTTHF Sum - Data", "HTTHF iE_{T}",
191  7000, -0.5, 6999.5);
192  httHFEmul = ibooker.book1D("Problematic HTTHF Sum - Emulator", "HTTHF iE_{T}",
193  7000, -0.5, 6999.5);
194 
195  // book MET type sums
196  metEtData = ibooker.book1D("Problematic MET Sum Et - Data", "MET iE_{T}",
197  7000, -0.5, 6999.5);
198  metEtEmul = ibooker.book1D("Problematic MET Sum Et - Emulator", "MET iE_{T}",
199  7000, -0.5, 6999.5);
200  metPhiData = ibooker.book1D("Problematic MET Sum phi - Data", "MET i#phi",
201  1008, -0.5, 1007.5);
202  metPhiEmul = ibooker.book1D("Problematic MET Sum phi - Emulator", "MET i#phi",
203  1008, -0.5, 1007.5);
204 
205  metHFEtData = ibooker.book1D("Problematic METHF Sum Et - Data",
206  "METHF iE_{T}", 7000, -0.5, 6999.5);
207  metHFEtEmul = ibooker.book1D("Problematic METHF Sum Et - Emulator",
208  "METHF iE_{T}", 7000, -0.5, 6999.5);
209  metHFPhiData = ibooker.book1D("Problematic METHF Sum phi - Data",
210  "METHF i#phi", 1008, -0.5, 1007.5);
211  metHFPhiEmul = ibooker.book1D("Problematic METHF Sum phi - Emulator",
212  "METHF i#phi", 1008, -0.5, 1007.5);
213 
214  // book MHT type sums
215  mhtEtData = ibooker.book1D("Problematic MHT Sum Et - Data", "MHT iE_{T}",
216  7000, -0.5, 6999.5);
217  mhtEtEmul = ibooker.book1D("Problematic MHT Sum Et - Emulator", "MHT iE_{T}",
218  7000, -0.5, 6999.5);
219  mhtPhiData = ibooker.book1D("Problematic MHT Sum phi - Data", "MHT i#phi",
220  1008, -0.5, 1007.5);
221  mhtPhiEmul = ibooker.book1D("Problematic MHT Sum phi - Emulator", "MHT i#phi",
222  1008, -0.5, 1007.5);
223 
224  mhtHFEtData = ibooker.book1D("Problematic MHTHF Sum Et - Data",
225  "MHTHF iE_{T}", 7000, -0.5, 6999.5);
226  mhtHFEtEmul = ibooker.book1D("Problematic MHTHF Sum Et - Emulator",
227  "MHTHF iE_{T}", 7000, -0.5, 6999.5);
228  mhtHFPhiData = ibooker.book1D("Problematic MHTHF Sum phi - Data",
229  "MHTHF i#phi", 1008, -0.5, 1007.5);
230  mhtHFPhiEmul = ibooker.book1D("Problematic MHTHF Sum phi - Emulator",
231  "MHTHF i#phi", 1008, -0.5, 1007.5);
232 
233  // book minimum bias sums
234  mbhfp0Data = ibooker.book1D("Problematic MBHFP0 Sum - Data",
235  "", 16, -0.5, 15.5);
236  mbhfp0Emul = ibooker.book1D("Problematic MBHFP0 Sum - Emulator",
237  "", 16, -0.5, 15.5);
238  mbhfm0Data = ibooker.book1D("Problematic MBHFM0 Sum - Data",
239  "", 16, -0.5, 15.5);
240  mbhfm0Emul = ibooker.book1D("Problematic MBHFM0 Sum - Emulator",
241  "", 16, -0.5, 15.5);
242  mbhfm1Data = ibooker.book1D("Problematic MBHFM1 Sum - Data",
243  "", 16, -0.5, 15.5);
244  mbhfm1Emul = ibooker.book1D("Problematic MBHFM1 Sum - Emulator",
245  "", 16, -0.5, 15.5);
246  mbhfp1Data = ibooker.book1D("Problematic MBHFP1 Sum - Data",
247  "", 16, -0.5, 15.5);
248  mbhfp1Emul = ibooker.book1D("Problematic MBHFP1 Sum - Emulator",
249  "", 16, -0.5, 15.5);
250 
251  // book tower count sums
252  towCountData = ibooker.book1D("Problematic Tower Count Sum - Data",
253  "", 5904, -0.5, 5903.5);
254  towCountEmul = ibooker.book1D("Problematic Tower Count Sum - Emulator",
255  "", 5904, -0.5, 5903.5);
256  // for reference on arguments of book2D, see
257  // https://cmssdt.cern.ch/SDT/doxygen/CMSSW_8_0_24/doc/html/df/d26/DQMStore_8cc_source.html#l01070
258 
259  // book asymmetry count
260 
261  asymCountData = ibooker.book1D("Problematic Asymmetry Count - Data",
262  "", 256, -0.5, 255.5);
263  asymCountEmul = ibooker.book1D("Problematic Asymmetry Count - Emulator",
264  "", 256, -0.5, 255.5);
265 
266  // book centrality sums
267 
268  centrCountData = ibooker.book1D("Problematic Centrality Count - Data",
269  "", 9, -1.5, 7.5);
270  centrCountEmul = ibooker.book1D("Problematic Centrality Count - Emulator",
271  "", 9, -1.5, 7.5);
272 
273 
274 
275 
276  // setup the directory where the histograms are to be visualised, value is set
277  // in constructor and taken from python configuration file for module
278  ibooker.setCurrentFolder(monitorDir + "/expert");
279 
280 
281  // Jet energy in MP firmware is stored in 16 bits which sets the range of
282  // jet energy to 2^16 * 0.5 GeV = 32768 GeV (65536 hardware units)
283  // --- this is only for MP jets, the demux jets have much decreased precision
284  // --- and this should be replaced
285 
286  // the index of the first bin in histogram should match value of first enum
287  agreementSummary = ibooker.book1D(
288  "CaloL2 Object Agreement Summary",
289  "CaloL2 event-by-event object agreement fractions", 10, 1, 11);
290 
291  agreementSummary->setBinLabel(EVENTGOOD, "good events");
292  agreementSummary->setBinLabel(NEVENTS, "total events");
293  agreementSummary->setBinLabel(NJETS_S, "total jets");
294  agreementSummary->setBinLabel(JETGOOD_S, "good jets");
295  agreementSummary->setBinLabel(NEGS_S, "total e/gs");
296  agreementSummary->setBinLabel(EGGOOD_S, "good e/gs");
297  agreementSummary->setBinLabel(NTAUS_S, "total taus");
298  agreementSummary->setBinLabel(TAUGOOD_S, "good taus");
299  agreementSummary->setBinLabel(NSUMS_S, "total sums");
300  agreementSummary->setBinLabel(SUMGOOD_S, "good sums");
301 
302  jetSummary = ibooker.book1D(
303  "Jet Agreement Summary", "Jet Agreement Summary", 4, 1, 5);
304  jetSummary->setBinLabel(NJETS, "total jets");
305  jetSummary->setBinLabel(JETGOOD, "good jets");
306  jetSummary->setBinLabel(JETPOSOFF, "jets pos off only");
307  jetSummary->setBinLabel(JETETOFF, "jets Et off only ");
308 
309  egSummary = ibooker.book1D(
310  "EG Agreement Summary", "EG Agreement Summary", 8, 1, 9);
311  egSummary->setBinLabel(NEGS, "total non-iso e/gs");
312  egSummary->setBinLabel(EGGOOD, "good non-iso e/gs");
313  egSummary->setBinLabel(EGPOSOFF, "non-iso e/gs pos off");
314  egSummary->setBinLabel(EGETOFF, "non-iso e/gs Et off");
315  egSummary->setBinLabel(NISOEGS, "total iso e/gs");
316  egSummary->setBinLabel(ISOEGGOOD, "good iso e/gs");
317  egSummary->setBinLabel(ISOEGPOSOFF, "iso e/gs pos off");
318  egSummary->setBinLabel(ISOEGETOFF, "iso e/gs Et off");
319 
320  tauSummary = ibooker.book1D(
321  "Tau Agreement Summary", "Tau Agreement Summary", 8, 1, 9);
322  tauSummary->setBinLabel(NTAUS, "total taus");
323  tauSummary->setBinLabel(TAUGOOD, "good non-iso taus");
324  tauSummary->setBinLabel(TAUPOSOFF, "non-iso taus pos off");
325  tauSummary->setBinLabel(TAUETOFF, "non-iso taus Et off");
326  tauSummary->setBinLabel(NISOTAUS, "total iso taus");
327  tauSummary->setBinLabel(ISOTAUGOOD, "good iso taus");
328  tauSummary->setBinLabel(ISOTAUPOSOFF, "iso taus pos off");
329  tauSummary->setBinLabel(ISOTAUETOFF, "iso taus Et off");
330 
331  sumSummary = ibooker.book1D(
332  "Energy Sum Agreement Summary", "Sum Agreement Summary", 18, 1, 19);
333  sumSummary->setBinLabel(NSUMS, "total sums");
334  sumSummary->setBinLabel(SUMGOOD, "good sums");
335  sumSummary->setBinLabel(NETTSUMS, "total ETT sums");
336  sumSummary->setBinLabel(ETTSUMGOOD, "good ETT sums");
337  sumSummary->setBinLabel(NHTTSUMS, "total HTT sums");
338  sumSummary->setBinLabel(HTTSUMGOOD, "good HTT sums");
339  sumSummary->setBinLabel(NMETSUMS, "total MET sums");
340  sumSummary->setBinLabel(METSUMGOOD, "good MET sums");
341  sumSummary->setBinLabel(NMHTSUMS, "total MHT sums");
342  sumSummary->setBinLabel(MHTSUMGOOD, "good MHT sums");
343  sumSummary->setBinLabel(NMBHFSUMS, "total MBHF sums");
344  sumSummary->setBinLabel(MBHFSUMGOOD, "good MBHF sums");
345  sumSummary->setBinLabel(NTOWCOUNTS, "total TowCount sums");
346  sumSummary->setBinLabel(TOWCOUNTGOOD, "good TowCount sums");
347  sumSummary->setBinLabel(NASYMCOUNTS, "total AsymCount sums");
348  sumSummary->setBinLabel(ASYMCOUNTGOOD, "good AsymCount sums");
349  sumSummary->setBinLabel(NCENTRCOUNTS, "total CentrCount sums");
350  sumSummary->setBinLabel(CENTRCOUNTGOOD, "good CentrCount sums");
351 
352 
353  // high level directory
354  ibooker.setCurrentFolder(monitorDir);
355 
356  problemSummary = ibooker.book1D(
357  "Problem Summary", "Problematic Event Summary", 8, 1, 9);
358  problemSummary->setBinLabel(NEVENTS_P, "total events");
359  problemSummary->setBinLabel(JETCOLLSIZE, "jet collection size");
360  problemSummary->setBinLabel(EGCOLLSIZE, "eg collection size");
361  problemSummary->setBinLabel(TAUCOLLSIZE, "tau collection size");
362  problemSummary->setBinLabel(JETMISMATCH, "jet mismatch");
363  problemSummary->setBinLabel(EGMISMATCH, "eg mismatch");
364  problemSummary->setBinLabel(TAUMISMATCH, "tau mismatch");
365  problemSummary->setBinLabel(SUMMISMATCH, "sum mismatch");
366 }
368  const edm::Event& e,
369  const edm::EventSetup & c) {
370 
371  if (verbose)
372  edm::LogInfo("L1TdeStage2CaloLayer2") << "L1TdeStage2CaloLayer2: analyse "
373  << std::endl;
374 
375  // define collections to hold lists of objects in event
384 
385  // map event contents to above collections
386  e.getByToken(calol2JetCollectionData, jetDataCol);
387  e.getByToken(calol2JetCollectionEmul, jetEmulCol);
390  e.getByToken(calol2TauCollectionData, tauDataCol);
391  e.getByToken(calol2TauCollectionEmul, tauEmulCol);
392  e.getByToken(calol2EtSumCollectionData, sumDataCol);
393  e.getByToken(calol2EtSumCollectionEmul, sumEmulCol);
394 
395  bool eventGood = true;
396 
397  // we assume that the first and last bx of the emulator data is 0 since it is
398  // very unlikely to have received RAW data from more than just the triggered
399  // bx
400 
419  if (!compareJets(jetDataCol, jetEmulCol)) {
420  if (verbose)
421  edm::LogInfo("L1TdeStage2CaloLayer2") << "l1t calol2 dqm: jet problem "
422  << std::endl;
424  eventGood = false;
425  }
426 
427  if (!compareEGs(egDataCol, egEmulCol)) {
428  if (verbose)
429  edm::LogInfo("L1TdeStage2CaloLayer2") << "l1t calol2 dqm: eg problem "
430  << std::endl;
432  eventGood = false;
433  }
434 
435  if (!compareTaus(tauDataCol, tauEmulCol)) {
436  if (verbose)
437  edm::LogInfo("L1TdeStage2CaloLayer2") << "l1t calol2 dqm: tau problem "
438  << std::endl;
440  eventGood = false;
441  }
442 
443  if (!compareSums(sumDataCol, sumEmulCol)) {
444  if (verbose)
445  edm::LogInfo("L1TdeStage2CaloLayer2") << "l1t calol2 dqm: sum problem "
446  << std::endl;
448  eventGood = false;
449  }
450 
457  if (eventGood) {
459  }
460 
463 }
464 
465 // comparison method for jets
467  const edm::Handle<l1t::JetBxCollection> & dataCol,
468  const edm::Handle<l1t::JetBxCollection> & emulCol)
469 {
470  bool eventGood = true;
471 
474 
475  // process jets
476  if (dataCol->size(currBx) != emulCol->size(currBx)) {
477 
478  if (dataCol->size(currBx) < emulCol->size(currBx)) {
479 
480  // if only the data collection is empty, declare event as bad
481  if (dataCol->isEmpty(currBx)) return false;
482 
483  while (true) {
484  jetEtData->Fill(dataIt->hwPt());
485  jetEtaData->Fill(dataIt->hwEta());
486  jetPhiData->Fill(dataIt->hwPhi());
487  if(enable2DComp) jet2DEtaPhiData->Fill(dataIt->eta(), dataIt->phi());
488 
489  ++dataIt;
490 
491  if (dataIt == dataCol->end(currBx))
492  break;
493  }
494  } else {
495 
496  // if only the emul collection is empty, declare event as bad
497  if (emulCol->isEmpty(currBx)) return false;
498 
499  while (true) {
500 
501  jetEtEmul->Fill(emulIt->hwPt());
502  jetEtaEmul->Fill(emulIt->hwEta());
503  jetPhiEmul->Fill(emulIt->hwPhi());
504  if(enable2DComp) jet2DEtaPhiEmul->Fill(emulIt->eta(), emulIt->phi());
505 
506  ++emulIt;
507 
508  if (emulIt == emulCol->end(currBx))
509  break;
510  }
511 
512  }
513 
515  return false;
516  }
517 
518  int nJets = 0;
519  if (dataIt != dataCol->end(currBx) ||
520  emulIt != emulCol->end(currBx)) {
521  while(true) {
522 
523  ++nJets;
524 
525  bool posGood = true;
526  bool etGood = true;
527 
528  // object pt mismatch
529  if (dataIt->hwPt() != emulIt->hwPt()) {
530  etGood = false;
531  eventGood = false;
532  }
533 
534  // object position mismatch (phi)
535  if (dataIt->hwPhi() != emulIt->hwPhi()){
536  posGood = false;
537  eventGood = false;
538 
539  }
540 
541  // object position mismatch (eta)
542  if (dataIt->hwEta() != emulIt->hwEta()) {
543  posGood = false;
544  eventGood = false;
545  }
546 
547  // if both position and energy agree, jet is good
548  if (etGood && posGood) {
551  } else {
552  jetEtData->Fill(dataIt->hwPt());
553  jetEtaData->Fill(dataIt->hwEta());
554  jetPhiData->Fill(dataIt->hwPhi());
555  if(enable2DComp) jet2DEtaPhiData->Fill(dataIt->eta(), dataIt->phi());
556 
557  jetEtEmul->Fill(emulIt->hwPt());
558  jetEtaEmul->Fill(emulIt->hwEta());
559  jetPhiEmul->Fill(emulIt->hwPhi());
560  if(enable2DComp) jet2DEtaPhiEmul->Fill(emulIt->eta(), emulIt->phi());
561 
562  if (verbose) {
563  edm::LogInfo("L1TdeStage2CaloLayer2") << "--- jet ---"<< std::endl;
564  edm::LogInfo("L1TdeStage2CaloLayer2") << "data jet Et = "
565  << dataIt->hwPt() << std::endl;
566  edm::LogInfo("L1TdeStage2CaloLayer2") << "emul jet Et = "
567  << emulIt->hwPt() << std::endl;
568  edm::LogInfo("L1TdeStage2CaloLayer2") << "data jet phi = "
569  << dataIt->hwPhi() << std::endl;
570  edm::LogInfo("L1TdeStage2CaloLayer2") << "emul jet phi = "
571  << emulIt->hwPhi() << std::endl;
572  edm::LogInfo("L1TdeStage2CaloLayer2") << "data jet eta = "
573  << dataIt->hwEta() << std::endl;
574  edm::LogInfo("L1TdeStage2CaloLayer2") << "emul jet eta = "
575  << emulIt->hwEta() << std::endl;
576  edm::LogInfo("L1TdeStage2CaloLayer2") << "---"<< std::endl;
577  }
578  }
579 
580  // if only position agrees
581  if (posGood && !etGood) {
583  }
584 
585  // if only energy agrees
586  if (!posGood && etGood) {
588  }
589 
590  // keep track of jets
593 
594  // increment position of pointers
595  ++dataIt;
596  ++emulIt;
597 
598  if (dataIt == dataCol->end(currBx) ||
599  emulIt == emulCol->end(currBx))
600  break;
601  }
602  } else {
603  if (dataCol->size(currBx) != 0 || emulCol->size(currBx) != 0)
604  return false;
605  }
606 
607  // return a boolean that states whether the jet data in the event is in
608  // agreement
609  return eventGood;
610 }
611 
612 // comparison method for e/gammas
614  const edm::Handle<l1t::EGammaBxCollection> & dataCol,
615  const edm::Handle<l1t::EGammaBxCollection> & emulCol)
616 {
617  bool eventGood = true;
618 
621 
622  // check length of collections
623  if (dataCol->size(currBx) != emulCol->size(currBx)) {
624 
625  if (dataCol->size(currBx) < emulCol->size(currBx)) {
626 
627  // if only the data collection is empty, declare event as bad
628  if (dataCol->isEmpty(currBx)) return false;
629 
630  // if there are more events in data loop over the data collection
631  while (true) {
632  if (dataIt->hwIso()) {
633  isoEgEtData->Fill(dataIt->hwPt());
634  isoEgEtaData->Fill(dataIt->hwEta());
635  isoEgPhiData->Fill(dataIt->hwPhi());
636  if(enable2DComp) isoEg2DEtaPhiData->Fill(dataIt->eta(), dataIt->phi());
637  } else {
638  egEtData->Fill(dataIt->hwPt());
639  egEtaData->Fill(dataIt->hwEta());
640  egPhiData->Fill(dataIt->hwPhi());
641  if(enable2DComp) eg2DEtaPhiData->Fill(dataIt->eta(), dataIt->phi());
642  }
643 
644  ++dataIt;
645 
646  if (dataIt == dataCol->end(currBx))
647  break;
648  }
649  } else {
650 
651  // if only the emul collection is empty, declare event as bad
652  if (emulCol->isEmpty(currBx)) return false;
653 
654  while (true) {
655  if(emulIt->hwIso()) {
656  isoEgEtEmul->Fill(emulIt->hwPt());
657  isoEgEtaEmul->Fill(emulIt->hwEta());
658  isoEgPhiEmul->Fill(emulIt->hwPhi());
659  if(enable2DComp) isoEg2DEtaPhiEmul->Fill(emulIt->eta(), emulIt->phi());
660  } else {
661  egEtEmul->Fill(emulIt->hwPt());
662  egEtaEmul->Fill(emulIt->hwEta());
663  egPhiEmul->Fill(emulIt->hwPhi());
664  if(enable2DComp) eg2DEtaPhiEmul->Fill(emulIt->eta(), emulIt->phi());
665  }
666 
667  ++emulIt;
668 
669  if (emulIt == emulCol->end(currBx))
670  break;
671  }
672  }
673 
675  return false;
676  }
677 
678  // processing continues only of length of data collections is the same
679  if (dataIt != dataCol->end(currBx) ||
680  emulIt != emulCol->end(currBx)) {
681 
682  while(true) {
683 
684  bool posGood = true;
685  bool etGood = true;
686  bool iso = dataIt->hwIso();
687 
688  // object pt mismatch
689  if (dataIt->hwPt() != emulIt->hwPt()) {
690  etGood = false;
691  eventGood = false;
692  }
693 
694  // object position mismatch (phi)
695  if (dataIt->hwPhi() != emulIt->hwPhi()) {
696  posGood = false;
697  eventGood = false;
698  }
699 
700  // object position mismatch (eta)
701  if (dataIt->hwEta() != emulIt->hwEta()) {
702  posGood = false;
703  eventGood = false;
704  }
705 
706  // if both position and energy agree, object is good
707  if (posGood && etGood) {
709 
710  if (iso) {
712  } else {
714  }
715 
716  } else {
717 
718  if (iso) {
719  isoEgEtData->Fill(dataIt->hwPt());
720  isoEgEtaData->Fill(dataIt->hwEta());
721  isoEgPhiData->Fill(dataIt->hwPhi());
722  if(enable2DComp) isoEg2DEtaPhiData->Fill(dataIt->eta(), dataIt->phi());
723 
724  isoEgEtEmul->Fill(emulIt->hwPt());
725  isoEgEtaEmul->Fill(emulIt->hwEta());
726  isoEgPhiEmul->Fill(emulIt->hwPhi());
727  if(enable2DComp) isoEg2DEtaPhiEmul->Fill(emulIt->eta(), emulIt->phi());
728  } else {
729  egEtData->Fill(dataIt->hwPt());
730  egEtaData->Fill(dataIt->hwEta());
731  egPhiData->Fill(dataIt->hwPhi());
732  if(enable2DComp) eg2DEtaPhiData->Fill(dataIt->eta(), dataIt->phi());
733 
734  egEtEmul->Fill(emulIt->hwPt());
735  egEtaEmul->Fill(emulIt->hwEta());
736  egPhiEmul->Fill(emulIt->hwPhi());
737  if(enable2DComp) eg2DEtaPhiEmul->Fill(emulIt->eta(), emulIt->phi());
738  }
739 
740  if (verbose) {
741  edm::LogInfo("L1TdeStage2CaloLayer2") << "--- eg ---"<< std::endl;
742  edm::LogInfo("L1TdeStage2CaloLayer2") << "data eg Et = "
743  << dataIt->hwPt() << std::endl;
744  edm::LogInfo("L1TdeStage2CaloLayer2") << "emul eg Et = "
745  << emulIt->hwPt() << std::endl;
746  edm::LogInfo("L1TdeStage2CaloLayer2") << "data eg phi = "
747  << dataIt->hwPhi() << std::endl;
748  edm::LogInfo("L1TdeStage2CaloLayer2") << "emul eg phi = "
749  << emulIt->hwPhi() << std::endl;
750  edm::LogInfo("L1TdeStage2CaloLayer2") << "data eg eta = "
751  << dataIt->hwEta() << std::endl;
752  edm::LogInfo("L1TdeStage2CaloLayer2") << "emul eg eta = "
753  << emulIt->hwEta() << std::endl;
754  edm::LogInfo("L1TdeStage2CaloLayer2") << "---"<< std::endl;
755  }
756  }
757 
758  // if only position agrees
759  if (posGood && !etGood) {
760  if (iso) {
762  } else {
764  }
765  }
766 
767  // if only energy agrees
768  if (!posGood && etGood) {
769  if (iso) {
771  } else {
773  }
774  }
775 
776  // keep track of number of objects
777  if (iso) {
779  } else {
780  egSummary->Fill(NEGS);
781  }
783 
784  // increment position of pointers
785  ++dataIt;
786  ++emulIt;
787 
788  if (dataIt == dataCol->end(currBx) ||
789  emulIt == emulCol->end(currBx))
790  break;
791  }
792  } else {
793  if (dataCol->size(currBx) != 0 || emulCol->size(currBx) != 0)
794  return false;
795  }
796 
797  // return a boolean that states whether the jet data in the event is in
798  // agreement
799  return eventGood;
800 }
801 
802 // comparison method for taus
804  const edm::Handle<l1t::TauBxCollection> & dataCol,
805  const edm::Handle<l1t::TauBxCollection> & emulCol)
806 {
807  bool eventGood = true;
808 
811 
812  // check length of collections
813  if (dataCol->size(currBx) != emulCol->size(currBx)) {
814 
815  if (dataCol->size(currBx) < emulCol->size(currBx)) {
816 
817  // if only the data collection is empty, declare event as bad
818  if (dataCol->isEmpty(currBx)) return false;
819 
820  // if there are more events in data loop over the data collection
821  while (true) {
822 
823  // Populate different set of histograms if object is solated
824 
825  if (dataIt->hwIso()) {
826  isoTauEtData->Fill(dataIt->hwPt());
827  isoTauEtaData->Fill(dataIt->hwEta());
828  isoTauPhiData->Fill(dataIt->hwPhi());
829  if(enable2DComp) isoTau2DEtaPhiData->Fill(dataIt->eta(), dataIt->phi());
830  } else {
831  tauEtData->Fill(dataIt->hwPt());
832  tauEtaData->Fill(dataIt->hwEta());
833  tauPhiData->Fill(dataIt->hwPhi());
834  if(enable2DComp) tau2DEtaPhiData->Fill(dataIt->eta(), dataIt->phi());
835  }
836 
837  ++dataIt;
838 
839  if (dataIt == dataCol->end(currBx))
840  break;
841  }
842  } else {
843 
844  // if only the emul collection is bad, declare the event as bad
845  if (emulCol->isEmpty(currBx)) return false;
846 
847  while (true) {
848 
849  // Populate different set of histograms if object is solated
850 
851  if(emulIt->hwIso()) {
852  isoTauEtEmul->Fill(emulIt->hwPt());
853  isoTauEtaEmul->Fill(emulIt->hwEta());
854  isoTauPhiEmul->Fill(emulIt->hwPhi());
855  if(enable2DComp) isoTau2DEtaPhiEmul->Fill(emulIt->eta(), emulIt->phi());
856 
857  } else {
858  tauEtEmul->Fill(emulIt->hwPt());
859  tauEtaEmul->Fill(emulIt->hwEta());
860  tauPhiEmul->Fill(emulIt->hwPhi());
861  if(enable2DComp) tau2DEtaPhiEmul->Fill(emulIt->eta(), emulIt->phi());
862  }
863 
864  ++emulIt;
865 
866  if (emulIt == emulCol->end(currBx))
867  break;
868  }
869  }
870 
872  return false;
873  }
874 
875  // processing continues only of length of data collections is the same
876  if (dataIt != dataCol->end(currBx) ||
877  emulIt != emulCol->end(currBx)) {
878 
879  while(true) {
880 
881  bool posGood = true;
882  bool etGood = true;
883  bool iso = dataIt->hwIso();
884 
885  // object Et mismatch
886  if (dataIt->hwPt() != emulIt->hwPt()) {
887  etGood = false;
888  eventGood = false;
889  }
890 
891  // object position mismatch (phi)
892  if (dataIt->hwPhi() != emulIt->hwPhi()) {
893  posGood = false;
894  eventGood = false;
895  }
896 
897  // object position mismatch (eta)
898  if (dataIt->hwEta() != emulIt->hwEta()) {
899  posGood = false;
900  eventGood = false;
901  }
902 
903  // if both position and energy agree, object is good
904  if (posGood && etGood) {
906 
907  if (iso) {
909  } else {
911  }
912  } else {
913 
914  if (iso) {
915  isoTauEtData->Fill(dataIt->hwPt());
916  isoTauEtaData->Fill(dataIt->hwEta());
917  isoTauPhiData->Fill(dataIt->hwPhi());
918  if(enable2DComp) isoTau2DEtaPhiData->Fill(dataIt->eta(), dataIt->phi());
919 
920  isoTauEtEmul->Fill(emulIt->hwPt());
921  isoTauEtaEmul->Fill(emulIt->hwEta());
922  isoTauPhiEmul->Fill(emulIt->hwPhi());
923  if(enable2DComp) isoTau2DEtaPhiEmul->Fill(emulIt->eta(), emulIt->phi());
924 
925  } else {
926  tauEtData->Fill(dataIt->hwPt());
927  tauEtaData->Fill(dataIt->hwEta());
928  tauPhiData->Fill(dataIt->hwPhi());
929  if(enable2DComp) tau2DEtaPhiData->Fill(dataIt->eta(), dataIt->phi());
930 
931  tauEtEmul->Fill(emulIt->hwPt());
932  tauEtaEmul->Fill(emulIt->hwEta());
933  tauPhiEmul->Fill(emulIt->hwPhi());
934  if(enable2DComp) tau2DEtaPhiEmul->Fill(emulIt->eta(), emulIt->phi());
935  }
936 
937  if (verbose) {
938  edm::LogInfo("L1TdeStage2CaloLayer2") << "--- tau ---"<< std::endl;
939  edm::LogInfo("L1TdeStage2CaloLayer2") << "data tau Et = "
940  << dataIt->hwPt() << std::endl;
941  edm::LogInfo("L1TdeStage2CaloLayer2") << "emul tau Et = "
942  << emulIt->hwPt() << std::endl;
943  edm::LogInfo("L1TdeStage2CaloLayer2") << "data tau phi = "
944  << dataIt->hwPhi() << std::endl;
945  edm::LogInfo("L1TdeStage2CaloLayer2") << "emul tau phi = "
946  << emulIt->hwPhi() << std::endl;
947  edm::LogInfo("L1TdeStage2CaloLayer2") << "data tau eta = "
948  << dataIt->hwEta() << std::endl;
949  edm::LogInfo("L1TdeStage2CaloLayer2") << "emul tau eta = "
950  << emulIt->hwEta() << std::endl;
951  edm::LogInfo("L1TdeStage2CaloLayer2") << "---"<< std::endl;
952  }
953  }
954 
955  // if only position agrees
956  if (posGood && !etGood) {
957  if (iso) {
959  } else {
961  }
962  }
963 
964  // if only energy agrees
965  if (!posGood && etGood) {
966  if (iso) {
968  } else {
970  }
971  }
972 
973  // keep track of number of objects
974  if (iso) {
976  } else {
978  }
979 
981 
982  // increment position of pointers
983  ++dataIt;
984  ++emulIt;
985 
986  if (dataIt == dataCol->end(currBx) ||
987  emulIt == emulCol->end(currBx))
988  break;
989  }
990  } else {
991  if (dataCol->size(currBx) != 0 || emulCol->size(currBx) != 0)
992  return false;
993  }
994 
995  // return a boolean that states whether the jet data in the event is in
996  // agreement
997  return eventGood;
998 }
999 
1000 // comparison method for sums
1002  const edm::Handle<l1t::EtSumBxCollection> & dataCol,
1003  const edm::Handle<l1t::EtSumBxCollection> & emulCol)
1004 {
1005  bool eventGood = true;
1006 
1007  bool etGood = true;
1008  bool phiGood = true;
1009 
1010  double dataEt = 0;
1011  double emulEt = 0;
1012  double dataPhi = 0;
1013  double emulPhi = 0;
1014  int dataCentr = 0;
1015  int emulCentr = 0;
1016 
1019 
1020  // if either data or emulator collections are empty mark the event as bad (this should never occur in normal running)
1021  // matching data/emul collections by type before proceeding with the checks
1022  if (dataCol->isEmpty(currBx) || emulCol->isEmpty(currBx))
1023  return false;
1024 
1025  while(true) {
1026  dataIt = dataCol->begin(currBx);
1027  while(true) {
1028  if (dataIt->getType()==emulIt->getType()){
1029  // It should be possible to implement this with a switch statement
1030  etGood = true;
1031  phiGood = true;
1032  // ETT
1033  if (l1t::EtSum::EtSumType::kTotalEt == dataIt->getType()) {
1034 
1035  dataEt = dataIt->hwPt();
1036  emulEt = emulIt->hwPt();
1037 
1038  if (dataEt != emulEt) {
1039  eventGood = false;
1040 
1041  ettData->Fill(dataEt);
1042  ettEmul->Fill(emulEt);
1043  } else {
1047  }
1048 
1049  if (verbose) {
1050  edm::LogInfo("L1TdeStage2CaloLayer2") << "ETT | ";
1051  if (dataEt != emulEt)
1052  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1053  else
1054  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1055  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1056  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1057  }
1058 
1059  // update sum counters
1062  sumSummary->Fill(NSUMS);
1063  }
1064 
1065  // ETTEM
1066  if (l1t::EtSum::EtSumType::kTotalEtEm == dataIt->getType()) {
1067 
1068  dataEt = dataIt->hwPt();
1069  emulEt = emulIt->hwPt();
1070 
1071  if (dataEt != emulEt) {
1072  eventGood = false;
1073  ettEmData->Fill(dataEt);
1074  ettEmEmul->Fill(emulEt);
1075 
1076  } else {
1080  }
1081 
1082  if (verbose) {
1083  edm::LogInfo("L1TdeStage2CaloLayer2") << "ETTEM | ";
1084  if (dataEt != emulEt)
1085  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1086  else
1087  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1088  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1089  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1090  }
1091 
1092  // update sum counters
1095  sumSummary->Fill(NSUMS);
1096  }
1097 
1098  // HTT
1099  if (l1t::EtSum::EtSumType::kTotalHt == dataIt->getType()) {
1100 
1101  dataEt = dataIt->hwPt();
1102  emulEt = emulIt->hwPt();
1103 
1104  if (dataEt != emulEt) {
1105  eventGood = false;
1106  httData->Fill(dataEt);
1107  httEmul->Fill(emulEt);
1108  } else {
1112  }
1113 
1114  if (verbose) {
1115  edm::LogInfo("L1TdeStage2CaloLayer2") << "HTT | ";
1116  if (dataEt != emulEt)
1117  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1118  else
1119  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1120  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1121  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1122  }
1123 
1124  // update sum counters
1127  sumSummary->Fill(NSUMS);
1128  }
1129 
1130  // MET
1131  if (l1t::EtSum::EtSumType::kMissingEt == dataIt->getType()
1132  && dataIt->hwPt() != 0) {
1133 
1134  dataEt = dataIt->hwPt();
1135  emulEt = emulIt->hwPt();
1136 
1137  dataPhi = dataIt->hwPhi();
1138  emulPhi = emulIt->hwPhi();
1139 
1140  if (dataEt != emulEt) {
1141  etGood = false;
1142  eventGood = false;
1143  }
1144 
1145  if (dataPhi != emulPhi) {
1146  phiGood = false;
1147  eventGood = false;
1148  }
1149 
1150  if (etGood && phiGood) {
1154  } else {
1155  metEtData->Fill(dataEt);
1156  metPhiData->Fill(dataPhi);
1157  metEtEmul->Fill(emulEt);
1158  metPhiEmul->Fill(emulPhi);
1159  }
1160 
1161  if (verbose) {
1162  edm::LogInfo("L1TdeStage2CaloLayer2") << "MET | ";
1163  if (dataEt != emulEt)
1164  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1165  else
1166  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1167  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1168  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1169 
1170  edm::LogInfo("L1TdeStage2CaloLayer2") << "MET phi | ";
1171  if (dataPhi != emulPhi)
1172  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1173  else
1174  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1175  edm::LogInfo("L1TdeStage2CaloLayer2") << dataPhi << "\t" << emulPhi;
1176  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1177  }
1178 
1179  // update sum counters
1182  sumSummary->Fill(NSUMS);
1183  }
1184 
1185  // METHF
1186  if (l1t::EtSum::EtSumType::kMissingEtHF == dataIt->getType()
1187  && dataIt->hwPt() != 0) {
1188 
1189  dataEt = dataIt->hwPt();
1190  emulEt = emulIt->hwPt();
1191 
1192  dataPhi = dataIt->hwPhi();
1193  emulPhi = emulIt->hwPhi();
1194 
1195  if (dataEt != emulEt) {
1196  etGood = false;
1197  eventGood = false;
1198  }
1199 
1200  if (dataPhi != emulPhi) {
1201  phiGood = false;
1202  eventGood = false;
1203  }
1204 
1205  if (etGood && phiGood) {
1209  } else {
1210  metHFEtData->Fill(dataEt);
1211  metHFPhiData->Fill(dataPhi);
1212  metHFEtEmul->Fill(emulEt);
1213  metHFPhiEmul->Fill(emulPhi);
1214  }
1215 
1216  if (verbose) {
1217  edm::LogInfo("L1TdeStage2CaloLayer2") << "METHF | ";
1218  if (dataEt != emulEt)
1219  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1220  else
1221  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1222  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1223  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1224 
1225  edm::LogInfo("L1TdeStage2CaloLayer2") << "METHF phi | ";
1226  if (dataPhi != emulPhi)
1227  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1228  else
1229  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1230  edm::LogInfo("L1TdeStage2CaloLayer2") << dataPhi << "\t" << emulPhi;
1231  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1232  }
1233 
1234  // update sum counters
1237  sumSummary->Fill(NSUMS);
1238  }
1239 
1240  // MHT
1241  if (l1t::EtSum::EtSumType::kMissingHt == dataIt->getType()
1242  && dataIt->hwPt() != 0) {
1243 
1244  dataEt = dataIt->hwPt();
1245  emulEt = emulIt->hwPt();
1246 
1247  dataPhi = dataIt->hwPhi();
1248  emulPhi = emulIt->hwPhi();
1249 
1250  if (dataEt != emulEt) {
1251  etGood = false;
1252  eventGood = false;
1253  }
1254 
1255  if (!(etGood && dataEt == 0)) {
1256  if (dataPhi != emulPhi) {
1257  phiGood = false;
1258  eventGood = false;
1259  }
1260  }
1261 
1262  if (etGood && phiGood) {
1266  } else {
1267  mhtEtData->Fill(dataEt);
1268  mhtPhiData->Fill(dataPhi);
1269  mhtEtEmul->Fill(emulEt);
1270  mhtPhiEmul->Fill(emulPhi);
1271  }
1272 
1273  if (verbose) {
1274  edm::LogInfo("L1TdeStage2CaloLayer2") << "MHT | ";
1275  if (dataEt != emulEt)
1276  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1277  else
1278  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1279  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1280  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1281 
1282  edm::LogInfo("L1TdeStage2CaloLayer2") << "MHT phi | ";
1283  if (dataPhi != emulPhi)
1284  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1285  else
1286  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1287  edm::LogInfo("L1TdeStage2CaloLayer2") << dataPhi << "\t" << emulPhi;
1288  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1289  }
1290 
1291  // update sum counters
1294  sumSummary->Fill(NSUMS);
1295  }
1296 
1297  // MHTHF
1298  if (l1t::EtSum::EtSumType::kMissingHtHF == dataIt->getType()
1299  && dataIt->hwPt() != 0) {
1300 
1301  dataEt = dataIt->hwPt();
1302  emulEt = emulIt->hwPt();
1303 
1304  dataPhi = dataIt->hwPhi();
1305  emulPhi = emulIt->hwPhi();
1306 
1307  if (dataEt != emulEt) {
1308  phiGood = false;
1309  eventGood = false;
1310  }
1311 
1312  if (!(etGood && dataEt == 0)) {
1313  if (dataPhi != emulPhi) {
1314  phiGood = false;
1315  eventGood = false;
1316  }
1317  }
1318 
1319  if (etGood && phiGood) {
1323  } else {
1324  mhtHFEtData->Fill(dataEt);
1325  mhtHFPhiData->Fill(dataPhi);
1326  mhtHFEtEmul->Fill(emulEt);
1327  mhtHFPhiEmul->Fill(emulPhi);
1328  }
1329 
1330  if (verbose) {
1331  edm::LogInfo("L1TdeStage2CaloLayer2") << "MHTHF | ";
1332  if (dataEt != emulEt)
1333  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1334  else
1335  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1336  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1337  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1338 
1339  edm::LogInfo("L1TdeStage2CaloLayer2") << "MHTHF phi | ";
1340  if (dataPhi != emulPhi)
1341  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1342  else
1343  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1344  edm::LogInfo("L1TdeStage2CaloLayer2") << dataPhi << "\t" << emulPhi;
1345  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1346  }
1347 
1348  // update sum counters
1351  sumSummary->Fill(NSUMS);
1352  }
1353 
1354  // MBHFP0
1355  if (l1t::EtSum::EtSumType::kMinBiasHFP0 == dataIt->getType()) {
1356 
1357  dataEt = dataIt->hwPt();
1358  emulEt = emulIt->hwPt();
1359 
1360  if (dataEt != emulEt) {
1361  eventGood = false;
1362  mbhfp0Data->Fill(dataEt);
1363  mbhfp0Emul->Fill(emulEt);
1364  } else {
1368  }
1369 
1370  if (verbose) {
1371  edm::LogInfo("L1TdeStage2CaloLayer2") << "MBHFP0 | ";
1372  if (dataEt != emulEt)
1373  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1374  else
1375  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1376  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1377  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1378  }
1379 
1380  // update sum counters
1383  sumSummary->Fill(NSUMS);
1384  }
1385 
1386  // MBHFM0
1387  if (l1t::EtSum::EtSumType::kMinBiasHFM0 == dataIt->getType()) {
1388 
1389  dataEt = dataIt->hwPt();
1390  emulEt = emulIt->hwPt();
1391 
1392  if (dataEt != emulEt) {
1393  eventGood = false;
1394  mbhfm0Data->Fill(dataEt);
1395  mbhfm0Emul->Fill(emulEt);
1396  } else {
1400  }
1401 
1402  // update sum counters
1405  sumSummary->Fill(NSUMS);
1406  }
1407 
1408  // MBHFP1
1409  if (l1t::EtSum::EtSumType::kMinBiasHFP1 == dataIt->getType()) {
1410 
1411  dataEt = dataIt->hwPt();
1412  emulEt = emulIt->hwPt();
1413 
1414  if (dataEt != emulEt) {
1415  eventGood = false;
1416  mbhfp1Data->Fill(dataEt);
1417  mbhfp1Emul->Fill(emulEt);
1418  } else {
1422  }
1423 
1424  if (verbose) {
1425  edm::LogInfo("L1TdeStage2CaloLayer2") << "MBHFP1 | ";
1426  if (dataEt != emulEt)
1427  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1428  else
1429  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1430  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1431  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1432  }
1433 
1434  // update sum counters
1437  sumSummary->Fill(NSUMS);
1438  }
1439 
1440  // MBHFM1
1441  if (l1t::EtSum::EtSumType::kMinBiasHFM1 == dataIt->getType()) {
1442 
1443  dataEt = dataIt->hwPt();
1444  emulEt = emulIt->hwPt();
1445 
1447 
1448  if (dataEt != emulEt) {
1449  eventGood = false;
1450  mbhfm1Data->Fill(dataEt);
1451  mbhfm1Emul->Fill(emulEt);
1452  } else {
1456  }
1457 
1458  if (verbose) {
1459  edm::LogInfo("L1TdeStage2CaloLayer2") << "MBHFM1 | ";
1460  if (dataEt != emulEt)
1461  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1462  else
1463  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1464  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1465  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1466  }
1467 
1469  sumSummary->Fill(NSUMS);
1470  }
1471 
1472  // TowerCount
1473  if (l1t::EtSum::EtSumType::kTowerCount == dataIt->getType()) {
1474 
1475  dataEt = dataIt->hwPt();
1476  emulEt = emulIt->hwPt();
1477 
1478  if (dataEt != emulEt) {
1479  eventGood = false;
1480  towCountData->Fill(dataEt);
1481  towCountEmul->Fill(emulEt);
1482  } else {
1486  }
1487 
1488  if (verbose) {
1489  edm::LogInfo("L1TdeStage2CaloLayer2") << "TowCount | ";
1490  if (dataEt != emulEt)
1491  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1492  else
1493  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1494  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1495  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1496  }
1497 
1498  // update sum counters
1501  sumSummary->Fill(NSUMS);
1502  }
1503 
1504  // AsymmetryCount
1505  if (l1t::EtSum::EtSumType::kAsymEt == dataIt->getType()) {
1506 
1507  dataEt = dataIt->hwPt();
1508  emulEt = emulIt->hwPt();
1509 
1510  if (dataEt != emulEt) {
1511  eventGood = false;
1512  asymCountData->Fill(dataEt);
1513  asymCountEmul->Fill(emulEt);
1514  } else {
1518  }
1519 
1520  if (verbose) {
1521  edm::LogInfo("L1TdeStage2CaloLayer2") << "AsymCount | ";
1522  if (dataEt != emulEt)
1523  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1524  else
1525  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1526 
1527  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1528  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1529  }
1530  // update sum counters
1533  sumSummary->Fill(NSUMS);
1534  }
1535 
1536  // CentralityCount
1537  if (l1t::EtSum::EtSumType::kCentrality == dataIt->getType()) {
1538  dataCentr = dataIt->hwPt();
1539  emulCentr = emulIt->hwPt();
1540 
1541  if (dataCentr != emulCentr) {
1542  eventGood = false;
1543  if (dataCentr==0) centrCountData->Fill(-1);
1544  else {
1545  for (int i=0; i<8; i++)
1546  if (((dataCentr>>i)&1)==1) centrCountData->Fill(i);
1547  }
1548 
1549  if (emulCentr==0) centrCountEmul->Fill(-1);
1550  else {
1551  for (int i=0; i<8; i++)
1552  if (((emulCentr>>i)&1)==1) centrCountEmul->Fill(i);
1553  }
1554 
1555  } else {
1559  }
1560 
1561  if (verbose) {
1562  edm::LogInfo("L1TdeStage2CaloLayer2") << "CentrCount | ";
1563  if (dataEt != emulEt)
1564  edm::LogInfo("L1TdeStage2CaloLayer2") << "x ";
1565  else
1566  edm::LogInfo("L1TdeStage2CaloLayer2") << " ";
1567 
1568  edm::LogInfo("L1TdeStage2CaloLayer2") << dataEt << "\t" << emulEt;
1569  edm::LogInfo("L1TdeStage2CaloLayer2") << std::endl;
1570  }
1571  // update sum counters
1574  sumSummary->Fill(NSUMS);
1575  }
1576 
1577  break;
1578  }
1579  ++dataIt;
1580  if (dataIt == dataCol->end(currBx))
1581  break;
1582 
1583  }
1584 
1585  ++emulIt;
1586  if (emulIt == emulCol->end(currBx))
1587  break;
1588  }
1589  // return a boolean that states whether the jet data in the event is in
1590  // agreement
1591  return eventGood;
1592 }
BXVector< EGamma > EGammaBxCollection
Definition: EGamma.h:11
edm::EDGetTokenT< l1t::JetBxCollection > calol2JetCollectionEmul
const_iterator end(int bx) const
edm::EDGetTokenT< l1t::TauBxCollection > calol2TauCollectionEmul
MonitorElement * jet2DEtaPhiData
MonitorElement * eg2DEtaPhiEmul
MonitorElement * problemSummary
unsigned size(int bx) const
MonitorElement * centrCountData
MonitorElement * isoTauPhiEmul
L1TdeStage2CaloLayer2(const edm::ParameterSet &ps)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
MonitorElement * centrCountEmul
edm::EDGetTokenT< l1t::EtSumBxCollection > calol2EtSumCollectionData
MonitorElement * isoTauEtaData
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * agreementSummary
MonitorElement * jet2DEtaPhiEmul
bool compareSums(const edm::Handle< l1t::EtSumBxCollection > &dataCol, const edm::Handle< l1t::EtSumBxCollection > &emulCol)
bool isEmpty(int bx) const
MonitorElement * asymCountData
delete x;
Definition: CaloConfig.h:22
BXVector< Tau > TauBxCollection
Definition: Tau.h:11
void Fill(long long x)
edm::EDGetTokenT< l1t::EGammaBxCollection > calol2EGammaCollectionEmul
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
edm::EDGetTokenT< l1t::EGammaBxCollection > calol2EGammaCollectionData
BXVector< EtSum > EtSumBxCollection
Definition: EtSum.h:11
MonitorElement * tau2DEtaPhiEmul
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
bool compareEGs(const edm::Handle< l1t::EGammaBxCollection > &dataCol, const edm::Handle< l1t::EGammaBxCollection > &emulCol)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * isoTauEtaEmul
MonitorElement * asymCountEmul
BXVector< Jet > JetBxCollection
Definition: Jet.h:11
void analyze(const edm::Event &, const edm::EventSetup &) override
bool compareTaus(const edm::Handle< l1t::TauBxCollection > &dataCol, const edm::Handle< l1t::TauBxCollection > &emulCol)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * isoTau2DEtaPhiData
edm::EDGetTokenT< l1t::JetBxCollection > calol2JetCollectionData
HLT enums.
bool compareJets(const edm::Handle< l1t::JetBxCollection > &dataCol, const edm::Handle< l1t::JetBxCollection > &emulCol)
MonitorElement * isoTauPhiData
MonitorElement * isoTau2DEtaPhiEmul
MonitorElement * isoEg2DEtaPhiData
edm::EDGetTokenT< l1t::TauBxCollection > calol2TauCollectionData
MonitorElement * tau2DEtaPhiData
const_iterator begin(int bx) const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
edm::EDGetTokenT< l1t::EtSumBxCollection > calol2EtSumCollectionEmul
MonitorElement * isoEg2DEtaPhiEmul
MonitorElement * eg2DEtaPhiData
Definition: Run.h:45
std::vector< T >::const_iterator const_iterator
Definition: BXVector.h:20