CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/CondTools/Hcal/plugins/HcalFlagHFDigiTimeParamsPopConAnalyzer.cc

Go to the documentation of this file.
00001 #include "CondCore/PopCon/interface/PopConAnalyzer.h"
00002 #include "CondTools/Hcal/interface/HcalFlagHFDigiTimeParamsHandler.h"
00003 #include "FWCore/Framework/interface/MakerMacros.h"
00004 
00005 //typedef popcon::PopConAnalyzer<HcalFlagHFDigiTimeParamsHandler> HcalFlagHFDigiTimeParamsPopConAnalyzer;
00006 
00007 class HcalFlagHFDigiTimeParamsPopConAnalyzer: public popcon::PopConAnalyzer<HcalFlagHFDigiTimeParamsHandler>
00008 {
00009 public:
00010   typedef HcalFlagHFDigiTimeParamsHandler SourceHandler;
00011 
00012   HcalFlagHFDigiTimeParamsPopConAnalyzer(const edm::ParameterSet& pset): 
00013     popcon::PopConAnalyzer<HcalFlagHFDigiTimeParamsHandler>(pset),
00014     m_populator(pset),
00015     m_source(pset.getParameter<edm::ParameterSet>("Source")) {}
00016 
00017 private:
00018   virtual void endJob() 
00019   {
00020     m_source.initObject(myDBObject);
00021     write();
00022   }
00023 
00024   virtual void analyze(const edm::Event& ev, const edm::EventSetup& esetup)
00025   {
00026     //Using ES to get the data:
00027 
00028     edm::ESHandle<HcalFlagHFDigiTimeParams> objecthandle;
00029     esetup.get<HcalFlagHFDigiTimeParamsRcd>().get(objecthandle);
00030     myDBObject = new HcalFlagHFDigiTimeParams(*objecthandle.product() );
00031   }
00032 
00033   void write() { m_populator.write(m_source); }
00034 
00035 private:
00036   popcon::PopCon m_populator;
00037   SourceHandler m_source;
00038 
00039   HcalFlagHFDigiTimeParams* myDBObject;
00040 };
00041 
00042 DEFINE_FWK_MODULE(HcalFlagHFDigiTimeParamsPopConAnalyzer);