CMS 3D CMS Logo

DigiTask.cc
Go to the documentation of this file.
2 
3 using namespace hcaldqm;
4 using namespace hcaldqm::constants;
5 using namespace hcaldqm::filter;
6 
8  DQTask(ps)
9 {
11  edm::InputTag("hcalDigis"));
13  edm::InputTag("hcalDigis"));
15  edm::InputTag("hcalDigis"));
17  edm::InputTag("hcalDigis"));
18 
19  _tokHBHE = consumes<HBHEDigiCollection>(_tagHBHE);
20  _tokHE = consumes<QIE11DigiCollection>(_tagHE);
21  _tokHO = consumes<HODigiCollection>(_tagHO);
22  _tokHF = consumes<QIE10DigiCollection>(_tagHF);
23 
24  _cutSumQ_HBHE = ps.getUntrackedParameter<double>("cutSumQ_HBHE", 20);
25  _cutSumQ_HE = ps.getUntrackedParameter<double>("cutSumQ_HE", 20);
26  _cutSumQ_HO = ps.getUntrackedParameter<double>("cutSumQ_HO", 20);
27  _cutSumQ_HF = ps.getUntrackedParameter<double>("cutSumQ_HF", 20);
28  _thresh_unihf = ps.getUntrackedParameter<double>("thresh_unihf", 0.2);
29  _thresh_led = ps.getUntrackedParameter<double>("thresh_led", 20);
30 
31  _vflags.resize(nDigiFlag);
32  _vflags[fUni]=hcaldqm::flag::Flag("UniSlotHF");
36  _vflags[fLED]=hcaldqm::flag::Flag("LEDMisfire");
37  _vflags[fCapId]=hcaldqm::flag::Flag("BadCapId");
38 
39  _qie10InConditions = ps.getUntrackedParameter<bool>("qie10InConditions", true);
40 
41  // Get reference digi sizes. Convert from unsigned to signed int, because <digi>::size()/samples() return ints for some reason.
42  std::vector<uint32_t> vrefDigiSize = ps.getUntrackedParameter<std::vector<uint32_t>>("refDigiSize");
43  _refDigiSize[HcalBarrel] = (int)vrefDigiSize[0];
44  _refDigiSize[HcalEndcap] = (int)vrefDigiSize[1];
45  _refDigiSize[HcalOuter] = (int)vrefDigiSize[2];
46  _refDigiSize[HcalForward] = (int)vrefDigiSize[3];
47 
48  // (capid - BX) % 4 to 1
49  _capidmbx[HcalBarrel] = 1;
50  _capidmbx[HcalEndcap] = 1;
51  _capidmbx[HcalOuter] = 1;
53 
54  // LED calibration channels
55  std::vector<edm::ParameterSet> vLedCalibChannels = ps.getParameter<std::vector<edm::ParameterSet>>("ledCalibrationChannels");
56  for (int i = 0; i <= 3; ++i) {
57  HcalSubdetector this_subdet = HcalEmpty;
58  switch (i) {
59  case 0:
60  this_subdet = HcalBarrel;
61  break;
62  case 1:
63  this_subdet = HcalEndcap;
64  break;
65  case 2:
66  this_subdet = HcalOuter;
67  break;
68  case 3:
69  this_subdet = HcalForward;
70  break;
71  default:
72  this_subdet = HcalEmpty;
73  break;
74  }
75  std::vector<int32_t> subdet_calib_ietas = vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("ieta");
76  std::vector<int32_t> subdet_calib_iphis = vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("iphi");
77  std::vector<int32_t> subdet_calib_depths = vLedCalibChannels[i].getUntrackedParameter<std::vector<int32_t>>("depth");
78  for (unsigned int ichannel = 0; ichannel < subdet_calib_ietas.size(); ++ichannel) {
79  _ledCalibrationChannels[this_subdet].push_back(HcalDetId(HcalOther, subdet_calib_ietas[ichannel], subdet_calib_iphis[ichannel], subdet_calib_depths[ichannel]));
80  }
81  }
82 }
83 
85  edm::Run const& r, edm::EventSetup const& es)
86 {
87  DQTask::bookHistograms(ib,r,es);
88 
89  // GET WHAT YOU NEED
91  es.get<HcalDbRecord>().get(dbs);
92  _emap = dbs->getHcalMapping();
93  std::vector<uint32_t> vVME;
94  std::vector<uint32_t> vuTCA;
98  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
100  vVME);
102  vuTCA);
103 
104  // Filters for QIE8 vs QIE10/11
105  std::vector<uint32_t> vhashQIE1011;
109  vhashQIE1011);
111  vhashQIE1011);
112 
113  // INITIALIZE FIRST
131 
145 
150  _cTimingCut_depth.initialize(_name, "TimingCut",
159 
160  // Occupancy w/o a cut
161  _cOccupancyvsLS_Subdet.initialize(_name, "OccupancyvsLS",
165  _cOccupancy_depth.initialize(_name, "Occupancy",
170 
171  // Occupancy w/ a cut
172  _cOccupancyCutvsLS_Subdet.initialize(_name, "OccupancyCutvsLS",
176  _cOccupancyCut_depth.initialize(_name, "OccupancyCut",
181 
182  // Digi size
183  _cDigiSize_Crate.initialize(_name, "DigiSize",
197 
198  _cLETDCTimevsADC_SubdetPM.initialize(_name, "LETDCTimevsADC",
203  _cLETDCvsADC_SubdetPM.initialize(_name, "LETDCvsADC",
208  _cLETDCvsTS_SubdetPM.initialize(_name, "LETDCvsTS",
217  _cLETDCTime_depth.initialize(_name, "LETDCTime",
222 
223  _cBadTDCValues_SubdetPM.initialize(_name, "BadTDCValues",
227  _cBadTDCvsBX_SubdetPM.initialize(_name, "BadTDCvsBX",
231  _cBadTDCvsLS_SubdetPM.initialize(_name, "BadTDCvsLS",
235  _cBadTDCCount_depth.initialize(_name, "BadTDCCount",
240 
241  if (_ptype == fOnline || _ptype == fLocal) {
243  "Occupancy", hashfunctions::fCrate,
248  "Occupancy", hashfunctions::fCrateSlot,
252  }
253 
254  // INITIALIZE HISTOGRAMS that are only for Online
255  if (_ptype==fOnline)
256  {
257  // Charge sharing
270  _cDigiSizevsLS_FED.initialize(_name, "DigiSizevsLS",
274  _cTimingCutvsiphi_SubdetPM.initialize(_name, "TimingCutvsiphi",
278  _cTimingCutvsieta_Subdet.initialize(_name, "TimingCutvsieta",
282  _cOccupancyvsiphi_SubdetPM.initialize(_name, "Occupancyvsiphi",
286  _cOccupancyvsieta_Subdet.initialize(_name, "Occupancyvsieta",
290  _cOccupancyCutvsiphi_SubdetPM.initialize(_name, "OccupancyCutvsiphi",
294  _cOccupancyCutvsieta_Subdet.initialize(_name, "OccupancyCutvsieta",
298  _cOccupancyCutvsLS_Subdet.initialize(_name, "OccupancyCutvsLS",
302  _cOccupancyCutvsBX_Subdet.initialize(_name, "OccupancyCutvsBX",
306 // _cOccupancyCutvsSlotvsLS_HFPM.initialize(_name,
307 // "OccupancyCutvsSlotvsLS", hcaldqm::hashfunctions::fSubdetPM,
308 // new hcaldqm::quantity::LumiSection(_maxLS),
309 // new hcaldqm::quantity::ElectronicsQuantity(hcaldqm::quantity::fSlotuTCA),
310 // new hcaldqm::quantity::ValueQuantity(hcaldqm::quantity::fN),0);
312  "OccupancyCutvsiphivsLS", hcaldqm::hashfunctions::fSubdetPM,
316  }
321 
322  for (int i = 0; i < 4; ++i) {
331  }
332 
333  if (_ptype != fOffline) { // hidefed2crate
334  std::vector<int> vFEDs = hcaldqm::utilities::getFEDList(_emap);
335  std::vector<int> vFEDsVME = hcaldqm::utilities::getFEDVMEList(_emap);
336  std::vector<int> vFEDsuTCA = hcaldqm::utilities::getFEDuTCAList(_emap);
337 
338  if (_ptype == fOnline) {
341  new hcaldqm::quantity::FEDQuantity(vFEDs),
343 
346  new hcaldqm::quantity::FEDQuantity(vFEDs),
348  }
349 
350  std::vector<uint32_t> vFEDHF;
351  vFEDHF.push_back(HcalElectronicsId(22, SLOT_uTCA_MIN,
352  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
353  vFEDHF.push_back(HcalElectronicsId(22, SLOT_uTCA_MIN+6,
354  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
355  vFEDHF.push_back(HcalElectronicsId(29, SLOT_uTCA_MIN,
356  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
357  vFEDHF.push_back(HcalElectronicsId(29, SLOT_uTCA_MIN+6,
358  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
359  vFEDHF.push_back(HcalElectronicsId(32, SLOT_uTCA_MIN,
360  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
361  vFEDHF.push_back(HcalElectronicsId(32, SLOT_uTCA_MIN+6,
362  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
363 
364  // initialize filters
366  vFEDHF);
367 
368  // push the rawIds of each fed into the vector...
369  for (std::vector<int>::const_iterator it=vFEDsVME.begin();
370  it!=vFEDsVME.end(); ++it)
371  _vhashFEDs.push_back(HcalElectronicsId(
373  (*it)-FED_VME_MIN).rawId());
374  for (std::vector<int>::const_iterator it=vFEDsuTCA.begin();
375  it!=vFEDsuTCA.end(); ++it)
376  {
377  std::pair<uint16_t, uint16_t> cspair = utilities::fed2crate(*it);
378  _vhashFEDs.push_back(HcalElectronicsId(
379  cspair.first, cspair.second, FIBER_uTCA_MIN1,
380  FIBERCH_MIN, false).rawId());
381  }
382 
383  _cShapeCut_FED.initialize(_name, "ShapeCut",
387 
388  _cTimingCut_FEDVME.initialize(_name, "TimingCut",
393  _cTimingCut_FEDuTCA.initialize(_name, "TimingCut",
400  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
405  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
408  _cTimingCutvsLS_FED.initialize(_name, "TimingvsLS",
412 
413  _cOccupancy_FEDVME.initialize(_name, "Occupancy",
418  _cOccupancy_FEDuTCA.initialize(_name, "Occupancy",
425  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
430  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
433 
434  _cOccupancyCut_FEDVME.initialize(_name, "OccupancyCut",
439  _cOccupancyCut_FEDuTCA.initialize(_name, "OccupancyCut",
446  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
451  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
454 
455  _cDigiSize_FED.initialize(_name, "DigiSize",
459 
460  if (_ptype == fOnline) {
461  _cSummaryvsLS_FED.initialize(_name, "SummaryvsLS",
466  _cSummaryvsLS.initialize(_name, "SummaryvsLS",
470 
477  }
478  }
479  if (_ptype != fLocal) {
480  _LED_ADCvsBX_Subdet.initialize(_name, "LED_ADCvsBX",
485 
486  _LED_CUCountvsLS_Subdet.initialize(_name, "LED_CUCountvsLS",
490  if (_ptype == fOnline) {
491  _LED_CUCountvsLSmod60_Subdet.initialize(_name, "LED_CUCountvsLSmod60",
495  }
496  }
497 
498  // BOOK HISTOGRAMS
499  char cutstr[200];
500  sprintf(cutstr, "_SumQHBHE%dHO%dHF%d", int(_cutSumQ_HBHE),
501  int(_cutSumQ_HO), int(_cutSumQ_HF));
502  char cutstr2[200];
503  sprintf(cutstr2, "_SumQHF%d", int(_cutSumQ_HF));
504 
517 
518  if (_ptype != fOffline) { // hidefed2crate
534  }
535 
539 
543 
549 
554 
556  if (_ptype == fOnline) {
557  _cCapid_BadvsFEDvsLS.book(ib, _subsystem, "BadvsLS");
558  _cCapid_BadvsFEDvsLSmod60.book(ib, _subsystem, "BadvsLSmod60");
559  }
560  for (int i = 0; i < 4; ++i) {
561  constexpr unsigned int kSize=16;
562  char aux[kSize];
563  snprintf(aux, kSize, "%d_uTCA", i);
565 
566  snprintf(aux, kSize, "%d_VME", i);
568  }
569 
570  if (_ptype != fLocal) {
573  if (_ptype == fOnline) {
575  }
576  }
577 
578  // BOOK HISTOGRAMS that are only for Online
581 
582  if (_ptype == fOnline || _ptype == fLocal) {
585  }
586 
587  if (_ptype==fOnline)
588  {
601 // _cOccupancyCutvsSlotvsLS_HFPM.book(ib, _emap, _filter_QIE1011, _subsystem);
605 
607  _xNChs.book(_emap);
609  _xUni.book(_emap);
612 
613  // just PER HF FED RECORD THE #CHANNELS
614  // ONLY WAY TO DO THAT AUTOMATICALLY AND W/O HARDCODING 1728
615  // or ANY OTHER VALUES LIKE 2592, 2192
616  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
617  for (std::vector<HcalGenericDetId>::const_iterator it=gids.begin();
618  it!=gids.end(); ++it)
619  {
620  if (!it->isHcalDetId())
621  continue;
622  HcalDetId did(it->rawId());
623  if (_xQuality.exists(did))
624  {
625  HcalChannelStatus cs(it->rawId(), _xQuality.get(
626  HcalDetId(*it)));
627  if (
630  continue;
631  }
633  _xNChsNominal.get(eid)++; // he will know the nominal #channels per FED
634  }
635  }
636 
637  // MARK THESE HISTOGRAMS AS LUMI BASED FOR OFFLINE PROCESSING
638  if (_ptype==fOffline)
639  {
641  //_cDigiSize_FED.setLumiFlag();
643  }
644 
645  // book Number of Events vs LS histogram
646  ib.setCurrentFolder(_subsystem+"/RunInfo");
647  meNumEvents1LS = ib.book1D("NumberOfEvents", "NumberOfEvents",
648  1, 0, 1);
650 
651  // book the flag for unknown ids and the online guy as well
653  meUnknownIds1LS = ib.book1D("UnknownIds", "UnknownIds",
654  1, 0, 1);
655  _unknownIdsPresent = false;
657 
658 }
659 
661 {
662  DQTask::_resetMonitors(uf);
663 
664  switch(uf)
665  {
666  case hcaldqm::f1LS:
667  _unknownIdsPresent = false;
668  break;
669  case hcaldqm::f50LS:
670  // ^^^ONLINE ONLY!
671  if (_ptype==fOnline)
673  // ^^^
674  break;
675  default:
676  break;
677  }
678 }
679 
680 /* virtual */ void DigiTask::_process(edm::Event const& e,
681  edm::EventSetup const&)
682 {
687 
688  if (!e.getByToken(_tokHBHE, chbhe))
689  _logger.dqmthrow("Collection HBHEDigiCollection isn't available"
690  + _tagHBHE.label() + " " + _tagHBHE.instance());
691  if (!e.getByToken(_tokHE, che_qie11))
692  _logger.dqmthrow("Collection QIE11DigiCollection isn't available"
693  + _tagHE.label() + " " + _tagHE.instance());
694  if (!e.getByToken(_tokHO, cho))
695  _logger.dqmthrow("Collection HODigiCollection isn't available"
696  + _tagHO.label() + " " + _tagHO.instance());
697  if (!e.getByToken(_tokHF, chf))
698  _logger.dqmthrow("Collection QIE10DigiCollection isn't available"
699  + _tagHF.label() + " " + _tagHF.instance());
700 
701  // extract some info per event
702  int bx = e.bunchCrossing();
703  meNumEvents1LS->Fill(0.5); // just increment
704 
705  // To fill histograms outside of the loop, you need to determine if there were
706  // any valid det ids first
707  uint32_t rawidValid = 0;
708  uint32_t rawidHBValid = 0;
709  uint32_t rawidHEValid = 0;
710 
711  // HB collection
712  int numChs = 0;
713  int numChsCut = 0;
714  int numChsHE = 0;
715  int numChsCutHE = 0;
716  for (HBHEDigiCollection::const_iterator it=chbhe->begin(); it!=chbhe->end();
717  ++it)
718  {
719  // Explicit check on the DetIds present in the Collection
720  HcalDetId const& did = it->id();
721  if (did.subdet() != HcalBarrel) {
722  continue;
723  }
724  uint32_t rawid = _ehashmap.lookup(did);
725  if (rawid == 0) {
726  meUnknownIds1LS->Fill(1);
727  _unknownIdsPresent=true;
728  continue;
729  } else {
730  if (did.subdet()==HcalBarrel) {
731  rawidHBValid = did.rawId();
732  } else if (did.subdet()==HcalEndcap) {
733  rawidHEValid = did.rawId();
734  }
735  }
736  HcalElectronicsId const& eid(rawid);
737 
738  // filter out channels that are masked out
739  if (_xQuality.exists(did))
740  {
741  HcalChannelStatus cs(did.rawId(), _xQuality.get(did));
742  if (
745  continue;
746  }
747 
748  if (_ptype == fOnline) {
749  short this_capidmbx = (it->sample(it->presamples()).capid() - bx) % 4;
750  if (this_capidmbx < 0) {
751  this_capidmbx += 4;
752  }
753  _cCapidMinusBXmod4_SubdetPM.fill(did, this_capidmbx);
754  bool good_capidmbx = (_capidmbx[did.subdet()] == this_capidmbx);
755  if (!good_capidmbx) {
756  _xBadCapid.get(eid)++;
759  }
760  if (eid.isVMEid()) {
761  _cCapidMinusBXmod4_CrateSlotVME[this_capidmbx].fill(eid);
762 
763  } else {
764  _cCapidMinusBXmod4_CrateSlotuTCA[this_capidmbx].fill(eid);
765  }
766  }
767 
768  //double sumQ = hcaldqm::utilities::sumQ<HBHEDataFrame>(*it, 2.5, 0, it->size()-1);
769  CaloSamples digi_fC = hcaldqm::utilities::loadADC2fCDB<HBHEDataFrame>(_dbService, did, *it);
770  double sumQ = hcaldqm::utilities::sumQDB<HBHEDataFrame>(_dbService, digi_fC, did, *it, 0, it->size()-1);
771 
772  _cSumQ_SubdetPM.fill(did, sumQ);
773  _cOccupancy_depth.fill(did);
774  if (_ptype == fOnline || _ptype == fLocal) {
775  _cOccupancy_Crate.fill(eid);
777  }
778  if (_ptype==fOnline)
779  {
780  _cDigiSizevsLS_FED.fill(eid, _currentLS, it->size());
781  it->size()!=_refDigiSize[did.subdet()]?
782  _xDigiSize.get(eid)++:_xDigiSize.get(eid)+=0;
785  }
786  _cDigiSize_Crate.fill(eid, it->size());
787  if (_ptype != fOffline) { // hidefed2crate
788  _cDigiSize_FED.fill(eid, it->size());
789  if (eid.isVMEid())
790  {
793  }
794  else
795  {
798  /*
799  if (!it->validate(0, it->size()))
800  {
801  _cCapIdRots_depth.fill(did);
802  _cCapIdRots_FEDuTCA.fill(eid, 1);
803  }*/
804  }
805  }
806 
807  for (int i=0; i<it->size(); i++)
808  {
809  _cADC_SubdetPM.fill(did, it->sample(i).adc());
810  _cfC_SubdetPM.fill(did, it->sample(i).nominal_fC());
811  if (_ptype != fOffline) { // hidefed2crate
812  _cADCvsTS_SubdetPM.fill(did, i, it->sample(i).adc());
813  if (sumQ>_cutSumQ_HBHE) {
814  _cShapeCut_FED.fill(eid, i, it->sample(i).nominal_fC());
815  }
816  }
817  }
818 
819  if (sumQ>_cutSumQ_HBHE)
820  {
821  //double timing = hcaldqm::utilities::aveTS<HBHEDataFrame>(*it, 2.5, 0, it->size()-1);
822  double timing = hcaldqm::utilities::aveTSDB<HBHEDataFrame>(_dbService, digi_fC, did, *it, 0, it->size()-1);
823  _cTimingCut_SubdetPM.fill(did, timing);
824  _cTimingCut_depth.fill(did, timing);
827  if (_ptype != fOffline) { // hidefed2crate
828  _cTimingCutvsLS_FED.fill(eid, _currentLS, timing);
829  }
830  _cSumQ_depth.fill(did, sumQ);
831  _cSumQvsLS_SubdetPM.fill(did, _currentLS, sumQ);
832  if (_ptype==fOnline)
833  {
834  _cSumQvsBX_SubdetPM.fill(did, bx, sumQ);
835  _cTimingCutvsiphi_SubdetPM.fill(did, timing);
836  _cTimingCutvsieta_Subdet.fill(did, timing);
840  }
841  if (_ptype != fOffline) { // hidefed2crate
842  if (eid.isVMEid())
843  {
844  _cTimingCut_FEDVME.fill(eid, timing);
845  _cTimingCut_ElectronicsVME.fill(eid, timing);
848  }
849  else
850  {
851  _cTimingCut_FEDuTCA.fill(eid, timing);
852  _cTimingCut_ElectronicsuTCA.fill(eid, timing);
855  }
856  }
857  did.subdet()==HcalBarrel?numChsCut++:numChsCutHE++;
858  }
859  did.subdet()==HcalBarrel?numChs++:numChsHE++;
860  }
861 
862  // HE QIE11 collection
863  for (QIE11DigiCollection::const_iterator it=che_qie11->begin(); it!=che_qie11->end();
864  ++it)
865  {
866  const QIE11DataFrame digi = static_cast<const QIE11DataFrame>(*it);
867 
868  // Explicit check on the DetIds present in the Collection
869  HcalDetId const& did = digi.detid();
870  if (did.subdet() != HcalEndcap) {
871  // LED monitoring from calibration channels
872  if (_ptype != fLocal) {
873  if (did.subdet() == HcalOther) {
874  HcalOtherDetId hodid(digi.detid());
875  if (hodid.subdet() == HcalCalibration) {
876  // New method: use configurable list of channels
878  bool channelLEDSignalPresent = false;
879  for (int i=0; i<digi.samples(); i++) {
880  _LED_ADCvsBX_Subdet.fill(HcalDetId(HcalEndcap, 16, 1, 1), bx, digi[i].adc());
881 
882  if (digi[i].adc() > _thresh_led) {
883  channelLEDSignalPresent = true;
884  }
885  }
886  if (channelLEDSignalPresent) {
888  if (_ptype == fOnline) {
890  }
891  }
892  }
893  }
894  }
895  }
896  continue;
897  }
898 
899  uint32_t rawid = _ehashmap.lookup(did);
900  if (rawid == 0) {
901  meUnknownIds1LS->Fill(1);
902  _unknownIdsPresent=true;
903  continue;
904  } else {
905  if (did.subdet()==HcalBarrel) { // Note: since this is HE, we obviously expect did.subdet() always to be HcalEndcap, but QIE11DigiCollection will have HB for Run 3.
906  rawidHBValid = did.rawId();
907  } else if (did.subdet()==HcalEndcap) {
908  rawidHEValid = did.rawId();
909  }
910  }
911  HcalElectronicsId const& eid(rawid);
912 
913  // filter out channels that are masked out
914  if (_xQuality.exists(did))
915  {
916  HcalChannelStatus cs(did.rawId(), _xQuality.get(did));
917  if (
920  continue;
921  }
922 
923  // (capid - BX) % 4
924  if (_ptype == fOnline) {
925  short soi = -1;
926  for (int i=0; i<digi.samples(); i++) {
927  if (digi[i].soi()) {
928  soi = i;
929  break;
930  }
931  }
932  short this_capidmbx = (digi[soi].capid() - bx) % 4;
933  if (this_capidmbx < 0) {
934  this_capidmbx += 4;
935  }
936  _cCapidMinusBXmod4_SubdetPM.fill(did, this_capidmbx);
937  bool good_capidmbx = (_capidmbx[did.subdet()] == this_capidmbx);
938  if (!good_capidmbx) {
939  _xBadCapid.get(eid)++;
942  }
943  if (eid.isVMEid()) {
944  _cCapidMinusBXmod4_CrateSlotVME[this_capidmbx].fill(eid);
945 
946  } else {
947  _cCapidMinusBXmod4_CrateSlotuTCA[this_capidmbx].fill(eid);
948  }
949  }
950 
951  CaloSamples digi_fC = hcaldqm::utilities::loadADC2fCDB<QIE11DataFrame>(_dbService, did, digi);
952  double sumQ = hcaldqm::utilities::sumQDB<QIE11DataFrame>(_dbService, digi_fC, did, digi, 0, digi.samples()-1);
953 
954  _cSumQ_SubdetPM_QIE1011.fill(did, sumQ);
955  _cOccupancy_depth.fill(did);
956  if (_ptype == fOnline || _ptype == fLocal) {
957  _cOccupancy_Crate.fill(eid);
959  }
960  if (_ptype==fOnline)
961  {
962  _cDigiSizevsLS_FED.fill(eid, _currentLS, digi.samples());
963  digi.samples()!=_refDigiSize[did.subdet()]?
964  _xDigiSize.get(eid)++:_xDigiSize.get(eid)+=0;
967  }
968  _cDigiSize_Crate.fill(eid, digi.samples());
969  if (_ptype != fOffline) { // hidefed2crate
970  _cDigiSize_FED.fill(eid, digi.samples());
971  if (eid.isVMEid())
972  {
975  }
976  else
977  {
980  /*
981  if (!digi.validate(0, digi.size()))
982  {
983  _cCapIdRots_depth.fill(did);
984  _cCapIdRots_FEDuTCA.fill(eid, 1);
985  }*/
986  }
987  }
988  for (int i=0; i<digi.samples(); i++) {
989  double q = hcaldqm::utilities::adc2fCDBMinusPedestal<QIE11DataFrame>(_dbService, digi_fC, did, digi, i);
990  _cADC_SubdetPM_QIE1011.fill(did, digi[i].adc());
991  _cfC_SubdetPM_QIE1011.fill(did, q);
992  _cLETDCvsADC_SubdetPM.fill(did, digi[i].adc(), digi[i].tdc());
993  _cLETDCvsTS_SubdetPM.fill(did, (int)i, digi[i].tdc());
994  if (digi[i].tdc() <50) {
995  double time = i*25. + (digi[i].tdc() / 2.);
996  _cLETDCTime_SubdetPM.fill(did, time);
997  _cLETDCTime_depth.fill(did, time);
998  _cLETDCTimevsADC_SubdetPM.fill(did, digi[i].adc(), time);
999  }
1000  // Bad TDC values: 50-61 should never happen in QIE10 or QIE11, but we saw some in 2017 data.
1001  if ((50 <= digi[i].tdc()) && (digi[i].tdc() <= 61)) {
1002  _cBadTDCValues_SubdetPM.fill(did, digi[i].tdc());
1003  _cBadTDCvsBX_SubdetPM.fill(did, bx);
1006  }
1007  if (_ptype != fOffline) { // hidefed2crate
1008  _cADCvsTS_SubdetPM_QIE1011.fill(did, i, digi[i].adc());
1009  if (sumQ>_cutSumQ_HE) {
1010  _cShapeCut_FED.fill(eid, i, q);
1011  }
1012  }
1013  }
1014 
1015  if (sumQ>_cutSumQ_HE)
1016  {
1017  //double timing = hcaldqm::utilities::aveTS_v10<QIE11DataFrame>(digi, 2.5, 0,digi.samples()-1);
1018  double timing = hcaldqm::utilities::aveTSDB<QIE11DataFrame>(_dbService, digi_fC, did, digi, 0, digi.samples()-1);
1019  _cTimingCut_SubdetPM.fill(did, timing);
1020  _cTimingCut_depth.fill(did, timing);
1023  if (_ptype != fOffline) { // hidefed2crate
1024  _cTimingCutvsLS_FED.fill(eid, _currentLS, timing);
1025  }
1026  _cSumQ_depth.fill(did, sumQ);
1028  if (_ptype==fOnline)
1029  {
1030  _cSumQvsBX_SubdetPM_QIE1011.fill(did, bx, sumQ);
1031  _cTimingCutvsiphi_SubdetPM.fill(did, timing);
1032  _cTimingCutvsieta_Subdet.fill(did, timing);
1036  }
1037  if (_ptype != fOffline) { // hidefed2crate
1038  if (eid.isVMEid())
1039  {
1040  _cTimingCut_FEDVME.fill(eid, timing);
1041  _cTimingCut_ElectronicsVME.fill(eid, timing);
1044  }
1045  else
1046  {
1047  _cTimingCut_FEDuTCA.fill(eid, timing);
1048  _cTimingCut_ElectronicsuTCA.fill(eid, timing);
1051  }
1052  }
1053  did.subdet()==HcalBarrel?numChsCut++:numChsCutHE++;
1054  }
1055  did.subdet()==HcalBarrel?numChs++:numChsHE++;
1056  }
1057 
1058  if (rawidHBValid!=0 && rawidHEValid!=0)
1059  {
1061  numChs);
1063  numChsHE);
1064  // ONLINE ONLY!
1065  if (_ptype==fOnline)
1066  {
1067  _cOccupancyCutvsLS_Subdet.fill(HcalDetId(rawidHBValid),
1068  _currentLS, numChsCut);
1069  _cOccupancyCutvsBX_Subdet.fill(HcalDetId(rawidHBValid), bx,
1070  numChsCut);
1071  _cOccupancyCutvsLS_Subdet.fill(HcalDetId(rawidHEValid),
1072  _currentLS, numChsCutHE);
1073  _cOccupancyCutvsBX_Subdet.fill(HcalDetId(rawidHEValid), bx,
1074  numChsCutHE);
1075  }
1076  // ^^^ONLINE ONLY!
1077  }
1078  numChs=0;
1079  numChsCut = 0;
1080 
1081  // reset
1082  rawidValid = 0;
1083 
1084 
1085  // HO collection
1086  for (HODigiCollection::const_iterator it=cho->begin(); it!=cho->end();
1087  ++it)
1088  {
1089  // Explicit check on the DetIds present in the Collection
1090  HcalDetId const& did = it->id();
1091  if (did.subdet() != HcalOuter) {
1092  continue;
1093  }
1094  uint32_t rawid = _ehashmap.lookup(did);
1095  if (rawid == 0) {
1096  meUnknownIds1LS->Fill(1);
1097  _unknownIdsPresent = true;
1098  continue;
1099  } else {
1100  rawidValid = did.rawId();
1101  }
1102  HcalElectronicsId const& eid(rawid);
1103 
1104  // filter out channels that are masked out
1105  if (_xQuality.exists(did))
1106  {
1107  HcalChannelStatus cs(did.rawId(), _xQuality.get(did));
1108  if (
1109  cs.isBitSet(HcalChannelStatus::HcalCellMask) ||
1111  continue;
1112  }
1113 
1114  if (_ptype == fOnline) {
1115  short this_capidmbx = (it->sample(it->presamples()).capid() - bx) % 4;
1116  if (this_capidmbx < 0) {
1117  this_capidmbx += 4;
1118  }
1119  _cCapidMinusBXmod4_SubdetPM.fill(did, this_capidmbx);
1120  bool good_capidmbx = (_capidmbx[did.subdet()] == this_capidmbx);
1121  if (!good_capidmbx) {
1122  _xBadCapid.get(eid)++;
1125  }
1126  if (eid.isVMEid()) {
1127  _cCapidMinusBXmod4_CrateSlotVME[this_capidmbx].fill(eid);
1128 
1129  } else {
1130  _cCapidMinusBXmod4_CrateSlotuTCA[this_capidmbx].fill(eid);
1131  }
1132  }
1133 
1134  //double sumQ = hcaldqm::utilities::sumQ<HODataFrame>(*it, 8.5, 0, it->size()-1);
1135  CaloSamples digi_fC = hcaldqm::utilities::loadADC2fCDB<HODataFrame>(_dbService, did, *it);
1136  double sumQ = hcaldqm::utilities::sumQDB<HODataFrame>(_dbService, digi_fC, did, *it, 0, it->size()-1);
1137 
1138  _cSumQ_SubdetPM.fill(did, sumQ);
1139  _cOccupancy_depth.fill(did);
1140  if (_ptype==fOnline)
1141  {
1142  _cDigiSizevsLS_FED.fill(eid, _currentLS, it->size());
1143  it->size()!=_refDigiSize[did.subdet()]?
1144  _xDigiSize.get(eid)++:_xDigiSize.get(eid)+=0;
1147  }
1148  _cDigiSize_Crate.fill(eid, it->size());
1149  if (_ptype != fOffline) { // hidefed2crate
1150  _cDigiSize_FED.fill(eid, it->size());
1151  if (eid.isVMEid())
1152  {
1153  _cOccupancy_FEDVME.fill(eid);
1155  /*
1156  if (!it->validate(0, it->size()))
1157  _cCapIdRots_FEDVME.fill(eid, 1);
1158  */
1159  }
1160  else
1161  {
1164  /*
1165  if (!it->validate(0, it->size()))
1166  _cCapIdRots_FEDuTCA.fill(eid, 1);*/
1167  }
1168  }
1169 
1170  for (int i=0; i<it->size(); i++)
1171  {
1172  _cADC_SubdetPM.fill(did, it->sample(i).adc());
1173  _cfC_SubdetPM.fill(did, it->sample(i).nominal_fC());
1174  if (_ptype != fOffline) { // hidefed2crate
1175  _cADCvsTS_SubdetPM.fill(did, i, it->sample(i).adc());
1176  if (sumQ>_cutSumQ_HO)
1177  _cShapeCut_FED.fill(eid, i, it->sample(i).nominal_fC());
1178  }
1179  }
1180 
1181  if (sumQ>_cutSumQ_HO)
1182  {
1183  //double timing = hcaldqm::utilities::aveTS<HODataFrame>(*it, 8.5, 0,it->size()-1);
1184  double timing = hcaldqm::utilities::aveTSDB<HODataFrame>(_dbService, digi_fC, did, *it, 0, it->size()-1);
1185  _cSumQ_depth.fill(did, sumQ);
1186  _cSumQvsLS_SubdetPM.fill(did, _currentLS, sumQ);
1188  _cTimingCut_SubdetPM.fill(did, timing);
1189  _cTimingCut_depth.fill(did, timing);
1191  if (_ptype != fOffline) { // hidefed2crate
1192  _cTimingCutvsLS_FED.fill(eid, _currentLS, timing);
1193  }
1194  if (_ptype==fOnline)
1195  {
1196  _cSumQvsBX_SubdetPM.fill(did, bx, sumQ);
1197  _cTimingCutvsiphi_SubdetPM.fill(did, timing);
1198  _cTimingCutvsieta_Subdet.fill(did, timing);
1202  }
1203  if (_ptype != fOffline) { // hidefed2crate
1204  if (eid.isVMEid())
1205  {
1206  _cTimingCut_FEDVME.fill(eid, timing);
1207  _cTimingCut_ElectronicsVME.fill(eid, timing);
1210  }
1211  else
1212  {
1213  _cTimingCut_FEDuTCA.fill(eid, timing);
1214  _cTimingCut_ElectronicsuTCA.fill(eid, timing);
1217  }
1218  }
1219  numChsCut++;
1220  }
1221  numChs++;
1222  }
1223 
1224  if (rawidValid!=0)
1225  {
1227  numChs);
1228 
1229  if (_ptype==fOnline)
1230  {
1232  _currentLS, numChsCut);
1233  _cOccupancyCutvsBX_Subdet.fill(HcalDetId(rawidValid), bx,
1234  numChsCut);
1235  }
1236  }
1237  numChs=0; numChsCut=0;
1238 
1239  // reset
1240  rawidValid = 0;
1241 
1242  // HF collection
1243  if (_qie10InConditions) {
1244  for (QIE10DigiCollection::const_iterator it=chf->begin(); it!=chf->end(); ++it) {
1245  const QIE10DataFrame digi = static_cast<const QIE10DataFrame>(*it);
1246 
1247  // Explicit check on the DetIds present in the Collection
1248  HcalDetId const& did = digi.detid();
1249  if (did.subdet() != HcalForward) {
1250  // LED monitoring from calibration channels
1251  if (_ptype != fLocal) {
1252  if (did.subdet() == HcalOther) {
1253  HcalOtherDetId hodid(digi.detid());
1254  if (hodid.subdet() == HcalCalibration) {
1255  // New method: use configurable list of channels
1257  bool channelLEDSignalPresent = false;
1258  for (int i=0; i<digi.samples(); i++) {
1259  _LED_ADCvsBX_Subdet.fill(HcalDetId(HcalForward, 16, 1, 1), bx, digi[i].adc());
1260 
1261  if (digi[i].adc() > _thresh_led) {
1262  channelLEDSignalPresent = true;
1263  }
1264  }
1265  if (channelLEDSignalPresent) {
1267  if (_ptype == fOnline) {
1269  }
1270  }
1271  }
1272  }
1273  }
1274  }
1275  continue;
1276  }
1277 
1278  uint32_t rawid = _ehashmap.lookup(did);
1279  if (rawid == 0) {
1280  meUnknownIds1LS->Fill(1);
1281  _unknownIdsPresent=true;
1282  continue;
1283  } else {
1284  rawidValid = did.rawId();
1285  }
1286  HcalElectronicsId const& eid(rawid);
1287 
1288  // filter out channels that are masked out
1289  if (_xQuality.exists(did))
1290  {
1291  HcalChannelStatus cs(did.rawId(), _xQuality.get(did));
1292  if (
1293  cs.isBitSet(HcalChannelStatus::HcalCellMask) ||
1295  continue;
1296  }
1297 
1298  // (capid - BX) % 4
1299  if (_ptype == fOnline) {
1300  short soi = -1;
1301  for (int i=0; i<digi.samples(); i++) {
1302  if (digi[i].soi()) {
1303  soi = i;
1304  break;
1305  }
1306  }
1307  short this_capidmbx = (digi[soi].capid() - bx) % 4;
1308  if (this_capidmbx < 0) {
1309  this_capidmbx += 4;
1310  }
1311  _cCapidMinusBXmod4_SubdetPM.fill(did, this_capidmbx);
1312  bool good_capidmbx = (_capidmbx[did.subdet()] == this_capidmbx);
1313  if (!good_capidmbx) {
1314  _xBadCapid.get(eid)++;
1317  }
1318  if (eid.isVMEid()) {
1319  _cCapidMinusBXmod4_CrateSlotVME[this_capidmbx].fill(eid);
1320 
1321  } else {
1322  _cCapidMinusBXmod4_CrateSlotuTCA[this_capidmbx].fill(eid);
1323  }
1324  }
1325 
1326  CaloSamples digi_fC = hcaldqm::utilities::loadADC2fCDB<QIE10DataFrame>(_dbService, did, digi);
1327  double sumQ = hcaldqm::utilities::sumQDB<QIE10DataFrame>(_dbService, digi_fC, did, digi, 0, digi.samples()-1);
1328  //double sumQ = hcaldqm::utilities::sumQ_v10<QIE10DataFrame>(digi, 2.5, 0, digi.samples()-1);
1329 
1330  //if (!_filter_QIE1011.filter(did)) {
1331  _cSumQ_SubdetPM_QIE1011.fill(did, sumQ);
1332  //}
1333  _cOccupancy_depth.fill(did);
1334  if (_ptype==fOnline)
1335  {
1336  _xNChs.get(eid)++;
1337  _cDigiSizevsLS_FED.fill(eid, _currentLS, digi.samples());
1338  digi.samples()!=_refDigiSize[did.subdet()]?
1339  _xDigiSize.get(eid)++:_xDigiSize.get(eid)+=0;
1342  }
1343  _cDigiSize_Crate.fill(eid, digi.samples());
1344  if (_ptype != fOffline) { // hidefed2crate
1345  _cDigiSize_FED.fill(eid, digi.samples());
1346  if (eid.isVMEid())
1347  {
1348  _cOccupancy_FEDVME.fill(eid);
1350  /*
1351  if (!it->validate(0, it->size()))
1352  _cCapIdRots_FEDVME.fill(eid, 1);*/
1353  }
1354  else
1355  {
1358  /*
1359  if (!it->validate(0, it->size()))
1360  _cCapIdRots_FEDuTCA.fill(eid, 1);*/
1361  }
1362  }
1363 
1364  for (int i=0; i<digi.samples(); i++)
1365  {
1366  double q = hcaldqm::utilities::adc2fCDBMinusPedestal<QIE10DataFrame>(_dbService, digi_fC, did, digi, i);
1367  //if (!_filter_QIE1011.filter(did)) {
1368  _cADC_SubdetPM_QIE1011.fill(did, digi[i].adc());
1369  _cfC_SubdetPM_QIE1011.fill(did, q);
1370  _cLETDCvsADC_SubdetPM.fill(did, digi[i].adc(), digi[i].le_tdc());
1371  _cLETDCvsTS_SubdetPM.fill(did, (int)i, digi[i].le_tdc());
1372  if (digi[i].le_tdc() <50) {
1373  double time = i*25. + (digi[i].le_tdc() / 2.);
1374  _cLETDCTime_SubdetPM.fill(did, time);
1375  _cLETDCTime_depth.fill(did, time);
1376  _cLETDCTimevsADC_SubdetPM.fill(did, digi[i].adc(), time);
1377  }
1378 
1379  // Bad TDC values: 50-61 should never happen in QIE10 or QIE11, but we are seeing some in 2017 data.
1380  if ((50 <= digi[i].le_tdc()) && (digi[i].le_tdc() <= 61)) {
1381  _cBadTDCValues_SubdetPM.fill(did, digi[i].le_tdc());
1382  _cBadTDCvsBX_SubdetPM.fill(did, bx);
1385  }
1386  if (_ptype != fOffline) { // hidefed2crate
1387  _cADCvsTS_SubdetPM_QIE1011.fill(did, (int)i, digi[i].adc());
1388  if (sumQ>_cutSumQ_HF)
1389  _cShapeCut_FED.fill(eid, (int)i, q);
1390  }
1391  //}
1392  }
1393 
1394  if (sumQ>_cutSumQ_HF)
1395  {
1396  double timing = hcaldqm::utilities::aveTS_v10<QIE10DataFrame>(digi, 2.5, 0,
1397  digi.samples()-1);
1398  double q1 = hcaldqm::utilities::adc2fCDBMinusPedestal<QIE10DataFrame>(_dbService, digi_fC, did, digi, 1);
1399  double q2 = hcaldqm::utilities::adc2fCDBMinusPedestal<QIE10DataFrame>(_dbService, digi_fC, did, digi, 2);
1400  double q2q12 = q2/(q1+q2);
1401  _cSumQ_depth.fill(did, sumQ);
1402  //if (!_filter_QIE1011.filter(did)) {
1404  //}
1405  _cTimingCut_SubdetPM.fill(did, timing);
1406  _cTimingCut_depth.fill(did, timing);
1408  if (_ptype==fOnline)
1409  {
1410  //if (!_filter_QIE1011.filter(did)) {
1411  _cSumQvsBX_SubdetPM_QIE1011.fill(did, bx, sumQ);
1412  //}
1413  _cTimingCutvsiphi_SubdetPM.fill(did, timing);
1414  _cTimingCutvsieta_Subdet.fill(did, timing);
1418  // _cOccupancyCutvsSlotvsLS_HFPM.fill(did, _currentLS);
1419  _xUniHF.get(eid)++;
1420  }
1421  if (_ptype != fOffline) { // hidefed2crate
1422  _cTimingCutvsLS_FED.fill(eid, _currentLS, timing);
1423  }
1425  if (!eid.isVMEid())
1426  if (_ptype==fOnline)
1427  _cQ2Q12CutvsLS_FEDHF.fill(eid, _currentLS, q2q12);
1428  if (_ptype != fOffline) { // hidefed2crate
1429  if (eid.isVMEid())
1430  {
1431  _cTimingCut_FEDVME.fill(eid, timing);
1432  _cTimingCut_ElectronicsVME.fill(eid, timing);
1435  }
1436  else
1437  {
1438  _cTimingCut_FEDuTCA.fill(eid, timing);
1439  _cTimingCut_ElectronicsuTCA.fill(eid, timing);
1442  }
1443  }
1444  numChsCut++;
1445  }
1446  numChs++;
1447  }
1448  }
1449 
1450  if (rawidValid!=0)
1451  {
1453  numChs);
1454 
1455  if (_ptype==fOnline)
1456  {
1458  _currentLS, numChsCut);
1459  _cOccupancyCutvsBX_Subdet.fill(HcalDetId(rawidValid), bx,
1460  numChsCut);
1461  }
1462  }
1463 }
1464 
1466  edm::LuminosityBlock const& lb, edm::EventSetup const& es)
1467 {
1468  DQTask::beginLuminosityBlock(lb, es);
1469  if (_ptype == fOnline) {
1470  // Reset the bin for _cCapid_BadvsFEDvsLSmod60
1471  for (std::vector<uint32_t>::const_iterator it=_vhashFEDs.begin();
1472  it!=_vhashFEDs.end(); ++it) {
1475  }
1476  }
1477 }
1478 
1480  edm::EventSetup const& es)
1481 {
1482  if (_ptype!=fOnline)
1483  return;
1484 
1485  for (uintCompactMap::const_iterator it=_xUniHF.begin();
1486  it!=_xUniHF.end(); ++it)
1487  {
1488  uint32_t hash1 = it->first;
1489  HcalElectronicsId eid1(hash1);
1490  double x1 = it->second;
1491 
1492  for (uintCompactMap::const_iterator jt=_xUniHF.begin();
1493  jt!=_xUniHF.end(); ++jt)
1494  {
1495  if (jt==it)
1496  continue;
1497  double x2 = jt->second;
1498  if (x2==0)
1499  continue;
1500  if (x1/x2<_thresh_unihf)
1501  _xUni.get(eid1)++;
1502  }
1503  }
1504 
1505  if (_ptype != fOffline) { // hidefed2crate
1506  for (std::vector<uint32_t>::const_iterator it=_vhashFEDs.begin();
1507  it!=_vhashFEDs.end(); ++it)
1508  {
1509  hcaldqm::flag::Flag fSum("DIGI");
1511 
1512  std::vector<uint32_t>::const_iterator cit=std::find(
1513  _vcdaqEids.begin(), _vcdaqEids.end(), *it);
1514  if (cit==_vcdaqEids.end())
1515  {
1516  // not @cDAQ
1517  for (uint32_t iflag=0; iflag<_vflags.size(); iflag++)
1518  _cSummaryvsLS_FED.setBinContent(eid, _currentLS, int(iflag),
1519  int(hcaldqm::flag::fNCDAQ));
1521  continue;
1522  }
1523 
1524  // FED is @cDAQ
1527  {
1528  if (_xDigiSize.get(eid)>0)
1530  else
1532 
1533  if (_xBadCapid.get(eid) > 0) {
1535  } else {
1537  }
1538 
1539  if (hcaldqm::utilities::isFEDHF(eid))
1540  {
1541  double fr = double(_xNChs.get(eid))/double(
1542  _xNChsNominal.get(eid)*_evsPerLS);
1543  if (_runkeyVal==0 || _runkeyVal==4)
1544  {
1545  // only for pp or hi
1546  if (_xUni.get(eid)>0)
1548  else
1549  _vflags[fUni]._state = hcaldqm::flag::fGOOD;
1550  }
1551  if (fr<0.95)
1553  else if (fr<1.0)
1555  else
1557  }
1558  }
1559  if (_unknownIdsPresent)
1561  else
1563 
1564  // LED misfires
1565  if (_ptype != fLocal) {
1566  if (hcaldqm::utilities::isFEDHBHE(eid)) {
1569 
1571  _vflags[fLED]._state = hcaldqm::flag::fBAD;
1572  } else {
1573  _vflags[fLED]._state = hcaldqm::flag::fGOOD;
1574  }
1575  } else if (hcaldqm::utilities::isFEDHF(eid)) {
1578  _vflags[fLED]._state = hcaldqm::flag::fBAD;
1579  } else {
1580  _vflags[fLED]._state = hcaldqm::flag::fGOOD;
1581  }
1582  } else if (hcaldqm::utilities::isFEDHO(eid)) {
1585  _vflags[fLED]._state = hcaldqm::flag::fBAD;
1586  } else {
1587  _vflags[fLED]._state = hcaldqm::flag::fGOOD;
1588  }
1589  }
1590  }
1591 
1592  int iflag=0;
1593  for (std::vector<hcaldqm::flag::Flag>::iterator ft=_vflags.begin();
1594  ft!=_vflags.end(); ++ft)
1595  {
1597  int(ft->_state));
1598  fSum+=(*ft);
1599  iflag++;
1600 
1601  // reset!
1602  ft->reset();
1603  }
1605  }
1606  }
1607 
1609  _xNChs.reset();
1610  _xBadCapid.reset();
1611 
1612  // in the end always do the DQTask::endLumi
1613  DQTask::endLuminosityBlock(lb, es);
1614 }
1615 
1617 
int adc(sample_type sample)
get the ADC sample (12 bits)
int samples() const
total number of samples in the digi
void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, int debug=0) override
DetId detid() const
Get the detector id.
hcaldqm::ContainerProf1D _cTimingCutvsiphi_SubdetPM
Definition: DigiTask.h:120
constexpr uint32_t rawId() const
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: DigiTask.cc:680
hcaldqm::ContainerXXX< uint32_t > _xBadCapid
Definition: DigiTask.h:164
T getParameter(std::string const &) const
bool _qie10InConditions
Definition: DigiTask.h:198
T getUntrackedParameter(std::string const &, T const &) const
double _thresh_led
Definition: DigiTask.h:203
MonitorElement * meNumEvents1LS
Definition: DigiTask.h:191
hcaldqm::Container1D _LED_CUCountvsLSmod60_Subdet
Definition: DigiTask.h:207
hcaldqm::Container1D _cADC_SubdetPM
Definition: DigiTask.h:90
hcaldqm::Container1D _cADC_SubdetPM_QIE1011
Definition: DigiTask.h:98
hcaldqm::Container1D _LED_CUCountvsLS_Subdet
Definition: DigiTask.h:206
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: DigiTask.cc:1479
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *qy=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container1D.cc:40
hcaldqm::Container1D _cOccupancyCutvsieta_Subdet
Definition: DigiTask.h:147
hcaldqm::ContainerProf1D _cSumQvsBX_SubdetPM
Definition: DigiTask.h:95
virtual bool exists(HcalDetId const &)
Definition: ContainerXXX.h:265
int const CRATE_VME_MIN
Definition: Constants.h:111
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:142
void fill(HcalDetId const &) override
edm::InputTag _tagHO
Definition: DigiTask.h:48
std::map< HcalSubdetector, int > _refDigiSize
Definition: DigiTask.h:74
hcaldqm::Container2D _cADCvsTS_SubdetPM
Definition: DigiTask.h:107
std::pair< uint16_t, uint16_t > fed2crate(int fed)
Definition: Utilities.cc:12
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: DigiTask.cc:1465
edm::EDGetTokenT< QIE11DigiCollection > _tokHE
Definition: DigiTask.h:51
double _cutSumQ_HE
Definition: DigiTask.h:55
hcaldqm::ContainerProf1D _cQ2Q12CutvsLS_FEDHF
Definition: DigiTask.h:124
MonitorElement * meUnknownIds1LS
Definition: DigiTask.h:192
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE
Definition: DigiTask.h:50
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
unique_ptr< ClusterSequence > cs
hcaldqm::Container2D _cLETDCTimevsADC_SubdetPM
Definition: DigiTask.h:167
double _cutSumQ_HO
Definition: DigiTask.h:55
virtual CompactMap::const_iterator begin()
Definition: ContainerXXX.h:73
double _thresh_unihf
Definition: DigiTask.h:56
UpdateFreq
Definition: DQTask.h:17
State _state
Definition: Flag.h:79
std::map< HcalSubdetector, short > _capidmbx
Definition: DigiTask.h:200
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
std::vector< HBHEDataFrame >::const_iterator const_iterator
int bunchCrossing() const
Definition: EventBase.h:66
hcaldqm::ContainerSingle2D _cCapidMinusBXmod4_CrateSlotuTCA[4]
Definition: DigiTask.h:185
virtual void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
virtual example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
int const SPIGOT_MIN
Definition: Constants.h:136
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
hcaldqm::ContainerProf2D _cSumQ_depth
Definition: DigiTask.h:93
edm::EDGetTokenT< HODigiCollection > _tokHO
Definition: DigiTask.h:52
hcaldqm::Container1D _cOccupancyCutvsiphi_SubdetPM
Definition: DigiTask.h:146
const_iterator begin() const
virtual void reset()
Definition: ContainerXXX.h:364
hcaldqm::ContainerProf1D _cSumQvsLS_SubdetPM_QIE1011
Definition: DigiTask.h:101
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
hcaldqm::ContainerSingle2D _cSummaryvsLS
Definition: DigiTask.h:196
hcaldqm::ContainerProf2D _cTimingCut_FEDVME
Definition: DigiTask.h:113
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: DigiTask.cc:84
int const FIBER_VME_MIN
Definition: Constants.h:141
hcaldqm::Container2D _cOccupancyCutvsiphivsLS_SubdetPM
Definition: DigiTask.h:149
hcaldqm::ContainerXXX< uint32_t > _xDigiSize
Definition: DigiTask.h:160
hcaldqm::ContainerProf2D _cTimingCut_FEDuTCA
Definition: DigiTask.h:114
#define constexpr
double q2[4]
Definition: TauolaWrapper.h:88
hcaldqm::Container1D _cBadTDCvsLS_SubdetPM
Definition: DigiTask.h:176
int const FIBERCH_MIN
Definition: Constants.h:151
void Fill(long long x)
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
std::vector< int > getFEDVMEList(HcalElectronicsMap const *)
Definition: Utilities.cc:119
hcaldqm::filter::HashFilter _filter_VME
Definition: DigiTask.h:81
virtual CompactMap::const_iterator end()
Definition: ContainerXXX.h:75
hcaldqm::Container2D _cLETDCvsTS_SubdetPM
Definition: DigiTask.h:169
ProcessingType _ptype
Definition: DQModule.h:59
virtual void fill(uint32_t)
Definition: Container1D.cc:82
virtual void reset()
Definition: Container1D.cc:65
edm::InputTag _tagHBHE
Definition: DigiTask.h:46
void reset()
Definition: Flag.h:76
void setLumiFlag()
this ME is meant to be stored for each luminosity section
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
hcaldqm::Container2D _cOccupancy_CrateSlot
Definition: DigiTask.h:133
virtual void setBinContent(int, int, int)
constexpr bool isVMEid() const
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
ContainerXXX< uint32_t > _xQuality
Definition: DQTask.h:62
hcaldqm::ContainerSingle2D _cCapid_BadvsFEDvsLS
Definition: DigiTask.h:187
int const FED_VME_MIN
Definition: Constants.h:98
hcaldqm::Container2D _cADCvsTS_SubdetPM_QIE1011
Definition: DigiTask.h:108
hcaldqm::Container2D _cOccupancyCut_ElectronicsVME
Definition: DigiTask.h:143
hcaldqm::Container1D _cDigiSize_Crate
Definition: DigiTask.h:157
hcaldqm::Container1D _cShapeCut_FED
Definition: DigiTask.h:106
hcaldqm::Container2D _cOccupancyCut_depth
Definition: DigiTask.h:145
hcaldqm::ContainerProf1D _cOccupancyCutvsBX_Subdet
Definition: DigiTask.h:154
double _cutSumQ_HF
Definition: DigiTask.h:55
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
HcalSubdetector
Definition: HcalAssistant.h:31
int const FIBER_uTCA_MIN1
Definition: Constants.h:144
hcaldqm::Container1D _cfC_SubdetPM_QIE1011
Definition: DigiTask.h:99
double _cutSumQ_HBHE
Definition: DigiTask.h:55
std::map< HcalSubdetector, std::vector< HcalDetId > > _ledCalibrationChannels
Definition: DigiTask.h:204
hash_function_did const hash_did[nHashType_did]
hcaldqm::ContainerProf2D _cTimingCut_depth
Definition: DigiTask.h:119
DetId detid() const
Get the detector id.
std::vector< HcalGenericDetId > allPrecisionId() const
Logger _logger
Definition: DQModule.h:70
hcaldqm::Container1D _cBadTDCValues_SubdetPM
Definition: DigiTask.h:174
#define end
Definition: vmac.h:39
hcaldqm::Container2D _cOccupancy_FEDVME
Definition: DigiTask.h:128
hcaldqm::ContainerProf1D _cTimingCutvsLS_SubdetPM
Definition: DigiTask.h:118
hcaldqm::Container2D _cOccupancyCut_FEDVME
Definition: DigiTask.h:141
hcaldqm::ContainerProf1D _cSumQvsBX_SubdetPM_QIE1011
Definition: DigiTask.h:102
hcaldqm::ContainerSingle2D _cCapidMinusBXmod4_CrateSlotVME[4]
Definition: DigiTask.h:186
uint32_t hash_Subdet(HcalDetId const &)
hcaldqm::Container2D _cOccupancy_depth
Definition: DigiTask.h:134
std::string _name
Definition: DQModule.h:57
HcalElectronicsMap const * _emap
Definition: DQTask.h:73
hcaldqm::Container2D _cSummaryvsLS_FED
Definition: DigiTask.h:195
hcaldqm::filter::HashFilter _filter_FEDHF
Definition: DigiTask.h:83
int const CRATE_uTCA_MIN
Definition: Constants.h:116
edm::InputTag _tagHE
Definition: DigiTask.h:47
const_iterator end() const
edm::EDGetTokenT< QIE10DigiCollection > _tokHF
Definition: DigiTask.h:53
DigiTask(edm::ParameterSet const &)
Definition: DigiTask.cc:7
hcaldqm::ContainerProf1D _cOccupancyvsLS_Subdet
Definition: DigiTask.h:152
void _resetMonitors(hcaldqm::UpdateFreq) override
Definition: DigiTask.cc:660
hcaldqm::ContainerProf1D _cSumQvsLS_SubdetPM
Definition: DigiTask.h:94
hcaldqm::ContainerXXX< uint32_t > _xUni
Definition: DigiTask.h:161
hcaldqm::ContainerProf1D _cTimingCutvsLS_FED
Definition: DigiTask.h:117
hcaldqm::Container2D _cOccupancyCut_FEDuTCA
Definition: DigiTask.h:142
hcaldqm::Container2D _cOccupancy_ElectronicsVME
Definition: DigiTask.h:130
edm::InputTag _tagHF
Definition: DigiTask.h:49
bool isFEDHBHE(HcalElectronicsId const &)
Definition: Utilities.cc:172
virtual void book(HcalElectronicsMap const *)
Definition: ContainerXXX.h:97
int size() const
get the size
Definition: CaloSamples.h:24
hcaldqm::Container1D _cDigiSize_FED
Definition: DigiTask.h:158
hcaldqm::filter::HashFilter _filter_QIE8
Definition: DigiTask.h:85
double q1[4]
Definition: TauolaWrapper.h:87
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:777
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container2D.cc:31
hcaldqm::Container2D _LED_ADCvsBX_Subdet
Definition: DigiTask.h:208
hcaldqm::ContainerXXX< uint32_t > _xNChsNominal
Definition: DigiTask.h:163
hcaldqm::Container1D _cSumQ_SubdetPM
Definition: DigiTask.h:92
hcaldqm::Container1D _cOccupancyvsiphi_SubdetPM
Definition: DigiTask.h:135
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
hcaldqm::ContainerProf1D _cTimingCutvsieta_Subdet
Definition: DigiTask.h:121
hcaldqm::ContainerSingle2D _cCapid_BadvsFEDvsLSmod60
Definition: DigiTask.h:188
hcaldqm::Container1D _cLETDCTime_SubdetPM
Definition: DigiTask.h:170
hcaldqm::electronicsmap::ElectronicsMap _dhashmap
Definition: DigiTask.h:78
void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fEnergy), int debug=0) override
std::vector< hcaldqm::flag::Flag > _vflags
Definition: DigiTask.h:59
void setBinContent(HcalDetId const &, int) override
Definition: Container2D.cc:234
std::string const & label() const
Definition: InputTag.h:36
const_iterator end() const
hcaldqm::Container2D _cOccupancyCut_ElectronicsuTCA
Definition: DigiTask.h:144
hcaldqm::ContainerProf2D _cTimingCut_ElectronicsVME
Definition: DigiTask.h:115
hcaldqm::Container2D _cLETDCvsADC_SubdetPM
Definition: DigiTask.h:168
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:247
#define begin
Definition: vmac.h:32
edm::ESHandle< HcalDbService > _dbService
Definition: DQTask.h:72
hcaldqm::Container1D _cBadTDCvsBX_SubdetPM
Definition: DigiTask.h:175
virtual void setLumiFlag()
Definition: Container1D.cc:998
virtual double getBinContent(HcalDetId const &)
Definition: Container1D.cc:214
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:95
hcaldqm::Container2D _cOccupancy_Crate
Definition: DigiTask.h:132
T get() const
Definition: EventSetup.h:62
std::vector< int > getFEDuTCAList(HcalElectronicsMap const *)
Definition: Utilities.cc:145
void fill(HcalDetId const &) override
Definition: Container2D.cc:58
const HcalElectronicsMap * getHcalMapping() const
virtual void initialize(FilterType ftype, hashfunctions::HashType htype, std::vector< uint32_t > const &)
Definition: HashFilter.cc:28
std::string _subsystem
Definition: DQModule.h:64
hcaldqm::filter::HashFilter _filter_uTCA
Definition: DigiTask.h:82
bool isFEDHO(HcalElectronicsId const &)
Definition: Utilities.cc:212
std::vector< uint32_t > _vcdaqEids
Definition: DQTask.h:65
hcaldqm::ContainerProf1D _cDigiSizevsLS_FED
Definition: DigiTask.h:159
hcaldqm::ContainerXXX< uint32_t > _xNChs
Definition: DigiTask.h:162
virtual void fill(int, int)
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: DigiTask.h:77
hcaldqm::ContainerProf1D _cOccupancyCutvsLS_Subdet
Definition: DigiTask.h:153
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:89
hcaldqm::filter::HashFilter _filter_QIE1011
Definition: DigiTask.h:84
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:894
hcaldqm::Container2D _cBadTDCCount_depth
Definition: DigiTask.h:177
hcaldqm::ContainerProf2D _cLETDCTime_depth
Definition: DigiTask.h:171
std::vector< uint32_t > _vhashFEDs
Definition: DigiTask.h:72
int samples() const
total number of samples in the digi
hcaldqm::Container1D _cOccupancyvsieta_Subdet
Definition: DigiTask.h:136
Readout chain identification for Hcal.
std::string const & instance() const
Definition: InputTag.h:37
bool isFEDHF(HcalElectronicsId const &)
Definition: Utilities.cc:187
hcaldqm::ContainerProf2D _cTimingCut_ElectronicsuTCA
Definition: DigiTask.h:116
int const SLOT_uTCA_MIN
Definition: Constants.h:123
const_iterator begin() const
hcaldqm::Container1D _cSumQ_SubdetPM_QIE1011
Definition: DigiTask.h:100
hcaldqm::Container1D _cTimingCut_SubdetPM
Definition: DigiTask.h:112
Definition: Run.h:44
bool _unknownIdsPresent
Definition: DigiTask.h:193
hcaldqm::Container2D _cOccupancy_FEDuTCA
Definition: DigiTask.h:129
hcaldqm::Container1D _cCapidMinusBXmod4_SubdetPM
Definition: DigiTask.h:184
ib
Definition: cuy.py:662
hcaldqm::ContainerXXX< uint32_t > _xUniHF
Definition: DigiTask.h:161
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:121
hcaldqm::Container1D _cfC_SubdetPM
Definition: DigiTask.h:91
hcaldqm::Container2D _cOccupancy_ElectronicsuTCA
Definition: DigiTask.h:131