Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:12:32

0001 #ifndef DQMOffline_CalibTracker_SiStripPopConDQMEDHarvester_H
0002 #define DQMOffline_CalibTracker_SiStripPopConDQMEDHarvester_H
0003 
0004 #include "FWCore/Framework/interface/EventSetup.h"
0005 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0006 #include "CondCore/PopCon/interface/PopCon.h"
0007 
0008 // copied from popCon::PopConAnalyzer
0009 // modified to pass an edm::EventSetup reference at begin run
0010 // and inherit from DQMEDHarvester
0011 // Compared to popCon::SourceHandler, the concrete types should additionally implement
0012 // the `void initES(const edm::EventSetup&)` and
0013 // `void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&)` methods
0014 template <class SourceHandler>
0015 class SiStripPopConDQMEDHarvester : public DQMEDHarvester {
0016 public:
0017   SiStripPopConDQMEDHarvester(const edm::ParameterSet& pset)
0018       : m_populator(pset), m_source(pset.getParameter<edm::ParameterSet>("Source"), consumesCollector()) {}
0019 
0020   ~SiStripPopConDQMEDHarvester() override {}
0021 
0022 private:
0023   void beginRun(const edm::Run&, const edm::EventSetup& setup) override { m_source.initES(setup); }
0024 
0025   void dqmEndJob(DQMStore::IBooker& booker, DQMStore::IGetter& getter) override {
0026     m_source.dqmEndJob(booker, getter);
0027     m_populator.write(m_source);
0028   }
0029 
0030 private:
0031   popcon::PopCon m_populator;
0032   SourceHandler m_source;
0033 };
0034 
0035 #endif  // DQMOffline_CalibTracker_SiStripPopConDQMEDHarvester_H