CMS 3D CMS Logo

L1TStage2CaloLayer1.cc
Go to the documentation of this file.
1 /*
2  * \file L1TStage2CaloLayer1.cc
3  *
4  * N. Smith <nick.smith@cern.ch>
5  */
6 //Modified by Bhawna Gomber <bhawna.gomber@cern.ch>
7 
9 
13 
16 
19 
21  ecalTPSourceRecd_(consumes<EcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("ecalTPSourceRecd"))),
22  ecalTPSourceRecdLabel_(ps.getParameter<edm::InputTag>("ecalTPSourceRecd").label()),
23  hcalTPSourceRecd_(consumes<HcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("hcalTPSourceRecd"))),
24  hcalTPSourceRecdLabel_(ps.getParameter<edm::InputTag>("hcalTPSourceRecd").label()),
25  ecalTPSourceSent_(consumes<EcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("ecalTPSourceSent"))),
26  ecalTPSourceSentLabel_(ps.getParameter<edm::InputTag>("ecalTPSourceSent").label()),
27  hcalTPSourceSent_(consumes<HcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("hcalTPSourceSent"))),
28  hcalTPSourceSentLabel_(ps.getParameter<edm::InputTag>("hcalTPSourceSent").label()),
29  fedRawData_(consumes<FEDRawDataCollection>(ps.getParameter<edm::InputTag>("fedRawDataLabel"))),
30  histFolder_(ps.getParameter<std::string>("histFolder")),
31  tpFillThreshold_(ps.getUntrackedParameter<int>("etDistributionsFillThreshold", 0)),
32  ignoreHFfbs_(ps.getUntrackedParameter<bool>("ignoreHFfbs", false))
33 {
34  ecalTPSentRecd_.reserve(28*2*72);
35  hcalTPSentRecd_.reserve(41*2*72);
36 }
37 
39 {
40 }
41 
43 {
44 }
45 
47 {
48  // Monitorables stored in Layer 1 raw data but
49  // not accessible from existing persistent data formats
50  edm::Handle<FEDRawDataCollection> fedRawDataCollection;
51  event.getByToken(fedRawData_, fedRawDataCollection);
52  bool caloLayer1OutOfRun{true};
53  if (fedRawDataCollection.isValid()) {
54  caloLayer1OutOfRun = false;
55  for(int iFed=1354; iFed<1360; iFed+=2) {
56  const FEDRawData& fedRawData = fedRawDataCollection->FEDData(iFed);
57  if ( fedRawData.size() == 0 ) {
58  caloLayer1OutOfRun = true;
59  continue; // In case one of 3 layer 1 FEDs not in
60  }
61  const uint64_t *fedRawDataArray = (const uint64_t *) fedRawData.data();
62  UCTDAQRawData daqData(fedRawDataArray);
63  for(uint32_t i = 0; i < daqData.nAMCs(); i++) {
64  UCTAMCRawData amcData(daqData.amcPayload(i));
65  int lPhi = amcData.layer1Phi();
66  if ( daqData.BXID() != amcData.BXID() ) {
67  bxidErrors_->Fill(lPhi);
68  }
69  if ( daqData.L1ID() != amcData.L1ID() ) {
70  l1idErrors_->Fill(lPhi);
71  }
72  // AMC payload header has 16 bit orbit number, AMC13 header is full 32
73  if ( (daqData.orbitNumber() & 0xFFFF) != amcData.orbitNo() ) {
74  orbitErrors_->Fill(lPhi);
75  }
76  }
77  }
78  }
79 
80 
82  event.getByToken(ecalTPSourceSent_, ecalTPsSent);
84  event.getByToken(ecalTPSourceRecd_, ecalTPsRecd);
85 
86  ecalTPSentRecd_.clear();
87 
88  ComparisonHelper::zip(ecalTPsSent->begin(), ecalTPsSent->end(),
89  ecalTPsRecd->begin(), ecalTPsRecd->end(),
91 
92  int nEcalLinkErrors{0};
93  int nEcalMismatch{0};
94 
95  for ( const auto& tpPair : ecalTPSentRecd_ ) {
96  auto sentTp = tpPair.first;
97  if ( sentTp.compressedEt() < 0 ) {
98  // ECal zero-suppresses digis, and a default-constructed
99  // digi has et=-1 apparently, but we know it should be zero
101  EcalTriggerPrimitiveDigi tpg(sentTp.id());
102  tpg.setSize(1);
103  tpg.setSample(0, sample);
104  swap(sentTp, tpg);
105  }
106  const auto& recdTp = tpPair.second;
107  const int ieta = sentTp.id().ieta();
108  const int iphi = sentTp.id().iphi();
109  const bool towerMasked = recdTp.sample(0).raw() & (1<<13);
110  const bool linkMasked = recdTp.sample(0).raw() & (1<<14);
111  const bool linkError = recdTp.sample(0).raw() & (1<<15);
112 
113  // Link status bits from layer 1
114  if( towerMasked ){
115  ecalOccTowerMasked_->Fill(ieta, iphi);
116  }
117  if( linkMasked ){
118  ecalOccLinkMasked_->Fill(ieta, iphi);
119  }
120 
121  if ( sentTp.compressedEt() > tpFillThreshold_ ) {
122  ecalTPRawEtSent_->Fill(sentTp.compressedEt());
123  ecalOccSent_->Fill(ieta, iphi);
124  }
125  if(sentTp.fineGrain()==1){
126  ecalOccSentFgVB_->Fill(ieta, iphi);
127  }
128 
129  if ( towerMasked || caloLayer1OutOfRun ) {
130  // Do not compare if we have a mask applied
131  continue;
132  }
133 
134  if ( linkError ) {
135  ecalLinkError_->Fill(ieta, iphi);
137  nEcalLinkErrors++;
138  // Don't compare anymore, we already know its bad
139  continue;
140  }
141 
142  ecalTPRawEtCorrelation_->Fill(sentTp.compressedEt(), recdTp.compressedEt());
143 
144  if ( recdTp.compressedEt() > tpFillThreshold_ ) {
145  ecalTPRawEtRecd_->Fill(recdTp.compressedEt());
146  ecalOccupancy_->Fill(ieta, iphi);
147  ecalOccRecdEtWgt_ ->Fill(ieta, iphi, recdTp.compressedEt());
148  }
149  if(recdTp.fineGrain()==1){
150  ecalOccRecdFgVB_->Fill(ieta, iphi);
151  }
152 
153  // Now for comparisons
154 
155  const bool EetAgreement = sentTp.compressedEt() == recdTp.compressedEt();
156  const bool EfbAgreement = sentTp.fineGrain() == recdTp.fineGrain();
157  if ( EetAgreement && EfbAgreement ) {
158  // Full match
159  if ( sentTp.compressedEt() > tpFillThreshold_ ) {
160  ecalOccSentAndRecd_->Fill(ieta, iphi);
161  ecalTPRawEtSentAndRecd_->Fill(sentTp.compressedEt());
162  }
163  }
164  else {
165  // There is some issue
166  ecalDiscrepancy_->Fill(ieta, iphi);
169  nEcalMismatch++;
170 
171  if ( not EetAgreement ) {
172  ecalOccEtDiscrepancy_->Fill(ieta, iphi);
173  ecalTPRawEtDiffNoMatch_->Fill(recdTp.compressedEt()-sentTp.compressedEt());
174  updateMismatch(event, 0);
175 
176  if ( sentTp.compressedEt() == 0 ) ecalOccRecdNotSent_->Fill(ieta, iphi);
177  else if ( recdTp.compressedEt() == 0 ) ecalOccSentNotRecd_->Fill(ieta, iphi);
178  else ecalOccNoMatch_->Fill(ieta, iphi);
179  }
180  if ( not EfbAgreement ) {
181  // occ for fine grain mismatch
182  ecalOccFgDiscrepancy_->Fill(ieta, iphi);
183  updateMismatch(event, 1);
184  }
185  }
186 
187  }
188 
189  if ( nEcalLinkErrors > maxEvtLinkErrorsECALCurrentLumi_ ) {
190  maxEvtLinkErrorsECALCurrentLumi_ = nEcalLinkErrors;
191  }
192  if ( nEcalMismatch > maxEvtMismatchECALCurrentLumi_ ) {
193  maxEvtMismatchECALCurrentLumi_ = nEcalMismatch;
194  }
195 
196 
198  event.getByToken(hcalTPSourceSent_, hcalTPsSent);
200  event.getByToken(hcalTPSourceRecd_, hcalTPsRecd);
201 
202  hcalTPSentRecd_.clear();
203 
204  ComparisonHelper::zip(hcalTPsSent->begin(), hcalTPsSent->end(),
205  hcalTPsRecd->begin(), hcalTPsRecd->end(),
207 
208  int nHcalLinkErrors{0};
209  int nHcalMismatch{0};
210 
211  for ( const auto& tpPair : hcalTPSentRecd_ ) {
212  const auto& sentTp = tpPair.first;
213  const auto& recdTp = tpPair.second;
214  const int ieta = sentTp.id().ieta();
215  if ( abs(ieta) > 28 && sentTp.id().version() != 1 ) continue;
216  const int iphi = sentTp.id().iphi();
217  const bool towerMasked = recdTp.sample(0).raw() & (1<<13);
218  const bool linkMasked = recdTp.sample(0).raw() & (1<<14);
219  const bool linkError = recdTp.sample(0).raw() & (1<<15);
220 
221  if(towerMasked){
222  hcalOccTowerMasked_->Fill(ieta, iphi);
223  }
224  if(linkMasked){
225  hcalOccLinkMasked_->Fill(ieta, iphi);
226  }
227 
228  if ( sentTp.SOI_compressedEt() > tpFillThreshold_ ) {
229  hcalTPRawEtSent_->Fill(sentTp.SOI_compressedEt());
230  hcalOccSent_->Fill(ieta, iphi);
231  }
232  if(sentTp.SOI_fineGrain()==1){
233  hcalOccSentFb_->Fill(ieta, iphi);
234  }
235  if(sentTp.t0().fineGrain(1)==1){
236  hcalOccSentFb2_->Fill(ieta, iphi);
237  }
238 
239  if ( towerMasked || caloLayer1OutOfRun ) {
240  // Do not compare if we have a mask applied
241  continue;
242  }
243 
244  if ( linkError ) {
245  hcalLinkError_->Fill(ieta, iphi);
247  nHcalLinkErrors++;
248  // Don't compare anymore, we already know its bad
249  continue;
250  }
251 
252  if ( recdTp.SOI_compressedEt() > tpFillThreshold_ ) {
253  hcalTPRawEtRecd_->Fill(recdTp.SOI_compressedEt());
254  hcalOccupancy_->Fill(ieta, iphi);
255  hcalOccRecdEtWgt_ ->Fill(ieta, iphi, recdTp.SOI_compressedEt());
256  }
257  if(recdTp.SOI_fineGrain()){
258  hcalOccRecdFb_->Fill(ieta, iphi);
259  }
260  if(recdTp.t0().fineGrain(1)){
261  hcalOccRecdFb2_->Fill(ieta, iphi);
262  }
263 
264  if ( abs(ieta) > 29 ) {
265  hcalTPRawEtCorrelationHF_->Fill(sentTp.SOI_compressedEt(), recdTp.SOI_compressedEt());
266  } else {
267  hcalTPRawEtCorrelationHBHE_->Fill(sentTp.SOI_compressedEt(), recdTp.SOI_compressedEt());
268  }
269 
270  const bool HetAgreement = sentTp.SOI_compressedEt() == recdTp.SOI_compressedEt();
271  const bool Hfb1Agreement = ( abs(ieta) < 29 ) ? true : (recdTp.SOI_compressedEt()==0 || (sentTp.SOI_fineGrain() == recdTp.SOI_fineGrain()) || ignoreHFfbs_);
272  // Ignore minBias (FB2) bit if we receieve 0 ET, which means it is likely zero-suppressed on HCal readout side
273  const bool Hfb2Agreement = ( abs(ieta) < 29 ) ? true : (recdTp.SOI_compressedEt()==0 || (sentTp.SOI_fineGrain(1) == recdTp.SOI_fineGrain(1)) || ignoreHFfbs_);
274  if ( HetAgreement && Hfb1Agreement && Hfb2Agreement ) {
275  // Full match
276  if ( sentTp.SOI_compressedEt() > tpFillThreshold_ ) {
277  hcalOccSentAndRecd_->Fill(ieta, iphi);
278  hcalTPRawEtSentAndRecd_->Fill(sentTp.SOI_compressedEt());
279  }
280  }
281  else {
282  // There is some issue
283  hcalDiscrepancy_->Fill(ieta, iphi);
285  nHcalMismatch++;
286 
287  if ( not HetAgreement ) {
288  if ( abs(ieta) > 29 ) {
290  } else {
292  }
293  hcalOccEtDiscrepancy_->Fill(ieta, iphi);
294  hcalTPRawEtDiffNoMatch_->Fill(recdTp.SOI_compressedEt()-sentTp.SOI_compressedEt());
295  updateMismatch(event, 2);
296 
297  // Handle HCal discrepancy debug
298  if ( sentTp.SOI_compressedEt() == 0 ) hcalOccRecdNotSent_->Fill(ieta, iphi);
299  else if ( recdTp.SOI_compressedEt() == 0 ) hcalOccSentNotRecd_->Fill(ieta, iphi);
300  else hcalOccNoMatch_->Fill(ieta, iphi);
301  }
302  if ( not Hfb1Agreement ) {
303  // Handle fine grain discrepancies
304  hcalOccFbDiscrepancy_->Fill(ieta, iphi);
305  updateMismatch(event, 3);
306  }
307  if ( not Hfb2Agreement ) {
308  // Handle fine grain discrepancies
309  hcalOccFb2Discrepancy_->Fill(ieta, iphi);
310  updateMismatch(event, 3);
311  }
312  }
313 
314  }
315 
316 
317  if ( nHcalLinkErrors > maxEvtLinkErrorsHCALCurrentLumi_ ) {
318  maxEvtLinkErrorsHCALCurrentLumi_ = nHcalLinkErrors;
319  }
320  if ( nHcalMismatch > maxEvtMismatchHCALCurrentLumi_ ) {
321  maxEvtMismatchHCALCurrentLumi_ = nHcalMismatch;
322  }
323 
324 }
325 
326 
327 void L1TStage2CaloLayer1::updateMismatch(const edm::Event& e, int mismatchType) {
328  auto id = e.id();
329  std::string eventString{std::to_string(id.run()) + ":" + std::to_string(id.luminosityBlock()) + ":" + std::to_string(id.event())};
330  if ( last20MismatchArray_.at(lastMismatchIndex_).first == eventString ) {
331  // same event
332  last20MismatchArray_.at(lastMismatchIndex_).second |= 1<<mismatchType;
333  }
334  else {
335  // New event, advance
337  last20MismatchArray_.at(lastMismatchIndex_) = {eventString, 1<<mismatchType};
338  }
339 }
340 
342  // Ugly way to loop backwards through the last 20 mismatches
343  auto h = last20Mismatches_->getTH2F();
344  for (size_t ibin=1, imatch=lastMismatchIndex_; ibin<=20; ibin++, imatch=(imatch+19)%20) {
345  h->GetYaxis()->SetBinLabel(ibin, last20MismatchArray_.at(imatch).first.c_str());
346  for(int itype=0; itype<h->GetNbinsX(); ++itype) {
347  int binContent = (last20MismatchArray_.at(imatch).second>>itype) & 1;
348  last20Mismatches_->setBinContent(itype+1, ibin, binContent);
349  }
350  }
351 }
352 
354  auto id = static_cast<double>(lumi.id().luminosityBlock()); // uint64_t
355 
358  }
361  }
364  }
367 
368  if ( maxEvtMismatchECALCurrentLumi_ > 0 ) {
370  }
371  if ( maxEvtMismatchHCALCurrentLumi_ > 0 ) {
373  }
376  }
379 
380  // Simple way to embed current lumi to auto-scale axis limits in render plugin
381  ecalLinkErrorByLumi_->getTH1F()->SetBinContent(0, id);
382  ecalMismatchByLumi_->getTH1F()->SetBinContent(0, id);
383  hcalLinkErrorByLumi_->getTH1F()->SetBinContent(0, id);
384  hcalMismatchByLumi_->getTH1F()->SetBinContent(0, id);
385  maxEvtLinkErrorsByLumiECAL_->getTH1F()->SetBinContent(0, id);
386  maxEvtLinkErrorsByLumiHCAL_->getTH1F()->SetBinContent(0, id);
387  maxEvtLinkErrorsByLumi_->getTH1F()->SetBinContent(0, id);
388  maxEvtMismatchByLumiECAL_->getTH1F()->SetBinContent(0, id);
389  maxEvtMismatchByLumiHCAL_->getTH1F()->SetBinContent(0, id);
390  maxEvtMismatchByLumi_->getTH1F()->SetBinContent(0, id);
391 }
392 
394 {
395  auto bookEt = [&ibooker](std::string name, std::string title) {
396  return ibooker.book1D(name, title+";Raw ET;Counts", 256, -0.5, 255.5);
397  };
398  auto bookEtCorrelation = [&ibooker](std::string name, std::string title) {
399  return ibooker.book2D(name, title, 256, -0.5, 255.5, 256, -0.5, 255.5);
400  };
401  auto bookEtDiff = [&ibooker](std::string name, std::string title) {
402  return ibooker.book1D(name, title+";#Delta Raw ET;Counts", 511, -255.5, 255.5);
403  };
404  auto bookEcalOccupancy = [&ibooker](std::string name, std::string title) {
405  return ibooker.book2D(name, title+";iEta;iPhi", 57, -28.5, 28.5, 72, 0.5, 72.5);
406  };
407  auto bookHcalOccupancy = [&ibooker](std::string name, std::string title) {
408  return ibooker.book2D(name, title+";iEta;iPhi", 83, -41.5, 41.5, 72, 0.5, 72.5);
409  };
410 
411  ibooker.setCurrentFolder(histFolder_);
412 
413  ecalDiscrepancy_ = bookEcalOccupancy("ecalDiscrepancy", "ECAL Discrepancies between TCC and Layer1 Readout");
414  ecalLinkError_ = bookEcalOccupancy("ecalLinkError", "ECAL Link Errors");
415  ecalOccupancy_ = bookEcalOccupancy("ecalOccupancy", "ECAL TP Occupancy at Layer1");
416  ecalOccRecdEtWgt_= bookEcalOccupancy("ecalOccRecdEtWgt", "ECal TP ET-weighted Occupancy at Layer1");
417  hcalDiscrepancy_ = bookHcalOccupancy("hcalDiscrepancy", "HCAL Discrepancies between uHTR and Layer1 Readout");
418  hcalLinkError_ = bookHcalOccupancy("hcalLinkError", "HCAL Link Errors");
419  hcalOccupancy_ = bookHcalOccupancy("hcalOccupancy", "HCAL TP Occupancy at Layer1");
420  hcalOccRecdEtWgt_= bookHcalOccupancy("hcalOccRecdEtWgt", "HCal TP ET-weighted Occupancy at Layer1");
421 
422 
423  ibooker.setCurrentFolder(histFolder_+"/ECalDetail");
424 
425  ecalOccEtDiscrepancy_ = bookEcalOccupancy("ecalOccEtDiscrepancy", "ECal Et Discrepancy Occupancy");
426  ecalOccFgDiscrepancy_ = bookEcalOccupancy("ecalOccFgDiscrepancy", "ECal FG Veto Bit Discrepancy Occupancy");
427  ecalOccLinkMasked_ = bookEcalOccupancy("ecalOccLinkMasked", "ECal Masked Links");
428  ecalOccRecdFgVB_ = bookEcalOccupancy("ecalOccRecdFgVB", "ECal FineGrain Veto Bit Occupancy at Layer1");
429  ecalOccSentAndRecd_ = bookEcalOccupancy("ecalOccSentAndRecd", "ECal TP Occupancy FULL MATCH");
430  ecalOccSentFgVB_ = bookEcalOccupancy("ecalOccSentFgVB", "ECal FineGrain Veto Bit Occupancy at TCC");
431  ecalOccSent_ = bookEcalOccupancy("ecalOccSent", "ECal TP Occupancy at TCC");
432  ecalOccTowerMasked_ = bookEcalOccupancy("ecalOccTowerMasked", "ECal Masked towers");
433  ecalTPRawEtCorrelation_ = bookEtCorrelation("ecalTPRawEtCorrelation", "Raw Et correlation TCC and Layer1;TCC Et;Layer1 Et");
434  ecalTPRawEtDiffNoMatch_ = bookEtDiff("ecalTPRawEtDiffNoMatch", "ECal Raw Et Difference Layer1 - TCC");
435  ecalTPRawEtRecd_ = bookEt("ecalTPRawEtRecd", "ECal Raw Et Layer1 Readout");
436  ecalTPRawEtSentAndRecd_ = bookEt("ecalTPRawEtMatch", "ECal Raw Et FULL MATCH");
437  ecalTPRawEtSent_ = bookEt("ecalTPRawEtSent", "ECal Raw Et TCC Readout");
438 
439  ibooker.setCurrentFolder(histFolder_+"/ECalDetail/TCCDebug");
440  ecalOccSentNotRecd_ = bookHcalOccupancy("ecalOccSentNotRecd", "ECal TP Occupancy sent by TCC, zero at Layer1");
441  ecalOccRecdNotSent_ = bookHcalOccupancy("ecalOccRecdNotSent", "ECal TP Occupancy received by Layer1, zero at TCC");
442  ecalOccNoMatch_ = bookHcalOccupancy("ecalOccNoMatch", "ECal TP Occupancy for TCC and Layer1 nonzero, not matching");
443 
444 
445  ibooker.setCurrentFolder(histFolder_+"/HCalDetail");
446 
447  hcalOccEtDiscrepancy_ = bookHcalOccupancy("hcalOccEtDiscrepancy", "HCal Et Discrepancy Occupancy");
448  hcalOccFbDiscrepancy_ = bookHcalOccupancy("hcalOccFbDiscrepancy", "HCal Feature Bit Discrepancy Occupancy");
449  hcalOccFb2Discrepancy_ = bookHcalOccupancy("hcalOccFb2Discrepancy", "HCal Second Feature Bit Discrepancy Occupancy");
450  hcalOccLinkMasked_ = bookHcalOccupancy("hcalOccLinkMasked", "HCal Masked Links");
451  hcalOccRecdFb_ = bookHcalOccupancy("hcalOccRecdFb", "HCal Feature Bit Occupancy at Layer1");
452  hcalOccRecdFb2_ = bookHcalOccupancy("hcalOccRecdFb2", "HF Second Feature Bit Occupancy at Layer1");
453  hcalOccSentAndRecd_ = bookHcalOccupancy("hcalOccSentAndRecd", "HCal TP Occupancy FULL MATCH");
454  hcalOccSentFb_ = bookHcalOccupancy("hcalOccSentFb", "HCal Feature Bit Occupancy at uHTR");
455  hcalOccSentFb2_ = bookHcalOccupancy("hcalOccSentFb2", "HF Second Feature Bit Occupancy at uHTR");
456  hcalOccSent_ = bookHcalOccupancy("hcalOccSent", "HCal TP Occupancy at uHTR");
457  hcalOccTowerMasked_ = bookHcalOccupancy("hcalOccTowerMasked", "HCal Masked towers");
458  hcalTPRawEtCorrelationHBHE_= bookEtCorrelation("hcalTPRawEtCorrelationHBHE", "HBHE Raw Et correlation uHTR and Layer1;uHTR Et;Layer1 Et");
459  hcalTPRawEtCorrelationHF_ = bookEtCorrelation("hcalTPRawEtCorrelationHF", "HF Raw Et correlation uHTR and Layer1;uHTR Et;Layer1 Et");
460  hcalTPRawEtDiffNoMatch_ = bookEtDiff("hcalTPRawEtDiffNoMatch", "HCal Raw Et Difference Layer1 - uHTR");
461  hcalTPRawEtRecd_ = bookEt("hcalTPRawEtRecd", "HCal Raw Et Layer1 Readout");
462  hcalTPRawEtSentAndRecd_ = bookEt("hcalTPRawEtMatch", "HCal Raw Et FULL MATCH");
463  hcalTPRawEtSent_ = bookEt("hcalTPRawEtSent", "HCal Raw Et uHTR Readout");
464 
465  ibooker.setCurrentFolder(histFolder_+"/HCalDetail/uHTRDebug");
466  hcalOccSentNotRecd_ = bookHcalOccupancy("hcalOccSentNotRecd", "HCal TP Occupancy sent by uHTR, zero at Layer1");
467  hcalOccRecdNotSent_ = bookHcalOccupancy("hcalOccRecdNotSent", "HCal TP Occupancy received by Layer1, zero at uHTR");
468  hcalOccNoMatch_ = bookHcalOccupancy("hcalOccNoMatch", "HCal TP Occupancy for uHTR and Layer1 nonzero, not matching");
469 
470  ibooker.setCurrentFolder(histFolder_+"/MismatchDetail");
471 
472  const int nMismatchTypes = 4;
473  last20Mismatches_ = ibooker.book2D("last20Mismatches",
474  "Log of last 20 mismatches (use json tool to copy/paste)",
475  nMismatchTypes, 0, nMismatchTypes, 20, 0, 20);
476  last20Mismatches_->getTH2F()->GetXaxis()->SetBinLabel(1, "Ecal TP Et Mismatch");
477  last20Mismatches_->getTH2F()->GetXaxis()->SetBinLabel(2, "Ecal TP Fine Grain Bit Mismatch");
478  last20Mismatches_->getTH2F()->GetXaxis()->SetBinLabel(3, "Hcal TP Et Mismatch");
479  last20Mismatches_->getTH2F()->GetXaxis()->SetBinLabel(4, "Hcal TP Feature Bit Mismatch");
480  for (size_t i=0; i<last20MismatchArray_.size(); ++i) last20MismatchArray_[i] = {"-"+std::to_string(i), 0};
481  for (size_t i=1; i<=20; ++i) last20Mismatches_->getTH2F()->GetYaxis()->SetBinLabel(i, ("-"+std::to_string(i)).c_str());
482 
483  const int nLumis = 2000;
484  ecalLinkErrorByLumi_ = ibooker.book1D("ecalLinkErrorByLumi", "Link error counts per lumi section for ECAL;LumiSection;Counts", nLumis, .5, nLumis+0.5);
485  ecalMismatchByLumi_ = ibooker.book1D("ecalMismatchByLumi", "Mismatch counts per lumi section for ECAL;LumiSection;Counts", nLumis, .5, nLumis+0.5);
486  hcalLinkErrorByLumi_ = ibooker.book1D("hcalLinkErrorByLumi", "Link error counts per lumi section for HCAL;LumiSection;Counts", nLumis, .5, nLumis+0.5);
487  hcalMismatchByLumi_ = ibooker.book1D("hcalMismatchByLumi", "Mismatch counts per lumi section for HCAL;LumiSection;Counts", nLumis, .5, nLumis+0.5);
488 
489  ECALmismatchesPerBx_ = ibooker.book1D("ECALmismatchesPerBx", "Mismatch counts per bunch crossing for ECAL", 3564, -.5, 3563.5);
490  HBHEmismatchesPerBx_ = ibooker.book1D("HBHEmismatchesPerBx", "Mismatch counts per bunch crossing for HBHE", 3564, -.5, 3563.5);
491  HFmismatchesPerBx_ = ibooker.book1D("HFmismatchesPerBx", "Mismatch counts per bunch crossing for HF", 3564, -.5, 3563.5);
492 
493  maxEvtLinkErrorsByLumiECAL_ = ibooker.book1D("maxEvtLinkErrorsByLumiECAL", "Max number of single-event ECAL link errors per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
494  maxEvtLinkErrorsByLumiHCAL_ = ibooker.book1D("maxEvtLinkErrorsByLumiHCAL", "Max number of single-event HCAL link errors per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
495 
496  maxEvtMismatchByLumiECAL_ = ibooker.book1D("maxEvtMismatchByLumiECAL", "Max number of single-event ECAL discrepancies per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
497  maxEvtMismatchByLumiHCAL_ = ibooker.book1D("maxEvtMismatchByLumiHCAL", "Max number of single-event HCAL discrepancies per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
498 
499  ibooker.setCurrentFolder(histFolder_);
500  maxEvtLinkErrorsByLumi_ = ibooker.book1D("maxEvtLinkErrorsByLumi", "Max number of single-event link errors per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
501  maxEvtMismatchByLumi_ = ibooker.book1D("maxEvtMismatchByLumi", "Max number of single-event discrepancies per lumi section;LumiSection;Counts", nLumis, .5, nLumis+0.5);
502 
503  ibooker.setCurrentFolder(histFolder_+"/AMC13ErrorCounters");
504  bxidErrors_ = ibooker.book1D("bxidErrors", "bxid mismatch between AMC13 and CTP Cards;Layer1 Phi;Counts", 18, -.5, 17.5);
505  l1idErrors_ = ibooker.book1D("l1idErrors", "l1id mismatch between AMC13 and CTP Cards;Layer1 Phi;Counts", 18, -.5, 17.5);
506  orbitErrors_ = ibooker.book1D("orbitErrors", "orbit mismatch between AMC13 and CTP Cards;Layer1 Phi;Counts", 18, -.5, 17.5);
507 }
508 
MonitorElement * hcalTPRawEtRecd_
LuminosityBlockID id() const
MonitorElement * ecalOccTowerMasked_
MonitorElement * ecalOccRecdNotSent_
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * ecalTPRawEtCorrelation_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPSourceSent_
std::vector< std::pair< HcalTriggerPrimitiveDigi, HcalTriggerPrimitiveDigi > > hcalTPSentRecd_
MonitorElement * maxEvtMismatchByLumiHCAL_
MonitorElement * maxEvtLinkErrorsByLumi_
MonitorElement * maxEvtMismatchByLumi_
MonitorElement * ecalOccRecdFgVB_
MonitorElement * ecalTPRawEtSentAndRecd_
MonitorElement * ecalOccFgDiscrepancy_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * ecalMismatchByLumi_
MonitorElement * bxidErrors_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPSourceRecd_
MonitorElement * maxEvtLinkErrorsByLumiHCAL_
TH1F * getTH1F() const
uint32_t BXID()
Definition: UCTDAQRawData.h:38
MonitorElement * hcalOccSentFb2_
MonitorElement * HBHEmismatchesPerBx_
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalTPSourceRecd_
MonitorElement * hcalOccSentFb_
MonitorElement * hcalOccTowerMasked_
MonitorElement * maxEvtMismatchByLumiECAL_
int bunchCrossing() const
Definition: EventBase.h:64
MonitorElement * ecalOccSentFgVB_
MonitorElement * hcalOccupancy_
MonitorElement * hcalLinkErrorByLumi_
MonitorElement * hcalTPRawEtSentAndRecd_
MonitorElement * hcalMismatchByLumi_
MonitorElement * hcalOccRecdEtWgt_
MonitorElement * ECALmismatchesPerBx_
std::array< std::pair< std::string, int >, 20 > last20MismatchArray_
MonitorElement * ecalOccupancy_
MonitorElement * hcalOccRecdNotSent_
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
MonitorElement * hcalOccLinkMasked_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
MonitorElement * ecalTPRawEtRecd_
uint32_t L1ID()
Definition: UCTDAQRawData.h:39
void Fill(long long x)
MonitorElement * ecalTPRawEtDiffNoMatch_
MonitorElement * hcalOccSent_
char const * label
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * ecalOccNoMatch_
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
MonitorElement * ecalTPRawEtSent_
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
MonitorElement * ecalOccSentAndRecd_
L1TStage2CaloLayer1(const edm::ParameterSet &ps)
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
MonitorElement * ecalLinkErrorByLumi_
MonitorElement * hcalOccEtDiscrepancy_
MonitorElement * hcalTPRawEtCorrelationHBHE_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void updateMismatch(const edm::Event &e, int mismatchType)
MonitorElement * ecalOccSent_
std::vector< std::pair< EcalTriggerPrimitiveDigi, EcalTriggerPrimitiveDigi > > ecalTPSentRecd_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * hcalOccSentAndRecd_
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * l1idErrors_
TH2F * getTH2F() const
uint32_t nAMCs()
Definition: UCTDAQRawData.h:44
MonitorElement * ecalDiscrepancy_
const_iterator end() const
MonitorElement * hcalOccFbDiscrepancy_
const uint32_t * amcPayload(uint32_t amc)
unsigned long long uint64_t
Definition: Time.h:15
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * hcalOccFb2Discrepancy_
LuminosityBlockNumber_t luminosityBlock() const
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
MonitorElement * hcalTPRawEtSent_
MonitorElement * hcalOccRecdFb2_
MonitorElement * hcalTPRawEtCorrelationHF_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
edm::EventID id() const
Definition: EventBase.h:59
MonitorElement * ecalLinkError_
HLT enums.
MonitorElement * hcalOccRecdFb_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
MonitorElement * last20Mismatches_
MonitorElement * hcalTPRawEtDiffNoMatch_
MonitorElement * ecalOccEtDiscrepancy_
MonitorElement * maxEvtLinkErrorsByLumiECAL_
MonitorElement * ecalOccRecdEtWgt_
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalTPSourceSent_
uint32_t orbitNumber()
Definition: UCTDAQRawData.h:41
MonitorElement * HFmismatchesPerBx_
MonitorElement * ecalOccLinkMasked_
edm::EDGetTokenT< FEDRawDataCollection > fedRawData_
MonitorElement * hcalOccNoMatch_
MonitorElement * hcalOccSentNotRecd_
MonitorElement * hcalLinkError_
MonitorElement * ecalOccSentNotRecd_
const_iterator begin() const
MonitorElement * orbitErrors_
Definition: event.py:1
Definition: Run.h:45
uint32_t layer1Phi()
Definition: UCTAMCRawData.h:25
MonitorElement * hcalDiscrepancy_