CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalRawDataMonitor.cc
Go to the documentation of this file.
1 
7 
8 
10  Online_ = ps.getParameter<bool>("online");
11  mergeRuns_ = ps.getParameter<bool>("mergeRuns");
12  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup");
13  debug_ = ps.getUntrackedParameter<int>("debug",0);
14  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder", "Hcal/"); // Hcal
15  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
16  prefixME_.append("/");
17  subdir_ = ps.getUntrackedParameter<std::string>("TaskFolder", "RawDataMonitor_Hcal/"); // RawDataMonitor_Hcal
18  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
19  subdir_.append("/");
20  subdir_=prefixME_+subdir_;
21  AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
22  skipOutOfOrderLS_ = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",true);
23  NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",-1);
24  makeDiagnostics_ = ps.getUntrackedParameter<bool>("makeDiagnostics",false);
25 
26  FEDRawDataCollection_ = ps.getUntrackedParameter<edm::InputTag>("FEDRawDataCollection");
28 
29  excludeHORing2_ = ps.getUntrackedParameter<bool>("excludeHORing2",false);
30 
31  //inputLabelReport_ = ps.getUntrackedParameter<edm::InputTag>("UnpackerReport");
32 
33  // Initialize an array of MonitorElements
35  meChann_DataIntegrityCheck_[1] =meCh_DataIntegrityFED01_;
36  meChann_DataIntegrityCheck_[2] =meCh_DataIntegrityFED02_;
37  meChann_DataIntegrityCheck_[3] =meCh_DataIntegrityFED03_;
38  meChann_DataIntegrityCheck_[4] =meCh_DataIntegrityFED04_;
39  meChann_DataIntegrityCheck_[5] =meCh_DataIntegrityFED05_;
40  meChann_DataIntegrityCheck_[6] =meCh_DataIntegrityFED06_;
41  meChann_DataIntegrityCheck_[7] =meCh_DataIntegrityFED07_;
42  meChann_DataIntegrityCheck_[8] =meCh_DataIntegrityFED08_;
43  meChann_DataIntegrityCheck_[9] =meCh_DataIntegrityFED09_;
44  meChann_DataIntegrityCheck_[10]=meCh_DataIntegrityFED10_;
45  meChann_DataIntegrityCheck_[11]=meCh_DataIntegrityFED11_;
46  meChann_DataIntegrityCheck_[12]=meCh_DataIntegrityFED12_;
47  meChann_DataIntegrityCheck_[13]=meCh_DataIntegrityFED13_;
48  meChann_DataIntegrityCheck_[14]=meCh_DataIntegrityFED14_;
49  meChann_DataIntegrityCheck_[15]=meCh_DataIntegrityFED15_;
50  meChann_DataIntegrityCheck_[16]=meCh_DataIntegrityFED16_;
51  meChann_DataIntegrityCheck_[17]=meCh_DataIntegrityFED17_;
52  meChann_DataIntegrityCheck_[18]=meCh_DataIntegrityFED18_;
53  meChann_DataIntegrityCheck_[19]=meCh_DataIntegrityFED19_;
54  meChann_DataIntegrityCheck_[20]=meCh_DataIntegrityFED20_;
55  meChann_DataIntegrityCheck_[21]=meCh_DataIntegrityFED21_;
56  meChann_DataIntegrityCheck_[22]=meCh_DataIntegrityFED22_;
57  meChann_DataIntegrityCheck_[23]=meCh_DataIntegrityFED23_;
58  meChann_DataIntegrityCheck_[24]=meCh_DataIntegrityFED24_;
59  meChann_DataIntegrityCheck_[25]=meCh_DataIntegrityFED25_;
60  meChann_DataIntegrityCheck_[26]=meCh_DataIntegrityFED26_;
61  meChann_DataIntegrityCheck_[27]=meCh_DataIntegrityFED27_;
62  meChann_DataIntegrityCheck_[28]=meCh_DataIntegrityFED28_;
63  meChann_DataIntegrityCheck_[29]=meCh_DataIntegrityFED29_;
64  meChann_DataIntegrityCheck_[30]=meCh_DataIntegrityFED30_;
65  meChann_DataIntegrityCheck_[31]=meCh_DataIntegrityFED31_;
66 
67  this->reset();
68 } // HcalRawDataMonitor::HcalRawDataMonitor()
69 
70 // destructor
72 
73 // reset
75 {
76 
77  for (int f=0; f<NUMDCCS; f++) {
78  for (int s=0; s<15; s++) {
79  UScount[f][s]=0;}}
80 
81  for (int x=0; x<THREE_FED; x++)
82  for (int y=0; y<THREE_SPG; y++)
84 
85  for (int x=0; x<THREE_FED; x++)
86  for (int y=0; y<THREE_SPG; y++)
88 
89  for (int x=0; x<TWO___FED; x++)
90  for (int y=0; y<TWO__SPGT; y++)
92 
93  for (int x=0; x<TWO___FED; x++)
94  for (int y=0; y<THREE_SPG; y++)
95  DataFlowInd_[x][y]=0;
96 
97  for (int f=0; f<NUMDCCS; f++)
98  for (int x=0; x< TWO_CHANN; x++)
99  for (int y=0; y<TWO__SPGT; y++)
101 
102  for (int i=0; i<(NUMDCCS * NUMSPIGS * HTRCHANMAX); i++)
104 
105  for (int d=0; d<DEPTHBINS; d++) {
106  for (int eta=0; eta<ETABINS; eta++) {
107  for (int phi=0; phi<PHIBINS; phi++){
108  uniqcounter[eta][phi][d] = 0.0;
109  problemcount[eta][phi][d] = 0.0;
110  problemfound[eta][phi][d] = false;
111  }
112  }
113  }
114 
115  // Properly initialze bylumi counters.
116  NumBadHB=0;
117  NumBadHE=0;
118  NumBadHO=0;
119  NumBadHF=0;
120  NumBadHFLUMI=0;
121  NumBadHO0=0;
122  NumBadHO12=0;
123 
124 } // HcalRawDataMonitor::HcalRawDataMonitor()
125 
126 // BeginRun
130  c.get<HcalDbRecord>().get( pSetup );
131 
132  readoutMap_=pSetup->getHcalMapping();
133  DetId detid_;
134  HcalDetId hcaldetid_;
135 
136  // Build a map of readout hardware unit to calorimeter channel
137  std::vector <HcalElectronicsId> AllElIds = readoutMap_->allElectronicsIdPrecision();
138  uint32_t itsdcc =0;
139  uint32_t itsspigot =0;
140  uint32_t itshtrchan=0;
141 
142  // by looping over all precision (non-trigger) items.
143  for (std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin();
144  eid != AllElIds.end();
145  eid++) {
146 
147  //Get the HcalDetId from the HcalElectronicsId
148  detid_ = readoutMap_->lookup(*eid);
149  // NULL if illegal; ignore
150  if (!detid_.null()) {
151  if (detid_.det()!=4) continue; //not Hcal
152  if (detid_.subdetId()!=HcalBarrel &&
153  detid_.subdetId()!=HcalEndcap &&
154  detid_.subdetId()!=HcalOuter &&
155  detid_.subdetId()!=HcalForward) continue;
156 
157  itsdcc =(uint32_t) eid->dccid();
158  itsspigot =(uint32_t) eid->spigot();
159  itshtrchan=(uint32_t) eid->htrChanId();
160  hcaldetid_ = HcalDetId(detid_);
161  stashHDI(hashup(itsdcc,itsspigot,itshtrchan),
162  hcaldetid_);
163  } // if (!detid_.null())
164  }
165 }
166 
167 // Begin LumiBlock
169  const edm::EventSetup& c) {
170  if (LumiInOrder(lumiSeg.luminosityBlock())==false) return;
172  //zeroCounters(); // zero hot cell counters at the start of each luminosity block
174  return;
175 }
176 // Setup
178  // Call base class setup
180  if (!dbe_) {
181  if (debug_>1)
182  std::cout <<"<HcalRawDataMonitor::setup> No DQMStore instance available. Bailing out."<<std::endl;
183  return;}
184 
185  /******* Set up all histograms ********/
186  if (debug_>1)
187  std::cout <<"<HcalRawDataMonitor::beginRun> Setting up histograms"<<std::endl;
188 
190  ProblemsVsLB=dbe_->bookProfile("RAW_Problems_HCAL_vs_LS",
191  "Total HCAL RAW Problems vs lumi section",
192  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
193 
194  ProblemsVsLB_HB=dbe_->bookProfile("Total_RAW_Problems_HB_vs_LS",
195  "Total HB RAW Problems vs lumi section",
196  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,3000);
197  ProblemsVsLB_HE=dbe_->bookProfile("Total_RAW_Problems_HE_vs_LS",
198  "Total HE RAW Problems vs lumi section",
199  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,3000);
200  ProblemsVsLB_HO=dbe_->bookProfile("Total_RAW_Problems_HO_vs_LS",
201  "Total HO RAW Problems vs lumi section",
202  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,3000);
203  ProblemsVsLB_HF=dbe_->bookProfile("Total_RAW_Problems_HF_vs_LS",
204  "Total HF RAW Problems vs lumi section",
205  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,2000);
206  ProblemsVsLB_HBHEHF=dbe_->bookProfile("Total_RAW_Problems_HBHEHF_vs_LS",
207  "Total HBHEHF RAW Problems vs lumi section",
208  NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,2000);
209 
210  ProblemsVsLB->getTProfile()->SetMarkerStyle(20);
211  ProblemsVsLB_HB->getTProfile()->SetMarkerStyle(20);
212  ProblemsVsLB_HE->getTProfile()->SetMarkerStyle(20);
213  ProblemsVsLB_HO->getTProfile()->SetMarkerStyle(20);
214  ProblemsVsLB_HF->getTProfile()->SetMarkerStyle(20);
215  ProblemsVsLB_HBHEHF->getTProfile()->SetMarkerStyle(20);
216  MonitorElement* excludeHO2=dbe_->bookInt("ExcludeHOring2");
217  // Fill with 0 if ring is not to be excluded; fill with 1 if it is to be excluded
218  if (excludeHO2) excludeHO2->Fill(excludeHORing2_==true ? 1 : 0);
219 
220 
221  // Already done in base class:
222  //dbe_->setCurrentFolder(subdir_);
223  //meIevt_ = dbe_->bookInt("EventsProcessed");
224  //if (meIevt_) meIevt_->Fill(-1);
225  //meLevt_ = dbe_->bookInt("EventsProcessed_currentLS");
226  //if (meLevt_) meLevt_->Fill(-1);
227  //meTevt_ = dbe_->bookInt("EventsProcessed_All");
228  //if (meTevt_) meTevt_->Fill(-1);
229  //meTevtHist_=dbe_->book1D("EventsProcessed_AllHists","Counter of Events Processed By This Task",1,0.5,1.5);
230  //if (meTevtHist_) meTevtHist_->Reset();
231 
232  std::string type;
233 
234  dbe_->setCurrentFolder(subdir_ + "Corruption");
235  type = "01 Common Data Format violations";
236  meCDFErrorFound_ = dbe_->book2D(type,type,32,699.5,731.5,9,0.5,9.5);
237  meCDFErrorFound_->setAxisTitle("HCAL FED ID", 1);
238  meCDFErrorFound_->setBinLabel(1, "Hdr1BitUnset", 2);
239  meCDFErrorFound_->setBinLabel(2, "FmtNumChange", 2);
240  meCDFErrorFound_->setBinLabel(3, "BOE not '0x5'", 2);
241  meCDFErrorFound_->setBinLabel(4, "Hdr2Bit Set", 2);
242  meCDFErrorFound_->setBinLabel(5, "Hdr1 36-55", 2);
243  meCDFErrorFound_->setBinLabel(6, "BOE not 0", 2);
244  meCDFErrorFound_->setBinLabel(7, "Trlr1Bit Set", 2);
245  meCDFErrorFound_->setBinLabel(8, "Size Error", 2);
246  meCDFErrorFound_->setBinLabel(9, "TrailerBad", 2);
247 
248  type = "02 DCC Event Format violation";
249  meDCCEventFormatError_ = dbe_->book2D(type,type,32,699.5,731.5,6,0.5,6.5);
250  meDCCEventFormatError_->setAxisTitle("HCAL FED ID", 1);
251  meDCCEventFormatError_->setBinLabel(1, "FmtVers Changed", 2);
252  meDCCEventFormatError_->setBinLabel(2, "StrayBits Changed", 2);
253  meDCCEventFormatError_->setBinLabel(3, "HTRStatusPad", 2);
254  meDCCEventFormatError_->setBinLabel(4, "32bitPadErr", 2);
255  meDCCEventFormatError_->setBinLabel(5, "Number Mismatch Bit Miscalc", 2);
256  meDCCEventFormatError_->setBinLabel(6, "Low 8 HTR Status Bits Miscopy", 2);
257 
258  type = "04 HTR BCN when OrN Diff";
259  meBCNwhenOrNDiff_ = dbe_->book1D(type,type,3564,-0.5,3563.5);
261  meBCNwhenOrNDiff_->setAxisTitle("# of Entries",2);
262 
263  type = "03 OrN NonZero Difference HTR - DCC";
264  meOrNCheck_ = dbe_->book1D(type,type,65,-32.5,32.5);
265  meOrNCheck_->setAxisTitle("htr OrN - dcc OrN",1);
266 
267  type = "03 OrN Inconsistent - HTR vs DCC";
268  meOrNSynch_= dbe_->book2D(type,type,32,700,732, 15,0,15);
269  meOrNSynch_->setAxisTitle("FED #",1);
270  meOrNSynch_->setAxisTitle("Spigot #",2);
271 
272  type = "05 BCN NonZero Difference HTR - DCC";
273  meBCNCheck_ = dbe_->book1D(type,type,501,-250.5,250.5);
274  meBCNCheck_->setAxisTitle("htr BCN - dcc BCN",1);
275 
276  type = "05 BCN Inconsistent - HTR vs DCC";
277  meBCNSynch_= dbe_->book2D(type,type,32,700,732, 15,0,15);
278  meBCNSynch_->setAxisTitle("FED #",1);
279  meBCNSynch_->setAxisTitle("Slot #",2);
280 
281  type = "06 EvN NonZero Difference HTR - DCC";
282  meEvtNCheck_ = dbe_->book1D(type,type,601,-300.5,300.5);
283  meEvtNCheck_->setAxisTitle("htr Evt # - dcc Evt #",1);
284 
285  type = "06 EvN Inconsistent - HTR vs DCC";
286  meEvtNumberSynch_= dbe_->book2D(type,type,32,700,732, 15,0,15);
287  meEvtNumberSynch_->setAxisTitle("FED #",1);
288  meEvtNumberSynch_->setAxisTitle("Slot #",2);
289 
290  // ----------------
291  // | E!P | UE | TR |
292  // ----| ND | OV | ID |
293  // | T | CRC | ST | ODD|
294  // --------------------
295  type="07 LRB Data Corruption Indicators";
298  THREE_SPG,0,THREE_SPG);
299  label_xFEDs (meLRBDataCorruptionIndicators_, 4); // 3 bins + 1 margin per ch.
300  label_ySpigots(meLRBDataCorruptionIndicators_, 4); // 3 bins + 1 margin each spgt
301 
302  // ----------------
303  // | CT | BE | |
304  // | HM | 15 | WW | (Wrong Wordcount)
305  // | TM | CK | IW | (Illegal Wordcount)
306  // ----------------
307  type="08 Half-HTR Data Corruption Indicators";
310  THREE_SPG,0,THREE_SPG);
311  label_xFEDs (meHalfHTRDataCorruptionIndicators_, 4); // 3 bins + 1 margin per ch.
312  label_ySpigots(meHalfHTRDataCorruptionIndicators_, 4); // 3 bins + 1 margin each spgt
313 
314  // ------------
315  // | !DV | Er |
316  // | NTS | Cap |
317  // ------------
318  type = "09 Channel Integrity Summarized by Spigot";
321  TWO__SPGT,0,TWO__SPGT);
322  label_xFEDs (meChannSumm_DataIntegrityCheck_, 3); // 2 bins + 1 margin per ch.
323  label_ySpigots(meChannSumm_DataIntegrityCheck_, 3); // 2 bins + 1 margin per spgt
324 
325  dbe_->setCurrentFolder(subdir_ + "Corruption/Channel Data Integrity");
326  char label[256];
327  for (int f=0; f<NUMDCCS; f++){
328  snprintf(label, 256, "FED %03d Channel Integrity", f+700);
329  meChann_DataIntegrityCheck_[f] = dbe_->book2D(label,label,
331  TWO__SPGT,0,TWO__SPGT);
332  label_xChanns (meChann_DataIntegrityCheck_[f], 3); // 2 bins + 1 margin per ch.
333  label_ySpigots(meChann_DataIntegrityCheck_[f], 3); // 2 bins + 1 margin per spgt
334  ;}
335 
336  dbe_->setCurrentFolder(subdir_ + "Data Flow");
337  type="DCC Event Counts";
338  mefedEntries_ = dbe_->book1D(type,type,32,699.5,731.5);
339 
340  type = "BCN from DCCs";
341  medccBCN_ = dbe_->book1D(type,type,3564,-0.5,3563.5);
342  medccBCN_->setAxisTitle("BCN",1);
343  medccBCN_->setAxisTitle("# of Entries",2);
344 
345  type = "BCN from HTRs";
346  meBCN_ = dbe_->book1D(type,type,3564,-0.5,3563.5);
347  meBCN_->setAxisTitle("BCN",1);
348  meBCN_->setAxisTitle("# of Entries",2);
349 
350  type = "DCC Data Block Size Distribution";
351  meFEDRawDataSizes_=dbe_->book1D(type,type,1200,-0.5,12000.5);
352  meFEDRawDataSizes_->setAxisTitle("# of bytes",1);
353  meFEDRawDataSizes_->setAxisTitle("# of Data Blocks",2);
354 
355  type = "DCC Data Block Size Profile";
356  meEvFragSize_ = dbe_->bookProfile(type,type,32,699.5,731.5,100,-1000.0,12000.0,"");
357  type = "DCC Data Block Size Each FED";
358  meEvFragSize2_ = dbe_->book2D(type,type,64,699.5,731.5, 240,0,12000);
359 
360  // ------------
361  // | OW | OFW | "Two Caps HTR; Three Caps FED."
362  // | BZ | BSY |
363  // | EE | RL |
364  // ----------------
365  // | CE | (corrected error, Hamming code)
366  // ------
367  type = "01 Data Flow Indicators";
368  meDataFlowInd_= dbe_->book2D(type,type,
370  THREE_SPG,0,THREE_SPG);
371  label_xFEDs (meDataFlowInd_, 3); // 2 bins + 1 margin per ch.
372  label_ySpigots(meDataFlowInd_, 4); // 3 bins + 1 margin each spgt
373 
374  dbe_->setCurrentFolder(subdir_ + "Diagnostics");
375 
376  type = "DCC Firmware Version";
377  meDCCVersion_ = dbe_->bookProfile(type,type, 32, 699.5, 731.5, 256, -0.5, 255.5);
378  meDCCVersion_ ->setAxisTitle("FED ID", 1);
379 
380  type = "HTR Status Word HBHE";
381  HTR_StatusWd_HBHE = dbe_->book1D(type,type,16,-0.5,15.5);
383 
384  type = "HTR Status Word HF";
385  HTR_StatusWd_HF = dbe_->book1D(type,type,16,-0.5,15.5);
387 
388  type = "HTR Status Word HO";
389  HTR_StatusWd_HO = dbe_->book1D(type,type,16,-0.5,15.5);
391 
392  int maxbits = 16;//Look at all 16 bits of the Error Words
393  type = "HTR Status Word by Crate";
394  meStatusWdCrate_ = dbe_->book2D(type,type,18,-0.5,17.5,maxbits,-0.5,maxbits-0.5);
395  meStatusWdCrate_ -> setAxisTitle("Crate #",1);
397 
398  type = "Unpacking - HcalHTRData check failures";
399  meInvHTRData_= dbe_->book2D(type,type,16,-0.5,15.5,32,699.5,731.5);
400  meInvHTRData_->setAxisTitle("Spigot #",1);
401  meInvHTRData_->setAxisTitle("DCC #",2);
402 
403  type = "HTR Fiber Orbit Message BCN";
404  meFibBCN_ = dbe_->book1D(type,type,3564,-0.5,3563.5);
405  meFibBCN_->setAxisTitle("BCN of Fib Orb Msg",1);
406 
407  type = "HTR Status Word - Crate 0";
408  meCrate0HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
409  meCrate0HTRStatus_ ->setAxisTitle("Slot #",1);
411 
412  type = "HTR Status Word - Crate 1";
413  meCrate1HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
414  meCrate1HTRStatus_ ->setAxisTitle("Slot #",1);
416 
417  type = "HTR Status Word - Crate 2";
418  meCrate2HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
419  meCrate2HTRStatus_ ->setAxisTitle("Slot #",1);
421 
422  type = "HTR Status Word - Crate 3";
423  meCrate3HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
424  meCrate3HTRStatus_ ->setAxisTitle("Slot #",1);
426 
427  type = "HTR Status Word - Crate 4";
428  meCrate4HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
429  meCrate4HTRStatus_ ->setAxisTitle("Slot #",1);
431 
432  type = "HTR Status Word - Crate 5";
433  meCrate5HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
434  meCrate5HTRStatus_ ->setAxisTitle("Slot #",1);
436 
437  type = "HTR Status Word - Crate 6";
438  meCrate6HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
439  meCrate6HTRStatus_ ->setAxisTitle("Slot #",1);
441 
442  type = "HTR Status Word - Crate 7";
443  meCrate7HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
444  meCrate7HTRStatus_ ->setAxisTitle("Slot #",1);
446 
447  type = "HTR Status Word - Crate 9";
448  meCrate9HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
449  meCrate9HTRStatus_ ->setAxisTitle("Slot #",1);
451 
452  type = "HTR Status Word - Crate 10";
453  meCrate10HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
454  meCrate10HTRStatus_ ->setAxisTitle("Slot #",1);
456 
457  type = "HTR Status Word - Crate 11";
458  meCrate11HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
459  meCrate11HTRStatus_ ->setAxisTitle("Slot #",1);
461 
462  type = "HTR Status Word - Crate 12";
463  meCrate12HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
464  meCrate12HTRStatus_ ->setAxisTitle("Slot #",1);
466 
467  type = "HTR Status Word - Crate 13";
468  meCrate13HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
469  meCrate13HTRStatus_ ->setAxisTitle("Slot #",1);
471 
472  type = "HTR Status Word - Crate 14";
473  meCrate14HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
474  meCrate14HTRStatus_ ->setAxisTitle("Slot #",1);
476 
477  type = "HTR Status Word - Crate 15";
478  meCrate15HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
479  meCrate15HTRStatus_ ->setAxisTitle("Slot #",1);
481 
482  type = "HTR Status Word - Crate 17";
483  meCrate17HTRStatus_ = dbe_->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5);
484  meCrate17HTRStatus_ ->setAxisTitle("Slot #",1);
486 
487  type = "HTR UnSuppressed Event Fractions";
488  meUSFractSpigs_ = dbe_->book1D(type,type,481,0,481);
489  for(int f=0; f<NUMDCCS; f++) {
490  snprintf(label, 256, "FED 7%02d", f);
492  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
493  snprintf(label, 256, "sp%02d", s);
494  meUSFractSpigs_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
495 
496  // Firmware version
497  type = "HTR Firmware Version";
498  // Maybe change to Profile histo eventually
499  //meHTRFWVersion_ = dbe_->bookProfile(type,type,18,-0.5,17.5,245,10.0,255.0,"");
500  meHTRFWVersion_ = dbe_->book2D(type,type ,18,-0.5,17.5,180,75.5,255.5);
501  meHTRFWVersion_->setAxisTitle("Crate #",1);
502  meHTRFWVersion_->setAxisTitle("HTR Firmware Version",2);
503 
504  type = "HTR Fiber 1 Orbit Message BCNs";
505  meFib1OrbMsgBCN_= dbe_->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5);
506  type = "HTR Fiber 2 Orbit Message BCNs";
507  meFib2OrbMsgBCN_= dbe_->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5);
508  type = "HTR Fiber 3 Orbit Message BCNs";
509  meFib3OrbMsgBCN_= dbe_->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5);
510  type = "HTR Fiber 4 Orbit Message BCNs";
511  meFib4OrbMsgBCN_= dbe_->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5);
512  type = "HTR Fiber 5 Orbit Message BCNs";
513  meFib5OrbMsgBCN_= dbe_->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5);
514  type = "HTR Fiber 6 Orbit Message BCNs";
515  meFib6OrbMsgBCN_= dbe_->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5);
516  type = "HTR Fiber 7 Orbit Message BCNs";
517  meFib7OrbMsgBCN_= dbe_->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5);
518  type = "HTR Fiber 8 Orbit Message BCNs";
519  meFib8OrbMsgBCN_= dbe_->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5);
520 
521 }
522 
523 // Analyze
525  if (!IsAllowedCalibType()) return;
526  if (LumiInOrder(e.luminosityBlock())==false) return;
527 
528  HcalBaseDQMonitor::analyze(e,s); // base class increments ievt_, etc. counters
529 
530  // try to get die Data
532  if (!(e.getByLabel(FEDRawDataCollection_,rawraw)))
533  // if (!(e.getByType(rawraw)))
534  {
535  edm::LogWarning("HcalRawDataMonitor")<<" raw data with label "<<FEDRawDataCollection_ <<" not available";
536  return;
537  }
539  if (!(e.getByLabel(digiLabel_,report)))
540  {
541  edm::LogWarning("HcalRawDataMonitor")<<" Unpacker Report "<<digiLabel_<<" not available";
542  return;
543  }
544 
545  // all objects grabbed; event is good
546  if (debug_>1) std::cout <<"\t<HcalRawDataMonitor::analyze> Processing good event! event # = "<<ievt_<<std::endl;
547 
548  // Raw Data collection was grabbed successfully; process the Event
549  processEvent(*rawraw, *report);
550 
551  //Loop over all cells, tallying problem counts before resetting
552  //Extract the subdetector region given the location
553  for (int d=0; d<DEPTHBINS; d++) {
554  for (int eta=0; eta<ETABINS; eta++) {
555  int ieta=CalcIeta(eta,d+1);
556  if (ieta==-9999) continue;
557  for (int phi=0; phi<PHIBINS; phi++){
558  if (problemcount[eta][phi][d]) {
559  // std::cout<<" "<<eta<<","<<phi<<","<<d<<" count:"<<problemcount[eta][phi][d]<<std::endl;
560  HcalSubdetector subdet=HcalEmpty;
561  if (isHB(eta,d+1))subdet=HcalBarrel;
562  else if (isHE(eta,d+1)) subdet=HcalEndcap;
563  else if (isHF(eta,d+1)) subdet=HcalForward;
564  else if (isHO(eta,d+1)) subdet=HcalOuter;
565  if (subdet!=HcalEmpty){
566  if (subdet==HcalBarrel) {if(uniqcounter[eta][phi][d]<1) NumBadHB+= problemcount[eta][phi][d]; uniqcounter[eta][phi][d]++; }
567  else if (subdet==HcalEndcap) {if(uniqcounter[eta][phi][d]<1) NumBadHE+= problemcount[eta][phi][d]; uniqcounter[eta][phi][d]++; }
569  else if (subdet==HcalOuter)
570  {
571  if(uniqcounter[eta][phi][d]<1)
572  NumBadHO += problemcount[eta][phi][d];
573  uniqcounter[eta][phi][d]++;
574  if (abs(ieta)<5) NumBadHO0+= problemcount[eta][phi][d];
575  else NumBadHO12+= problemcount[eta][phi][d];
576  }
577  else if (subdet==HcalForward)
578  {
579  if(uniqcounter[eta][phi][d]<1)
580  NumBadHF+= problemcount[eta][phi][d];
581  uniqcounter[eta][phi][d]++;
582  if (d==1 && (abs(ieta)==33 || abs(ieta)==34))
584  else if (d==2 && (abs(ieta)==35 || abs(ieta)==36))
586  }
587  }
588  problemcount[eta][phi][d]=0;
589  }
590  }
591  }
592  }
593 }
594 
596  const HcalUnpackerReport& report){
597  if(!dbe_) {
598  if (debug_>1)
599  printf("HcalRawDataMonitor::processEvent DQMStore not instantiated!\n");
600  return;}
601 
602  // Fill event counters (underflow bins of histograms)
606  for (int f=0; f<NUMDCCS; f++)
609 
610  // Loop over all FEDs reporting the event, unpacking if good.
612  const FEDRawData& fed = rawraw.FEDData(i);
613  if (fed.size()<12) continue; //At least the size of headers and trailers of a DCC.
614 
615  int value = (int)((const HcalDCCHeader*)(fed.data()))->getCalibType() ;
616  if(value>7)
617  {
618  edm::LogWarning("HcalMonitorModule::CalibTypeFilter") << "Unexpected Calibration type: "<< value << " in FED: "<<i<<" (should be 0-7). I am bailing out...";
619  return;
620  }
621 
622  unpack(fed); //Interpret data, fill histograms, everything.
623  }
624 
625  //increment problemcount[] where problemfound[], and clear problemfound[]
626  for (int x=0; x<ETABINS; x++)
627  for (int y=0; y<PHIBINS; y++)
628  for (int z=0; z<DEPTHBINS; z++)
629  if (problemfound[x][y][z]) {
630  problemcount[x][y][z]++;
631  problemfound[x][y][z]=false;
632  }
633  return;
634 } //void HcalRawDataMonitor::processEvent()
635 
636 // Process one FED's worth (one DCC's worth) of the event data.
638 
639  // get the DCC header & trailer (or bail out)
640  const HcalDCCHeader* dccHeader=(const HcalDCCHeader*)(raw.data());
641  if(!dccHeader) return;
642  unsigned char* trailer_ptr = (unsigned char*) (raw.data()+raw.size()-sizeof(uint64_t));
643  FEDTrailer trailer = FEDTrailer(trailer_ptr);
644 
645  // FED id declared in the header
646  int dccid=dccHeader->getSourceId();
647  //Force 0<= dcc_ <= 31
648  int dcc_=std::max(0,dccid-700);
649  dcc_ = std::min(dcc_,31);
650  if(debug_>1) std::cout << "DCC " << dccid << std::endl;
651  uint64_t* dccfw= (uint64_t*) (raw.data()+(sizeof(uint64_t)*2)); //64-bit DAQ word number 2 (from 0)
652  int dcc_fw = ( ((*dccfw)>>(6*8))&0x00000000000000FF ); //Shift right 6 bytes, get that low byte.
653  meDCCVersion_ -> Fill(dccid,dcc_fw);
654 
655  //Before all else, how much data are we dealing with here?
656  uint64_t* lastDataWord = (uint64_t*) ( raw.data()+(raw.size())-(1*sizeof(uint64_t)) );
657  int EvFragLength = (int) (*lastDataWord>>(4*8)) & 0x0000000000FFFFFF ; //Shift right 4 bytes, get low 3 bytes.
658  meFEDRawDataSizes_->Fill(EvFragLength*8); //# 64-bit DAQ words *8 = # bytes.
659  meEvFragSize_ ->Fill(dccid, EvFragLength*8); //# 64-bit DAQ words *8 = # bytes.
660  meEvFragSize2_ ->Fill(dccid, EvFragLength*8); //# 64-bit DAQ words *8 = # bytes.
661 
662  //Orbit, BunchCount, and Event Numbers
663  unsigned long dccEvtNum = dccHeader->getDCCEventNumber();
664  int dccBCN = dccHeader->getBunchId();
665  //Mask down to 5 bits, since only used for comparison to HTR's five bit number...
666  unsigned int dccOrN = (unsigned int) (dccHeader->getOrbitNumber() & 0x0000001F);
667  medccBCN_ -> Fill(dccBCN);
668 
670  bool CDFProbThisDCC = false;
671  /* 1 */ //There should always be a second CDF header word indicated.
672  if (!dccHeader->thereIsASecondCDFHeaderWord()
673  //TESTME_HCALRAWDATA//
674  //|| ((dccid==702)&&(tevt_%2==0))
675  ) {
676  meCDFErrorFound_->Fill(dccid, 1);
677  CDFProbThisDCC = true;
678  }
679  /* 2 */ //Make sure a reference CDF Version value has been recorded for this dccid
680  CDFvers_it = CDFversionNumber_list.find(dccid);
681  if (CDFvers_it == CDFversionNumber_list.end()) {
682  CDFversionNumber_list.insert(std::pair<int,short>
683  (dccid,dccHeader->getCDFversionNumber() ) );
684  CDFvers_it = CDFversionNumber_list.find(dccid);
685  } // then check against it.
686  if (dccHeader->getCDFversionNumber()!= CDFvers_it->second) {
687  meCDFErrorFound_->Fill(dccid,2);
688  CDFProbThisDCC = true;
689  }
690  /* 3 */ //There should always be a '5' in CDF Header word 0, bits [63:60]
691  if (dccHeader->BOEshouldBe5Always()!=5) {
692  meCDFErrorFound_->Fill(dccid, 3);
693  CDFProbThisDCC = true;
694  }
695  /* 4 */ //There should never be a third CDF Header word indicated.
696  if (dccHeader->thereIsAThirdCDFHeaderWord()) {
697  meCDFErrorFound_->Fill(dccid, 4);
698  CDFProbThisDCC = true;
699  }
700  /* 5 */ //Make sure a reference value of Reserved Bits has been recorded for this dccid
703  CDFReservedBits_list.insert(std::pair<int,short>
704  (dccid,dccHeader->getSlink64ReservedBits() & 0x0000FFFF ) );
706  } // then check against it.
707  if (((int) dccHeader->getSlink64ReservedBits() & 0x0000FFFF ) != CDFReservedBits_it->second) {
708  meCDFErrorFound_->Fill(dccid,5);
709  //CDFProbThisDCC = true;
710  }
711  /* 6 */ //There should always be 0x0 in CDF Header word 1, bits [63:60]
712  if (dccHeader->BOEshouldBeZeroAlways() !=0) {
713  meCDFErrorFound_->Fill(dccid, 6);
714  CDFProbThisDCC = true;
715  }
716  /* 7 */ //There should only be one trailer
717  if (trailer.moreTrailers()) {
718  meCDFErrorFound_->Fill(dccid, 7);
719  CDFProbThisDCC = true;
720  }
721  // if trailer.
722  /* 8 */ //CDF Trailer [55:30] should be the # 64-bit words in the EvFragment
723  if ((uint64_t) raw.size() != ( (uint64_t) trailer.lenght()*sizeof(uint64_t)) ) //The function name is a typo! Awesome.
724  {
725  meCDFErrorFound_->Fill(dccid, 8);
726  CDFProbThisDCC = true;
727  }
728  /* 9 */ //There is a rudimentary sanity check built into the FEDTrailer class
729  if (!trailer.check()) {
730  meCDFErrorFound_->Fill(dccid, 9);
731  CDFProbThisDCC = true;
732  }
733  if (CDFProbThisDCC) {
734  //Set the problem flag for the ieta, iphi of any channel in this DCC
735  mapDCCproblem(dcc_);
736  if (debug_>0) std::cout <<"CDFProbThisDCC"<<std::endl;
737  }
738 
739  mefedEntries_->Fill(dccid);
740 
741  CDFProbThisDCC = false; // reset for the next go-round.
742 
743  char CRC_err;
744  for(int i=0; i<HcalDCCHeader::SPIGOT_COUNT; i++) {
745  CRC_err = ((dccHeader->getSpigotSummary(i) >> 10) & 0x00000001);
746  if (CRC_err) {
747  mapDCCproblem(dcc_);
748  //Set the problem flag for the ieta, iphi of any channel in this DCC
749  if (debug_>0) std::cout <<"HTR Problem: CRC_err"<<std::endl;
750  }
751  }
752 
753  // The DCC TTS state at event-sending time
754  char TTS_state = (char)trailer.ttsBits();
755  // The DCC TTS state at time L1A received (event enqueued to be built)
756  char L1AtimeTTS_state=(char) dccHeader->getAcceptTimeTTS();
757  if (TTS_state==L1AtimeTTS_state) ;//party
758 
760  /* 1 */ //Make sure a reference value of the DCC Event Format version has been noted for this dcc.
761  DCCEvtFormat_it = DCCEvtFormat_list.find(dccid);
762  if (DCCEvtFormat_it == DCCEvtFormat_list.end()) {
763  DCCEvtFormat_list.insert(std::pair<int,short>
764  (dccid,dccHeader->getDCCDataFormatVersion() ) );
765  DCCEvtFormat_it = DCCEvtFormat_list.find(dccid);
766  } // then check against it.
767  if (dccHeader->getDCCDataFormatVersion()!= DCCEvtFormat_it->second) {
768  meDCCEventFormatError_->Fill(dccid,1);
769  mapDCCproblem(dcc_);
770  if (debug_>0)std::cout <<"DCC Error Type 1"<<std::endl;
771  }
772  /* 2 */ //Check for ones where there should always be zeros
773  if (false) //dccHeader->getByte1Zeroes() || dccHeader->getByte3Zeroes() || dccHeader->getByte567Zeroes())
774  {
775  meDCCEventFormatError_->Fill(dccid,2);
776  mapDCCproblem(dcc_);
777  if (debug_>0)std::cout <<"DCC Error Type 2"<<std::endl;
778  }
779  /* 3 */ //Check that there are zeros following the HTR Status words.
780  int SpigotPad = HcalDCCHeader::SPIGOT_COUNT;
781  if ( (((uint64_t) dccHeader->getSpigotSummary(SpigotPad) )
782  | ((uint64_t) dccHeader->getSpigotSummary(SpigotPad+1))
783  | ((uint64_t) dccHeader->getSpigotSummary(SpigotPad+2))) != 0){
784  meDCCEventFormatError_->Fill(dccid,3);
785  mapDCCproblem(dcc_);
786  if (debug_>0)std::cout <<"DCC Error Type 3"<<std::endl;
787  }
788  /* 4 */ //Check that there are zeros following the HTR Payloads, if needed.
789  int nHTR32BitWords=0;
790  // add up all the declared HTR Payload lengths
791  for(int i=0; i<HcalDCCHeader::SPIGOT_COUNT; i++) {
792  nHTR32BitWords += dccHeader->getSpigotDataLength(i); }
793  // if it's an odd number, check for the padding zeroes
794  if (( nHTR32BitWords % 2) == 1) {
795  uint64_t* lastDataWord = (uint64_t*) ( raw.data()+raw.size()-(2*sizeof(uint64_t)) );
796  if ((*lastDataWord>>32) != 0x00000000){
797  meDCCEventFormatError_->Fill(dccid, 4);
798  mapDCCproblem(dcc_);
799  if (debug_>0)std::cout <<"DCC Error Type 4"<<std::endl;
800  }
801  }
802 
803  //unsigned char HTRErrorList=0;
804  //for(int j=0; j<HcalDCCHeader::SPIGOT_COUNT; j++) {
805  // HTRErrorList=dccHeader->getSpigotErrorBits(j);
806  //}
807 
808  // These will be used in FED-vs-spigot 2D Histograms
809  const int fed3offset = 1 + (4*dcc_); //3 bins, plus one of margin, each DCC
810  const int fed2offset = 1 + (3*dcc_); //2 bins, plus one of margin, each DCC
811  if (TTS_state & 0x8) /*RDY*/
812  ;
813  if (TTS_state & 0x2) /*SYN*/
814  {
815  mapDCCproblem(dcc_);
816  if (debug_>0)std::cout <<"TTS_state Error:sync"<<std::endl;
817  }
818  //Histogram per-Spigot bits from the DCC Header
819  int WholeErrorList=0;
820  for(int spigot=0; spigot<HcalDCCHeader::SPIGOT_COUNT; spigot++) {
821  if (!( dccHeader->getSpigotEnabled((unsigned int) spigot)) )
822  continue; //skip when not enabled
823  // This will be used in FED-vs-spigot 2D Histograms
824  const int spg3offset = 1 + (4*spigot); //3 bins, plus one of margin, each spigot
825 
826  if (TTS_state & 0x4) /*BSY*/
827  ++DataFlowInd_[fed2offset+1][spg3offset+1];
828  if (TTS_state & 0x1) /*OFW*/
829  ++DataFlowInd_[fed2offset+1][spg3offset+2];
830 
831  WholeErrorList=dccHeader->getLRBErrorBits((unsigned int) spigot);
832  if (WholeErrorList!=0) {
833  if ((WholeErrorList>>0)&0x01) //HammingCode Corrected -- Not data corruption!
834  DataFlowInd_[fed2offset-1][spg3offset-1]++;
835  if (((WholeErrorList>>1)&0x01)!=0) {//HammingCode Uncorrected Error
836  LRBDataCorruptionIndicators_[fed3offset+1][spg3offset+2]++;
837  mapHTRproblem(dcc_,spigot);
838  }
839  if (((WholeErrorList>>2)&0x01)!=0) {//Truncated data coming into LRB
840  LRBDataCorruptionIndicators_[fed3offset+2][spg3offset+2]++;
841  mapHTRproblem(dcc_,spigot);
842  }
843  if (((WholeErrorList>>3)&0x01)!=0) {//FIFO Overflow
844  LRBDataCorruptionIndicators_[fed3offset+1][spg3offset+1]++;
845  mapHTRproblem(dcc_,spigot);
846  }
847  if (((WholeErrorList>>4)&0x01)!=0) {//ID (EvN Mismatch), htr payload metadeta
848  LRBDataCorruptionIndicators_[fed3offset+2][spg3offset+1]++;
849  mapHTRproblem(dcc_,spigot);
850  }
851  if (((WholeErrorList>>5)&0x01)!=0) {//STatus: hdr/data/trlr error
852  LRBDataCorruptionIndicators_[fed3offset+1][spg3offset+0]++;
853  mapHTRproblem(dcc_,spigot);
854  }
855  if (((WholeErrorList>>6)&0x01)!=0) {//ODD 16-bit word count from HTR
856  LRBDataCorruptionIndicators_[fed3offset+2][spg3offset+0]++;
857  mapHTRproblem(dcc_,spigot);
858  }
859  }
860  if (!dccHeader->getSpigotPresent((unsigned int) spigot)){
861  LRBDataCorruptionIndicators_[fed3offset+0][spg3offset+2]++; //Enabled, but data not present!
862  mapHTRproblem(dcc_,spigot);
863  if (debug_>0)std::cout <<"HTR Problem: Spigot Not Present"<<std::endl;
864  } else {
865  if ( dccHeader->getSpigotDataTruncated((unsigned int) spigot)) {
866  LRBDataCorruptionIndicators_[fed3offset-1][spg3offset+0]++; // EventBuilder truncated babbling LRB
867  mapHTRproblem(dcc_,spigot);
868  if (debug_>0)std::cout <<"HTR Problem: Spigot Data Truncated"<<std::endl;
869  }
870  if ( dccHeader->getSpigotCRCError((unsigned int) spigot)) {
871  LRBDataCorruptionIndicators_[fed3offset+0][spg3offset+0]++;
872  mapHTRproblem(dcc_,spigot);
873  }
874  } //else spigot marked "Present"
875  if (dccHeader->getSpigotDataLength(spigot) <(unsigned long)4) {
876  LRBDataCorruptionIndicators_[fed3offset+0][spg3offset+1]++; //Lost HTR Data for sure.
877  mapHTRproblem(dcc_,spigot);
878  if (debug_>0)std::cout <<"HTR Problem: Spigot Data Length too small"<<std::endl;
879  }
880  }
881 
882  // Walk through the HTR data...
883  HcalHTRData htr;
884  for (int spigot=0; spigot<HcalDCCHeader::SPIGOT_COUNT; spigot++) {
885  const int spg3offset = 1 + (4*spigot); //3 bins, plus one of margin, each spigot
886  const int spg2offset = 1 + (3*spigot); //3 bins, plus one of margin, each spigot
887  if (!dccHeader->getSpigotPresent(spigot)) continue;
888 
889  // Load the given decoder with the pointer and length from this spigot.
890  // i.e. initialize htr, within dcc raw data size.
891  dccHeader->getSpigotData(spigot,htr, raw.size());
892  const unsigned short* HTRraw = htr.getRawData();
893 
894  // check min length, correct wordcount, empty event, or total length if histo event.
895  if (!htr.check()) {
896  meInvHTRData_ -> Fill(spigot,dccid);
897  mapHTRproblem(dcc_,spigot);
898  if (debug_>0)std::cout <<"HTR Problem: HTR check fails"<<std::endl;
899  }
900 
901  unsigned short HTRwdcount = htr.getRawLength();
902  if (HTRwdcount == 0)
903  {
904  edm::LogWarning("HcalMonitorModule::RawDataTas") << "Unexpected Raw Length: "<< HTRwdcount <<" I am bailing out...";
905  continue;
906  }
907 
908  // Size checks for internal consistency
909  // getNTP(), get NDD() seems to be mismatched with format. Manually:
910  int NTP = ((htr.getExtHdr6() >> 8) & 0x00FF);
911  int NDAQ = (HTRraw[htr.getRawLength() - 4] & 0x7FF);
912 
913  if ( ! ((HTRwdcount != 8) ||
914  (HTRwdcount != 12 + NTP + NDAQ) ||
915  (HTRwdcount != 20 + NTP + NDAQ) )) {
916  ++HalfHTRDataCorruptionIndicators_[fed3offset+2][spg3offset+0];
917  mapHTRproblem(dcc_,spigot);
918  if (debug_>0)std::cout <<"HTR Problem: NTP+NDAQ size consistency check fails"<<std::endl;
919  //incompatible Sizes declared. Skip it.
920  continue; }
921  bool EE = ((dccHeader->getSpigotErrorBits(spigot) >> 2) & 0x01);
922  if (EE) {
923  if (HTRwdcount != 8) { //incompatible Sizes declared. Skip it.
924  ++HalfHTRDataCorruptionIndicators_[fed3offset+2][spg3offset+1];
925  if (debug_>0)std::cout <<"HTR Problem: HTRwdcount !=8"<<std::endl;
926  }
927  DataFlowInd_[fed2offset+0][spg3offset+0]++;
928  continue;}
929  else{ //For non-EE, both CompactMode and !CompactMode
930  bool CM = (htr.getExtHdr7() >> 14)&0x0001;
931  int paddingsize = ((NDAQ+NTP)%2); //Extra padding to make HTRwdcount even
932  if (( CM && ( (HTRwdcount-NDAQ-NTP-paddingsize) != 12) )
933  ||
934  (!CM && ( (HTRwdcount-NDAQ-NTP-paddingsize) != 20) ) ) { //incompatible Sizes declared. Skip it.
935  ++HalfHTRDataCorruptionIndicators_[fed3offset+2][spg3offset+1];
936  mapHTRproblem(dcc_,spigot);
937  continue;} }
938 
939  if (htr.isHistogramEvent()) continue;
940 
941  //We trust the data now. Finish with the check against DCCHeader
942  unsigned int htrOrN = htr.getOrbitNumber();
943  unsigned int htrBCN = htr.getBunchNumber();
944  unsigned int htrEvtN = htr.getL1ANumber();
945  meBCN_->Fill(htrBCN); //The only periodic number for whole events.
946 
947  if (( (htrOrN == dccOrN ) &&
948  (htrBCN == (unsigned int) dccBCN) )
949  != (dccHeader->getBxMismatchWithDCC(spigot)) ){
950  meDCCEventFormatError_->Fill(dccid,5);
951  mapHTRproblem(dcc_,spigot);
952  if (debug_>0)std::cout <<"Orbit or BCN HTR/DCC mismatch"<<std::endl;
953  }
954  if ( (htrEvtN == dccEvtNum) !=
955  dccHeader->getSpigotValid(spigot) ) {
956  meDCCEventFormatError_->Fill(dccid,5);
957  mapHTRproblem(dcc_,spigot);
958  if (debug_>0)std::cout <<"DCC invalid spigot"<<std::endl;
959  }
960  int cratenum = htr.readoutVMECrateId();
961  float slotnum = htr.htrSlot() + 0.5*htr.htrTopBottom();
962  if (debug_ > 0) HTRPrint(htr,debug_);
963  unsigned int htrFWVer = htr.getFirmwareRevision() & 0xFF;
964  meHTRFWVersion_->Fill(cratenum,htrFWVer);
965 
967  int EvtNdiff = htrEvtN - dccEvtNum;
968  if (EvtNdiff!=0) {
969  meEvtNumberSynch_->Fill(dccid,spigot);
970  mapHTRproblem(dcc_,spigot);
971  meEvtNCheck_->Fill(EvtNdiff);
972  if (debug_ == 1)std::cout << "++++ Evt # out of sync, ref, this HTR: "<< dccEvtNum << " "<<htrEvtN <<std::endl;
973  }
974 
976  int BCNdiff = htrBCN-dccBCN;
977  if ((BCNdiff!=0)
978  //TESTME_HCALRAWDATA//
979  //|| ((dccid==727) && (spigot==8) && (dccEvtNum%3==0))
980  ){
981  meBCNSynch_->Fill(dccid,spigot);
982  mapHTRproblem(dcc_,spigot);
983  meBCNCheck_->Fill(BCNdiff);
984  if (debug_==1)std::cout << "++++ BCN # out of sync, ref, this HTR: "<< dccBCN << " "<<htrBCN <<std::endl;
985  }
986 
988  int OrNdiff = htrOrN-dccOrN;
989  if (OrNdiff!=0) {
990  meOrNSynch_->Fill(dccid,spigot);
991  mapHTRproblem(dcc_,spigot);
992  meOrNCheck_->Fill(OrNdiff);
993  meBCNwhenOrNDiff_->Fill(htrBCN); // Are there special BCN where OrN mismatched occur? Let's see.
994  if (debug_==1)std::cout << "++++ OrN # out of sync, ref, this HTR: "<< dccOrN << " "<<htrOrN <<std::endl;
995  }
996 
997  bool htrUnSuppressed=(HTRraw[6]>>15 & 0x0001);
998  if (htrUnSuppressed) {
999  UScount[dcc_][spigot]++;
1000  int here=1+(HcalDCCHeader::SPIGOT_COUNT*(dcc_))+spigot;
1001  meUSFractSpigs_->Fill(here,
1002  ((double)UScount[dcc_][spigot]));}
1003 
1004  MonitorElement* tmpErr = 0;
1005  HcalDetId HDI = hashedHcalDetId_[hashup(dcc_,spigot)];
1006  if (HDI != HcalDetId::Undefined) {
1007  switch (HDI.subdetId()) {
1008  case (HcalBarrel): {
1009  tmpErr = HTR_StatusWd_HBHE;
1010  } break;
1011  case (HcalEndcap): {
1012  tmpErr = HTR_StatusWd_HBHE;
1013  } break;
1014  case (HcalOuter): {
1015  tmpErr = HTR_StatusWd_HO;
1016  } break;
1017  case (HcalForward): {
1018  tmpErr = HTR_StatusWd_HF;
1019  } break;
1020  default: break;
1021  }
1022  }
1023 
1024  int errWord = htr.getErrorsWord() & 0xFFFF;
1025  if ( (((dccHeader->getSpigotSummary( spigot))>>24)&0x00FF)
1026  != (errWord&0x00FF) ){
1027  meDCCEventFormatError_->Fill(dccid,6);//Low 8 bits miscopied into DCCHeader
1028  mapHTRproblem(dcc_,spigot);
1029  if (debug_>0)std::cout <<"DCC spigot summary error or HTR error word"<<std::endl;
1030  //What other problems may lurk? Spooky.
1031  }
1032  if(tmpErr!=NULL){
1033  for(int i=0; i<16; i++){
1034  int errbit = errWord&(0x01<<i);
1035  // Bit 15 should always be 1; consider it an error if it isn't.
1036  if (i==15) errbit = errbit - 0x8000;
1037  if (errbit !=0) {
1038  tmpErr->Fill(i);
1039  //Only certain bits indicate corrupted data:
1040  switch (i) {
1041  case (14): //CT (obsolete Calibration Trigger scheme used)
1042  HalfHTRDataCorruptionIndicators_[fed3offset+0][spg3offset+2]++;
1043  mapHTRproblem(dcc_,spigot);
1044  if (debug_>0)std::cout <<"HTR Problem: Case 14"<<std::endl;
1045  break;
1046  case (13): //HM
1047  HalfHTRDataCorruptionIndicators_[fed3offset+0][spg3offset+1]++;
1048  mapHTRproblem(dcc_,spigot);
1049  if (debug_>0)std::cout <<"HTR Problem: Case 13"<<std::endl;
1050  break;
1051  case (12): //TM
1052  HalfHTRDataCorruptionIndicators_[fed3offset+0][spg3offset+0]++;
1053  mapHTRproblem(dcc_,spigot);
1054  if (debug_>0)std::cout <<"HTR Problem: Case 12"<<std::endl;
1055  break;
1056  case ( 8): //BE
1057  HalfHTRDataCorruptionIndicators_[fed3offset+1][spg3offset+2]++;
1058  mapHTRproblem(dcc_,spigot);
1059  if (debug_>0)std::cout <<"HTR Problem: Case 8"<<std::endl;
1060  break;
1061  case (15): //b15
1062  HalfHTRDataCorruptionIndicators_[fed3offset+1][spg3offset+1]++;
1063  mapHTRproblem(dcc_,spigot);
1064  break;
1065  case ( 7): //CK
1066  HalfHTRDataCorruptionIndicators_[fed3offset+1][spg3offset+0]++;
1067  mapHTRproblem(dcc_,spigot);
1068  if (debug_>0)std::cout <<"HTR Problem: Case 7"<<std::endl;
1069  break;
1070  //\\case ( 5): //LW removed 2010.02.16
1071  //\\ HalfHTRDataCorruptionIndicators_[fed3offset+2][spg3offset+2]++;
1072  //\\ //Sometimes set spuriously at startup, per-fiber, .: Leniency: 8
1073  //\\ if (HalfHTRDataCorruptionIndicators_[fed3offset+2][spg3offset+2] > 8) {
1074  //\\ if (debug_>0)std::cout <<"HTR Problem: Case 5"<<std::endl;
1075  //\\ break;
1076  //\\ }
1077  case ( 3): //L1 (previous L1A violated trigger rules)
1078  DataFlowInd_[fed2offset+1][spg3offset+0]++; break;
1079  case ( 1): //BZ
1080  DataFlowInd_[fed2offset+0][spg3offset+1]++; break;
1081  case ( 0): //OW
1082  DataFlowInd_[fed2offset+0][spg3offset+2]++;
1083  default: break;
1084  }
1085  meStatusWdCrate_->Fill(cratenum,i);
1086  if (cratenum == 0) meCrate0HTRStatus_ -> Fill(slotnum,i);
1087  else if (cratenum == 1) meCrate1HTRStatus_ -> Fill(slotnum,i);
1088  else if (cratenum == 2) meCrate2HTRStatus_ -> Fill(slotnum,i);
1089  else if (cratenum == 3) meCrate3HTRStatus_ -> Fill(slotnum,i);
1090  else if (cratenum == 4) meCrate4HTRStatus_ -> Fill(slotnum,i);
1091  else if (cratenum == 5) meCrate5HTRStatus_ -> Fill(slotnum,i);
1092  else if (cratenum == 6) meCrate6HTRStatus_ -> Fill(slotnum,i);
1093  else if (cratenum == 7) meCrate7HTRStatus_ -> Fill(slotnum,i);
1094  else if (cratenum == 9) meCrate9HTRStatus_ -> Fill(slotnum,i);
1095  else if (cratenum ==10)meCrate10HTRStatus_ -> Fill(slotnum,i);
1096  else if (cratenum ==11)meCrate11HTRStatus_ -> Fill(slotnum,i);
1097  else if (cratenum ==12)meCrate12HTRStatus_ -> Fill(slotnum,i);
1098  else if (cratenum ==13)meCrate13HTRStatus_ -> Fill(slotnum,i);
1099  else if (cratenum ==14)meCrate14HTRStatus_ -> Fill(slotnum,i);
1100  else if (cratenum ==15)meCrate15HTRStatus_ -> Fill(slotnum,i);
1101  else if (cratenum ==17)meCrate17HTRStatus_ -> Fill(slotnum,i);
1102  }
1103  }
1104  }
1105 
1106  // Fish out Front-End Errors from the precision channels
1107  const short unsigned int* daq_first, *daq_last, *tp_first, *tp_last;
1108  const HcalQIESample* qie_begin, *qie_end, *qie_work;
1109 
1110  // get pointers
1111  htr.dataPointers(&daq_first,&daq_last,&tp_first,&tp_last);
1112  qie_begin=(HcalQIESample*)daq_first;
1113  qie_end=(HcalQIESample*)(daq_last+1); // one beyond last..
1114 
1115  //TESTME_HCALRAWDATA//if (dccid==715 && spigot==5 && tevt_%3==0)
1116  //TESTME_HCALRAWDATA// Chann_DataIntegrityCheck_[dcc_][16][spg2offset]++;
1117 
1119  if (htr.getFormatVersion() < 6 ) { //HcalHTRData::FORMAT_VERSION_COMPACT_DATA is 6
1120 
1121  int lastcapid=-1;
1122  int samplecounter=-1;
1123  int htrchan=-1; // Valid: [1,24]
1124  int chn2offset=0;
1125  int NTS = htr.getNDD(); //number time slices, in precision channels
1126 
1127  ChannSumm_DataIntegrityCheck_ [fed2offset-1][spg2offset+0]=-NTS;//For normalization by client - NB! negative!
1128  // Run over DAQ words for this spigot
1129  for (qie_work=qie_begin; qie_work!=qie_end; qie_work++) {
1130  if (qie_work->raw()==0xFFFF) // filler word
1131  continue;
1132  //Beginning a channel's samples?
1133  if (( 1 + ( 3* (qie_work->fiber()-1) ) + qie_work->fiberChan() ) != htrchan) { //new channel starting
1134  // A fiber [1..8] carries three fiber channels, each is [0..2]. Make htrchan [1..24]
1135  htrchan= (3* (qie_work->fiber()-1) ) + qie_work->fiberChan();
1136  chn2offset = (htrchan*3)+1;
1137  --ChannSumm_DataIntegrityCheck_ [fed2offset-1][spg2offset-1];//event tally -- NB! negative!
1138  --Chann_DataIntegrityCheck_[dcc_][chn2offset-1][spg2offset-1];//event tally -- NB! negative!
1139  if (samplecounter !=-1) { //Wrap up the previous channel if there is one
1140  //Check the previous digi for number of timeslices
1141  if (((samplecounter != NTS) &&
1142  (samplecounter != 1) )
1143  //||
1144  //((htrchan==5) && (spigot==5) && (dcc_==5))
1145  )
1146  { //Wrong DigiSize
1147  ++ChannSumm_DataIntegrityCheck_ [fed2offset+0][spg2offset+0];
1148  ++Chann_DataIntegrityCheck_[dcc_][chn2offset+0][spg2offset+0];
1149  mapChannproblem(dcc_,spigot,htrchan);
1150  if (debug_)std::cout <<"mapChannelProblem: Wrong Digi Size"<<std::endl;
1151  }
1152  }
1153  //set up for this new channel
1154  lastcapid=qie_work->capid();
1155  samplecounter=1;} // fi (qie_work->fiberAndChan() != lastfibchan)
1156  else { //precision samples not the first timeslice
1157  int hope = lastcapid +1;// What capid would we hope for here?
1158  if (hope==4) hope = 0; // What capid would we hope for here?
1159  if (qie_work->capid() != hope){
1160  ++ChannSumm_DataIntegrityCheck_ [fed2offset+1][spg2offset+0];
1161  ++Chann_DataIntegrityCheck_[dcc_][chn2offset+1][spg2offset+0];
1162  mapChannproblem(dcc_,spigot,htrchan);
1163  if (debug_)std::cout <<"mapChannelProblem: Wrong Cap ID"<<std::endl;
1164  }
1165  lastcapid=qie_work->capid();
1166  samplecounter++;}
1167  //For every sample, whether the first of the channel or not, !DV, Er
1168  if (!(qie_work->dv())){
1169  ++ChannSumm_DataIntegrityCheck_ [fed2offset+0][spg2offset+1];
1170  ++Chann_DataIntegrityCheck_[dcc_][chn2offset+0][spg2offset+1];
1171  }
1172  if (qie_work->er()) { // FEE - Front End Error
1173  ++ChannSumm_DataIntegrityCheck_ [fed2offset+1][spg2offset+1];
1174  ++Chann_DataIntegrityCheck_[dcc_][chn2offset+1][spg2offset+1];
1175  mapChannproblem(dcc_,spigot,htrchan);
1176  if (debug_)std::cout <<"mapChannelProblem: FE Error"<<std::endl;
1177  }
1178  } // for (qie_work = qie_begin;...) end loop over all timesamples in this spigot
1179  //Wrap up the last channel
1180  //Check the last digi for number of timeslices
1181  if ((samplecounter != NTS) &&
1182  (samplecounter != 1) &&
1183  (samplecounter !=-1) ) { //Wrong DigiSize (unexpected num. timesamples)
1184  ++ChannSumm_DataIntegrityCheck_ [fed2offset+0][spg2offset+0];
1185  ++Chann_DataIntegrityCheck_[dcc_][chn2offset+0][spg2offset+0];
1186  mapChannproblem(dcc_,spigot,htrchan);
1187  if (debug_)std::cout <<"mapChannelProblem: Wrong Digi Size (last digi)"<<std::endl;
1188  }
1189  } else { // this is the branch for unpacking the compact data format with per-channel headers
1190  const unsigned short* ptr_header=daq_first;
1191  const unsigned short* ptr_end=daq_last+1;
1192  int flavor, error_flags, capid0, channelid;
1193  // int samplecounter=-1; // for a digisize check
1194  int htrchan=-1; // Valid: [1,24]
1195  int chn2offset=0;
1196  int NTS = htr.getNDD(); //number time slices, in precision channels
1197  int Nchan = 3; // 3 channels per fiber
1198  while (ptr_header!=ptr_end) {
1199  if (*ptr_header==0xFFFF) { // impossible filler word
1200  ptr_header++;
1201  continue;
1202  }
1203  error_flags = capid0 = channelid = 0;
1204  // unpack the header word
1205  bool isheader=HcalHTRData::unpack_per_channel_header(*ptr_header,flavor,error_flags,capid0,channelid);
1206  if (!isheader) {
1207  ptr_header++;
1208  continue;
1209  }
1210  // A fiber [1..8] carries three fiber channels, each is [0..2]. Make htrchan [1..24]
1211  int fiber = 1 + ((channelid & 0x1C) >> 2); //Mask and shift to get bits [2:4]
1212  int chan = channelid & 0x3; //bits [0:1]
1213  htrchan = ((fiber -1) * Nchan) + chan + 1; //ta-dah! I really wish everything counted from zero...
1214  chn2offset = ((htrchan-1)*3)+1; //For placing the errors on the histogram. Also very tidy. Sorry.
1215  //debug// if (error_flags) std::cout<<fiber<<","<<chan<<" = "<<htrchan<<" @"<<chn2offset<<std::endl;
1216  ChannSumm_DataIntegrityCheck_ [fed2offset-1][spg2offset-1] -= NTS;//event tally -- NB: negative!
1217  Chann_DataIntegrityCheck_[dcc_][chn2offset-1][spg2offset-1] -= NTS;//event tally -- NB: negative!
1218  if (error_flags & 2) { //a CapId violation (non correct rotation)
1219  ++ChannSumm_DataIntegrityCheck_ [fed2offset+1][spg2offset+0];
1220  ++Chann_DataIntegrityCheck_[dcc_][chn2offset+1][spg2offset+0];
1221  mapChannproblem(dcc_,spigot,htrchan);
1222  }
1223  if (error_flags & 1) { //an asserted Link-Error (Er)
1224  ++ChannSumm_DataIntegrityCheck_ [fed2offset+1][spg2offset+1];
1225  ++Chann_DataIntegrityCheck_[dcc_][chn2offset+1][spg2offset+1];
1226  mapChannproblem(dcc_,spigot,htrchan);
1227  }
1228 
1229  for (ptr_header++;
1230  ptr_header!=ptr_end && !HcalHTRData::is_channel_header(*ptr_header);
1231  ptr_header++);
1232  }
1233  }
1234  unsigned int fib1BCN = htr.getFib1OrbMsgBCN();
1235  unsigned int fib2BCN = htr.getFib2OrbMsgBCN();
1236  unsigned int fib3BCN = htr.getFib3OrbMsgBCN();
1237  unsigned int fib4BCN = htr.getFib4OrbMsgBCN();
1238  unsigned int fib5BCN = htr.getFib5OrbMsgBCN();
1239  unsigned int fib6BCN = htr.getFib6OrbMsgBCN();
1240  unsigned int fib7BCN = htr.getFib7OrbMsgBCN();
1241  unsigned int fib8BCN = htr.getFib8OrbMsgBCN();
1242  meFibBCN_->Fill(fib1BCN);
1243  meFibBCN_->Fill(fib2BCN);
1244  meFibBCN_->Fill(fib3BCN);
1245  meFibBCN_->Fill(fib4BCN);
1246  meFibBCN_->Fill(fib5BCN);
1247  meFibBCN_->Fill(fib6BCN);
1248  meFibBCN_->Fill(fib7BCN);
1249  meFibBCN_->Fill(fib8BCN);
1250  // Disable for now?
1251  meFib1OrbMsgBCN_->Fill(slotnum, cratenum, fib1BCN);
1252  meFib2OrbMsgBCN_->Fill(slotnum, cratenum, fib2BCN);
1253  meFib3OrbMsgBCN_->Fill(slotnum, cratenum, fib3BCN);
1254  meFib4OrbMsgBCN_->Fill(slotnum, cratenum, fib4BCN);
1255  meFib5OrbMsgBCN_->Fill(slotnum, cratenum, fib5BCN);
1256  meFib6OrbMsgBCN_->Fill(slotnum, cratenum, fib6BCN);
1257  meFib7OrbMsgBCN_->Fill(slotnum, cratenum, fib7BCN);
1258  meFib8OrbMsgBCN_->Fill(slotnum, cratenum, fib8BCN);
1259 
1260  } // loop over spigots
1261  return;
1262 } // loop over DCCs void HcalRawDataMonitor::unpack(
1263 
1264 
1265 // End LumiBlock
1267  const edm::EventSetup& c){
1268 
1269 
1276 
1277  // Reset current LS histogram, if it exists
1278  if (ProblemsCurrentLB)
1280  if (ProblemsCurrentLB)
1281  {
1282 
1283  ProblemsCurrentLB->setBinContent(0,0, levt_); // underflow bin contains number of events
1291 
1292  }
1293 
1294  for (int d=0; d<DEPTHBINS; d++) {
1295  for (int eta=0; eta<ETABINS; eta++) {
1296  for (int phi=0; phi<PHIBINS; phi++){
1297  uniqcounter[eta][phi][d] = 0.0;
1298  }
1299  }
1300  }
1301 
1302  UpdateMEs();
1303 }
1304 // EndRun -- Anything to do here?
1306 
1307 // EndJob
1309  if (debug_>0) std::cout <<"HcalRawDataMonitor::endJob()"<<std::endl;
1310  if (enableCleanup_) cleanup(); // when do we force cleanup?
1311 }
1312 
1313 //No size checking; better have enough y-axis bins!
1315  char label[32];
1316  for (int spig=0; spig<HcalDCCHeader::SPIGOT_COUNT; spig++) {
1317  snprintf(label, 32, "Spgt %02d", spig);
1318  me_ptr->setBinLabel((2+(spig*ybins)), label, 2); //margin of 1 at low value
1319  }
1320 }
1321 
1322 //No size checking; better have enough x-axis bins!
1324  char label[32];
1325  for (int ch=0; ch<HcalHTRData::CHANNELS_PER_SPIGOT; ch++) {
1326  snprintf(label, 32, "Ch %02d", ch+1);
1327  me_ptr->setBinLabel((2+(ch*xbins)), label, 1); //margin of 3 at low value
1328  }
1329 }
1330 
1331 //No size checking; better have enough x-axis bins!
1333  char label[32];
1334  for (int thfed=0; thfed<NUMDCCS; thfed++) {
1335  snprintf(label, 32, "%03d", thfed+700);
1336  me_ptr->setBinLabel((2+(thfed*xbins)), label, 1); //margin of 1 at low value
1337  }
1338 }
1339 
1340 void HcalRawDataMonitor::labelHTRBits(MonitorElement* mePlot,unsigned int axisType) {
1341 
1342  if (axisType !=1 && axisType != 2) return;
1343 
1344  mePlot -> setBinLabel(1,"Overflow Warn",axisType);
1345  mePlot -> setBinLabel(2,"Buffer Busy",axisType);
1346  mePlot -> setBinLabel(3,"Empty Event",axisType);
1347  mePlot -> setBinLabel(4,"Rejected L1A",axisType);
1348  mePlot -> setBinLabel(5,"Invalid Stream",axisType);
1349  mePlot -> setBinLabel(6,"Latency Warn",axisType);
1350  mePlot -> setBinLabel(7,"OptDat Err",axisType);
1351  mePlot -> setBinLabel(8,"Clock Err",axisType);
1352  mePlot -> setBinLabel(9,"Bunch Err",axisType);
1353  mePlot -> setBinLabel(10,"b9",axisType);
1354  mePlot -> setBinLabel(11,"b10",axisType);
1355  mePlot -> setBinLabel(12,"b11",axisType);
1356  mePlot -> setBinLabel(13,"Test Mode",axisType);
1357  mePlot -> setBinLabel(14,"Histo Mode",axisType);
1358  mePlot -> setBinLabel(15,"Calib Trig",axisType);
1359  mePlot -> setBinLabel(16,"Bit15 Err",axisType);
1360 
1361  return;
1362 }
1363 
1364 void HcalRawDataMonitor::stashHDI(int thehash, HcalDetId thehcaldetid) {
1365  //Let's not allow indexing off the array...
1366  if ((thehash<0)||(thehash>(NUMDCCS*NUMSPIGS*HTRCHANMAX)))return;
1367  //...but still do the job requested.
1368  hashedHcalDetId_[thehash] = thehcaldetid;
1369 }
1370 
1371 //Debugging output for single half-HTRs (single spigot)
1372 //-->Class member debug_ usually passed for prtlvl argument.<--
1373 void HcalRawDataMonitor::HTRPrint(const HcalHTRData& htr,int prtlvl){
1374  if (prtlvl == 1){
1375  int cratenum = htr.readoutVMECrateId();
1376  float slotnum = htr.htrSlot() + 0.5*htr.htrTopBottom();
1377  printf("Crate,Slot,ErrWord,Evt#,BCN: %3i %4.1f %6X %7i %4X \n", cratenum,slotnum,htr.getErrorsWord(),htr.getL1ANumber(),htr.getBunchNumber());
1378  // printf(" DLLunlk,TTCrdy:%2i %2i \n",htr.getDLLunlock(),htr.getTTCready());
1379  }
1380  // This one needs new version of HcalHTRData.h to activate
1381  else if (prtlvl == 2){
1382  int cratenum = htr.readoutVMECrateId();
1383  float slotnum = htr.htrSlot() + 0.5*htr.htrTopBottom();
1384  printf("Crate, Slot:%3i %4.1f \n", cratenum,slotnum);
1385  // printf(" Ext Hdr: %4X %4X %4X %4X %4X %4X %4X %4X \n",htr.getExtHdr1(),htr.getExtHdr2(),htr.getExtHdr3(),htr.getExtHdr4(),htr.getExtHdr5(),htr.getExtHdr6(),htr.getExtHdr7(),htr.getExtHdr8());
1386  }
1387 
1388  else if (prtlvl == 3){
1389  int cratenum = htr.readoutVMECrateId();
1390  float slotnum = htr.htrSlot() + 0.5*htr.htrTopBottom();
1391  printf("Crate, Slot:%3i %4.1f", cratenum,slotnum);
1392  printf(" FibOrbMsgBCNs: %4X %4X %4X %4X %4X %4X %4X %4X \n",htr.getFib1OrbMsgBCN(),htr.getFib2OrbMsgBCN(),htr.getFib3OrbMsgBCN(),htr.getFib4OrbMsgBCN(),htr.getFib5OrbMsgBCN(),htr.getFib6OrbMsgBCN(),htr.getFib7OrbMsgBCN(),htr.getFib8OrbMsgBCN());
1393  }
1394 
1395  return;
1396 }
1397 
1398 
1400  tevt_=0;
1401  if (meTevtHist_) tevt_= (int)meTevtHist_->getBinContent(1);
1402  NumBadHB=0;
1403  NumBadHE=0;
1404  NumBadHO=0;
1405  NumBadHF=0;
1406  NumBadHFLUMI=0;
1407  NumBadHO0=0;
1408  NumBadHO12=0;
1409 
1410 
1412  for (int x=0; x<THREE_FED; x++)
1413  for (int y=0; y<THREE_SPG; y++)
1416 
1418  for (int x=0; x<THREE_FED; x++)
1419  for (int y=0; y<THREE_SPG; y++)
1422 
1424  for (int x=0; x<TWO___FED; x++)
1425  for (int y=0; y<TWO__SPGT; y++)
1428 
1429  for (int f=0; f<NUMDCCS; f++){
1431  for (int x=0; x<TWO_CHANN; x++)
1432  for (int y=0; y<TWO__SPGT; y++)
1433  if (Chann_DataIntegrityCheck_[f][x][y])
1435  }
1436 
1438  for (int x=0; x<TWO___FED; x++)
1439  for (int y=0; y<THREE_SPG; y++)
1440  if (DataFlowInd_[x][y])
1442 } //UpdateMEs
1443 
1444 //Increment the NumBad counter for this LS, for this Hcal subdet
1446 // if (subdet==HcalBarrel) ++NumBadHB;
1447 // else if (subdet==HcalEndcap) ++NumBadHE;
1448 // else if (subdet==HcalOuter)
1449 // {
1450 // ++NumBadHO;
1451 // if (abs(ieta)<5) ++NumBadHO0;
1452 // else ++NumBadHO12;
1453 // }
1454 // else if (subdet==HcalForward)
1455 // {
1456 // ++NumBadHF;
1457 // if (depth==1 && (abs(ieta)==33 || abs(ieta)==34))
1458 // ++NumBadHFLUMI;
1459 // else if (depth==2 && (abs(ieta)==35 || abs(ieta)==36))
1460 // ++NumBadHFLUMI;
1461 // }
1462 }
1463 
1465  int myeta = 0;
1466  int myphi =-1;
1467  int mydepth = 0;
1468  HcalDetId HDI;
1469  //Light up all affected cells.
1470  for (int i=hashup(dcc);
1471  i<hashup(dcc)+(NUMSPIGS*HTRCHANMAX);
1472  i++) {
1473  HDI = hashedHcalDetId_[i];
1474  if (HDI==HcalDetId::Undefined)
1475  continue;
1476  mydepth = HDI.depth();
1477  myphi = HDI.iphi();
1478  myeta = CalcEtaBin(HDI.subdet(),
1479  HDI.ieta(),
1480  mydepth);
1481  //Protect against indexing off array
1482  if (myeta>=0 && myeta<85 &&
1483  (myphi-1)>=0 && (myphi-1)<72 &&
1484  (mydepth-1)>=0 && (mydepth-1)<4){
1485  problemfound[myeta][myphi-1][mydepth-1] = true;
1486 
1487  //exlcude the decommissioned HO ring2, except SiPMs
1488  if(mydepth==4 && excludeHORing2_==true)
1489  if (abs(HDI.ieta())>=11 && abs(HDI.ieta())<=15 && !isSiPM(HDI.ieta(),HDI.iphi(),mydepth))
1490  problemfound[myeta][myphi-1][mydepth-1] = false;
1491 
1492  if (debug_>0)
1493  std::cout<<" mapDCCproblem found error! "<<HDI.subdet()<<"("<<HDI.ieta()<<", "<<HDI.iphi()<<", "<<HDI.depth()<<")"<<std::endl;
1494  }
1495  }
1496 }
1497 void HcalRawDataMonitor::mapHTRproblem(int dcc, int spigot) {
1498  int myeta = 0;
1499  int myphi =-1;
1500  int mydepth = 0;
1501  HcalDetId HDI;
1502  //Light up all affected cells.
1503  for (int i=hashup(dcc,spigot);
1504  i<hashup(dcc,spigot)+(HTRCHANMAX); //nice, linear hash....
1505  i++) {
1506  HDI = hashedHcalDetId_[i];
1507  if (HDI==HcalDetId::Undefined) {
1508  continue;
1509  }
1510  mydepth = HDI.depth();
1511  myphi = HDI.iphi();
1512  myeta = CalcEtaBin(HDI.subdet(),
1513  HDI.ieta(),
1514  mydepth);
1515  //Protect against indexing off array
1516  if (myeta>=0 && myeta<85 &&
1517  (myphi-1)>=0 && (myphi-1)<72 &&
1518  (mydepth-1)>=0 && (mydepth-1)<4){
1519  problemfound[myeta][myphi-1][mydepth-1] = true;
1520 
1521  //exlcude the decommissioned HO ring2, except SiPMs
1522  if(mydepth==4 && excludeHORing2_==true)
1523  if (abs(HDI.ieta())>=11 && abs(HDI.ieta())<=15 && !isSiPM(HDI.ieta(),HDI.iphi(),mydepth))
1524  problemfound[myeta][myphi-1][mydepth-1] = false;
1525 
1526  if (debug_>0)
1527  std::cout<<" mapDCCproblem found error! "<<HDI.subdet()<<"("<<HDI.ieta()<<", "<<HDI.iphi()<<", "<<HDI.depth()<<")"<<std::endl;
1528  }
1529 
1530  }
1531 } // void HcalRawDataMonitor::mapHTRproblem(...)
1532 
1533 void HcalRawDataMonitor::mapChannproblem(int dcc, int spigot, int htrchan) {
1534  int myeta = 0;
1535  int myphi =-1;
1536  int mydepth = 0;
1537  HcalDetId HDI;
1538  //Light up the affected cell.
1539  int i=hashup(dcc,spigot,htrchan);
1540  HDI = HashToHDI(i);
1541  if (HDI==HcalDetId::Undefined) {
1542  return; // Do nothing at all, instead.
1543  }
1544  mydepth = HDI.depth();
1545  myphi = HDI.iphi();
1546  myeta = CalcEtaBin(HDI.subdet(),
1547  HDI.ieta(),
1548  mydepth);
1549  //Protect against indexing off array
1550  if (myeta>=0 && myeta<85 &&
1551  (myphi-1)>=0 && (myphi-1)<72 &&
1552  (mydepth-1)>=0 && (mydepth-1)<4){
1553  problemfound[myeta][myphi-1][mydepth-1] = true;
1554 
1555  //exlcude the decommissioned HO ring2, except SiPMs
1556  if(mydepth==4 && excludeHORing2_==true)
1557  if (abs(HDI.ieta())>=11 && abs(HDI.ieta())<=15 && !isSiPM(HDI.ieta(),HDI.iphi(),mydepth))
1558  problemfound[myeta][myphi-1][mydepth-1] = false;
1559 
1560  if (debug_>0)
1561  std::cout<<" mapDCCproblem found error! "<<HDI.subdet()<<"("<<HDI.ieta()<<", "<<HDI.iphi()<<", "<<HDI.depth()<<")"<<std::endl;
1562  }
1563 } // void HcalRawDataMonitor::mapChannproblem(...)
1564 
1565 
MonitorElement * meCh_DataIntegrityFED04_
bool isHO(int etabin, int depth)
type
Definition: HCALResponse.h:22
MonitorElement * meCh_DataIntegrityFED27_
T getParameter(std::string const &) const
float ChannSumm_DataIntegrityCheck_[TWO___FED][TWO__SPGT]
unsigned int getFib6OrbMsgBCN() const
Definition: HcalHTRData.h:203
static const HcalDetId Undefined
Definition: HcalDetId.h:66
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meUSFractSpigs_
MonitorElement * meCh_DataIntegrityFED23_
int i
Definition: DBlmapReader.cc:9
MonitorElement * meBCN_
bool LumiInOrder(int lumisec)
int getSpigotSummary(int nspigot) const
Definition: HcalDCCHeader.h:84
MonitorElement * meCDFErrorFound_
int getNDD() const
Get the number of daq data samples per channel when not zero-suppressed.
Definition: HcalHTRData.cc:390
unsigned int getFib1OrbMsgBCN() const
Get the BCN of the Fiber Orbit Messages.
Definition: HcalHTRData.h:184
MonitorElement * meCrate7HTRStatus_
void label_xFEDs(MonitorElement *me_ptr, int xbins)
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meCrate4HTRStatus_
bool check()
Definition: FEDTrailer.cc:66
unsigned int getSlink64ReservedBits() const
Definition: HcalDCCHeader.h:50
MonitorElement * ProblemsCurrentLB
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
unsigned char getSpigotErrorBits(unsigned int nspigot) const
Access the HTR error bits (decoding tbd)
MonitorElement * meCh_DataIntegrityFED25_
MonitorElement * meCh_DataIntegrityFED13_
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
unsigned int getSpigotDataLength(int nspigot) const
Definition: HcalDCCHeader.h:98
void whosebad(int subdet)
uint16_t raw() const
get the raw word
Definition: HcalQIESample.h:22
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:32
bool check() const
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event...
Definition: HcalHTRData.cc:64
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
const double xbins[]
MonitorElement * meEvtNumberSynch_
#define TWO_CHANN
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * meCrate3HTRStatus_
unsigned int htrTopBottom() const
HcalElectronicsId-style HTR top/bottom (1=top/0=bottom)
Definition: HcalHTRData.cc:344
MonitorElement * meCh_DataIntegrityFED02_
MonitorElement * meCh_DataIntegrityFED05_
MonitorElement * meFib5OrbMsgBCN_
#define THREE_FED
MonitorElement * meCh_DataIntegrityFED09_
int getAcceptTimeTTS() const
Definition: HcalDCCHeader.h:60
#define HTRCHANMAX
MonitorElement * ProblemsVsLB_HF
int fiberChan() const
get the fiber channel number
Definition: HcalQIESample.h:36
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
MonitorElement * meBCNCheck_
#define NUMDCCS
std::vector< int > AllowedCalibTypes_
MonitorElement * meCrate17HTRStatus_
bool getSpigotCRCError(unsigned int nspigot) const
Read the &quot;CRC-Mismatch&quot; bit for this spigot.
MonitorElement * meChannSumm_DataIntegrityCheck_
void stashHDI(int thehash, HcalDetId thehcaldetid)
virtual void cleanup(void)
void processEvent(const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report)
bool moreTrailers()
Definition: FEDTrailer.cc:39
MonitorElement * meCrate13HTRStatus_
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)
bool dv() const
is the Data Valid bit set?
Definition: HcalQIESample.h:30
#define abs(x)
Definition: mlp_lapack.h:159
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
std::map< int, short > CDFversionNumber_list
MonitorElement * meOrNCheck_
HcalDetId hashedHcalDetId_[NUMDCCS *NUMSPIGS *HTRCHANMAX]
unsigned int getExtHdr6() const
Definition: HcalHTRData.h:228
#define NULL
Definition: scimark2.h:8
unsigned int getFib8OrbMsgBCN() const
Definition: HcalHTRData.h:211
#define min(a, b)
Definition: mlp_lapack.h:161
MonitorElement * meCrate2HTRStatus_
std::map< int, short > CDFReservedBits_list
void label_xChanns(MonitorElement *me_ptr, int xbins)
void update(void)
Mark the object updated.
MonitorElement * meBCNSynch_
bool isHE(int etabin, int depth)
static const int CHANNELS_PER_SPIGOT
Definition: HcalHTRData.h:20
bool thereIsAThirdCDFHeaderWord() const
Definition: HcalDCCHeader.h:46
uint64_t problemcount[ETABINS][PHIBINS][DEPTHBINS]
T eta() const
static bool unpack_per_channel_header(unsigned short, int &flav, int &error_flags, int &capid0, int &channelid)
Unpack a per-channel header word (compact format)
Definition: HcalHTRData.cc:435
MonitorElement * meCrate14HTRStatus_
int getSpigotData(int nspigot, HcalHTRData &decodeTool, int validSize) const
MonitorElement * meCh_DataIntegrityFED03_
void analyze(const edm::Event &e, const edm::EventSetup &c)
unsigned char getLRBErrorBits(unsigned int nspigot) const
Access the Link Receiver Board error bits (decoding tbd)
#define NUMSPIGS
unsigned int getOrbitNumber() const
Get the HTR orbit number.
Definition: HcalHTRData.cc:326
void labelHTRBits(MonitorElement *mePlot, unsigned int axisType)
int getFormatVersion() const
Get the version number of this event.
Definition: HcalHTRData.h:35
double double double z
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
MonitorElement * meCrate15HTRStatus_
void beginRun(const edm::Run &run, const edm::EventSetup &c)
MonitorElement * meDataFlowInd_
void Fill(long long x)
MonitorElement * meCh_DataIntegrityFED14_
std::map< int, short >::iterator CDFReservedBits_it
LuminosityBlockNumber_t luminosityBlock() const
#define DEPTHBINS
tuple report
Definition: zeeHLT_cff.py:9
unsigned int getOrbitNumber() const
Definition: HcalDCCHeader.h:48
float LRBDataCorruptionIndicators_[THREE_FED][THREE_SPG]
#define TWO__SPGT
int getBunchId() const
Definition: HcalDCCHeader.h:36
bool isSiPM(int ieta, int iphi, int depth)
unsigned int htrSlot() const
HcalElectronicsId-style HTR slot.
Definition: HcalHTRData.cc:340
int depth() const
get the tower depth
Definition: HcalDetId.h:42
MonitorElement * meCrate6HTRStatus_
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
MonitorElement * meTevtHist_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
edm::InputTag FEDRawDataCollection_
int CalcIeta(int subdet, int eta, int depth)
MonitorElement * meCh_DataIntegrityFED24_
std::map< int, short >::iterator DCCEvtFormat_it
static bool is_channel_header(unsigned short value)
check top bit to see if this is a compact format channel header word
Definition: HcalHTRData.h:92
MonitorElement * meCh_DataIntegrityFED06_
bool getBxMismatchWithDCC(unsigned int nspigot) const
Read the &quot;BxID FAILS TO MATCH WITH DCC&quot; bit for this spigot.
const T & max(const T &a, const T &b)
unsigned int getFib7OrbMsgBCN() const
Definition: HcalHTRData.h:207
MonitorElement * ProblemsVsLB_HBHEHF
const HcalElectronicsMap * readoutMap_
MonitorElement * ProblemsVsLB_HB
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * HTR_StatusWd_HO
MonitorElement * meCrate5HTRStatus_
void unpack(const FEDRawData &raw)
MonitorElement * meCrate0HTRStatus_
MonitorElement * meChann_DataIntegrityCheck_[NUMDCCS]
const int getRawLength() const
Get the length of the raw data.
Definition: HcalHTRData.h:41
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
HcalSubdetector
Definition: HcalAssistant.h:32
MonitorElement * meOrNSynch_
void endRun(const edm::Run &run, const edm::EventSetup &c)
double f[11][100]
bool problemfound[ETABINS][PHIBINS][DEPTHBINS]
void label_ySpigots(MonitorElement *me_ptr, int ybins)
int fiber() const
get the fiber number
Definition: HcalQIESample.h:34
bool getSpigotPresent(unsigned int nspigot) const
Read the &quot;PRESENT&quot; bit for this spigot.
MonitorElement * meCh_DataIntegrityFED11_
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1031
MonitorElement * meCrate12HTRStatus_
std::map< int, short >::iterator CDFvers_it
MonitorElement * meCh_DataIntegrityFED17_
bool isHB(int etabin, int depth)
MonitorElement * meFibBCN_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
MonitorElement * meDCCEventFormatError_
MonitorElement * meCh_DataIntegrityFED30_
MonitorElement * medccBCN_
MonitorElement * meCh_DataIntegrityFED12_
unsigned int getFib3OrbMsgBCN() const
Definition: HcalHTRData.h:191
#define TWO___FED
MonitorElement * HTR_StatusWd_HBHE
bool getSpigotEnabled(unsigned int nspigot) const
Read the &quot;ENABLED&quot; bit for this spigot.
MonitorElement * meCh_DataIntegrityFED10_
MonitorElement * meFib4OrbMsgBCN_
int ttsBits()
Current value of the Trigger Throttling System bitsAQ).
Definition: FEDTrailer.cc:34
MonitorElement * meInvHTRData_
int getSourceId() const
Definition: HcalDCCHeader.h:34
MonitorElement * meCh_DataIntegrityFED19_
int iphi() const
get the cell iphi
Definition: HcalDetId.h:40
void mapHTRproblem(int dcc, int spigot)
Definition: DetId.h:20
MonitorElement * meEvtNCheck_
MonitorElement * meBCNwhenOrNDiff_
bool isHF(int etabin, int depth)
MonitorElement * meFib1OrbMsgBCN_
void HTRPrint(const HcalHTRData &htr, int prtlvl)
unsigned long long uint64_t
Definition: Time.h:15
MonitorElement * meCrate11HTRStatus_
int capid() const
get the Capacitor id
Definition: HcalQIESample.h:28
MonitorElement * meFib8OrbMsgBCN_
unsigned int getFib5OrbMsgBCN() const
Definition: HcalHTRData.h:199
const unsigned short * getRawData() const
Get a pointer to the raw data.
Definition: HcalHTRData.h:38
int lenght()
The length of the event fragment counted in 64-bit words including header and trailer.
Definition: FEDTrailer.cc:19
MonitorElement * meLRBDataCorruptionIndicators_
void dataPointers(const unsigned short **daq_first, const unsigned short **daq_last, const unsigned short **tp_first, const unsigned short **tp_last) const
Obtain the starting and ending pointers for external unpacking of the data.
Definition: HcalHTRData.cc:155
MonitorElement * meCh_DataIntegrityFED08_
unsigned int getErrorsWord() const
Get the errors word.
Definition: HcalHTRData.h:158
MonitorElement * meCh_DataIntegrityFED29_
MonitorElement * meCh_DataIntegrityFED00_
const T & get() const
Definition: EventSetup.h:55
#define ETABINS
bool null() const
is this a null id ?
Definition: DetId.h:47
MonitorElement * meCh_DataIntegrityFED26_
float HalfHTRDataCorruptionIndicators_[THREE_FED][THREE_SPG]
MonitorElement * meCrate1HTRStatus_
unsigned int getExtHdr7() const
Definition: HcalHTRData.h:230
MonitorElement * meStatusWdCrate_
MonitorElement * meFib7OrbMsgBCN_
MonitorElement * ProblemsVsLB_HE
short BOEshouldBeZeroAlways() const
Definition: HcalDCCHeader.h:52
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void mapChannproblem(int dcc, int spigot, int htrchan)
int CalcEtaBin(int subdet, int ieta, int depth)
unsigned int readoutVMECrateId() const
HcalElectronicsId-style VME crate number.
Definition: HcalHTRData.cc:348
bool getSpigotValid(unsigned int nspigot) const
Read the &quot;VALID&quot; bit for this spigot; TTC EvN matched HTR EvN.
MonitorElement * meCh_DataIntegrityFED16_
#define THREE_SPG
unsigned int getFib4OrbMsgBCN() const
Definition: HcalHTRData.h:195
MonitorElement * meCh_DataIntegrityFED07_
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:21
double getBinContent(int binx) const
get content of bin (1-D)
uint64_t UScount[NUMDCCS][NUMSPIGS]
MonitorElement * meEvFragSize_
MonitorElement * HTR_StatusWd_HF
MonitorElement * meCh_DataIntegrityFED28_
#define update(a, b)
TProfile * getTProfile(void) const
unsigned int getBunchNumber() const
Get the HTR bunch number.
Definition: HcalHTRData.h:116
unsigned int getFib2OrbMsgBCN() const
Definition: HcalHTRData.h:187
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
MonitorElement * meFib2OrbMsgBCN_
#define PHIBINS
float Chann_DataIntegrityCheck_[NUMDCCS][TWO_CHANN][TWO__SPGT]
MonitorElement * meEvFragSize2_
bool getSpigotDataTruncated(unsigned int nspigot) const
Read the &quot;TRUNCATED&quot; bit for this spigot; LRB truncated data (took too long)
tuple cout
Definition: gather_cfg.py:121
short getCDFversionNumber() const
Definition: HcalDCCHeader.h:32
short getDCCDataFormatVersion() const
Definition: HcalDCCHeader.h:59
MonitorElement * meDCCVersion_
MonitorElement * meCh_DataIntegrityFED20_
std::map< int, short > DCCEvtFormat_list
MonitorElement * ProblemsVsLB_HO
MonitorElement * meCrate10HTRStatus_
unsigned int getFirmwareRevision() const
Get the HTR firmware version.
Definition: HcalHTRData.cc:408
Definition: DDAxes.h:10
MonitorElement * ProblemsVsLB
uint64_t uniqcounter[ETABINS][PHIBINS][DEPTHBINS]
MonitorElement * meHTRFWVersion_
MonitorElement * meFEDRawDataSizes_
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
unsigned short BOEshouldBe5Always() const
Definition: HcalDCCHeader.h:42
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
MonitorElement * meCh_DataIntegrityFED01_
MonitorElement * mefedEntries_
virtual void setup(void)
MonitorElement * meCh_DataIntegrityFED15_
float DataFlowInd_[TWO___FED][THREE_SPG]
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
unsigned int getL1ANumber() const
Get the HTR event number.
Definition: HcalHTRData.h:112
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * meCh_DataIntegrityFED31_
bool thereIsASecondCDFHeaderWord() const
Definition: HcalDCCHeader.h:30
HcalDetId HashToHDI(int thehash)
void Reset(void)
reset ME (ie. contents, errors, etc)
unsigned long getDCCEventNumber() const
Definition: HcalDCCHeader.h:38
MonitorElement * meHalfHTRDataCorruptionIndicators_
edm::InputTag digiLabel_
int hashup(uint32_t d=0, uint32_t s=0, uint32_t c=1)
MonitorElement * meFib3OrbMsgBCN_
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
bool er() const
is the error bit set?
Definition: HcalQIESample.h:32
MonitorElement * meCh_DataIntegrityFED21_
MonitorElement * meFib6OrbMsgBCN_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
Definition: HcalHTRData.cc:387
Definition: Run.h:33
MonitorElement * meCh_DataIntegrityFED18_
MonitorElement * meCrate9HTRStatus_
MonitorElement * meCh_DataIntegrityFED22_
Definition: DDAxes.h:10