Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DQWorkerClient_H
0002 #define DQWorkerClient_H
0003 
0004 #include <utility>
0005 
0006 #include "DQM/EcalCommon/interface/DQWorker.h"
0007 #include "FWCore/Framework/interface/ConsumesCollector.h"
0008 
0009 class DetId;
0010 namespace edm {
0011   class ConsumesCollector;
0012 }  // namespace edm
0013 
0014 namespace ecaldqm {
0015   class StatusManager;
0016 
0017   class DQWorkerClient : public DQWorker {
0018   public:
0019     enum ProcessType { kLumi, kJob, nProcessType };
0020 
0021     DQWorkerClient();
0022     ~DQWorkerClient() override {}
0023 
0024     static void fillDescriptions(edm::ParameterSetDescription&);
0025 
0026     void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0027     void resetPerLumi();
0028 
0029     void bookMEs(DQMStore::IBooker&) override;
0030     void releaseMEs() override;
0031 
0032     void releaseSource();
0033     bool retrieveSource(DQMStore::IGetter&, ProcessType);
0034 
0035     bool runsOn(ProcessType _type) const { return _type == kJob || hasLumiPlots_; }
0036     virtual void resetMEs();
0037     virtual void producePlots(ProcessType) = 0;
0038 
0039     // mechanisms to register EDGetTokens for any additional objects used internally
0040     virtual void setTokens(edm::ConsumesCollector&) {}
0041 
0042     void setStatusManager(StatusManager const& _manager) { statusManager_ = &_manager; }
0043 
0044     enum Quality { kBad = 0, kGood = 1, kUnknown = 2, kMBad = 3, kMGood = 4, kMUnknown = 5 };
0045 
0046   protected:
0047     void setME(edm::ParameterSet const& _ps) final;
0048     void setSource(edm::ParameterSet const&) override;
0049 
0050     bool using_(std::string const& _name, ProcessType _type = kJob) const {
0051       MESetCollection::const_iterator itr(sources_.find(_name));
0052       if (itr == sources_.end())
0053         return false;
0054       if (_type == kJob)
0055         return true;
0056       else
0057         return itr->second->getLumiFlag();
0058     }
0059 
0060     void towerAverage_(MESet&, MESet const&, float);
0061 
0062     MESetCollection sources_;
0063     std::set<std::string> qualitySummaries_;
0064 
0065     bool hasLumiPlots_;
0066 
0067     StatusManager const* statusManager_;
0068   };
0069 }  // namespace ecaldqm
0070 #endif