Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-29 01:21:17

0001 #include "DQM/EcalCommon/interface/EcalMEFormatter.h"
0002 
0003 #include "DQM/EcalCommon/interface/MESetDet2D.h"
0004 
0005 #include "DQMServices/Core/interface/DQMStore.h"
0006 #include "FWCore/ServiceRegistry/interface/Service.h"
0007 
0008 #include "FWCore/Framework/interface/MakerMacros.h"
0009 
0010 #include <limits>
0011 
0012 EcalMEFormatter::EcalMEFormatter(edm::ParameterSet const &_ps) : DQMEDHarvester(), ecaldqm::DQWorker() {
0013   initialize("EcalMEFormatter", _ps);
0014   edm::ConsumesCollector collector(consumesCollector());
0015   setTokens(collector);
0016   setME(_ps.getUntrackedParameterSet("MEs"));
0017   verbosity_ = _ps.getUntrackedParameter<int>("verbosity", 0);
0018 }
0019 
0020 /*static*/
0021 void EcalMEFormatter::fillDescriptions(edm::ConfigurationDescriptions &_descs) {
0022   edm::ParameterSetDescription desc;
0023   ecaldqm::DQWorker::fillDescriptions(desc);
0024   desc.addUntracked<int>("verbosity", 0);
0025 
0026   _descs.addDefault(desc);
0027 }
0028 
0029 void EcalMEFormatter::dqmEndLuminosityBlock(DQMStore::IBooker &,
0030                                             DQMStore::IGetter &_igetter,
0031                                             edm::LuminosityBlock const &,
0032                                             edm::EventSetup const &_es) {
0033   setSetupObjectsEndLumi(_es);
0034   format_(_igetter, true);
0035 }
0036 
0037 void EcalMEFormatter::dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &_igetter) { format_(_igetter, false); }
0038 
0039 void EcalMEFormatter::format_(DQMStore::IGetter &_igetter, bool _checkLumi) {
0040   std::string failedPath;
0041 
0042   for (auto &mItr : MEs_) {
0043     if (_checkLumi && !mItr.second->getLumiFlag())
0044       continue;
0045     mItr.second->clear();
0046     if (!mItr.second->retrieve(GetElectronicsMap(), _igetter, &failedPath)) {
0047       if (verbosity_ > 0)
0048         edm::LogWarning("EcalDQM") << "Could not find ME " << mItr.first << "@" << failedPath;
0049       continue;
0050     }
0051     if (verbosity_ > 1)
0052       edm::LogInfo("EcalDQM") << "Retrieved " << mItr.first << " from DQMStore";
0053 
0054     if (dynamic_cast<ecaldqm::MESetDet2D *>(mItr.second.get()))
0055       formatDet2D_(*mItr.second);
0056   }
0057 }
0058 
0059 void EcalMEFormatter::formatDet2D_(ecaldqm::MESet &_meSet) { return; }
0060 
0061 DEFINE_FWK_MODULE(EcalMEFormatter);