CMS 3D CMS Logo

TPTask.cc
Go to the documentation of this file.
2 
3 
4 using namespace hcaldqm;
5 using namespace hcaldqm::constants;
7  DQTask(ps)
8 {
10  edm::InputTag("hcalDigis"));
12  edm::InputTag("emulDigis"));
14  edm::InputTag("emulTPDigisNoTDCCut"));
15 
16  _tokData = consumes<HcalTrigPrimDigiCollection>(_tagData);
17  _tokEmul = consumes<HcalTrigPrimDigiCollection>(_tagEmul);
18  _tokEmulNoTDCCut = consumes<HcalTrigPrimDigiCollection>(_tagEmulNoTDCCut);
19 
20  _skip1x1 = ps.getUntrackedParameter<bool>("skip1x1", true);
21  _cutEt = ps.getUntrackedParameter<int>("cutEt", 3);
23  "thresh_EtMsmRate_high", 0.2);
25  "thresh_EtMsmRate_low", 0.05);
27  "thresh_FGMsmRate", 0.2);
29  "thresh_FGMsmRate_low", 0.05);
30  _thresh_DataMsn = ps.getUntrackedParameter<double>("thresh_DataMsn",
31  0.1);
32  _thresh_EmulMsn = ps.getUntrackedParameter<double>("thresh_EmulMsn");
33  std::vector<int> tmp = ps.getUntrackedParameter<std::vector<int> >("vFGBitsReady");
34  for (uint32_t iii=0; iii<constants::NUM_FGBITS; iii++)
35  _vFGBitsReady.push_back(tmp[iii]);
36 
37  _vflags.resize(nTPFlag);
38  _vflags[fEtMsm]=flag::Flag("EtMsm");
39  _vflags[fDataMsn]=flag::Flag("DataMsn");
40  _vflags[fEmulMsn]=flag::Flag("EmulMsn");
41  _vflags[fUnknownIds]=flag::Flag("UnknownIds");
42 }
43 
45  edm::Run const& r, edm::EventSetup const& es)
46 {
47  DQTask::bookHistograms(ib,r,es);
48 
49  // GET WHAT YOU NEED
51  es.get<HcalDbRecord>().get(dbs);
52  _emap = dbs->getHcalMapping();
53  std::vector<uint32_t> vVME;
54  std::vector<uint32_t> vuTCA;
55  std::vector<uint32_t> depth0;
56  vVME.push_back(HcalElectronicsId(FIBERCH_MIN,
59  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
61  vVME);
63  vuTCA);
64  depth0.push_back(HcalTrigTowerDetId(1, 1, 0).rawId());
66  depth0);
67 
68  // INITIALIZE FIRST
69  // Et/FG
80  for (uint8_t iii=0; iii<constants::NUM_FGBITS; iii++)
81  {
86  }
87 
104 
105  // Occupancy
106  _cOccupancyData_depthlike.initialize(_name, "OccupancyData",
110  _cOccupancyEmul_depthlike.initialize(_name, "OccupancyEmul",
114  _cOccupancyCutData_depthlike.initialize(_name, "OccupancyCutData",
118  _cOccupancyCutEmul_depthlike.initialize(_name, "OccupancyCutEmul",
122 
123  // Mismatches
132 
133  // Missing Data w.r.t. Emulator
142 
147 
148  _cOccupancyDatavsBX_TTSubdet.initialize(_name, "OccupancyDatavsBX",
152  _cOccupancyEmulvsBX_TTSubdet.initialize(_name, "OccupancyEmulvsBX",
156  _cOccupancyCutDatavsBX_TTSubdet.initialize(_name, "OccupancyCutDatavsBX",
160  _cOccupancyCutEmulvsBX_TTSubdet.initialize(_name, "OccupancyCutEmulvsBX",
164 
165  // INITIALIZE HISTOGRAMS to be used in Online only!
166  if (_ptype==fOnline)
167  {
168  _cEtCorr2x3_TTSubdet.initialize(_name, "EtCorr2x3",
173  _cOccupancyData2x3_depthlike.initialize(_name, "OccupancyData2x3",
177  _cOccupancyEmul2x3_depthlike.initialize(_name, "OccupancyEmul2x3",
181  _cEtCutDatavsLS_TTSubdet.initialize(_name, "EtCutDatavsLS",
185  _cEtCutEmulvsLS_TTSubdet.initialize(_name, "EtCutEmulvsLS",
189  _cEtCutDatavsBX_TTSubdet.initialize(_name, "EtCutDatavsBX",
193  _cEtCutEmulvsBX_TTSubdet.initialize(_name, "EtCutEmulvsBX",
197  _cEtCorrRatiovsLS_TTSubdet.initialize(_name, "EtCorrRatiovsLS",
201  _cEtCorrRatiovsBX_TTSubdet.initialize(_name, "EtCorrRatiovsBX",
205  _cEtMsmRatiovsLS_TTSubdet.initialize(_name, "EtMsmRatiovsLS",
209  _cEtMsmRatiovsBX_TTSubdet.initialize(_name, "EtMsmRatiovsBX",
221  _cMsnDatavsLS_TTSubdet.initialize(_name, "MsnDatavsLS",
225  _cMsnCutDatavsLS_TTSubdet.initialize(_name, "MsnCutDatavsLS",
229  _cMsnDatavsBX_TTSubdet.initialize(_name, "MsnDatavsBX",
233  _cMsnCutDatavsBX_TTSubdet.initialize(_name, "MsnCutDatavsBX",
237  _cMsnEmulvsLS_TTSubdet.initialize(_name, "MsnEmulvsLS",
241  _cMsnCutEmulvsLS_TTSubdet.initialize(_name, "MsnCutEmulvsLS",
245  _cMsnEmulvsBX_TTSubdet.initialize(_name, "MsnEmulvsBX",
249  _cMsnCutEmulvsBX_TTSubdet.initialize(_name, "MsnCutEmulvsBX",
253  _cOccupancyDatavsLS_TTSubdet.initialize(_name, "OccupancyDatavsLS",
258  "OccupancyCutDatavsLS",
262  _cOccupancyDatavsBX_TTSubdet.initialize(_name, "OccupancyDatavsBX",
267  "OccupancyCutDatavsBX",
271  _cOccupancyEmulvsLS_TTSubdet.initialize(_name, "OccupancyEmulvsLS",
276  "OccupancyCutEmulvsLS",
280  _cOccupancyEmulvsBX_TTSubdet.initialize(_name, "OccupancyEmulvsBX",
285  "OccupancyCutEmulvsBX",
289 
290  _cOccupancy_HF_depth.initialize(_name, "OccupancyDataHF_depth",
294  _cOccupancyNoTDC_HF_depth.initialize(_name, "OccupancyEmulHFNoTDC_depth",
298  _cOccupancy_HF_ieta.initialize(_name, "OccupancyDataHF_ieta",
301  _cOccupancyNoTDC_HF_ieta.initialize(_name, "OccupancyEmulHFNoTDC_ieta",
304  }
305 
306  // FED-based containers
307  if (_ptype != fOffline) { // hidefed2crate
308  std::vector<int> vFEDs = hcaldqm::utilities::getFEDList(_emap);
309  std::vector<int> vFEDsVME = hcaldqm::utilities::getFEDVMEList(_emap);
310  std::vector<int> vFEDsuTCA = hcaldqm::utilities::getFEDuTCAList(_emap);
311  // push the rawIds of each fed into the vector
312  // this vector is used at endlumi for online state generation
313  for (std::vector<int>::const_iterator it=vFEDsVME.begin();
314  it!=vFEDsVME.end(); ++it)
315  {
317  SPIGOT_MIN, (*it)-FED_VME_MIN).rawId());
318  }
319  for (std::vector<int>::const_iterator it=vFEDsuTCA.begin();
320  it!=vFEDsuTCA.end(); ++it)
321  {
322  std::pair<uint16_t, uint16_t> cspair = hcaldqm::utilities::fed2crate(*it);
323  _vhashFEDs.push_back(HcalElectronicsId(cspair.first,
324  cspair.second, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
325  }
328  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
333  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
338  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
343  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
346  // Occupancies
349  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
354  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
359  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
364  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
367 
370  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
375  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
380  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
385  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
388  // Mismatches
391  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
396  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
401  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
406  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
409 
410  // Missing Data w.r.t. Emulator
413  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
418  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
423  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
428  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
433  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
438  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
441  if (_ptype == fOnline) {
442  _cSummaryvsLS_FED.initialize(_name, "SummaryvsLS",
447  _cSummaryvsLS.initialize(_name, "SummaryvsLS",
451 
459  }
460  }
461 
462  // BOOK HISTOGRAMS
463  char aux[20];
464  for (unsigned int iii=0; iii<constants::NUM_FGBITS; iii++)
465  {
466  sprintf(aux, "BIT%d", iii);
467  _cFGCorr_TTSubdet[iii].book(ib, _emap, _subsystem, aux);
468  }
472  if (_ptype != fOffline) { // hidefed2crate
477  }
482  if (_ptype != fOffline) { // hidefed2crate
491  }
496 
502 
503  if (_ptype != fOffline) { // hidefed2crate
514  }
515 
516  // whatever has to go online only goes here
517  if (_ptype==fOnline)
518  {
550 
551  _xEtMsm.book(_emap);
552  _xFGMsm.book(_emap);
558 
563 
564  }
565 
566  // initialize the hash map
568 
569  // book the flag for unknown ids and the online guy as well
571  meUnknownIds1LS = ib.book1D("UnknownIds", "UnknownIds",
572  1, 0, 1);
573  _unknownIdsPresent = false;
575 }
576 
578 {
579  DQTask::_resetMonitors(uf);
580  switch (uf)
581  {
582  case hcaldqm::f1LS:
583  _unknownIdsPresent = false;
584  break;
585  default :
586  break;
587  }
588 }
589 
590 /* virtual */ void TPTask::_process(edm::Event const& e,
591  edm::EventSetup const&)
592 {
596  if (!e.getByToken(_tokData, cdata))
597  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available: "
598  + _tagData.label() + " " + _tagData.instance());
599  if (!e.getByToken(_tokEmul, cemul))
600  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available: "
601  + _tagEmul.label() + " " + _tagEmul.instance());
602  if (_ptype == fOnline) {
603  if (!e.getByToken(_tokEmulNoTDCCut, cemul_noTDCCut)) {
604  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available: "
606  }
607  }
608 
609  // extract some info per event
610  int bx = e.bunchCrossing();
611 
612  // some summaries... per event
613  int numHBHE(0), numHF(0), numCutHBHE(0), numCutHF(0);
614  int numCorrHBHE(0), numCorrHF(0);
615  int numMsmHBHE(0), numMsmHF(0);
616  int numMsnHBHE(0), numMsnHF(0), numMsnCutHBHE(0), numMsnCutHF(0);
617 
618  // for explanation see RecHit or Digi Tasks
619  uint32_t rawidHBHEValid = 0;
620  uint32_t rawidHFValid = 0;
621 
622  /*
623  * STEP1:
624  * Loop over the data digis and
625  * - do ... for all the data digis
626  * - find the emulator digi
627  * --- compare soi Et
628  * --- compare soi FG
629  * --- Do not fill anything for emulator Et!!!
630  */
632  it!=cdata->end(); ++it)
633  {
634  // Explicit check on the DetIds present in the Collection
635  HcalTrigTowerDetId tid = it->id();
636  uint32_t rawid = _ehashmap.lookup(tid);
637  if (rawid==0) {
638  meUnknownIds1LS->Fill(1);
639  _unknownIdsPresent = true;
640  continue;
641  }
642  HcalElectronicsId const& eid(rawid);
643  if (tid.ietaAbs()>=29)
644  rawidHFValid = tid.rawId();
645  else
646  rawidHBHEValid = tid.rawId();
647 
648  //
649  // HF 2x3 TPs Treat theam separately and only for ONLINE!
650  //
651  if (tid.version()==0 && tid.ietaAbs()>=29)
652  {
653  // do this only for online processing
654  if (_ptype == fOnline)
655  {
658  if (jt!=cemul->end())
659  _cEtCorr2x3_TTSubdet.fill(tid, it->SOI_compressedEt(),
660  jt->SOI_compressedEt());
661  }
662 
663  // skip to the next tp digi
664  continue;
665  }
666 
667  // FROM THIS POINT, HBHE + 1x1 HF TPs
668  int soiEt_d = it->t0().compressedEt();
669  int soiFG_d[constants::NUM_FGBITS];
670  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
671  soiFG_d[ibit] = it->t0().fineGrain(ibit)?1:0;
672  tid.ietaAbs()>=29?numHF++:numHBHE++;
673 
674  // fill w/o a cut
675  _cEtData_TTSubdet.fill(tid, soiEt_d);
676  _cEtData_depthlike.fill(tid, soiEt_d);
678 
679  if (_ptype == fOnline) {
680  if (tid.ietaAbs()>=29) {
681  if (soiEt_d > 0) {
684  }
685  }
686  }
687  if (_ptype != fOffline) { // hidefed2crate
688  if (eid.isVMEid())
689  {
691  _cEtData_ElectronicsVME.fill(eid, soiEt_d);
692  }
693  else
694  {
696  _cEtData_ElectronicsuTCA.fill(eid, soiEt_d);
697  }
698  }
699 
700  // FILL w/a CUT
701  if (soiEt_d>_cutEt)
702  {
703  tid.ietaAbs()>=29?numCutHF++:numCutHBHE++;
705  _cEtCutData_depthlike.fill(tid, soiEt_d);
706 
707  // ONLINE ONLY!
708  if (_ptype==fOnline)
709  {
711  _cEtCutDatavsBX_TTSubdet.fill(tid, bx, soiEt_d);
712  _xDataTotal.get(eid)++;
713  }
714  // ^^^ONLINE ONLY!
715  if (_ptype != fOffline) { // hidefed2crate
716  if (eid.isVMEid())
718  else
720  }
721  }
722 
723  // FIND the EMULATOR DIGI
725  if (jt!=cemul->end())
726  {
727  // if PRESENT!
728  int soiEt_e = jt->SOI_compressedEt();
729  int soiFG_e[constants::NUM_FGBITS];
730  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
731  soiFG_e[ibit] = jt->t0().fineGrain(ibit)?1:0;
732  // if both are zeroes => set 1
733  double rEt = soiEt_d==0 && soiEt_e==0?1:
734  double(std::min(soiEt_d, soiEt_e))/
735  double(std::max(soiEt_e, soiEt_d));
736 
737  // ONLINE ONLY!
738  if (_ptype==fOnline)
739  {
740  _xNumCorr.get(eid)++;
741  tid.ietaAbs()>=29?numCorrHF++:numCorrHBHE++;
743  _cEtCorrRatiovsBX_TTSubdet.fill(tid, bx, rEt);
744  }
745  // ^^^ONLINE ONLY!
746 
747  _cEtCorrRatio_depthlike.fill(tid, rEt);
748  _cEtCorr_TTSubdet.fill(tid, soiEt_d, soiEt_e);
749  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
750  _cFGCorr_TTSubdet[ibit].fill(tid, soiFG_d[ibit], soiFG_e[ibit]);
751  // FILL w/o a CUT
752  if (_ptype != fOffline) { // hidefed2crate
753  if (eid.isVMEid())
754  {
756  }
757  else
758  {
760  }
761  }
762 
763  // if SOI Et are not equal
764  // fill mismatched
765  if (soiEt_d!=soiEt_e)
766  {
767  tid.ietaAbs()>=29?numMsmHF++:numMsmHBHE++;
768  _cEtMsm_depthlike.fill(tid);
769  if (_ptype != fOffline) { // hidefed2crate
770  if (eid.isVMEid())
772  else
774  }
775  if (_ptype==fOnline)
776  _xEtMsm.get(eid)++;
777  }
778  // if SOI FG are not equal
779  // fill mismatched.
780  // Do this comparison only for FG Bits that are commissioned
781  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
782  if (soiFG_d[ibit]!=soiFG_e[ibit] && _vFGBitsReady[ibit])
783  {
784  _cFGMsm_depthlike.fill(tid);
785  if (_ptype != fOffline) { // hidefed2crate
786  if (eid.isVMEid())
788  else
790  }
791  if (_ptype==fOnline)
792  _xFGMsm.get(eid)++;
793  }
794  }
795  else
796  {
797  // IF MISSING
798  _cEtCorr_TTSubdet.fill(tid, soiEt_d, -2);
800  tid.ietaAbs()>=29?numMsnHF++:numMsnHBHE++;
801  if (_ptype != fOffline) { // hidefed2crate
802  if (eid.isVMEid())
804  else
806  }
807 
808  if (soiEt_d>_cutEt)
809  {
810  tid.ietaAbs()>=29?numMsnCutHF++:numMsnCutHBHE++;
811  if (_ptype==fOnline)
812  _xEmulMsn.get(eid)++;
813  }
814  }
815  }
816 
817  if (_ptype == fOnline) {
818  for (HcalTrigPrimDigiCollection::const_iterator it=cemul_noTDCCut->begin(); it!=cemul_noTDCCut->end(); ++it) {
819  // Explicit check on the DetIds present in the Collection
820  HcalTrigTowerDetId tid = it->id();
821  uint32_t rawid = _ehashmap.lookup(tid);
822  if (rawid==0) {
823  continue;
824  }
825  if (tid.version()==0 && tid.ietaAbs()>=29)
826  {
827  continue;
828  }
829  int soiEt_e = it->SOI_compressedEt();
830  if (tid.ietaAbs() >= 29) {
831  if (soiEt_e > 0) {
834  }
835  }
836  }
837  }
838 
839  if (rawidHFValid!=0 && rawidHBHEValid!=0)
840  {
841  // ONLINE ONLY!
842  if (_ptype==fOnline)
843  {
845  numHBHE);
847  numHF);
849  bx, numCutHBHE);
851  numCutHF);
853  _currentLS, numHBHE);
855  _currentLS,numHF);
857  _currentLS, numCutHBHE);
859  _currentLS, numCutHF);
860 
862  numMsmHBHE);
864  numMsmHF);
865  _cEtMsmvsBX_TTSubdet.fill(HcalTrigTowerDetId(rawidHBHEValid), bx,
866  numMsmHBHE);
867  _cEtMsmvsBX_TTSubdet.fill(HcalTrigTowerDetId(rawidHFValid), bx,
868  numMsmHF);
869 
871  _currentLS,
872  double(numMsmHBHE)/double(numCorrHBHE));
874  _currentLS,
875  double(numMsmHF)/double(numCorrHF));
877  double(numMsmHBHE)/double(numCorrHBHE));
879  double(numMsmHF)/double(numCorrHF));
880 
882  _currentLS, numMsnHBHE);
884  _currentLS, numMsnHF);
886  _currentLS, numMsnCutHBHE);
888  _currentLS, numMsnCutHF);
889 
891  bx, numMsnHBHE);
893  bx, numMsnHF);
895  bx, numMsnCutHBHE);
897  bx, numMsnCutHF);
898  }
899  }
900 
901  numHBHE=0; numHF=0; numCutHBHE=0; numCutHF=0;
902  numMsnHBHE=0; numMsnHF=0; numCutHBHE=0; numCutHF=0;
903 
904  // reset
905  rawidHBHEValid = 0;
906  rawidHFValid = 0;
907 
908  /*
909  * STEP2:
910  * Loop over the emulator digis and
911  * - do ... for all the emulator digis
912  * - find data digi and
913  * --- if found skip
914  * --- if not found - fill the missing Data plot
915  */
917  it!=cemul->end(); ++it)
918  {
919  // Explicit check on the DetIds present in the Collection
920  HcalTrigTowerDetId tid = it->id();
921  uint32_t rawid = _ehashmap.lookup(tid);
922  if (rawid==0)
923  {meUnknownIds1LS->Fill(1); _unknownIdsPresent = true; continue;}
924  HcalElectronicsId const& eid(rawid);
925  if (tid.ietaAbs()>=29)
926  rawidHFValid = tid.rawId();
927  else
928  rawidHBHEValid = tid.rawId();
929 
930  // HF 2x3 TPs. Only do it for Online!!!
931  if (tid.version()==0 && tid.ietaAbs()>=29)
932  {
933  // only do this for online processing
934  if (_ptype==fOnline)
936  continue;
937  }
938  int soiEt = it->SOI_compressedEt();
939 
940  // FILL/INCREMENT w/o a CUT
941  tid.ietaAbs()>=29?numHF++:numHBHE++;
942  _cEtEmul_TTSubdet.fill(tid, soiEt);
943  _cEtEmul_depthlike.fill(tid, soiEt);
945  if (_ptype != fOffline) { // hidefed2crate
946  if (eid.isVMEid())
947  {
949  _cEtEmul_ElectronicsVME.fill(eid, soiEt);
950  }
951  else
952  {
954  _cEtEmul_ElectronicsuTCA.fill(eid, soiEt);
955  }
956  }
957 
958  // FILL w/ a CUT
959  if (soiEt>_cutEt)
960  {
961  tid.ietaAbs()>=29?numCutHF++:numCutHBHE++;
963  _cEtCutEmul_depthlike.fill(tid, soiEt);
964  if (_ptype != fOffline) { // hidefed2crate
965  if (eid.isVMEid())
967  else
969  }
970 
971  // ONLINE ONLY!
972  if (_ptype==fOnline)
973  {
975  _cEtCutEmulvsBX_TTSubdet.fill(tid, bx, soiEt);
976  _xEmulTotal.get(eid)++;
977  }
978  // ^^^ONLINE ONLY!
979  }
980 
981  // Look for a data digi.
982  // Do not perform if the emulated digi is zero suppressed.
983  if(!(it->zsMarkAndPass())) {
985  if (jt==cdata->end())
986  {
987  tid.ietaAbs()>=29?numMsnHF++:numMsnHBHE++;
988  _cEtCorr_TTSubdet.fill(tid, -2, soiEt);
990  if (_ptype != fOffline) { // hidefed2crate
991  if (eid.isVMEid())
993  else
995  }
996  if (soiEt>_cutEt)
997  {
998  tid.ietaAbs()>=29?numMsnCutHF++:numMsnCutHBHE++;
999  if (_ptype==fOnline)
1000  _xDataMsn.get(eid)++;
1001  }
1002  }
1003  }
1004  }
1005 
1006  // ONLINE ONLY!
1007  if (_ptype==fOnline) {
1008  if (rawidHBHEValid != 0) {
1010  numHBHE);
1012  bx,
1013  numCutHBHE);
1015  _currentLS, numHBHE);
1017  _currentLS, numCutHBHE);
1019  _currentLS, numMsnHBHE);
1021  _currentLS, numMsnCutHBHE);
1023  bx, numMsnHBHE);
1025  bx, numMsnCutHBHE);
1026  }
1027  if (rawidHFValid!=0) {
1029  numHF);
1031  numCutHF);
1033  _currentLS,numHF);
1035  _currentLS, numCutHF);
1037  _currentLS, numMsnHF);
1039  _currentLS, numMsnCutHF);
1041  bx, numMsnHF);
1043  bx, numMsnCutHF);
1044  }
1045  // ^^^ONLINE ONLY!
1046  }
1047 }
1048 
1050  edm::EventSetup const& es)
1051 {
1052  DQTask::beginLuminosityBlock(lb, es);
1053 }
1054 
1056  edm::EventSetup const& es)
1057 {
1058  if (_ptype!=fOnline)
1059  return;
1060 
1061  //
1062  // GENERATE STATUS ONLY FOR ONLINE!
1063  //
1064  for (std::vector<uint32_t>::const_iterator it=_vhashFEDs.begin();
1065  it!=_vhashFEDs.end(); ++it)
1066  {
1067  flag::Flag fSum("TP");
1069 
1070  std::vector<uint32_t>::const_iterator cit=std::find(
1071  _vcdaqEids.begin(), _vcdaqEids.end(), *it);
1072  if (cit==_vcdaqEids.end())
1073  {
1074  // not @cDAQ
1075  for (uint32_t iflag=0; iflag<_vflags.size(); iflag++)
1076  _cSummaryvsLS_FED.setBinContent(eid, _currentLS, int(iflag),
1077  int(flag::fNCDAQ));
1079  continue;
1080  }
1081 
1083  {
1084  // FED is @cDAQ
1085  double etmsm = _xNumCorr.get(eid)>0?
1086  double(_xEtMsm.get(eid))/double(_xNumCorr.get(eid)):0;
1087  /*
1088  * UNUSED VARS
1089  * double dmsm = _xDataTotal.get(eid)>0?
1090  double(_xDataMsn.get(eid))/double(_xDataTotal.get(eid)):0;
1091  double emsm = _xEmulTotal.get(eid)>0?
1092  double(_xEmulMsn.get(eid))/double(_xEmulTotal.get(eid)):0;
1093  double fgmsm = _xNumCorr.get(eid)>0?
1094  double(_xFGMsm.get(eid))/double(_xNumCorr.get(eid)):0;
1095  */
1096  if (etmsm>=_thresh_EtMsmRate_high)
1097  _vflags[fEtMsm]._state = flag::fBAD;
1098  else if (etmsm>=_thresh_EtMsmRate_low)
1099  _vflags[fEtMsm]._state = flag::fPROBLEMATIC;
1100  else
1101  _vflags[fEtMsm]._state = flag::fGOOD;
1102  /*
1103  * DISABLE THESE FLAGS FOR ONLINE FOR NOW!
1104  if (dmsm>=_thresh_DataMsn)
1105  _vflags[fDataMsn]._state = flag::fBAD;
1106  else
1107  _vflags[fDataMsn]._state = flag::fGOOD;
1108  if (emsm>=_thresh_EmulMsn)
1109  _vflags[fEmulMsn]._state = flag::fBAD;
1110  else
1111  _vflags[fEmulMsn]._state = flag::fGOOD;
1112  */
1113  }
1114 
1115  if (_unknownIdsPresent)
1116  _vflags[fUnknownIds]._state = flag::fBAD;
1117  else
1118  _vflags[fUnknownIds]._state = flag::fGOOD;
1119 
1120  int iflag=0;
1121  for (std::vector<flag::Flag>::iterator ft=_vflags.begin();
1122  ft!=_vflags.end(); ++ft)
1123  {
1124  _cSummaryvsLS_FED.setBinContent(eid, _currentLS, int(iflag),
1125  ft->_state);
1126  fSum+=(*ft);
1127  iflag++;
1128 
1129  // this is the MUST!
1130  // reset after using this flag
1131  ft->reset();
1132  }
1133  _cSummaryvsLS.setBinContent(eid, _currentLS, int(fSum._state));
1134  }
1135 
1136  // reset...
1139  _xEmulTotal.reset();
1140 
1141  // in the end always do the DQTask::endLumi
1142  DQTask::endLuminosityBlock(lb, es);
1143 }
1144 
1146 
hcaldqm::ContainerProf1D _cEtCorrRatiovsBX_TTSubdet
Definition: TPTask.h:103
hcaldqm::ContainerXXX< uint32_t > _xDataTotal
Definition: TPTask.h:172
T getUntrackedParameter(std::string const &, T const &) const
bool _skip1x1
Definition: TPTask.h:58
hcaldqm::ContainerProf1D _cMsnCutEmulvsBX_TTSubdet
Definition: TPTask.h:154
hcaldqm::Container2D _cMsnData_ElectronicsVME
Definition: TPTask.h:139
virtual void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *qy=new ValueQuantity(quantity::fN), int debug=0)
Definition: Container1D.cc:40
hcaldqm::Container1D _cEtEmul_TTSubdet
Definition: TPTask.h:78
hcaldqm::ContainerSingleProf2D _cEtData_depthlike
Definition: TPTask.h:93
edm::InputTag _tagData
Definition: TPTask.h:39
int const CRATE_VME_MIN
Definition: Constants.h:111
hcaldqm::ContainerProf1D _cMsnDatavsBX_TTSubdet
Definition: TPTask.h:144
double _thresh_FGMsmRate_high
Definition: TPTask.h:60
hcaldqm::ContainerSingle2D _cOccupancyCutEmul_depthlike
Definition: TPTask.h:120
hcaldqm::ContainerProf1D _cMsnDatavsLS_TTSubdet
Definition: TPTask.h:142
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
std::pair< uint16_t, uint16_t > fed2crate(int fed)
Definition: Utilities.cc:12
std::vector< uint32_t > _vhashFEDs
Definition: TPTask.h:66
uint32_t rawId() const
hcaldqm::ContainerProf1D _cEtMsmvsLS_TTSubdet
Definition: TPTask.h:133
hcaldqm::Container2D _cOccupancyData_ElectronicsVME
Definition: TPTask.h:106
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
virtual void initialize(std::string const &folder, Quantity *, Quantity *qy=new ValueQuantity(quantity::fN), int debug=0)
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
hcaldqm::ContainerProf1D _cEtCutEmulvsLS_TTSubdet
Definition: TPTask.h:83
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: TPTask.h:69
edm::EDGetTokenT< HcalTrigPrimDigiCollection > _tokData
Definition: TPTask.h:42
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
UpdateFreq
Definition: DQTask.h:17
MonitorElement * meUnknownIds1LS
Definition: TPTask.h:167
State _state
Definition: Flag.h:79
std::vector< HcalTriggerPrimitiveDigi >::const_iterator const_iterator
hcaldqm::ContainerSingleProf2D _cEtCorrRatio_depthlike
Definition: TPTask.h:101
hcaldqm::ContainerProf1D _cMsnCutDatavsBX_TTSubdet
Definition: TPTask.h:145
int bunchCrossing() const
Definition: EventBase.h:66
int _cutEt
Definition: TPTask.h:59
int const SPIGOT_MIN
Definition: Constants.h:136
hcaldqm::ContainerProf1D _cMsnCutDatavsLS_TTSubdet
Definition: TPTask.h:143
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
virtual void reset()
Definition: ContainerXXX.h:366
hcaldqm::ContainerSingle2D _cOccupancyCutData_depthlike
Definition: TPTask.h:119
double _thresh_FGMsmRate_low
Definition: TPTask.h:60
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
int const FIBER_VME_MIN
Definition: Constants.h:141
hcaldqm::ContainerProf1D _cOccupancyDatavsLS_TTSubdet
Definition: TPTask.h:161
edm::EDGetTokenT< HcalTrigPrimDigiCollection > _tokEmulNoTDCCut
Definition: TPTask.h:44
hcaldqm::Container2D _cOccupancyEmul_ElectronicsVME
Definition: TPTask.h:108
hcaldqm::ContainerProf1D _cEtMsmRatiovsLS_TTSubdet
Definition: TPTask.h:134
hcaldqm::ContainerSingle2D _cOccupancyEmul2x3_depthlike
Definition: TPTask.h:124
hcaldqm::ContainerProf1D _cMsnEmulvsBX_TTSubdet
Definition: TPTask.h:153
int const FIBERCH_MIN
Definition: Constants.h:151
void Fill(long long x)
double _thresh_EtMsmRate_low
Definition: TPTask.h:60
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
hcaldqm::ContainerProf2D _cEtCorrRatio_ElectronicsuTCA
Definition: TPTask.h:100
std::vector< int > getFEDVMEList(HcalElectronicsMap const *)
Definition: Utilities.cc:119
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
hcaldqm::Container2D _cFGCorr_TTSubdet[hcaldqm::constants::NUM_FGBITS]
Definition: TPTask.h:81
hcaldqm::ContainerXXX< uint32_t > _xDataMsn
Definition: TPTask.h:172
hcaldqm::filter::HashFilter _filter_uTCA
Definition: TPTask.h:73
double _thresh_EmulMsn
Definition: TPTask.h:60
hcaldqm::Container2D _cSummaryvsLS_FED
Definition: TPTask.h:170
ProcessingType _ptype
Definition: DQModule.h:59
virtual void fill(uint32_t)
Definition: Container1D.cc:82
edm::InputTag _tagEmulNoTDCCut
Definition: TPTask.h:41
hcaldqm::Container2D _cOccupancyCutData_ElectronicsVME
Definition: TPTask.h:111
std::vector< hcaldqm::flag::Flag > _vflags
Definition: TPTask.h:47
void reset()
Definition: Flag.h:76
void setLumiFlag()
this ME is meant to be stored for each luminosity section
virtual void setBinContent(int, int, int)
hcaldqm::ContainerXXX< uint32_t > _xEmulMsn
Definition: TPTask.h:172
void _resetMonitors(hcaldqm::UpdateFreq) override
Definition: TPTask.cc:577
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
hcaldqm::ContainerProf2D _cEtData_ElectronicsVME
Definition: TPTask.h:87
hcaldqm::ContainerProf1D _cEtMsmvsBX_TTSubdet
Definition: TPTask.h:135
int const FED_VME_MIN
Definition: Constants.h:98
void initialize(std::string const &folder, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0) override
TPTask(edm::ParameterSet const &)
Definition: TPTask.cc:6
hcaldqm::ContainerProf1D _cOccupancyDatavsBX_TTSubdet
Definition: TPTask.h:157
hcaldqm::ContainerProf2D _cEtEmul_ElectronicsuTCA
Definition: TPTask.h:90
hcaldqm::ContainerProf1D _cEtCorrRatiovsLS_TTSubdet
Definition: TPTask.h:102
hcaldqm::ContainerSingle2D _cOccupancyData2x3_depthlike
Definition: TPTask.h:123
hcaldqm::ContainerSingle2D _cFGMsm_depthlike
Definition: TPTask.h:132
hcaldqm::ContainerProf2D _cEtEmul_ElectronicsVME
Definition: TPTask.h:89
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
virtual example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
hcaldqm::filter::HashFilter _filter_depth0
Definition: TPTask.h:74
virtual void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
Definition: Container2D.cc:32
int const FIBER_uTCA_MIN1
Definition: Constants.h:144
hcaldqm::ContainerProf2D _cEtCorrRatio_ElectronicsVME
Definition: TPTask.h:99
hcaldqm::ContainerXXX< uint32_t > _xEtMsm
Definition: TPTask.h:172
hcaldqm::Container2D _cEtMsm_ElectronicsuTCA
Definition: TPTask.h:128
hcaldqm::Container2D _cOccupancyCutEmul_ElectronicsuTCA
Definition: TPTask.h:114
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: TPTask.cc:44
Logger _logger
Definition: DQModule.h:70
T min(T a, T b)
Definition: MathUtil.h:58
hcaldqm::ContainerSingle2D _cOccupancy_HF_depth
Definition: TPTask.h:176
double _thresh_EtMsmRate_high
Definition: TPTask.h:60
std::string _name
Definition: DQModule.h:57
hcaldqm::ContainerProf1D _cOccupancyCutDatavsLS_TTSubdet
Definition: TPTask.h:163
hcaldqm::Container2D _cOccupancyCutData_ElectronicsuTCA
Definition: TPTask.h:112
HcalElectronicsMap const * _emap
Definition: DQTask.h:73
hcaldqm::ContainerSingle2D _cSummaryvsLS
Definition: TPTask.h:171
void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fEnergy), int debug=0) override
int const CRATE_uTCA_MIN
Definition: Constants.h:116
hcaldqm::ContainerSingle2D _cOccupancyData_depthlike
Definition: TPTask.h:117
hcaldqm::Container2D _cOccupancyCutEmul_ElectronicsVME
Definition: TPTask.h:113
const_iterator end() const
hcaldqm::ContainerSingle2D _cEtMsm_depthlike
Definition: TPTask.h:131
hcaldqm::ContainerProf1D _cEtCutDatavsLS_TTSubdet
Definition: TPTask.h:82
hcaldqm::Container2D _cMsnData_ElectronicsuTCA
Definition: TPTask.h:140
hcaldqm::Container2D _cFGMsm_ElectronicsVME
Definition: TPTask.h:129
hcaldqm::Container2D _cMsnEmul_ElectronicsuTCA
Definition: TPTask.h:149
hcaldqm::ContainerProf1D _cOccupancyEmulvsBX_TTSubdet
Definition: TPTask.h:158
bool isVMEid() const
hcaldqm::ContainerXXX< uint32_t > _xEmulTotal
Definition: TPTask.h:172
double _thresh_DataMsn
Definition: TPTask.h:60
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
bool isFEDHBHE(HcalElectronicsId const &)
Definition: Utilities.cc:172
virtual void book(HcalElectronicsMap const *)
Definition: ContainerXXX.h:99
hcaldqm::Container2D _cFGMsm_ElectronicsuTCA
Definition: TPTask.h:130
virtual void initialize(std::string const &folder, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:957
hcaldqm::ContainerProf1D _cEtCutDatavsBX_TTSubdet
Definition: TPTask.h:84
int version() const
get the version code for the trigger tower
const T & get() const
Definition: EventSetup.h:59
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
std::vector< bool > _vFGBitsReady
Definition: TPTask.h:63
void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *, int debug=0) override
hcaldqm::ContainerProf1D _cOccupancyCutEmulvsBX_TTSubdet
Definition: TPTask.h:160
hcaldqm::ContainerXXX< uint32_t > _xFGMsm
Definition: TPTask.h:172
hcaldqm::Container2D _cOccupancyEmul_ElectronicsuTCA
Definition: TPTask.h:109
void setBinContent(HcalDetId const &, int) override
Definition: Container2D.cc:235
std::string const & label() const
Definition: InputTag.h:36
hcaldqm::ContainerProf1D _cOccupancyCutDatavsBX_TTSubdet
Definition: TPTask.h:159
hcaldqm::ContainerSingle1D _cOccupancyNoTDC_HF_ieta
Definition: TPTask.h:177
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
iterator find(key_type k)
hcaldqm::ContainerSingle2D _cOccupancyEmul_depthlike
Definition: TPTask.h:118
hcaldqm::Container2D _cOccupancyData_ElectronicsuTCA
Definition: TPTask.h:107
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:249
int const NUM_FGBITS
Definition: Constants.h:229
edm::EDGetTokenT< HcalTrigPrimDigiCollection > _tokEmul
Definition: TPTask.h:43
hcaldqm::ContainerProf1D _cEtCutEmulvsBX_TTSubdet
Definition: TPTask.h:85
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:95
hcaldqm::Container2D _cEtMsm_ElectronicsVME
Definition: TPTask.h:127
hcaldqm::Container2D _cEtCorr2x3_TTSubdet
Definition: TPTask.h:80
std::vector< int > getFEDuTCAList(HcalElectronicsMap const *)
Definition: Utilities.cc:145
void fill(HcalDetId const &) override
Definition: Container2D.cc:59
const HcalElectronicsMap * getHcalMapping() const
hcaldqm::Container2D _cEtCorr_TTSubdet
Definition: TPTask.h:79
std::string _subsystem
Definition: DQModule.h:64
hcaldqm::ContainerSingle2D _cOccupancyNoTDC_HF_depth
Definition: TPTask.h:176
hcaldqm::ContainerSingleProf2D _cEtEmul_depthlike
Definition: TPTask.h:94
Definition: TPTask.py:1
hcaldqm::ContainerXXX< uint32_t > _xNumCorr
Definition: TPTask.h:172
bool _unknownIdsPresent
Definition: TPTask.h:168
hcaldqm::filter::HashFilter _filter_VME
Definition: TPTask.h:72
std::vector< uint32_t > _vcdaqEids
Definition: DQTask.h:65
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: TPTask.cc:590
hcaldqm::ContainerProf1D _cOccupancyEmulvsLS_TTSubdet
Definition: TPTask.h:162
hcaldqm::ContainerProf1D _cOccupancyCutEmulvsLS_TTSubdet
Definition: TPTask.h:164
virtual void fill(int, int)
virtual void initialize(hashfunctions::HashType, int debug=0)
Definition: ContainerXXX.h:91
virtual void initialize(FilterType ftype, HashType htype, std::vector< uint32_t > const &)
Definition: HashFilter.cc:26
hcaldqm::ContainerProf1D _cEtMsmRatiovsBX_TTSubdet
Definition: TPTask.h:136
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:895
edm::InputTag _tagEmul
Definition: TPTask.h:40
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: TPTask.cc:1055
hcaldqm::ContainerSingleProf2D _cEtCutEmul_depthlike
Definition: TPTask.h:96
hcaldqm::ContainerProf2D _cEtData_ElectronicsuTCA
Definition: TPTask.h:88
hcaldqm::ContainerProf1D _cMsnEmulvsLS_TTSubdet
Definition: TPTask.h:151
void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="") override
hcaldqm::ContainerSingle1D _cOccupancy_HF_ieta
Definition: TPTask.h:177
Readout chain identification for Hcal.
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: TPTask.cc:1049
std::string const & instance() const
Definition: InputTag.h:37
hcaldqm::ContainerSingle2D _cMsnData_depthlike
Definition: TPTask.h:141
bool isFEDHF(HcalElectronicsId const &)
Definition: Utilities.cc:187
int ietaAbs() const
get the absolute value of the tower ieta
int const SLOT_uTCA_MIN
Definition: Constants.h:123
hcaldqm::ContainerSingleProf2D _cEtCutData_depthlike
Definition: TPTask.h:95
const_iterator begin() const
Definition: Run.h:43
hcaldqm::Container1D _cEtData_TTSubdet
Definition: TPTask.h:77
ib
Definition: cuy.py:660
hcaldqm::ContainerSingle2D _cMsnEmul_depthlike
Definition: TPTask.h:150
hcaldqm::ContainerProf1D _cMsnCutEmulvsLS_TTSubdet
Definition: TPTask.h:152
hcaldqm::Container2D _cMsnEmul_ElectronicsVME
Definition: TPTask.h:148