CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/CondTools/Ecal/interface/EcalCondHandler.h

Go to the documentation of this file.
00001 #ifndef _CondTools_Ecal_EcalCondHandler_
00002 #define _CondTools_Ecal_EcalCondHandler_
00003 
00004 #include "CondCore/PopCon/interface/PopConSourceHandler.h"
00005 #include "CondTools/Ecal/interface/EcalCondHeader.h"
00006 #include <string>
00007 
00008 
00009 template <typename Payload, typename XMLTranslator>
00010 class EcalCondHandler: 
00011    public popcon::PopConSourceHandler<Payload> {
00012 
00013  public:
00014 
00015   EcalCondHandler(const edm::ParameterSet & ps):
00016     xmlFileSource_(ps.getUntrackedParameter<std::string>("xmlFile")),
00017     since_(ps.getUntrackedParameter<long long>("since")){}
00018 
00019   virtual void getNewObjects(){
00020 
00021     EcalCondHeader   header;
00022     Payload * payload = new Payload;
00023     XMLTranslator::readXML(xmlFileSource_,header,*payload);
00024     popcon::PopConSourceHandler<Payload>::m_to_transfer.push_back(
00025                                     std::make_pair(payload,since_));
00026   }
00027 
00028   virtual std::string id() const {return std::string("dummy");}
00029 
00030  private:
00031   
00032   std::string xmlFileSource_;
00033   long long since_; 
00034  
00035 
00036 };
00037 
00038 #endif
00039 
00040 // Configure (x)emacs for this file ...
00041 // Local Variables:
00042 // mode:c++
00043 // compile-command: "scram b"
00044 // End