Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:43

0001 #ifndef POPCON_ANALYZER_H
0002 #define POPCON_ANALYZER_H
0003 
0004 //
0005 // Original Author:  Marcin BOGUSZ
0006 //         Created:  Tue Jul  3 10:48:22 CEST 2007
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 }  // namespace popcon
0043 #endif