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"));
13 
14  _tokData = consumes<HcalTrigPrimDigiCollection>(_tagData);
15  _tokEmul = consumes<HcalTrigPrimDigiCollection>(_tagEmul);
16 
17  _skip1x1 = ps.getUntrackedParameter<bool>("skip1x1", true);
18  _cutEt = ps.getUntrackedParameter<int>("cutEt", 3);
20  "thresh_EtMsmRate_high", 0.2);
22  "thresh_EtMsmRate_low", 0.05);
24  "thresh_FGMsmRate", 0.2);
26  "thresh_FGMsmRate_low", 0.05);
27  _thresh_DataMsn = ps.getUntrackedParameter<double>("thresh_DataMsn",
28  0.1);
29  _thresh_EmulMsn = ps.getUntrackedParameter<double>("thresh_EmulMsn");
30  std::vector<int> tmp = ps.getUntrackedParameter<std::vector<int> >("vFGBitsReady");
31  for (uint32_t iii=0; iii<constants::NUM_FGBITS; iii++)
32  _vFGBitsReady.push_back(tmp[iii]);
33 
34  _vflags.resize(nTPFlag);
35  _vflags[fEtMsm]=flag::Flag("EtMsm");
36  _vflags[fFGMsm]=flag::Flag("FGMsm");
37  _vflags[fDataMsn]=flag::Flag("DataMsn");
38  _vflags[fEmulMsn]=flag::Flag("EmulMsn");
39  _vflags[fUnknownIds]=flag::Flag("UnknownIds");
40 }
41 
43  edm::Run const& r, edm::EventSetup const& es)
44 {
45  DQTask::bookHistograms(ib,r,es);
46 
47  // GET WHAT YOU NEED
49  es.get<HcalDbRecord>().get(dbs);
50  _emap = dbs->getHcalMapping();
51  std::vector<uint32_t> vVME;
52  std::vector<uint32_t> vuTCA;
53  std::vector<uint32_t> depth0;
54  vVME.push_back(HcalElectronicsId(FIBERCH_MIN,
57  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
59  vVME);
61  vuTCA);
62  depth0.push_back(HcalTrigTowerDetId(1, 1, 0).rawId());
64  depth0);
65 
66  // INITIALIZE FIRST
67  // Et/FG
78  for (uint8_t iii=0; iii<constants::NUM_FGBITS; iii++)
79  {
84  }
85 
102 
103  // Occupancy
104  _cOccupancyData_depthlike.initialize(_name, "OccupancyData",
108  _cOccupancyEmul_depthlike.initialize(_name, "OccupancyEmul",
112  _cOccupancyCutData_depthlike.initialize(_name, "OccupancyCutData",
116  _cOccupancyCutEmul_depthlike.initialize(_name, "OccupancyCutEmul",
120 
121  // Mismatches
130 
131  // Missing Data w.r.t. Emulator
140 
145 
146  _cOccupancyDatavsBX_TTSubdet.initialize(_name, "OccupancyDatavsBX",
150  _cOccupancyEmulvsBX_TTSubdet.initialize(_name, "OccupancyEmulvsBX",
154  _cOccupancyCutDatavsBX_TTSubdet.initialize(_name, "OccupancyCutDatavsBX",
158  _cOccupancyCutEmulvsBX_TTSubdet.initialize(_name, "OccupancyCutEmulvsBX",
162 
163  // INITIALIZE HISTOGRAMS to be used in Online only!
164  if (_ptype==fOnline)
165  {
166  _cEtCorr2x3_TTSubdet.initialize(_name, "EtCorr2x3",
171  _cOccupancyData2x3_depthlike.initialize(_name, "OccupancyData2x3",
175  _cOccupancyEmul2x3_depthlike.initialize(_name, "OccupancyEmul2x3",
179  _cEtCutDatavsLS_TTSubdet.initialize(_name, "EtCutDatavsLS",
183  _cEtCutEmulvsLS_TTSubdet.initialize(_name, "EtCutEmulvsLS",
187  _cEtCutDatavsBX_TTSubdet.initialize(_name, "EtCutDatavsBX",
191  _cEtCutEmulvsBX_TTSubdet.initialize(_name, "EtCutEmulvsBX",
195  _cEtCorrRatiovsLS_TTSubdet.initialize(_name, "EtCorrRatiovsLS",
199  _cEtCorrRatiovsBX_TTSubdet.initialize(_name, "EtCorrRatiovsBX",
203  _cEtMsmRatiovsLS_TTSubdet.initialize(_name, "EtMsmRatiovsLS",
207  _cEtMsmRatiovsBX_TTSubdet.initialize(_name, "EtMsmRatiovsBX",
219  _cMsnDatavsLS_TTSubdet.initialize(_name, "MsnDatavsLS",
223  _cMsnCutDatavsLS_TTSubdet.initialize(_name, "MsnCutDatavsLS",
227  _cMsnDatavsBX_TTSubdet.initialize(_name, "MsnDatavsBX",
231  _cMsnCutDatavsBX_TTSubdet.initialize(_name, "MsnCutDatavsBX",
235  _cMsnEmulvsLS_TTSubdet.initialize(_name, "MsnEmulvsLS",
239  _cMsnCutEmulvsLS_TTSubdet.initialize(_name, "MsnCutEmulvsLS",
243  _cMsnEmulvsBX_TTSubdet.initialize(_name, "MsnEmulvsBX",
247  _cMsnCutEmulvsBX_TTSubdet.initialize(_name, "MsnCutEmulvsBX",
251  _cOccupancyDatavsLS_TTSubdet.initialize(_name, "OccupancyDatavsLS",
256  "OccupancyCutDatavsLS",
260  _cOccupancyDatavsBX_TTSubdet.initialize(_name, "OccupancyDatavsBX",
265  "OccupancyCutDatavsBX",
269  _cOccupancyEmulvsLS_TTSubdet.initialize(_name, "OccupancyEmulvsLS",
274  "OccupancyCutEmulvsLS",
278  _cOccupancyEmulvsBX_TTSubdet.initialize(_name, "OccupancyEmulvsBX",
283  "OccupancyCutEmulvsBX",
287  }
288 
289  // FED-based containers
290  if (_ptype != fOffline) { // hidefed2crate
291  std::vector<int> vFEDs = hcaldqm::utilities::getFEDList(_emap);
292  std::vector<int> vFEDsVME = hcaldqm::utilities::getFEDVMEList(_emap);
293  std::vector<int> vFEDsuTCA = hcaldqm::utilities::getFEDuTCAList(_emap);
294  // push the rawIds of each fed into the vector
295  // this vector is used at endlumi for online state generation
296  for (std::vector<int>::const_iterator it=vFEDsVME.begin();
297  it!=vFEDsVME.end(); ++it)
298  {
300  SPIGOT_MIN, (*it)-FED_VME_MIN).rawId());
301  }
302  for (std::vector<int>::const_iterator it=vFEDsuTCA.begin();
303  it!=vFEDsuTCA.end(); ++it)
304  {
305  std::pair<uint16_t, uint16_t> cspair = hcaldqm::utilities::fed2crate(*it);
306  _vhashFEDs.push_back(HcalElectronicsId(cspair.first,
307  cspair.second, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
308  }
311  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
316  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
321  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
326  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
329  // Occupancies
332  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
337  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
342  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
347  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
350 
353  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
358  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
363  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
368  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
371  // Mismatches
374  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
379  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
384  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
389  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
392 
393  // Missing Data w.r.t. Emulator
396  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
401  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
406  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
411  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
416  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
421  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
424  if (_ptype == fOnline) {
425  _cSummaryvsLS_FED.initialize(_name, "SummaryvsLS",
430  _cSummaryvsLS.initialize(_name, "SummaryvsLS",
434 
442 
443  }
444  }
445 
446  // BOOK HISTOGRAMS
447  char aux[20];
448  for (unsigned int iii=0; iii<constants::NUM_FGBITS; iii++)
449  {
450  sprintf(aux, "BIT%d", iii);
451  _cFGCorr_TTSubdet[iii].book(ib, _emap, _subsystem, aux);
452  }
456  if (_ptype != fOffline) { // hidefed2crate
461  }
466  if (_ptype != fOffline) { // hidefed2crate
475  }
480 
486 
487  if (_ptype != fOffline) { // hidefed2crate
498  }
499 
500  // whatever has to go online only goes here
501  if (_ptype==fOnline)
502  {
534 
535  _xEtMsm.book(_emap);
536  _xFGMsm.book(_emap);
542  }
543 
544  // initialize the hash map
546 
547  // book the flag for unknown ids and the online guy as well
549  meUnknownIds1LS = ib.book1D("UnknownIds", "UnknownIds",
550  1, 0, 1);
551  _unknownIdsPresent = false;
553 }
554 
556 {
557  DQTask::_resetMonitors(uf);
558  switch (uf)
559  {
560  case hcaldqm::f1LS:
561  _unknownIdsPresent = false;
562  break;
563  default :
564  break;
565  }
566 }
567 
568 /* virtual */ void TPTask::_process(edm::Event const& e,
569  edm::EventSetup const&)
570 {
573  if (!e.getByToken(_tokData, cdata))
574  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available"
575  + _tagData.label() + " " + _tagData.instance());
576  if (!e.getByToken(_tokEmul, cemul))
577  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available"
578  + _tagEmul.label() + " " + _tagEmul.instance());
579 
580  // extract some info per event
581  int bx = e.bunchCrossing();
582 
583  // some summaries... per event
584  int numHBHE(0), numHF(0), numCutHBHE(0), numCutHF(0);
585  int numCorrHBHE(0), numCorrHF(0);
586  int numMsmHBHE(0), numMsmHF(0);
587  int numMsnHBHE(0), numMsnHF(0), numMsnCutHBHE(0), numMsnCutHF(0);
588 
589  // for explanation see RecHit or Digi Tasks
590  uint32_t rawidHBHEValid = 0;
591  uint32_t rawidHFValid = 0;
592 
593  /*
594  * STEP1:
595  * Loop over the data digis and
596  * - do ... for all the data digis
597  * - find the emulator digi
598  * --- compare soi Et
599  * --- compare soi FG
600  * --- Do not fill anything for emulator Et!!!
601  */
603  it!=cdata->end(); ++it)
604  {
605  // Explicit check on the DetIds present in the Collection
606  HcalTrigTowerDetId tid = it->id();
607  uint32_t rawid = _ehashmap.lookup(tid);
608  if (rawid==0)
609  {meUnknownIds1LS->Fill(1); _unknownIdsPresent = true; continue;}
610  HcalElectronicsId const& eid(rawid);
611  if (tid.ietaAbs()>=29)
612  rawidHFValid = tid.rawId();
613  else
614  rawidHBHEValid = tid.rawId();
615 
616  //
617  // HF 2x3 TPs Treat theam separately and only for ONLINE!
618  //
619  if (tid.version()==0 && tid.ietaAbs()>=29)
620  {
621  // do this only for online processing
622  if (_ptype==fOnline)
623  {
626  if (jt!=cemul->end())
627  _cEtCorr2x3_TTSubdet.fill(tid, it->SOI_compressedEt(),
628  jt->SOI_compressedEt());
629  }
630 
631  // skip to the next tp digi
632  continue;
633  }
634 
635  // FROM THIS POINT, HBHE + 1x1 HF TPs
636  int soiEt_d = it->t0().compressedEt();
637  int soiFG_d[constants::NUM_FGBITS];
638  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
639  soiFG_d[ibit] = it->t0().fineGrain(ibit)?1:0;
640  tid.ietaAbs()>=29?numHF++:numHBHE++;
641 
642  // fill w/o a cut
643  _cEtData_TTSubdet.fill(tid, soiEt_d);
644  _cEtData_depthlike.fill(tid, soiEt_d);
646  if (_ptype != fOffline) { // hidefed2crate
647  if (eid.isVMEid())
648  {
650  _cEtData_ElectronicsVME.fill(eid, soiEt_d);
651  }
652  else
653  {
655  _cEtData_ElectronicsuTCA.fill(eid, soiEt_d);
656  }
657  }
658 
659  // FILL w/a CUT
660  if (soiEt_d>_cutEt)
661  {
662  tid.ietaAbs()>=29?numCutHF++:numCutHBHE++;
664  _cEtCutData_depthlike.fill(tid, soiEt_d);
665 
666  // ONLINE ONLY!
667  if (_ptype==fOnline)
668  {
670  _cEtCutDatavsBX_TTSubdet.fill(tid, bx, soiEt_d);
671  _xDataTotal.get(eid)++;
672  }
673  // ^^^ONLINE ONLY!
674  if (_ptype != fOffline) { // hidefed2crate
675  if (eid.isVMEid())
677  else
679  }
680  }
681 
682  // FIND the EMULATOR DIGI
684  if (jt!=cemul->end())
685  {
686  // if PRESENT!
687  int soiEt_e = jt->SOI_compressedEt();
688  int soiFG_e[constants::NUM_FGBITS];
689  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
690  soiFG_e[ibit] = jt->t0().fineGrain(ibit)?1:0;
691  // if both are zeroes => set 1
692  double rEt = soiEt_d==0 && soiEt_e==0?1:
693  double(std::min(soiEt_d, soiEt_e))/
694  double(std::max(soiEt_e, soiEt_d));
695 
696  // ONLINE ONLY!
697  if (_ptype==fOnline)
698  {
699  _xNumCorr.get(eid)++;
700  tid.ietaAbs()>=29?numCorrHF++:numCorrHBHE++;
702  _cEtCorrRatiovsBX_TTSubdet.fill(tid, bx, rEt);
703  }
704  // ^^^ONLINE ONLY!
705 
706  _cEtCorrRatio_depthlike.fill(tid, rEt);
707  _cEtCorr_TTSubdet.fill(tid, soiEt_d, soiEt_e);
708  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
709  _cFGCorr_TTSubdet[ibit].fill(tid, soiFG_d[ibit], soiFG_e[ibit]);
710  // FILL w/o a CUT
711  if (_ptype != fOffline) { // hidefed2crate
712  if (eid.isVMEid())
713  {
715  }
716  else
717  {
719  }
720  }
721 
722  // if SOI Et are not equal
723  // fill mismatched
724  if (soiEt_d!=soiEt_e)
725  {
726  tid.ietaAbs()>=29?numMsmHF++:numMsmHBHE++;
727  _cEtMsm_depthlike.fill(tid);
728  if (_ptype != fOffline) { // hidefed2crate
729  if (eid.isVMEid())
731  else
733  }
734  if (_ptype==fOnline)
735  _xEtMsm.get(eid)++;
736  }
737  // if SOI FG are not equal
738  // fill mismatched.
739  // Do this comparison only for FG Bits that are commissioned
740  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
741  if (soiFG_d[ibit]!=soiFG_e[ibit] && _vFGBitsReady[ibit])
742  {
743  _cFGMsm_depthlike.fill(tid);
744  if (_ptype != fOffline) { // hidefed2crate
745  if (eid.isVMEid())
747  else
749  }
750  if (_ptype==fOnline)
751  _xFGMsm.get(eid)++;
752  }
753  }
754  else
755  {
756  // IF MISSING
757  _cEtCorr_TTSubdet.fill(tid, soiEt_d, -2);
759  tid.ietaAbs()>=29?numMsnHF++:numMsnHBHE++;
760  if (_ptype != fOffline) { // hidefed2crate
761  if (eid.isVMEid())
763  else
765  }
766 
767  if (soiEt_d>_cutEt)
768  {
769  tid.ietaAbs()>=29?numMsnCutHF++:numMsnCutHBHE++;
770  if (_ptype==fOnline)
771  _xEmulMsn.get(eid)++;
772  }
773  }
774  }
775 
776  if (rawidHFValid!=0 && rawidHBHEValid!=0)
777  {
778  // ONLINE ONLY!
779  if (_ptype==fOnline)
780  {
782  numHBHE);
784  numHF);
786  bx, numCutHBHE);
788  numCutHF);
790  _currentLS, numHBHE);
792  _currentLS,numHF);
794  _currentLS, numCutHBHE);
796  _currentLS, numCutHF);
797 
799  numMsmHBHE);
801  numMsmHF);
802  _cEtMsmvsBX_TTSubdet.fill(HcalTrigTowerDetId(rawidHBHEValid), bx,
803  numMsmHBHE);
804  _cEtMsmvsBX_TTSubdet.fill(HcalTrigTowerDetId(rawidHFValid), bx,
805  numMsmHF);
806 
808  _currentLS,
809  double(numMsmHBHE)/double(numCorrHBHE));
811  _currentLS,
812  double(numMsmHF)/double(numCorrHF));
814  double(numMsmHBHE)/double(numCorrHBHE));
816  double(numMsmHF)/double(numCorrHF));
817 
819  _currentLS, numMsnHBHE);
821  _currentLS, numMsnHF);
823  _currentLS, numMsnCutHBHE);
825  _currentLS, numMsnCutHF);
826 
828  bx, numMsnHBHE);
830  bx, numMsnHF);
832  bx, numMsnCutHBHE);
834  bx, numMsnCutHF);
835  }
836  }
837 
838  numHBHE=0; numHF=0; numCutHBHE=0; numCutHF=0;
839  numMsnHBHE=0; numMsnHF=0; numCutHBHE=0; numCutHF=0;
840 
841  // reset
842  rawidHBHEValid = 0;
843  rawidHFValid = 0;
844 
845  /*
846  * STEP2:
847  * Loop over the emulator digis and
848  * - do ... for all the emulator digis
849  * - find data digi and
850  * --- if found skip
851  * --- if not found - fill the missing Data plot
852  */
854  it!=cemul->end(); ++it)
855  {
856  // Explicit check on the DetIds present in the Collection
857  HcalTrigTowerDetId tid = it->id();
858  uint32_t rawid = _ehashmap.lookup(tid);
859  if (rawid==0)
860  {meUnknownIds1LS->Fill(1); _unknownIdsPresent = true; continue;}
861  HcalElectronicsId const& eid(rawid);
862  if (tid.ietaAbs()>=29)
863  rawidHFValid = tid.rawId();
864  else
865  rawidHBHEValid = tid.rawId();
866 
867  // HF 2x3 TPs. Only do it for Online!!!
868  if (tid.version()==0 && tid.ietaAbs()>=29)
869  {
870  // only do this for online processing
871  if (_ptype==fOnline)
873  continue;
874  }
875  int soiEt = it->SOI_compressedEt();
876 
877  // FILL/INCREMENT w/o a CUT
878  tid.ietaAbs()>=29?numHF++:numHBHE++;
879  _cEtEmul_TTSubdet.fill(tid, soiEt);
880  _cEtEmul_depthlike.fill(tid, soiEt);
882  if (_ptype != fOffline) { // hidefed2crate
883  if (eid.isVMEid())
884  {
886  _cEtEmul_ElectronicsVME.fill(eid, soiEt);
887  }
888  else
889  {
891  _cEtEmul_ElectronicsuTCA.fill(eid, soiEt);
892  }
893  }
894 
895  // FILL w/ a CUT
896  if (soiEt>_cutEt)
897  {
898  tid.ietaAbs()>=29?numCutHF++:numCutHBHE++;
900  _cEtCutEmul_depthlike.fill(tid, soiEt);
901  if (_ptype != fOffline) { // hidefed2crate
902  if (eid.isVMEid())
904  else
906  }
907 
908  // ONLINE ONLY!
909  if (_ptype==fOnline)
910  {
912  _cEtCutEmulvsBX_TTSubdet.fill(tid, bx, soiEt);
913  _xEmulTotal.get(eid)++;
914  }
915  // ^^^ONLINE ONLY!
916  }
917 
918  // FIND a data digi
920  if (jt==cdata->end())
921  {
922  tid.ietaAbs()>=29?numMsnHF++:numMsnHBHE++;
923  _cEtCorr_TTSubdet.fill(tid, -2, soiEt);
924  if (_ptype != fOffline) { // hidefed2crate
925  if (eid.isVMEid())
927  else
929  }
930  if (soiEt>_cutEt)
931  {
932  tid.ietaAbs()>=29?numMsnCutHF++:numMsnCutHBHE++;
933  if (_ptype==fOnline)
934  _xDataMsn.get(eid)++;
935  }
936  }
937  }
938 
939  if (rawidHBHEValid!=0 && rawidHFValid!=0)
940  {
941  // ONLINE ONLY!
942  if (_ptype==fOnline)
943  {
945  numHBHE);
947  numHF);
949  bx,
950  numCutHBHE);
952  numCutHF);
953 
955  _currentLS, numHBHE);
957  _currentLS,numHF);
959  _currentLS, numCutHBHE);
961  _currentLS, numCutHF);
962 
964  _currentLS, numMsnHBHE);
966  _currentLS, numMsnHF);
968  _currentLS, numMsnCutHBHE);
970  _currentLS, numMsnCutHF);
971 
973  bx, numMsnHBHE);
975  bx, numMsnHF);
977  bx, numMsnCutHBHE);
979  bx, numMsnCutHF);
980  }
981  // ^^^ONLINE ONLY!
982  }
983 }
984 
986  edm::EventSetup const& es)
987 {
988  DQTask::beginLuminosityBlock(lb, es);
989 }
990 
992  edm::EventSetup const& es)
993 {
994  if (_ptype!=fOnline)
995  return;
996 
997  //
998  // GENERATE STATUS ONLY FOR ONLINE!
999  //
1000  for (std::vector<uint32_t>::const_iterator it=_vhashFEDs.begin();
1001  it!=_vhashFEDs.end(); ++it)
1002  {
1003  flag::Flag fSum("TP");
1005 
1006  std::vector<uint32_t>::const_iterator cit=std::find(
1007  _vcdaqEids.begin(), _vcdaqEids.end(), *it);
1008  if (cit==_vcdaqEids.end())
1009  {
1010  // not @cDAQ
1011  for (uint32_t iflag=0; iflag<_vflags.size(); iflag++)
1012  _cSummaryvsLS_FED.setBinContent(eid, _currentLS, int(iflag),
1013  int(flag::fNCDAQ));
1015  continue;
1016  }
1017 
1019  {
1020  // FED is @cDAQ
1021  double etmsm = _xNumCorr.get(eid)>0?
1022  double(_xEtMsm.get(eid))/double(_xNumCorr.get(eid)):0;
1023  double fgmsm = _xNumCorr.get(eid)>0?
1024  double(_xFGMsm.get(eid))/double(_xNumCorr.get(eid)):0;
1025  /*
1026  * UNUSED VARS
1027  * double dmsm = _xDataTotal.get(eid)>0?
1028  double(_xDataMsn.get(eid))/double(_xDataTotal.get(eid)):0;
1029  double emsm = _xEmulTotal.get(eid)>0?
1030  double(_xEmulMsn.get(eid))/double(_xEmulTotal.get(eid)):0;
1031  */
1032  if (etmsm>=_thresh_EtMsmRate_high)
1033  _vflags[fEtMsm]._state = flag::fBAD;
1034  else if (etmsm>=_thresh_EtMsmRate_low)
1035  _vflags[fEtMsm]._state = flag::fPROBLEMATIC;
1036  else
1037  _vflags[fEtMsm]._state = flag::fGOOD;
1038  if (fgmsm>=_thresh_FGMsmRate_high)
1039  _vflags[fFGMsm]._state = flag::fBAD;
1040  else if (fgmsm>=_thresh_FGMsmRate_low)
1041  _vflags[fFGMsm]._state = flag::fPROBLEMATIC;
1042  else
1043  _vflags[fFGMsm]._state = flag::fGOOD;
1044  /*
1045  * DISABLE THESE FLAGS FOR ONLINE FOR NOW!
1046  if (dmsm>=_thresh_DataMsn)
1047  _vflags[fDataMsn]._state = flag::fBAD;
1048  else
1049  _vflags[fDataMsn]._state = flag::fGOOD;
1050  if (emsm>=_thresh_EmulMsn)
1051  _vflags[fEmulMsn]._state = flag::fBAD;
1052  else
1053  _vflags[fEmulMsn]._state = flag::fGOOD;
1054  */
1055  }
1056 
1057  if (_unknownIdsPresent)
1058  _vflags[fUnknownIds]._state = flag::fBAD;
1059  else
1060  _vflags[fUnknownIds]._state = flag::fGOOD;
1061 
1062  int iflag=0;
1063  for (std::vector<flag::Flag>::iterator ft=_vflags.begin();
1064  ft!=_vflags.end(); ++ft)
1065  {
1066  _cSummaryvsLS_FED.setBinContent(eid, _currentLS, int(iflag),
1067  ft->_state);
1068  fSum+=(*ft);
1069  iflag++;
1070 
1071  // this is the MUST!
1072  // reset after using this flag
1073  ft->reset();
1074  }
1075  _cSummaryvsLS.setBinContent(eid, _currentLS, int(fSum._state));
1076  }
1077 
1078  // reset...
1081  _xEmulTotal.reset();
1082 
1083  // in the end always do the DQTask::endLumi
1084  DQTask::endLuminosityBlock(lb, es);
1085 }
1086 
1088 
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:57
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:68
hcaldqm::ContainerProf1D _cMsnDatavsBX_TTSubdet
Definition: TPTask.h:144
double _thresh_FGMsmRate_high
Definition: TPTask.h:59
hcaldqm::ContainerSingle2D _cOccupancyCutEmul_depthlike
Definition: TPTask.h:120
hcaldqm::ContainerProf1D _cMsnDatavsLS_TTSubdet
Definition: TPTask.h:142
std::pair< uint16_t, uint16_t > fed2crate(int fed)
Definition: Utilities.cc:13
std::vector< uint32_t > _vhashFEDs
Definition: TPTask.h:65
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:457
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:41
#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:64
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
int _cutEt
Definition: TPTask.h:58
int const SPIGOT_MIN
Definition: Constants.h:93
hcaldqm::ContainerProf1D _cMsnCutDatavsLS_TTSubdet
Definition: TPTask.h:143
virtual void reset()
Definition: ContainerXXX.h:366
hcaldqm::ContainerSingle2D _cOccupancyCutData_depthlike
Definition: TPTask.h:119
double _thresh_FGMsmRate_low
Definition: TPTask.h:59
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:98
hcaldqm::ContainerProf1D _cOccupancyDatavsLS_TTSubdet
Definition: TPTask.h:161
hcaldqm::Container2D _cOccupancyEmul_ElectronicsVME
Definition: TPTask.h:108
hcaldqm::ContainerProf1D _cEtMsmRatiovsLS_TTSubdet
Definition: TPTask.h:134
void bookHistograms(fwlite::EventContainer &eventCont)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: TPTask.cc:991
hcaldqm::ContainerSingle2D _cOccupancyEmul2x3_depthlike
Definition: TPTask.h:124
hcaldqm::ContainerProf1D _cMsnEmulvsBX_TTSubdet
Definition: TPTask.h:153
int const FIBERCH_MIN
Definition: Constants.h:108
virtual void initialize(std::string const &folder, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
void Fill(long long x)
double _thresh_EtMsmRate_low
Definition: TPTask.h:59
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:110
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: TPTask.cc:985
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:59
hcaldqm::Container2D _cSummaryvsLS_FED
Definition: TPTask.h:170
ProcessingType _ptype
Definition: DQModule.h:59
virtual void fill(uint32_t)
Definition: Container1D.cc:82
virtual void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *, int debug=0)
hcaldqm::Container2D _cOccupancyCutData_ElectronicsVME
Definition: TPTask.h:111
std::vector< hcaldqm::flag::Flag > _vflags
Definition: TPTask.h:45
void reset()
Definition: Flag.h:76
virtual void setBinContent(int, int, int)
hcaldqm::ContainerXXX< uint32_t > _xEmulMsn
Definition: TPTask.h:172
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
HcalElectronicsMap const * _emap
Definition: TPTask.h:68
int const FED_VME_MIN
Definition: Constants.h:55
virtual void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fEnergy), int debug=0)
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:115
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:101
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
Logger _logger
Definition: DQModule.h:70
T min(T a, T b)
Definition: MathUtil.h:58
double _thresh_EtMsmRate_high
Definition: TPTask.h:59
std::string _name
Definition: DQModule.h:57
hcaldqm::ContainerProf1D _cOccupancyCutDatavsLS_TTSubdet
Definition: TPTask.h:163
hcaldqm::Container2D _cOccupancyCutData_ElectronicsuTCA
Definition: TPTask.h:112
hcaldqm::ContainerSingle2D _cSummaryvsLS
Definition: TPTask.h:171
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
int const CRATE_uTCA_MIN
Definition: Constants.h:73
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:59
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
bool isFEDHBHE(HcalElectronicsId const &)
Definition: Utilities.cc:163
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:56
std::vector< bool > _vFGBitsReady
Definition: TPTask.h:62
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
virtual 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
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:186
edm::EDGetTokenT< HcalTrigPrimDigiCollection > _tokEmul
Definition: TPTask.h:42
hcaldqm::ContainerProf1D _cEtCutEmulvsBX_TTSubdet
Definition: TPTask.h:85
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:86
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:136
virtual 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::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
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
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
hcaldqm::ContainerProf1D _cEtMsmRatiovsBX_TTSubdet
Definition: TPTask.h:136
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:895
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
edm::InputTag _tagEmul
Definition: TPTask.h:40
hcaldqm::ContainerSingleProf2D _cEtCutEmul_depthlike
Definition: TPTask.h:96
hcaldqm::ContainerProf2D _cEtData_ElectronicsuTCA
Definition: TPTask.h:88
hcaldqm::ContainerProf1D _cMsnEmulvsLS_TTSubdet
Definition: TPTask.h:151
Readout chain identification for Hcal.
std::string const & instance() const
Definition: InputTag.h:37
hcaldqm::ContainerSingle2D _cMsnData_depthlike
Definition: TPTask.h:141
bool isFEDHF(HcalElectronicsId const &)
Definition: Utilities.cc:185
int ietaAbs() const
get the absolute value of the tower ieta
virtual void _process(edm::Event const &, edm::EventSetup const &)
Definition: TPTask.cc:568
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Definition: TPTask.cc:42
int const SLOT_uTCA_MIN
Definition: Constants.h:80
hcaldqm::ContainerSingleProf2D _cEtCutData_depthlike
Definition: TPTask.h:95
const_iterator begin() const
Definition: Run.h:42
virtual void _resetMonitors(hcaldqm::UpdateFreq)
Definition: TPTask.cc:555
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