CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/CondTools/Ecal/plugins/TestEcalChannelStatusAnalyzer.cc

Go to the documentation of this file.
00001 #include "CondCore/PopCon/interface/PopConAnalyzer.h"
00002 #include "CondTools/Ecal/interface/EcalChannelStatusHandler.h"
00003 #include "FWCore/Framework/interface/MakerMacros.h"
00004 
00005 class ExTestEcalChannelStatusAnalyzer: public popcon::PopConAnalyzer<popcon::EcalChannelStatusHandler>
00006 {
00007 public:
00008 
00009   typedef popcon::EcalChannelStatusHandler SourceHandler;
00010   
00011   ExTestEcalChannelStatusAnalyzer(const edm::ParameterSet& pset):
00012     popcon::PopConAnalyzer<popcon::EcalChannelStatusHandler>(pset),
00013     m_populator(pset),
00014     m_source(pset.getParameter<edm::ParameterSet>("Source")) {}
00015 
00016 private:
00017 
00018   virtual void analyze(const edm::Event& ev, const edm::EventSetup& iSetup) {
00019 
00020     edm::ESHandle<EcalElectronicsMapping> eleMap;
00021     iSetup.get< EcalMappingRcd >().get(eleMap);
00022     ecalElectronicsMap = eleMap.product();
00023   }
00024 
00025   virtual void endJob() {
00026 
00027     m_source.setElectronicsMap(ecalElectronicsMap);
00028     write();
00029   }
00030 
00031   void write() { m_populator.write(m_source); }
00032   
00033 
00034 private:
00035 
00036   popcon::PopCon m_populator;
00037   SourceHandler m_source;
00038   const EcalElectronicsMapping* ecalElectronicsMap;
00039 };
00040 
00041 
00042 
00043 //define this as a plug-in
00044 DEFINE_FWK_MODULE(ExTestEcalChannelStatusAnalyzer);