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