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[fDataMsn]=flag::Flag("DataMsn");
37  _vflags[fEmulMsn]=flag::Flag("EmulMsn");
38  _vflags[fUnknownIds]=flag::Flag("UnknownIds");
39 }
40 
42  edm::Run const& r, edm::EventSetup const& es)
43 {
44  DQTask::bookHistograms(ib,r,es);
45 
46  // GET WHAT YOU NEED
48  es.get<HcalDbRecord>().get(dbs);
49  _emap = dbs->getHcalMapping();
50  std::vector<uint32_t> vVME;
51  std::vector<uint32_t> vuTCA;
52  std::vector<uint32_t> depth0;
53  vVME.push_back(HcalElectronicsId(FIBERCH_MIN,
56  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
58  vVME);
60  vuTCA);
61  depth0.push_back(HcalTrigTowerDetId(1, 1, 0).rawId());
63  depth0);
64 
65  // INITIALIZE FIRST
66  // Et/FG
77  for (uint8_t iii=0; iii<constants::NUM_FGBITS; iii++)
78  {
83  }
84 
101 
102  // Occupancy
103  _cOccupancyData_depthlike.initialize(_name, "OccupancyData",
107  _cOccupancyEmul_depthlike.initialize(_name, "OccupancyEmul",
111  _cOccupancyCutData_depthlike.initialize(_name, "OccupancyCutData",
115  _cOccupancyCutEmul_depthlike.initialize(_name, "OccupancyCutEmul",
119 
120  // Mismatches
129 
130  // Missing Data w.r.t. Emulator
139 
144 
145  _cOccupancyDatavsBX_TTSubdet.initialize(_name, "OccupancyDatavsBX",
149  _cOccupancyEmulvsBX_TTSubdet.initialize(_name, "OccupancyEmulvsBX",
153  _cOccupancyCutDatavsBX_TTSubdet.initialize(_name, "OccupancyCutDatavsBX",
157  _cOccupancyCutEmulvsBX_TTSubdet.initialize(_name, "OccupancyCutEmulvsBX",
161 
162  // INITIALIZE HISTOGRAMS to be used in Online only!
163  if (_ptype==fOnline)
164  {
165  _cEtCorr2x3_TTSubdet.initialize(_name, "EtCorr2x3",
170  _cOccupancyData2x3_depthlike.initialize(_name, "OccupancyData2x3",
174  _cOccupancyEmul2x3_depthlike.initialize(_name, "OccupancyEmul2x3",
178  _cEtCutDatavsLS_TTSubdet.initialize(_name, "EtCutDatavsLS",
182  _cEtCutEmulvsLS_TTSubdet.initialize(_name, "EtCutEmulvsLS",
186  _cEtCutDatavsBX_TTSubdet.initialize(_name, "EtCutDatavsBX",
190  _cEtCutEmulvsBX_TTSubdet.initialize(_name, "EtCutEmulvsBX",
194  _cEtCorrRatiovsLS_TTSubdet.initialize(_name, "EtCorrRatiovsLS",
198  _cEtCorrRatiovsBX_TTSubdet.initialize(_name, "EtCorrRatiovsBX",
202  _cEtMsmRatiovsLS_TTSubdet.initialize(_name, "EtMsmRatiovsLS",
206  _cEtMsmRatiovsBX_TTSubdet.initialize(_name, "EtMsmRatiovsBX",
218  _cMsnDatavsLS_TTSubdet.initialize(_name, "MsnDatavsLS",
222  _cMsnCutDatavsLS_TTSubdet.initialize(_name, "MsnCutDatavsLS",
226  _cMsnDatavsBX_TTSubdet.initialize(_name, "MsnDatavsBX",
230  _cMsnCutDatavsBX_TTSubdet.initialize(_name, "MsnCutDatavsBX",
234  _cMsnEmulvsLS_TTSubdet.initialize(_name, "MsnEmulvsLS",
238  _cMsnCutEmulvsLS_TTSubdet.initialize(_name, "MsnCutEmulvsLS",
242  _cMsnEmulvsBX_TTSubdet.initialize(_name, "MsnEmulvsBX",
246  _cMsnCutEmulvsBX_TTSubdet.initialize(_name, "MsnCutEmulvsBX",
250  _cOccupancyDatavsLS_TTSubdet.initialize(_name, "OccupancyDatavsLS",
255  "OccupancyCutDatavsLS",
259  _cOccupancyDatavsBX_TTSubdet.initialize(_name, "OccupancyDatavsBX",
264  "OccupancyCutDatavsBX",
268  _cOccupancyEmulvsLS_TTSubdet.initialize(_name, "OccupancyEmulvsLS",
273  "OccupancyCutEmulvsLS",
277  _cOccupancyEmulvsBX_TTSubdet.initialize(_name, "OccupancyEmulvsBX",
282  "OccupancyCutEmulvsBX",
286  }
287 
288  // FED-based containers
289  if (_ptype != fOffline) { // hidefed2crate
290  std::vector<int> vFEDs = hcaldqm::utilities::getFEDList(_emap);
291  std::vector<int> vFEDsVME = hcaldqm::utilities::getFEDVMEList(_emap);
292  std::vector<int> vFEDsuTCA = hcaldqm::utilities::getFEDuTCAList(_emap);
293  // push the rawIds of each fed into the vector
294  // this vector is used at endlumi for online state generation
295  for (std::vector<int>::const_iterator it=vFEDsVME.begin();
296  it!=vFEDsVME.end(); ++it)
297  {
299  SPIGOT_MIN, (*it)-FED_VME_MIN).rawId());
300  }
301  for (std::vector<int>::const_iterator it=vFEDsuTCA.begin();
302  it!=vFEDsuTCA.end(); ++it)
303  {
304  std::pair<uint16_t, uint16_t> cspair = hcaldqm::utilities::fed2crate(*it);
305  _vhashFEDs.push_back(HcalElectronicsId(cspair.first,
306  cspair.second, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
307  }
310  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
315  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
320  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
325  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
328  // Occupancies
331  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
336  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
341  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
346  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
349 
352  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
357  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
362  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
367  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
370  // Mismatches
373  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
378  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
383  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
388  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
391 
392  // Missing Data w.r.t. Emulator
395  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
400  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
405  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
410  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
415  new hcaldqm::quantity::FEDQuantity(vFEDsVME),
420  new hcaldqm::quantity::FEDQuantity(vFEDsuTCA),
423  if (_ptype == fOnline) {
424  _cSummaryvsLS_FED.initialize(_name, "SummaryvsLS",
429  _cSummaryvsLS.initialize(_name, "SummaryvsLS",
433 
441 
442  }
443  }
444 
445  // BOOK HISTOGRAMS
446  char aux[20];
447  for (unsigned int iii=0; iii<constants::NUM_FGBITS; iii++)
448  {
449  sprintf(aux, "BIT%d", iii);
450  _cFGCorr_TTSubdet[iii].book(ib, _emap, _subsystem, aux);
451  }
455  if (_ptype != fOffline) { // hidefed2crate
460  }
465  if (_ptype != fOffline) { // hidefed2crate
474  }
479 
485 
486  if (_ptype != fOffline) { // hidefed2crate
497  }
498 
499  // whatever has to go online only goes here
500  if (_ptype==fOnline)
501  {
533 
534  _xEtMsm.book(_emap);
535  _xFGMsm.book(_emap);
541  }
542 
543  // initialize the hash map
545 
546  // book the flag for unknown ids and the online guy as well
548  meUnknownIds1LS = ib.book1D("UnknownIds", "UnknownIds",
549  1, 0, 1);
550  _unknownIdsPresent = false;
552 }
553 
555 {
556  DQTask::_resetMonitors(uf);
557  switch (uf)
558  {
559  case hcaldqm::f1LS:
560  _unknownIdsPresent = false;
561  break;
562  default :
563  break;
564  }
565 }
566 
567 /* virtual */ void TPTask::_process(edm::Event const& e,
568  edm::EventSetup const&)
569 {
572  if (!e.getByToken(_tokData, cdata))
573  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available"
574  + _tagData.label() + " " + _tagData.instance());
575  if (!e.getByToken(_tokEmul, cemul))
576  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available"
577  + _tagEmul.label() + " " + _tagEmul.instance());
578 
579  // extract some info per event
580  int bx = e.bunchCrossing();
581 
582  // some summaries... per event
583  int numHBHE(0), numHF(0), numCutHBHE(0), numCutHF(0);
584  int numCorrHBHE(0), numCorrHF(0);
585  int numMsmHBHE(0), numMsmHF(0);
586  int numMsnHBHE(0), numMsnHF(0), numMsnCutHBHE(0), numMsnCutHF(0);
587 
588  // for explanation see RecHit or Digi Tasks
589  uint32_t rawidHBHEValid = 0;
590  uint32_t rawidHFValid = 0;
591 
592  /*
593  * STEP1:
594  * Loop over the data digis and
595  * - do ... for all the data digis
596  * - find the emulator digi
597  * --- compare soi Et
598  * --- compare soi FG
599  * --- Do not fill anything for emulator Et!!!
600  */
602  it!=cdata->end(); ++it)
603  {
604  // Explicit check on the DetIds present in the Collection
605  HcalTrigTowerDetId tid = it->id();
606  uint32_t rawid = _ehashmap.lookup(tid);
607  if (rawid==0)
608  {meUnknownIds1LS->Fill(1); _unknownIdsPresent = true; continue;}
609  HcalElectronicsId const& eid(rawid);
610  if (tid.ietaAbs()>=29)
611  rawidHFValid = tid.rawId();
612  else
613  rawidHBHEValid = tid.rawId();
614 
615  //
616  // HF 2x3 TPs Treat theam separately and only for ONLINE!
617  //
618  if (tid.version()==0 && tid.ietaAbs()>=29)
619  {
620  // do this only for online processing
621  if (_ptype==fOnline)
622  {
625  if (jt!=cemul->end())
626  _cEtCorr2x3_TTSubdet.fill(tid, it->SOI_compressedEt(),
627  jt->SOI_compressedEt());
628  }
629 
630  // skip to the next tp digi
631  continue;
632  }
633 
634  // FROM THIS POINT, HBHE + 1x1 HF TPs
635  int soiEt_d = it->t0().compressedEt();
636  int soiFG_d[constants::NUM_FGBITS];
637  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
638  soiFG_d[ibit] = it->t0().fineGrain(ibit)?1:0;
639  tid.ietaAbs()>=29?numHF++:numHBHE++;
640 
641  // fill w/o a cut
642  _cEtData_TTSubdet.fill(tid, soiEt_d);
643  _cEtData_depthlike.fill(tid, soiEt_d);
645  if (_ptype != fOffline) { // hidefed2crate
646  if (eid.isVMEid())
647  {
649  _cEtData_ElectronicsVME.fill(eid, soiEt_d);
650  }
651  else
652  {
654  _cEtData_ElectronicsuTCA.fill(eid, soiEt_d);
655  }
656  }
657 
658  // FILL w/a CUT
659  if (soiEt_d>_cutEt)
660  {
661  tid.ietaAbs()>=29?numCutHF++:numCutHBHE++;
663  _cEtCutData_depthlike.fill(tid, soiEt_d);
664 
665  // ONLINE ONLY!
666  if (_ptype==fOnline)
667  {
669  _cEtCutDatavsBX_TTSubdet.fill(tid, bx, soiEt_d);
670  _xDataTotal.get(eid)++;
671  }
672  // ^^^ONLINE ONLY!
673  if (_ptype != fOffline) { // hidefed2crate
674  if (eid.isVMEid())
676  else
678  }
679  }
680 
681  // FIND the EMULATOR DIGI
683  if (jt!=cemul->end())
684  {
685  // if PRESENT!
686  int soiEt_e = jt->SOI_compressedEt();
687  int soiFG_e[constants::NUM_FGBITS];
688  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
689  soiFG_e[ibit] = jt->t0().fineGrain(ibit)?1:0;
690  // if both are zeroes => set 1
691  double rEt = soiEt_d==0 && soiEt_e==0?1:
692  double(std::min(soiEt_d, soiEt_e))/
693  double(std::max(soiEt_e, soiEt_d));
694 
695  // ONLINE ONLY!
696  if (_ptype==fOnline)
697  {
698  _xNumCorr.get(eid)++;
699  tid.ietaAbs()>=29?numCorrHF++:numCorrHBHE++;
701  _cEtCorrRatiovsBX_TTSubdet.fill(tid, bx, rEt);
702  }
703  // ^^^ONLINE ONLY!
704 
705  _cEtCorrRatio_depthlike.fill(tid, rEt);
706  _cEtCorr_TTSubdet.fill(tid, soiEt_d, soiEt_e);
707  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
708  _cFGCorr_TTSubdet[ibit].fill(tid, soiFG_d[ibit], soiFG_e[ibit]);
709  // FILL w/o a CUT
710  if (_ptype != fOffline) { // hidefed2crate
711  if (eid.isVMEid())
712  {
714  }
715  else
716  {
718  }
719  }
720 
721  // if SOI Et are not equal
722  // fill mismatched
723  if (soiEt_d!=soiEt_e)
724  {
725  tid.ietaAbs()>=29?numMsmHF++:numMsmHBHE++;
726  _cEtMsm_depthlike.fill(tid);
727  if (_ptype != fOffline) { // hidefed2crate
728  if (eid.isVMEid())
730  else
732  }
733  if (_ptype==fOnline)
734  _xEtMsm.get(eid)++;
735  }
736  // if SOI FG are not equal
737  // fill mismatched.
738  // Do this comparison only for FG Bits that are commissioned
739  for (uint32_t ibit=0; ibit<constants::NUM_FGBITS; ibit++)
740  if (soiFG_d[ibit]!=soiFG_e[ibit] && _vFGBitsReady[ibit])
741  {
742  _cFGMsm_depthlike.fill(tid);
743  if (_ptype != fOffline) { // hidefed2crate
744  if (eid.isVMEid())
746  else
748  }
749  if (_ptype==fOnline)
750  _xFGMsm.get(eid)++;
751  }
752  }
753  else
754  {
755  // IF MISSING
756  _cEtCorr_TTSubdet.fill(tid, soiEt_d, -2);
758  tid.ietaAbs()>=29?numMsnHF++:numMsnHBHE++;
759  if (_ptype != fOffline) { // hidefed2crate
760  if (eid.isVMEid())
762  else
764  }
765 
766  if (soiEt_d>_cutEt)
767  {
768  tid.ietaAbs()>=29?numMsnCutHF++:numMsnCutHBHE++;
769  if (_ptype==fOnline)
770  _xEmulMsn.get(eid)++;
771  }
772  }
773  }
774 
775  if (rawidHFValid!=0 && rawidHBHEValid!=0)
776  {
777  // ONLINE ONLY!
778  if (_ptype==fOnline)
779  {
781  numHBHE);
783  numHF);
785  bx, numCutHBHE);
787  numCutHF);
789  _currentLS, numHBHE);
791  _currentLS,numHF);
793  _currentLS, numCutHBHE);
795  _currentLS, numCutHF);
796 
798  numMsmHBHE);
800  numMsmHF);
801  _cEtMsmvsBX_TTSubdet.fill(HcalTrigTowerDetId(rawidHBHEValid), bx,
802  numMsmHBHE);
803  _cEtMsmvsBX_TTSubdet.fill(HcalTrigTowerDetId(rawidHFValid), bx,
804  numMsmHF);
805 
807  _currentLS,
808  double(numMsmHBHE)/double(numCorrHBHE));
810  _currentLS,
811  double(numMsmHF)/double(numCorrHF));
813  double(numMsmHBHE)/double(numCorrHBHE));
815  double(numMsmHF)/double(numCorrHF));
816 
818  _currentLS, numMsnHBHE);
820  _currentLS, numMsnHF);
822  _currentLS, numMsnCutHBHE);
824  _currentLS, numMsnCutHF);
825 
827  bx, numMsnHBHE);
829  bx, numMsnHF);
831  bx, numMsnCutHBHE);
833  bx, numMsnCutHF);
834  }
835  }
836 
837  numHBHE=0; numHF=0; numCutHBHE=0; numCutHF=0;
838  numMsnHBHE=0; numMsnHF=0; numCutHBHE=0; numCutHF=0;
839 
840  // reset
841  rawidHBHEValid = 0;
842  rawidHFValid = 0;
843 
844  /*
845  * STEP2:
846  * Loop over the emulator digis and
847  * - do ... for all the emulator digis
848  * - find data digi and
849  * --- if found skip
850  * --- if not found - fill the missing Data plot
851  */
853  it!=cemul->end(); ++it)
854  {
855  // Explicit check on the DetIds present in the Collection
856  HcalTrigTowerDetId tid = it->id();
857  uint32_t rawid = _ehashmap.lookup(tid);
858  if (rawid==0)
859  {meUnknownIds1LS->Fill(1); _unknownIdsPresent = true; continue;}
860  HcalElectronicsId const& eid(rawid);
861  if (tid.ietaAbs()>=29)
862  rawidHFValid = tid.rawId();
863  else
864  rawidHBHEValid = tid.rawId();
865 
866  // HF 2x3 TPs. Only do it for Online!!!
867  if (tid.version()==0 && tid.ietaAbs()>=29)
868  {
869  // only do this for online processing
870  if (_ptype==fOnline)
872  continue;
873  }
874  int soiEt = it->SOI_compressedEt();
875 
876  // FILL/INCREMENT w/o a CUT
877  tid.ietaAbs()>=29?numHF++:numHBHE++;
878  _cEtEmul_TTSubdet.fill(tid, soiEt);
879  _cEtEmul_depthlike.fill(tid, soiEt);
881  if (_ptype != fOffline) { // hidefed2crate
882  if (eid.isVMEid())
883  {
885  _cEtEmul_ElectronicsVME.fill(eid, soiEt);
886  }
887  else
888  {
890  _cEtEmul_ElectronicsuTCA.fill(eid, soiEt);
891  }
892  }
893 
894  // FILL w/ a CUT
895  if (soiEt>_cutEt)
896  {
897  tid.ietaAbs()>=29?numCutHF++:numCutHBHE++;
899  _cEtCutEmul_depthlike.fill(tid, soiEt);
900  if (_ptype != fOffline) { // hidefed2crate
901  if (eid.isVMEid())
903  else
905  }
906 
907  // ONLINE ONLY!
908  if (_ptype==fOnline)
909  {
911  _cEtCutEmulvsBX_TTSubdet.fill(tid, bx, soiEt);
912  _xEmulTotal.get(eid)++;
913  }
914  // ^^^ONLINE ONLY!
915  }
916 
917  // Look for a data digi.
918  // Do not perform if the emulated digi is zero suppressed.
919  if(!(it->zsMarkAndPass())) {
921  if (jt==cdata->end())
922  {
923  tid.ietaAbs()>=29?numMsnHF++:numMsnHBHE++;
924  _cEtCorr_TTSubdet.fill(tid, -2, soiEt);
926  if (_ptype != fOffline) { // hidefed2crate
927  if (eid.isVMEid())
929  else
931  }
932  if (soiEt>_cutEt)
933  {
934  tid.ietaAbs()>=29?numMsnCutHF++:numMsnCutHBHE++;
935  if (_ptype==fOnline)
936  _xDataMsn.get(eid)++;
937  }
938  }
939  }
940  }
941 
942  if (rawidHBHEValid!=0 && rawidHFValid!=0)
943  {
944  // ONLINE ONLY!
945  if (_ptype==fOnline)
946  {
948  numHBHE);
950  numHF);
952  bx,
953  numCutHBHE);
955  numCutHF);
956 
958  _currentLS, numHBHE);
960  _currentLS,numHF);
962  _currentLS, numCutHBHE);
964  _currentLS, numCutHF);
965 
967  _currentLS, numMsnHBHE);
969  _currentLS, numMsnHF);
971  _currentLS, numMsnCutHBHE);
973  _currentLS, numMsnCutHF);
974 
976  bx, numMsnHBHE);
978  bx, numMsnHF);
980  bx, numMsnCutHBHE);
982  bx, numMsnCutHF);
983  }
984  // ^^^ONLINE ONLY!
985  }
986 }
987 
989  edm::EventSetup const& es)
990 {
991  DQTask::beginLuminosityBlock(lb, es);
992 }
993 
995  edm::EventSetup const& es)
996 {
997  if (_ptype!=fOnline)
998  return;
999 
1000  //
1001  // GENERATE STATUS ONLY FOR ONLINE!
1002  //
1003  for (std::vector<uint32_t>::const_iterator it=_vhashFEDs.begin();
1004  it!=_vhashFEDs.end(); ++it)
1005  {
1006  flag::Flag fSum("TP");
1008 
1009  std::vector<uint32_t>::const_iterator cit=std::find(
1010  _vcdaqEids.begin(), _vcdaqEids.end(), *it);
1011  if (cit==_vcdaqEids.end())
1012  {
1013  // not @cDAQ
1014  for (uint32_t iflag=0; iflag<_vflags.size(); iflag++)
1015  _cSummaryvsLS_FED.setBinContent(eid, _currentLS, int(iflag),
1016  int(flag::fNCDAQ));
1018  continue;
1019  }
1020 
1022  {
1023  // FED is @cDAQ
1024  double etmsm = _xNumCorr.get(eid)>0?
1025  double(_xEtMsm.get(eid))/double(_xNumCorr.get(eid)):0;
1026  /*
1027  * UNUSED VARS
1028  * double dmsm = _xDataTotal.get(eid)>0?
1029  double(_xDataMsn.get(eid))/double(_xDataTotal.get(eid)):0;
1030  double emsm = _xEmulTotal.get(eid)>0?
1031  double(_xEmulMsn.get(eid))/double(_xEmulTotal.get(eid)):0;
1032  double fgmsm = _xNumCorr.get(eid)>0?
1033  double(_xFGMsm.get(eid))/double(_xNumCorr.get(eid)):0;
1034  */
1035  if (etmsm>=_thresh_EtMsmRate_high)
1036  _vflags[fEtMsm]._state = flag::fBAD;
1037  else if (etmsm>=_thresh_EtMsmRate_low)
1038  _vflags[fEtMsm]._state = flag::fPROBLEMATIC;
1039  else
1040  _vflags[fEtMsm]._state = flag::fGOOD;
1041  /*
1042  * DISABLE THESE FLAGS FOR ONLINE FOR NOW!
1043  if (dmsm>=_thresh_DataMsn)
1044  _vflags[fDataMsn]._state = flag::fBAD;
1045  else
1046  _vflags[fDataMsn]._state = flag::fGOOD;
1047  if (emsm>=_thresh_EmulMsn)
1048  _vflags[fEmulMsn]._state = flag::fBAD;
1049  else
1050  _vflags[fEmulMsn]._state = flag::fGOOD;
1051  */
1052  }
1053 
1054  if (_unknownIdsPresent)
1055  _vflags[fUnknownIds]._state = flag::fBAD;
1056  else
1057  _vflags[fUnknownIds]._state = flag::fGOOD;
1058 
1059  int iflag=0;
1060  for (std::vector<flag::Flag>::iterator ft=_vflags.begin();
1061  ft!=_vflags.end(); ++ft)
1062  {
1063  _cSummaryvsLS_FED.setBinContent(eid, _currentLS, int(iflag),
1064  ft->_state);
1065  fSum+=(*ft);
1066  iflag++;
1067 
1068  // this is the MUST!
1069  // reset after using this flag
1070  ft->reset();
1071  }
1072  _cSummaryvsLS.setBinContent(eid, _currentLS, int(fSum._state));
1073  }
1074 
1075  // reset...
1078  _xEmulTotal.reset();
1079 
1080  // in the end always do the DQTask::endLumi
1081  DQTask::endLuminosityBlock(lb, es);
1082 }
1083 
1085 
hcaldqm::ContainerProf1D _cEtCorrRatiovsBX_TTSubdet
Definition: TPTask.h:101
hcaldqm::ContainerXXX< uint32_t > _xDataTotal
Definition: TPTask.h:170
T getUntrackedParameter(std::string const &, T const &) const
bool _skip1x1
Definition: TPTask.h:56
hcaldqm::ContainerProf1D _cMsnCutEmulvsBX_TTSubdet
Definition: TPTask.h:152
hcaldqm::Container2D _cMsnData_ElectronicsVME
Definition: TPTask.h:137
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:76
hcaldqm::ContainerSingleProf2D _cEtData_depthlike
Definition: TPTask.h:91
edm::InputTag _tagData
Definition: TPTask.h:39
int const CRATE_VME_MIN
Definition: Constants.h:111
hcaldqm::ContainerProf1D _cMsnDatavsBX_TTSubdet
Definition: TPTask.h:142
double _thresh_FGMsmRate_high
Definition: TPTask.h:58
hcaldqm::ContainerSingle2D _cOccupancyCutEmul_depthlike
Definition: TPTask.h:118
hcaldqm::ContainerProf1D _cMsnDatavsLS_TTSubdet
Definition: TPTask.h:140
std::pair< uint16_t, uint16_t > fed2crate(int fed)
Definition: Utilities.cc:12
std::vector< uint32_t > _vhashFEDs
Definition: TPTask.h:64
uint32_t rawId() const
hcaldqm::ContainerProf1D _cEtMsmvsLS_TTSubdet
Definition: TPTask.h:131
hcaldqm::Container2D _cOccupancyData_ElectronicsVME
Definition: TPTask.h:104
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
hcaldqm::ContainerProf1D _cEtCutEmulvsLS_TTSubdet
Definition: TPTask.h:81
hcaldqm::electronicsmap::ElectronicsMap _ehashmap
Definition: TPTask.h:67
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:165
State _state
Definition: Flag.h:79
std::vector< HcalTriggerPrimitiveDigi >::const_iterator const_iterator
hcaldqm::ContainerSingleProf2D _cEtCorrRatio_depthlike
Definition: TPTask.h:99
hcaldqm::ContainerProf1D _cMsnCutDatavsBX_TTSubdet
Definition: TPTask.h:143
int bunchCrossing() const
Definition: EventBase.h:66
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
int _cutEt
Definition: TPTask.h:57
int const SPIGOT_MIN
Definition: Constants.h:136
hcaldqm::ContainerProf1D _cMsnCutDatavsLS_TTSubdet
Definition: TPTask.h:141
virtual void reset()
Definition: ContainerXXX.h:366
hcaldqm::ContainerSingle2D _cOccupancyCutData_depthlike
Definition: TPTask.h:117
double _thresh_FGMsmRate_low
Definition: TPTask.h:58
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:159
hcaldqm::Container2D _cOccupancyEmul_ElectronicsVME
Definition: TPTask.h:106
hcaldqm::ContainerProf1D _cEtMsmRatiovsLS_TTSubdet
Definition: TPTask.h:132
void bookHistograms(fwlite::EventContainer &eventCont)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: TPTask.cc:994
hcaldqm::ContainerSingle2D _cOccupancyEmul2x3_depthlike
Definition: TPTask.h:122
hcaldqm::ContainerProf1D _cMsnEmulvsBX_TTSubdet
Definition: TPTask.h:151
int const FIBERCH_MIN
Definition: Constants.h:151
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:58
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
hcaldqm::ContainerProf2D _cEtCorrRatio_ElectronicsuTCA
Definition: TPTask.h:98
std::vector< int > getFEDVMEList(HcalElectronicsMap const *)
Definition: Utilities.cc:119
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: TPTask.cc:988
hcaldqm::Container2D _cFGCorr_TTSubdet[hcaldqm::constants::NUM_FGBITS]
Definition: TPTask.h:79
hcaldqm::ContainerXXX< uint32_t > _xDataMsn
Definition: TPTask.h:170
hcaldqm::filter::HashFilter _filter_uTCA
Definition: TPTask.h:71
double _thresh_EmulMsn
Definition: TPTask.h:58
hcaldqm::Container2D _cSummaryvsLS_FED
Definition: TPTask.h:168
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:109
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:170
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
hcaldqm::ContainerProf2D _cEtData_ElectronicsVME
Definition: TPTask.h:85
hcaldqm::ContainerProf1D _cEtMsmvsBX_TTSubdet
Definition: TPTask.h:133
int const FED_VME_MIN
Definition: Constants.h:98
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:155
hcaldqm::ContainerProf2D _cEtEmul_ElectronicsuTCA
Definition: TPTask.h:88
hcaldqm::ContainerProf1D _cEtCorrRatiovsLS_TTSubdet
Definition: TPTask.h:100
hcaldqm::ContainerSingle2D _cOccupancyData2x3_depthlike
Definition: TPTask.h:121
hcaldqm::ContainerSingle2D _cFGMsm_depthlike
Definition: TPTask.h:130
hcaldqm::ContainerProf2D _cEtEmul_ElectronicsVME
Definition: TPTask.h:87
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
hcaldqm::filter::HashFilter _filter_depth0
Definition: TPTask.h:72
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:97
hcaldqm::ContainerXXX< uint32_t > _xEtMsm
Definition: TPTask.h:170
hcaldqm::Container2D _cEtMsm_ElectronicsuTCA
Definition: TPTask.h:126
hcaldqm::Container2D _cOccupancyCutEmul_ElectronicsuTCA
Definition: TPTask.h:112
Logger _logger
Definition: DQModule.h:70
T min(T a, T b)
Definition: MathUtil.h:58
double _thresh_EtMsmRate_high
Definition: TPTask.h:58
std::string _name
Definition: DQModule.h:57
hcaldqm::ContainerProf1D _cOccupancyCutDatavsLS_TTSubdet
Definition: TPTask.h:161
hcaldqm::Container2D _cOccupancyCutData_ElectronicsuTCA
Definition: TPTask.h:110
HcalElectronicsMap const * _emap
Definition: DQTask.h:73
hcaldqm::ContainerSingle2D _cSummaryvsLS
Definition: TPTask.h:169
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
int const CRATE_uTCA_MIN
Definition: Constants.h:116
hcaldqm::ContainerSingle2D _cOccupancyData_depthlike
Definition: TPTask.h:115
hcaldqm::Container2D _cOccupancyCutEmul_ElectronicsVME
Definition: TPTask.h:111
const_iterator end() const
hcaldqm::ContainerSingle2D _cEtMsm_depthlike
Definition: TPTask.h:129
hcaldqm::ContainerProf1D _cEtCutDatavsLS_TTSubdet
Definition: TPTask.h:80
hcaldqm::Container2D _cMsnData_ElectronicsuTCA
Definition: TPTask.h:138
hcaldqm::Container2D _cFGMsm_ElectronicsVME
Definition: TPTask.h:127
hcaldqm::Container2D _cMsnEmul_ElectronicsuTCA
Definition: TPTask.h:147
hcaldqm::ContainerProf1D _cOccupancyEmulvsBX_TTSubdet
Definition: TPTask.h:156
bool isVMEid() const
hcaldqm::ContainerXXX< uint32_t > _xEmulTotal
Definition: TPTask.h:170
double _thresh_DataMsn
Definition: TPTask.h:58
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
bool isFEDHBHE(HcalElectronicsId const &)
Definition: Utilities.cc:172
virtual void book(HcalElectronicsMap const *)
Definition: ContainerXXX.h:99
hcaldqm::Container2D _cFGMsm_ElectronicsuTCA
Definition: TPTask.h:128
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:82
int version() const
get the version code for the trigger tower
const T & get() const
Definition: EventSetup.h:55
std::vector< bool > _vFGBitsReady
Definition: TPTask.h:61
hcaldqm::ContainerProf1D _cOccupancyCutEmulvsBX_TTSubdet
Definition: TPTask.h:158
hcaldqm::ContainerXXX< uint32_t > _xFGMsm
Definition: TPTask.h:170
hcaldqm::Container2D _cOccupancyEmul_ElectronicsuTCA
Definition: TPTask.h:107
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:157
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
iterator find(key_type k)
hcaldqm::ContainerSingle2D _cOccupancyEmul_depthlike
Definition: TPTask.h:116
hcaldqm::Container2D _cOccupancyData_ElectronicsuTCA
Definition: TPTask.h:105
virtual STDTYPE & get(HcalDetId const &)
Definition: ContainerXXX.h:249
int const NUM_FGBITS
Definition: Constants.h:229
edm::EDGetTokenT< HcalTrigPrimDigiCollection > _tokEmul
Definition: TPTask.h:42
hcaldqm::ContainerProf1D _cEtCutEmulvsBX_TTSubdet
Definition: TPTask.h:83
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:95
hcaldqm::Container2D _cEtMsm_ElectronicsVME
Definition: TPTask.h:125
hcaldqm::Container2D _cEtCorr2x3_TTSubdet
Definition: TPTask.h:78
std::vector< int > getFEDuTCAList(HcalElectronicsMap const *)
Definition: Utilities.cc:145
virtual void fill(HcalDetId const &) override
Definition: Container2D.cc:59
const HcalElectronicsMap * getHcalMapping() const
hcaldqm::Container2D _cEtCorr_TTSubdet
Definition: TPTask.h:77
std::string _subsystem
Definition: DQModule.h:64
hcaldqm::ContainerSingleProf2D _cEtEmul_depthlike
Definition: TPTask.h:92
Definition: TPTask.py:1
hcaldqm::ContainerXXX< uint32_t > _xNumCorr
Definition: TPTask.h:170
bool _unknownIdsPresent
Definition: TPTask.h:166
hcaldqm::filter::HashFilter _filter_VME
Definition: TPTask.h:70
std::vector< uint32_t > _vcdaqEids
Definition: DQTask.h:65
hcaldqm::ContainerProf1D _cOccupancyEmulvsLS_TTSubdet
Definition: TPTask.h:160
hcaldqm::ContainerProf1D _cOccupancyCutEmulvsLS_TTSubdet
Definition: TPTask.h:162
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:134
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:94
hcaldqm::ContainerProf2D _cEtData_ElectronicsuTCA
Definition: TPTask.h:86
hcaldqm::ContainerProf1D _cMsnEmulvsLS_TTSubdet
Definition: TPTask.h:149
Readout chain identification for Hcal.
std::string const & instance() const
Definition: InputTag.h:37
hcaldqm::ContainerSingle2D _cMsnData_depthlike
Definition: TPTask.h:139
bool isFEDHF(HcalElectronicsId const &)
Definition: Utilities.cc:187
int ietaAbs() const
get the absolute value of the tower ieta
virtual void _process(edm::Event const &, edm::EventSetup const &)
Definition: TPTask.cc:567
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Definition: TPTask.cc:41
int const SLOT_uTCA_MIN
Definition: Constants.h:123
hcaldqm::ContainerSingleProf2D _cEtCutData_depthlike
Definition: TPTask.h:93
const_iterator begin() const
Definition: Run.h:42
virtual void _resetMonitors(hcaldqm::UpdateFreq)
Definition: TPTask.cc:554
hcaldqm::Container1D _cEtData_TTSubdet
Definition: TPTask.h:75
ib
Definition: cuy.py:660
hcaldqm::ContainerSingle2D _cMsnEmul_depthlike
Definition: TPTask.h:148
hcaldqm::ContainerProf1D _cMsnCutEmulvsLS_TTSubdet
Definition: TPTask.h:150
hcaldqm::Container2D _cMsnEmul_ElectronicsVME
Definition: TPTask.h:146