File indexing completed on 2024-11-04 06:48:47
0001 #ifndef CONDCORE_POPCON_ONLINEPOPCONANALYZER_H
0002 #define CONDCORE_POPCON_ONLINEPOPCONANALYZER_H
0003
0004
0005
0006
0007
0008
0009
0010 #include "CondCore/PopCon/interface/OnlinePopCon.h"
0011 #include "FWCore/Framework/interface/Frameworkfwd.h"
0012 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014
0015 #include <vector>
0016
0017 namespace popcon {
0018 template <typename S>
0019 class OnlinePopConAnalyzer : public edm::one::EDAnalyzer<> {
0020 public:
0021 typedef S SourceHandler;
0022
0023 OnlinePopConAnalyzer(const edm::ParameterSet& pset)
0024 : m_populator(pset), m_source(pset.getParameter<edm::ParameterSet>("Source")) {}
0025
0026 ~OnlinePopConAnalyzer() override {}
0027
0028 protected:
0029 SourceHandler& source() { return m_source; }
0030
0031 private:
0032 void beginJob() override {}
0033 void endJob() override { write(); }
0034
0035 void analyze(const edm::Event&, const edm::EventSetup&) override {}
0036
0037 void write() { m_populator.write(m_source); }
0038
0039 private:
0040 OnlinePopCon m_populator;
0041 SourceHandler m_source;
0042 };
0043
0044 }
0045 #endif