CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RecHitTask.cc
Go to the documentation of this file.
2 #include <cmath>
3 
4 using namespace hcaldqm;
5 using namespace hcaldqm::constants;
6 using namespace hcaldqm::filter;
7 
9  : DQTask(ps), hcalDbServiceToken_(esConsumes<HcalDbService, HcalDbRecord, edm::Transition::BeginRun>()) {
10  _tagHBHE = ps.getUntrackedParameter<edm::InputTag>("tagHBHE", edm::InputTag("hbhereco"));
11  _tagHO = ps.getUntrackedParameter<edm::InputTag>("tagHO", edm::InputTag("horeco"));
12  _tagHF = ps.getUntrackedParameter<edm::InputTag>("tagHF", edm::InputTag("hfreco"));
14  _hfPreRecHitsAvailable = ps.getUntrackedParameter<bool>("hfPreRecHitsAvailable", false);
15 
16  _tokHBHE = consumes<HBHERecHitCollection>(_tagHBHE);
17  _tokHO = consumes<HORecHitCollection>(_tagHO);
18  _tokHF = consumes<HFRecHitCollection>(_tagHF);
19  _tokPreHF = consumes<HFPreRecHitCollection>(_tagPreHF);
20 
21  _cutE_HBHE = ps.getUntrackedParameter<double>("cutE_HBHE", 5);
22  _cutE_HO = ps.getUntrackedParameter<double>("cutE_HO", 5);
23  _cutE_HF = ps.getUntrackedParameter<double>("cutE_HF", 5);
24  _thresh_unihf = ps.getUntrackedParameter<double>("thresh_unihf", 0.2);
25 
26  // order must be the same as in RecoFlag enum
27  _vflags.resize(nRecoFlag);
28  _vflags[fUni] = flag::Flag("UniSlotHF");
29  _vflags[fTCDS] = flag::Flag("TCDS");
30  _vflags[fUnknownIds] = flag::Flag("UnknownIds");
31 }
32 
33 /* virtual */ void RecHitTask::bookHistograms(DQMStore::IBooker& ib, edm::Run const& r, edm::EventSetup const& es) {
34  DQTask::bookHistograms(ib, r, es);
35 
36  // GET WHAT YOU NEED
38  _emap = dbs->getHcalMapping();
39 
40  std::vector<uint32_t> vVME;
41  std::vector<uint32_t> vuTCA;
42  vVME.push_back(
44  vuTCA.push_back(HcalElectronicsId(CRATE_uTCA_MIN, SLOT_uTCA_MIN, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
47  std::vector<uint32_t> vhashHF;
48  vhashHF.push_back(
50 
52 
53  // INITIALIZE FIRST
54  // Energy
56  "Energy",
60  0);
62  "Energy",
67  0);
68 
69  // Timing
71  "TimingCut",
75  0);
77  "TimingvsEnergy",
82  0);
83 
85  "TimingCut",
89  0);
91  "TimingCut",
96  0);
98  "TimingCutvsLS",
102  0);
103 
104  // Occupancy
106  "Occupancy",
111  0);
112 
114  "OccupancyvsLS",
118  0);
119 
121  "OccupancyCut",
126  0);
127 
130  _name,
131  "ChargeVsAsymmetry",
136  0);
138  "AsymmetryMean",
143  0);
145  "Asymmetry",
149  0);
150  }
151 
152  // INITIALIZE HISTOGRAMS to be used only in Online
153  if (_ptype == fOnline) {
155  "Energyvsieta",
159  0);
161  "Energyvsiphi",
165  0);
167  "EnergyvsLS",
171  0);
173  "EnergyvsBX",
177  0);
179  "TimingCutvsieta",
183  0);
185  "TimingCutvsiphi",
189  0);
191  "TimingCutvsBX",
195  0);
197  "Occupancyvsiphi",
201  0);
203  "Occupancyvsieta",
207  0);
209  "OccupancyCutvsiphi",
213  0);
215  "OccupancyCutvsieta",
219  0);
221  "OccupancyCutvsBX",
225  0);
227  "OccupancyCutvsiphivsLS",
232  0);
234  "OccupancyCutvsLS",
238  0);
239  }
240 
241  // FED-based plots
242  if (_ptype != fOffline) { // hidefed2crate
243  std::vector<int> vFEDs = hcaldqm::utilities::getFEDList(_emap);
244  std::vector<int> vFEDsVME = hcaldqm::utilities::getFEDVMEList(_emap);
245  std::vector<int> vFEDsuTCA = hcaldqm::utilities::getFEDuTCAList(_emap);
246 
247  // push the rawIds of each fed into the vector
248  for (std::vector<int>::const_iterator it = vFEDsVME.begin(); it != vFEDsVME.end(); ++it)
250  for (std::vector<int>::const_iterator it = vFEDsuTCA.begin(); it != vFEDsuTCA.end(); ++it) {
251  std::pair<uint16_t, uint16_t> cspair = utilities::fed2crate(*it);
252  _vhashFEDs.push_back(HcalElectronicsId(cspair.first, cspair.second, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
253  }
254 
256  "TimingCut",
261  0);
263  "TimingCutvsLS",
267  0);
269  "TimingCut",
271  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
274  0);
275 
277  "Occupancy",
282  0);
284  "Occupancy",
286  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
289  0);
290 
292  "OccupancyCut",
297  0);
299  "OccupancyCut",
301  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
304  0);
305  if (_ptype == fOnline) {
307  "SummaryvsLS",
312  0);
314  "SummaryvsLS",
318  0);
319 
322  }
323  }
324 
325  // BOOK HISTOGRAMS
326  char cutstr[200];
327  sprintf(cutstr, "_EHBHE%dHO%dHF%d", int(_cutE_HBHE), int(_cutE_HO), int(_cutE_HF));
328  char cutstr2[200];
329  sprintf(cutstr2, "_EHF%d", int(_cutE_HF));
330 
331  // Energy
334 
335  // Timing
338  if (_ptype != fOffline) { // hidefed2crate
341  }
345  if (_ptype != fOffline) { // hidefed2crate
347  }
348 
349  // Occupancy
351  if (_ptype != fOffline) { // hidefed2crate
354  }
357  if (_ptype != fOffline) { // hidefed2crate
360  }
361 
366  }
367 
368  // BOOK HISTOGRAMS to be used only in Online
369  if (_ptype == fOnline) {
386 
387  std::vector<uint32_t> vhashFEDHF;
388  vhashFEDHF.push_back(HcalElectronicsId(22, SLOT_uTCA_MIN, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
389  vhashFEDHF.push_back(HcalElectronicsId(29, SLOT_uTCA_MIN, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
390  vhashFEDHF.push_back(HcalElectronicsId(32, SLOT_uTCA_MIN, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
391  vhashFEDHF.push_back(HcalElectronicsId(22, SLOT_uTCA_MIN + 6, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
392  vhashFEDHF.push_back(HcalElectronicsId(29, SLOT_uTCA_MIN + 6, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
393  vhashFEDHF.push_back(HcalElectronicsId(32, SLOT_uTCA_MIN + 6, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
394  HashFilter filter_FEDHF;
396 
398  if (_ptype != fOffline) { // hidefed2crate
399  _xUniHF.book(_emap, filter_FEDHF);
400  _xUni.book(_emap);
401  }
402  }
403 
404  // initialize hash map
406 
407  // book some mes...
408  ib.setCurrentFolder(_subsystem + "/" + _name);
409  auto scope = DQMStore::IBooker::UseLumiScope(ib);
410  meUnknownIds1LS = ib.book1DD("UnknownIds", "UnknownIds", 1, 0, 1);
411  _unknownIdsPresent = false;
412 }
413 
415  switch (uf) {
416  case hcaldqm::f1LS:
417  _unknownIdsPresent = false;
418  break;
419  default:
420  break;
421  }
422 
423  DQTask::_resetMonitors(uf);
424 }
425 
426 /* virtual */ void RecHitTask::_process(edm::Event const& e, edm::EventSetup const&) {
430 
431  if (!(e.getByToken(_tokHBHE, chbhe)))
432  _logger.dqmthrow("Collection HBHERecHitCollection not available " + _tagHBHE.label() + " " + _tagHBHE.instance());
433  if (!(e.getByToken(_tokHO, cho)))
434  _logger.dqmthrow("Collection HORecHitCollection not available " + _tagHO.label() + " " + _tagHO.instance());
435  if (!(e.getByToken(_tokHF, chf)))
436  _logger.dqmthrow("Collection HFRecHitCollection not available " + _tagHF.label() + " " + _tagHF.instance());
437 
440  if (!(e.getByToken(_tokPreHF, cprehf)))
441  _logger.dqmthrow("Collection HFPreRecHitCollection not available " + _tagPreHF.label() + " " +
442  _tagPreHF.instance());
443  }
444 
445  // extract some info per event
446  int bx = e.bunchCrossing();
447 
448  auto lumiCache = luminosityBlockCache(e.getLuminosityBlock().index());
449  _currentLS = lumiCache->currentLS;
450 
451  // To fill histograms outside of the loop, you need to determine if there were
452  // any valid det ids first
453  uint32_t rawidValid = 0;
454  uint32_t rawidHBValid = 0;
455  uint32_t rawidHEValid = 0;
456 
457  double ehbm = 0;
458  double ehbp = 0;
459  double ehem = 0;
460  double ehep = 0;
461  int nChsHB = 0;
462  int nChsHE = 0;
463  int nChsHBCut = 0;
464  int nChsHECut = 0;
465  for (HBHERecHitCollection::const_iterator it = chbhe->begin(); it != chbhe->end(); ++it) {
466  double energy = it->energy();
467  double timing = it->time();
468 
469  // Explicit check on the DetIds present in the Collection
470  HcalDetId did = it->id();
471  uint32_t rawid = _ehashmap.lookup(did);
472  /*
473  * Needs to be removed as DetIds that belong to the HEP17 after combination
474  * are not present in the emap
475  * Removed until further notice!
476  *
477  */
478  //if (rawid==0)
479  //{meUnknownIds1LS->Fill(1); _unknownIdsPresent=true;continue;}
480 
481  HcalElectronicsId const& eid(rawid);
482  rawidValid = did.rawId();
483  if (did.subdet() == HcalBarrel)
484  rawidHBValid = did.rawId();
485  else if (did.subdet() == HcalEndcap)
486  rawidHEValid = did.rawId();
487 
488  _cEnergy_Subdet.fill(did, energy);
489  _cTimingvsEnergy_SubdetPM.fill(did, energy, timing);
490  _cOccupancy_depth.fill(did);
491  did.subdet() == HcalBarrel ? did.ieta() > 0 ? ehbp += energy : ehbm += energy
492  : did.ieta() > 0 ? ehep += energy
493  : ehem += energy;
494 
495  // ONLINE ONLY!
496  if (_ptype == fOnline) {
499  }
500  // ^^^ONLINE ONLY!
501  //
502  if (_ptype != fOffline) { // hidefed2crate
503  // Also, for these electronics plots, require that the channel was found in the emap.
504  if (rawid != 0) {
505  if (!eid.isVMEid()) {
508  }
509  }
510  }
511 
512  if (energy > _cutE_HBHE) {
513  // ONLINE ONLY!
514  if (_ptype == fOnline) {
515  _cEnergyvsLS_SubdetPM.fill(did, _currentLS, energy);
516  _cEnergyvsBX_SubdetPM.fill(did, bx, energy);
517  _cEnergyvsieta_Subdet.fill(did, energy);
518  _cEnergyvsiphi_SubdetPM.fill(did, energy);
519  _cTimingCutvsieta_Subdet.fill(did, timing);
520  _cTimingCutvsiphi_SubdetPM.fill(did, timing);
521  _cTimingCutvsBX_SubdetPM.fill(did, bx, timing);
524  _cOccupancyCutvsiphivsLS_SubdetPM.fill(did, _currentLS);
525  }
526  // ^^^ONLINE ONLY!
527  _cEnergy_depth.fill(did, energy);
528  _cTimingCut_SubdetPM.fill(did, timing);
529  _cTimingCut_HBHEPartition.fill(did, timing);
530  _cTimingCutvsLS_SubdetPM.fill(did, _currentLS, timing);
531 
532  // ONLINE
533  if (_ptype == fOnline) {
534  if (rawid != 0) {
535  _cTimingCutvsLS_FED.fill(eid, _currentLS, timing);
536  }
537  _cTimingCut_depth.fill(did, timing);
538  // ^^^ONLINE
539  } else {
540  if (_ptype != fOffline) { // hidefed2crate
541  if (rawid != 0) {
542  _cTimingCutvsLS_FED.fill(eid, _currentLS, timing);
543  }
544  }
545  _cTimingCut_depth.fill(did, timing);
546  }
548  if (_ptype != fOffline) { // hidefed2crate
549  if (rawid != 0) {
550  if (eid.isUTCAid()) {
551  if (_ptype == fOnline) {
552  // time constraints are explicit!
553  _cTimingCut_FEDuTCA.fill(eid, timing);
554  _cTimingCut_ElectronicsuTCA.fill(eid, timing);
555  } else {
556  _cTimingCut_FEDuTCA.fill(eid, timing);
557  _cTimingCut_ElectronicsuTCA.fill(eid, timing);
558  }
561  }
562  }
563  }
564  did.subdet() == HcalBarrel ? nChsHBCut++ : nChsHECut++;
565  }
566  did.subdet() == HcalBarrel ? nChsHB++ : nChsHE++;
567  }
568 
569  if (rawidHBValid != 0 && rawidHEValid != 0) {
570  _cOccupancyvsLS_Subdet.fill(HcalDetId(rawidHBValid), _currentLS, nChsHB);
571  _cOccupancyvsLS_Subdet.fill(HcalDetId(rawidHEValid), _currentLS, nChsHE);
572 
573  // ONLINE ONLY!
574  if (_ptype == fOnline) {
575  _cOccupancyCutvsBX_Subdet.fill(HcalDetId(rawidHBValid), bx, nChsHBCut);
576  _cOccupancyCutvsBX_Subdet.fill(HcalDetId(rawidHEValid), bx, nChsHECut);
577  _cOccupancyCutvsLS_Subdet.fill(HcalDetId(rawidHBValid), _currentLS, nChsHBCut);
578  _cOccupancyCutvsLS_Subdet.fill(HcalDetId(rawidHEValid), _currentLS, nChsHECut);
579  }
580  // ^^^ONLINE ONLY!
581  }
582 
583  // reset
584  rawidValid = 0;
585 
586  int nChsHO = 0;
587  int nChsHOCut = 0;
588  double ehop = 0;
589  double ehom = 0;
590  for (HORecHitCollection::const_iterator it = cho->begin(); it != cho->end(); ++it) {
591  double energy = it->energy();
592  double timing = it->time();
593 
594  // Explicit check on the DetIds present in the Collection
595  HcalDetId did = it->id();
596  uint32_t rawid = _ehashmap.lookup(did);
597  if (rawid == 0) {
598  meUnknownIds1LS->Fill(1);
599  _unknownIdsPresent = true;
600  continue;
601  }
602  HcalElectronicsId const& eid(rawid);
603  if (did.subdet() == HcalOuter)
604  rawidValid = did.rawId();
605 
606  _cEnergy_Subdet.fill(did, energy);
607  _cTimingvsEnergy_SubdetPM.fill(did, energy, timing);
608  _cOccupancy_depth.fill(did);
609  did.ieta() > 0 ? ehop += energy : ehom += energy;
610 
611  // IMPORTANT: ONLINE ONLY!
612  if (_ptype == fOnline) {
615  }
616  // ONLINE ONLY!
617 
618  if (_ptype != fOffline) { // hidefed2crate
619  if (!eid.isVMEid()) {
622  }
623  }
624 
625  if (energy > _cutE_HO) {
626  // ONLINE ONLY!
627  if (_ptype == fOnline) {
628  _cEnergyvsLS_SubdetPM.fill(did, _currentLS, energy);
629  _cEnergyvsBX_SubdetPM.fill(did, bx, energy);
630  _cEnergyvsieta_Subdet.fill(did, energy);
631  _cEnergyvsiphi_SubdetPM.fill(did, energy);
632  _cTimingCutvsieta_Subdet.fill(did, timing);
633  _cTimingCutvsiphi_SubdetPM.fill(did, timing);
634  _cTimingCutvsBX_SubdetPM.fill(did, bx, timing);
637  _cOccupancyCutvsiphivsLS_SubdetPM.fill(did, _currentLS);
638  }
639  // ^^^ONLINE ONLY!
640 
641  _cEnergy_depth.fill(did, energy);
642  _cTimingCut_SubdetPM.fill(did, timing);
643  _cTimingCutvsLS_SubdetPM.fill(did, _currentLS, timing);
644  if (_ptype != fOffline) { // hidefed2crate
645  _cTimingCutvsLS_FED.fill(eid, _currentLS, timing);
646  }
648  _cTimingCut_depth.fill(did, timing);
649  if (_ptype != fOffline) { // hidefed2crate
650  if (!eid.isVMEid()) {
651  _cTimingCut_FEDuTCA.fill(eid, timing);
652  _cTimingCut_ElectronicsuTCA.fill(eid, timing);
655  }
656  }
657  nChsHOCut++;
658  }
659  nChsHO++;
660  }
661 
662  if (rawidValid != 0) {
663  _cOccupancyvsLS_Subdet.fill(HcalDetId(rawidValid), _currentLS, nChsHO);
664  // ONLINE ONLY!
665  if (_ptype == fOnline) {
666  _cOccupancyCutvsBX_Subdet.fill(HcalDetId(rawidValid), bx, nChsHOCut);
667  _cOccupancyCutvsLS_Subdet.fill(HcalDetId(rawidValid), _currentLS, nChsHOCut);
668  }
669  // ^^^ONLINE ONLY!
670  }
671 
672  //reset
673  rawidValid = 0;
674 
675  int nChsHF = 0;
676  int nChsHFCut = 0;
677  double ehfp = 0;
678  double ehfm = 0;
679  for (HFRecHitCollection::const_iterator it = chf->begin(); it != chf->end(); ++it) {
680  double energy = it->energy();
681  double timing = it->time();
682 
683  // Explicit check on the DetIds present in the Collection
684  HcalDetId did = it->id();
685  uint32_t rawid = _ehashmap.lookup(did);
686  if (rawid == 0) {
687  meUnknownIds1LS->Fill(1);
688  _unknownIdsPresent = true;
689  continue;
690  }
691  HcalElectronicsId const& eid(rawid);
692  if (did.subdet() == HcalForward)
693  rawidValid = did.rawId();
694 
695  _cEnergy_Subdet.fill(did, energy);
696  _cTimingvsEnergy_SubdetPM.fill(did, energy, timing);
697  _cOccupancy_depth.fill(did);
698  did.ieta() > 0 ? ehfp += energy : ehfm += energy;
699 
700  // IMPORTANT:
701  // only for Online Processing
702  //
703  if (_ptype == fOnline) {
706  }
707  // ONLINE ONLY!
708 
709  if (_ptype != fOffline) { // hidefed2crate
710  if (!eid.isVMEid()) {
713  }
714  }
715 
716  if (energy > _cutE_HF) {
717  // ONLINE ONLY!
718  if (_ptype == fOnline) {
719  _cEnergyvsLS_SubdetPM.fill(did, _currentLS, energy);
720  _cEnergyvsBX_SubdetPM.fill(did, bx, energy);
721  _cEnergyvsieta_Subdet.fill(did, energy);
722  _cEnergyvsiphi_SubdetPM.fill(did, energy);
723  _cTimingCutvsieta_Subdet.fill(did, timing);
724  _cTimingCutvsiphi_SubdetPM.fill(did, timing);
725  _cTimingCutvsBX_SubdetPM.fill(did, bx, timing);
728  _cOccupancyCutvsiphivsLS_SubdetPM.fill(did, _currentLS);
729  if (_ptype != fOffline) { // hidefed2crate
730  _xUniHF.get(eid)++;
731  }
732  }
733  // ^^^ONLINE ONLY!
734  _cEnergy_depth.fill(did, energy);
735  _cTimingCut_SubdetPM.fill(did, timing);
736  _cTimingCutvsLS_SubdetPM.fill(did, _currentLS, timing);
737  if (_ptype != fOffline) { // hidefed2crate
738  _cTimingCutvsLS_FED.fill(eid, _currentLS, timing);
739  }
741  _cTimingCut_depth.fill(did, timing);
742  if (_ptype != fOffline) { // hidefed2crate
743  if (!eid.isVMEid()) {
744  _cTimingCut_FEDuTCA.fill(eid, timing);
745  _cTimingCut_ElectronicsuTCA.fill(eid, timing);
748  }
749  }
750  nChsHFCut++;
751  }
752  nChsHF++;
753  }
754 
755  if (rawidValid != 0) {
756  _cOccupancyvsLS_Subdet.fill(HcalDetId(rawidValid), _currentLS, nChsHF);
757  // ONLINE ONLY!
758  if (_ptype == fOnline) {
759  _cOccupancyCutvsBX_Subdet.fill(HcalDetId(rawidValid), bx, nChsHFCut);
760  _cOccupancyCutvsLS_Subdet.fill(HcalDetId(rawidValid), _currentLS, nChsHFCut);
761  }
762  // ^^^ONLINE ONLY!
763  }
764 
765  // Loop over HFPreRecHits to get charge and charge asymmetry
767  for (HFPreRecHitCollection::const_iterator it = cprehf->begin(); it != cprehf->end(); ++it) {
768  HcalDetId did = it->id();
769  if (_filter_HF.filter(did)) {
770  continue;
771  }
772  std::pair<float, bool> chargeAsymmetry = it->chargeAsymmetry(0.);
773  std::pair<float, bool> chargeAsymmetryCut = it->chargeAsymmetry(20.);
774 
775  if (chargeAsymmetry.second) {
776  _cDAAsymmetryVsCharge_SubdetPM.fill(did, chargeAsymmetry.first, it->charge());
777  }
778  if (chargeAsymmetryCut.second) {
779  _cDAAsymmetryMean_cut_depth.fill(did, chargeAsymmetryCut.first);
780  _cDAAsymmetry_cut_SubdetPM.fill(did, chargeAsymmetryCut.first);
781  }
782  }
783  }
784 }
785 
786 std::shared_ptr<hcaldqm::Cache> RecHitTask::globalBeginLuminosityBlock(edm::LuminosityBlock const& lb,
787  edm::EventSetup const& es) const {
788  return DQTask::globalBeginLuminosityBlock(lb, es);
789 }
790 
792  if (_ptype != fOnline)
793  return;
794 
795  auto lumiCache = luminosityBlockCache(lb.index());
796  _currentLS = lumiCache->currentLS;
797 
798  //
799  // GENERATE STATUS ONLY FOR ONLINE
800  //
801  // for (std::vector<HcalGenericDetId>::const_iterator it=gids.begin();
802  // it!=gids.end(); ++it)
803  // {}
804 
805  for (uintCompactMap::const_iterator it = _xUniHF.begin(); it != _xUniHF.end(); ++it) {
806  uint32_t hash1 = it->first;
807  HcalElectronicsId eid1(hash1);
808  double x1 = it->second;
809 
810  for (uintCompactMap::const_iterator jt = _xUniHF.begin(); jt != _xUniHF.end(); ++jt) {
811  if (jt == it)
812  continue;
813  double x2 = jt->second;
814  if (x2 == 0)
815  continue;
816  if (x1 / x2 < _thresh_unihf)
817  _xUni.get(eid1)++;
818  }
819  }
820 
821  if (_ptype != fOffline) { // hidefed2crate
822  for (std::vector<uint32_t>::const_iterator it = _vhashFEDs.begin(); it != _vhashFEDs.end(); ++it) {
823  flag::Flag fSum("RECO");
825 
826  std::vector<uint32_t>::const_iterator cit = std::find(_vcdaqEids.begin(), _vcdaqEids.end(), *it);
827  if (cit == _vcdaqEids.end()) {
828  // not @cDAQ
829  for (uint32_t iflag = 0; iflag < _vflags.size(); iflag++)
830  _cSummaryvsLS_FED.setBinContent(eid, _currentLS, int(iflag), int(flag::fNCDAQ));
831  _cSummaryvsLS.setBinContent(eid, _currentLS, int(flag::fNCDAQ));
832  continue;
833  }
834 
835  // FED is @cDAQ
836  if (hcaldqm::utilities::isFEDHF(eid) && (_runkeyVal == 0 || _runkeyVal == 4)) {
837  if (_xUni.get(eid) > 0)
838  _vflags[fUni]._state = flag::fPROBLEMATIC;
839  else
840  _vflags[fUni]._state = flag::fGOOD;
841  }
842 
843  if (_unknownIdsPresent)
844  _vflags[fUnknownIds]._state = flag::fBAD;
845  else
846  _vflags[fUnknownIds]._state = flag::fGOOD;
847 
848  int iflag = 0;
849  for (std::vector<flag::Flag>::iterator ft = _vflags.begin(); ft != _vflags.end(); ++ft) {
850  _cSummaryvsLS_FED.setBinContent(eid, _currentLS, int(iflag), int(ft->_state));
851  fSum += (*ft);
852  iflag++;
853 
854  // reset after using
855  ft->reset();
856  }
857  _cSummaryvsLS.setBinContent(eid, _currentLS, fSum._state);
858  }
859  _xUniHF.reset();
860  _xUni.reset();
861  }
862 
863  // in the end always do the DQTask::endLumi
864  DQTask::globalEndLuminosityBlock(lb, es);
865 }
866 
void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, int debug=0) override
hcaldqm::ContainerXXX< uint32_t > _xUniHF
Definition: RecHitTask.h:111
constexpr uint32_t rawId() const
T getUntrackedParameter(std::string const &, T const &) const
hcaldqm::Container2D _cOccupancyCut_depth
Definition: RecHitTask.h:106
hcaldqm::Container2D _cSummaryvsLS_FED
Definition: RecHitTask.h:123
std::vector< uint32_t > _vhashFEDs
Definition: RecHitTask.h:55
hcaldqm::ContainerProf1D _cOccupancyvsLS_Subdet
Definition: RecHitTask.h:98
edm::EDGetTokenT< HBHERecHitCollection > _tokHBHE
Definition: RecHitTask.h:45
hcaldqm::ContainerProf2D _cEnergy_depth
Definition: RecHitTask.h:75
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:33
hcaldqm::Container2D _cTimingvsEnergy_SubdetPM
Definition: RecHitTask.h:80
int const CRATE_VME_MIN
Definition: Constants.h:95
int ib
Definition: cuy.py:661
double _cutE_HO
Definition: RecHitTask.h:51
void fill(HcalDetId const &) override
std::pair< uint16_t, uint16_t > fed2crate(int fed)
Definition: Utilities.cc:10
LuminosityBlockIndex index() const
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::EDGetTokenT< HFRecHitCollection > _tokHF
Definition: RecHitTask.h:47
hcaldqm::ContainerXXX< uint32_t > _xUni
Definition: RecHitTask.h:111
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
void _resetMonitors(hcaldqm::UpdateFreq) override
Definition: RecHitTask.cc:414
hcaldqm::Container1D _cOccupancyCutvsiphi_SubdetPM
Definition: RecHitTask.h:107
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
hcaldqm::ContainerProf1D _cEnergyvsieta_Subdet
Definition: RecHitTask.h:73
hcaldqm::ContainerProf1D _cEnergyvsiphi_SubdetPM
Definition: RecHitTask.h:74
hcaldqm::Container2D _cOccupancyCutvsiphivsLS_SubdetPM
Definition: RecHitTask.h:110
std::vector< HcalGenericDetId > _gids
Definition: RecHitTask.h:122
virtual CompactMap::const_iterator begin()
Definition: ContainerXXX.h:69
UpdateFreq
Definition: DQTask.h:32
State _state
Definition: Flag.h:62
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< T >::const_iterator const_iterator
hcaldqm::Container1D _cTimingCut_SubdetPM
Definition: RecHitTask.h:83
int bunchCrossing() const
Definition: EventBase.h:64
RecHitTask(edm::ParameterSet const &)
Definition: RecHitTask.cc:8
virtual void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
int const SPIGOT_MIN
Definition: Constants.h:120
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
virtual void reset()
Definition: ContainerXXX.h:292
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: RecHitTask.cc:791
hcaldqm::ContainerProf1D _cTimingCutvsieta_Subdet
Definition: RecHitTask.h:90
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
int const FIBER_VME_MIN
Definition: Constants.h:125
hcaldqm::ContainerProf1D _cEnergyvsBX_SubdetPM
Definition: RecHitTask.h:77
int const FIBERCH_MIN
Definition: Constants.h:134
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< int > getFEDVMEList(HcalElectronicsMap const *)
Definition: Utilities.cc:115
hcaldqm::ContainerProf2D _cTimingCut_ElectronicsuTCA
Definition: RecHitTask.h:86
void Fill(long long x)
virtual CompactMap::const_iterator end()
Definition: ContainerXXX.h:70
constexpr bool isUTCAid() const
std::vector< hcaldqm::flag::Flag > _vflags
Definition: RecHitTask.h:58
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:155
double _cutE_HBHE
Definition: RecHitTask.h:51
ProcessingType _ptype
Definition: DQModule.h:44
virtual void fill(uint32_t)
Definition: Container1D.cc:73
hcaldqm::Container1D _cEnergy_Subdet
Definition: RecHitTask.h:72
hcaldqm::ContainerProf1D _cTimingCutvsLS_FED
Definition: RecHitTask.h:88
hcaldqm::ContainerProf1D _cTimingCutvsLS_SubdetPM
Definition: RecHitTask.h:89
void reset()
Definition: Flag.h:59
hcaldqm::Container2D _cOccupancyCut_ElectronicsuTCA
Definition: RecHitTask.h:104
virtual void setBinContent(int, int, int)
hcaldqm::ContainerProf1D _cOccupancyCutvsBX_Subdet
Definition: RecHitTask.h:109
constexpr bool isVMEid() const
void dqmthrow(std::string const &msg) const
Definition: Logger.h:12
int const FED_VME_MIN
Definition: Constants.h:82
edm::InputTag _tagPreHF
Definition: RecHitTask.h:43
int const FIBER_uTCA_MIN1
Definition: Constants.h:128
double _cutE_HF
Definition: RecHitTask.h:51
Transition
Definition: Transition.h:12
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: RecHitTask.cc:33
hash_function_did const hash_did[nHashType_did]
std::vector< HcalGenericDetId > allPrecisionId() const
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:100
Logger _logger
Definition: DQModule.h:55
hcaldqm::Container2D _cOccupancyCut_FEDuTCA
Definition: RecHitTask.h:103
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: RecHitTask.h:62
MonitorElement * meUnknownIds1LS
Definition: RecHitTask.h:119
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
Definition: DQMStore.h:463
edm::EDGetTokenT< HFPreRecHitCollection > _tokPreHF
Definition: RecHitTask.h:48
std::string _name
Definition: DQModule.h:42
HcalElectronicsMap const * _emap
Definition: DQTask.h:81
hcaldqm::ContainerSingle2D _cSummaryvsLS
Definition: RecHitTask.h:124
double _thresh_unihf
Definition: RecHitTask.h:52
int const CRATE_uTCA_MIN
Definition: Constants.h:100
hcaldqm::Container2D _cOccupancy_ElectronicsuTCA
Definition: RecHitTask.h:97
virtual void book(HcalElectronicsMap const *)
Definition: ContainerXXX.h:87
edm::InputTag _tagHO
Definition: RecHitTask.h:41
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:592
hcaldqm::filter::HashFilter _filter_HF
Definition: RecHitTask.h:69
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:25
hcaldqm::Container2D _cOccupancy_FEDuTCA
Definition: RecHitTask.h:96
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
edm::InputTag _tagHF
Definition: RecHitTask.h:42
edm::ESGetToken< HcalDbService, HcalDbRecord > hcalDbServiceToken_
Definition: RecHitTask.h:49
void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fEnergy), int debug=0) override
hcaldqm::Container2D _cDAAsymmetryVsCharge_SubdetPM
Definition: RecHitTask.h:114
void setBinContent(HcalDetId const &, int) override
Definition: Container2D.cc:163
std::string const & label() const
Definition: InputTag.h:36
hcaldqm::Container1D _cTimingCut_HBHEPartition
Definition: RecHitTask.h:84
hcaldqm::filter::HashFilter _filter_uTCA
Definition: RecHitTask.h:66
hcaldqm::ContainerProf1D _cOccupancyCutvsLS_Subdet
Definition: RecHitTask.h:105
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:197
hcaldqm::Container1D _cOccupancyvsieta_Subdet
Definition: RecHitTask.h:100
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:97
std::vector< int > getFEDuTCAList(HcalElectronicsMap const *)
Definition: Utilities.cc:135
void fill(HcalDetId const &) override
Definition: Container2D.cc:52
virtual bool filter(HcalDetId const &) const
Definition: HashFilter.cc:24
bool _hfPreRecHitsAvailable
Definition: RecHitTask.h:44
virtual void initialize(FilterType ftype, hashfunctions::HashType htype, std::vector< uint32_t > const &)
Definition: HashFilter.cc:17
std::string _subsystem
Definition: DQModule.h:49
hcaldqm::ContainerProf1D _cTimingCutvsBX_SubdetPM
Definition: RecHitTask.h:92
edm::EDGetTokenT< HORecHitCollection > _tokHO
Definition: RecHitTask.h:46
std::vector< uint32_t > _vcdaqEids
Definition: DQTask.h:69
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: RecHitTask.cc:426
edm::InputTag _tagHBHE
Definition: RecHitTask.h:40
hcaldqm::ContainerProf2D _cTimingCut_FEDuTCA
Definition: RecHitTask.h:85
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:81
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:567
hcaldqm::Container2D _cOccupancy_depth
Definition: RecHitTask.h:95
hcaldqm::ContainerProf2D _cDAAsymmetryMean_cut_depth
Definition: RecHitTask.h:115
hcaldqm::ContainerProf1D _cTimingCutvsiphi_SubdetPM
Definition: RecHitTask.h:91
hcaldqm::ContainerProf2D _cTimingCut_depth
Definition: RecHitTask.h:87
Readout chain identification for Hcal.
std::string const & instance() const
Definition: InputTag.h:37
std::shared_ptr< hcaldqm::Cache > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
Definition: RecHitTask.cc:786
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
hcaldqm::filter::HashFilter _filter_VME
Definition: RecHitTask.h:65
hcaldqm::Container1D _cOccupancyCutvsieta_Subdet
Definition: RecHitTask.h:108
bool isFEDHF(HcalElectronicsId const &)
Definition: Utilities.cc:170
hcaldqm::Container1D _cOccupancyvsiphi_SubdetPM
Definition: RecHitTask.h:99
int const SLOT_uTCA_MIN
Definition: Constants.h:107
Definition: Run.h:45
bool _unknownIdsPresent
Definition: RecHitTask.h:120
hcaldqm::Container1D _cDAAsymmetry_cut_SubdetPM
Definition: RecHitTask.h:116
hcaldqm::ContainerProf1D _cEnergyvsLS_SubdetPM
Definition: RecHitTask.h:76