CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CondCore/PopCon/interface/PopConAnalyzer.h

Go to the documentation of this file.
00001 #ifndef POPCON_ANALYZER_H
00002 #define POPCON_ANALYZER_H
00003 
00004 //
00005 // Original Author:  Marcin BOGUSZ
00006 //         Created:  Tue Jul  3 10:48:22 CEST 2007
00007 
00008 
00009 #include "CondCore/PopCon/interface/PopCon.h"
00010 #include <vector>
00011 
00012 
00013 #include "FWCore/Framework/interface/Frameworkfwd.h"
00014 #include "FWCore/Framework/interface/EDAnalyzer.h"
00015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00016 
00017 namespace popcon{
00018   template <typename S>
00019   class PopConAnalyzer : public edm::EDAnalyzer {
00020   public:
00021     typedef S SourceHandler;
00022     
00023     PopConAnalyzer(const edm::ParameterSet& pset) : 
00024       m_populator(pset),
00025       m_source(pset.getParameter<edm::ParameterSet>("Source")) {}
00026     
00027     
00028     virtual ~PopConAnalyzer(){}
00029     
00030   private:
00031     
00032     virtual void beginJob(){}
00033     virtual void endJob() {
00034       write();
00035     }
00036     
00037     virtual void analyze(const edm::Event&, const edm::EventSetup&){} 
00038     
00039     
00040     void write() {
00041       m_populator.write(m_source);
00042       
00043     }
00044     
00045   private:
00046     PopCon m_populator;
00047     SourceHandler m_source;     
00048   };
00049 
00050 }
00051 #endif