Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:49

0001 #ifndef _CondTools_Ecal_EcalCondHandler_
0002 #define _CondTools_Ecal_EcalCondHandler_
0003 
0004 #include "CondCore/PopCon/interface/PopConSourceHandler.h"
0005 #include "CondTools/Ecal/interface/EcalCondHeader.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include <string>
0008 
0009 template <typename Payload, typename XMLTranslator>
0010 class EcalCondHandler : public popcon::PopConSourceHandler<Payload> {
0011 public:
0012   EcalCondHandler(const edm::ParameterSet& ps)
0013       : xmlFileSource_(ps.getUntrackedParameter<std::string>("xmlFile")),
0014         since_(ps.getUntrackedParameter<long long>("since")) {}
0015 
0016   void getNewObjects() override {
0017     EcalCondHeader header;
0018     Payload* payload = new Payload;
0019     XMLTranslator::readXML(xmlFileSource_, header, *payload);
0020     popcon::PopConSourceHandler<Payload>::m_to_transfer.push_back(std::make_pair(payload, since_));
0021   }
0022 
0023   std::string id() const override { return std::string("dummy"); }
0024 
0025 private:
0026   std::string xmlFileSource_;
0027   long long since_;
0028 };
0029 
0030 #endif
0031 
0032 // Configure (x)emacs for this file ...
0033 // Local Variables:
0034 // mode:c++
0035 // compile-command: "scram b"
0036 // End