Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-17 23:26:22

0001 #include "DQM/EcalMonitorClient/interface/SelectiveReadoutClient.h"
0002 
0003 #include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h"
0004 
0005 #include <cmath>
0006 
0007 namespace ecaldqm {
0008   SelectiveReadoutClient::SelectiveReadoutClient() : DQWorkerClient() {}
0009 
0010   void SelectiveReadoutClient::producePlots(ProcessType) {
0011     MESet& meFRDropped(MEs_.at("FRDropped"));
0012     MESet& meZSReadout(MEs_.at("ZSReadout"));
0013     MESet& meFR(MEs_.at("FR"));
0014     MESet& meRUForced(MEs_.at("RUForced"));
0015     MESet& meZS1(MEs_.at("ZS1"));
0016     MESet& meHighInterest(MEs_.at("HighInterest"));
0017     MESet& meMedInterest(MEs_.at("MedInterest"));
0018     MESet& meLowInterest(MEs_.at("LowInterest"));
0019 
0020     MESet const& sFlagCounterMap(sources_.at("FlagCounterMap"));
0021     MESet const& sRUForcedMap(sources_.at("RUForcedMap"));
0022     MESet const& sFullReadoutMap(sources_.at("FullReadoutMap"));
0023     MESet const& sZS1Map(sources_.at("ZS1Map"));
0024     MESet const& sZSMap(sources_.at("ZSMap"));
0025     MESet const& sZSFullReadoutMap(sources_.at("ZSFullReadoutMap"));
0026     MESet const& sFRDroppedMap(sources_.at("FRDroppedMap"));
0027     MESet const& sHighIntMap(sources_.at("HighIntMap"));
0028     MESet const& sMedIntMap(sources_.at("MedIntMap"));
0029     MESet const& sLowIntMap(sources_.at("LowIntMap"));
0030 
0031     MESet::const_iterator ruItr(GetElectronicsMap(), sRUForcedMap);
0032     MESet::const_iterator frItr(GetElectronicsMap(), sFullReadoutMap);
0033     MESet::const_iterator zs1Itr(GetElectronicsMap(), sZS1Map);
0034     MESet::const_iterator zsItr(GetElectronicsMap(), sZSMap);
0035     MESet::const_iterator zsfrItr(GetElectronicsMap(), sZSFullReadoutMap);
0036     MESet::const_iterator frdItr(GetElectronicsMap(), sFRDroppedMap);
0037 
0038     MESet::iterator frdRateItr(GetElectronicsMap(), meFRDropped);
0039     MESet::iterator zsrRateItr(GetElectronicsMap(), meZSReadout);
0040     MESet::iterator frRateItr(GetElectronicsMap(), meFR);
0041     MESet::iterator ruRateItr(GetElectronicsMap(), meRUForced);
0042     MESet::iterator zs1RateItr(GetElectronicsMap(), meZS1);
0043 
0044     MESet::const_iterator cEnd(sFlagCounterMap.end(GetElectronicsMap()));
0045     for (MESet::const_iterator cItr(sFlagCounterMap.beginChannel(GetElectronicsMap())); cItr != cEnd;
0046          cItr.toNextChannel(GetElectronicsMap())) {
0047       ruItr = cItr;
0048       frItr = cItr;
0049       zs1Itr = cItr;
0050       zsItr = cItr;
0051       zsfrItr = cItr;
0052       frdItr = cItr;
0053 
0054       frdRateItr = cItr;
0055       zsrRateItr = cItr;
0056       frRateItr = cItr;
0057       ruRateItr = cItr;
0058       zs1RateItr = cItr;
0059 
0060       float nFlags(cItr->getBinContent());
0061       float nZS12Flags(zsItr->getBinContent());
0062       float nFullReadoutFlags(frItr->getBinContent());
0063 
0064       if (nFlags > 0.) {
0065         frRateItr->setBinContent(nFullReadoutFlags / nFlags);
0066         zs1RateItr->setBinContent(zs1Itr->getBinContent() / nFlags);
0067         ruRateItr->setBinContent(ruItr->getBinContent() / nFlags);
0068       }
0069       if (nZS12Flags > 0.)
0070         zsrRateItr->setBinContent(zsfrItr->getBinContent() / nZS12Flags);
0071       if (nFullReadoutFlags > 0.)
0072         frdRateItr->setBinContent(frdItr->getBinContent() / nFullReadoutFlags);
0073     }
0074 
0075     // iterator not supported for kTriggerTower binning yet
0076     for (unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; ++iTT) {
0077       EcalTrigTowerDetId id(EcalTrigTowerDetId::detIdFromDenseIndex(iTT));
0078 
0079       float nHigh(sHighIntMap.getBinContent(getEcalDQMSetupObjects(), id));
0080       float nMed(sMedIntMap.getBinContent(getEcalDQMSetupObjects(), id));
0081       float nLow(sLowIntMap.getBinContent(getEcalDQMSetupObjects(), id));
0082       float total(nHigh + nMed + nLow);
0083 
0084       if (total > 0.) {
0085         meHighInterest.setBinContent(getEcalDQMSetupObjects(), id, nHigh / total);
0086         meMedInterest.setBinContent(getEcalDQMSetupObjects(), id, nMed / total);
0087         meLowInterest.setBinContent(getEcalDQMSetupObjects(), id, nLow / total);
0088       }
0089     }
0090   }
0091 
0092   DEFINE_ECALDQM_WORKER(SelectiveReadoutClient);
0093 }  // namespace ecaldqm