Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-19 05:08:16

0001 #ifndef LHCINFOPOPCONSOURCEHANDLER_H
0002 #define LHCINFOPOPCONSOURCEHANDLER_H
0003 
0004 #include <string>
0005 
0006 #include "CondCore/PopCon/interface/PopConSourceHandler.h"
0007 #include "CondFormats/RunInfo/interface/LHCInfo.h"
0008 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0009 
0010 namespace cond {
0011   class OMSService;
0012 }
0013 
0014 class LHCInfoPopConSourceHandler : public popcon::PopConSourceHandler<LHCInfo> {
0015 public:
0016   LHCInfoPopConSourceHandler(const edm::ParameterSet& pset);
0017   ~LHCInfoPopConSourceHandler() override;
0018   void getNewObjects() override;
0019   std::string id() const override;
0020 
0021 private:
0022   void addEmptyPayload(cond::Time_t iov);
0023 
0024   size_t getLumiData(const cond::OMSService& service,
0025                      unsigned short fillId,
0026                      const boost::posix_time::ptime& beginFillTime,
0027                      const boost::posix_time::ptime& endFillTime);
0028   void getDipData(const cond::OMSService& service,
0029                   const boost::posix_time::ptime& beginFillTime,
0030                   const boost::posix_time::ptime& endFillTime);
0031   bool getCTTPSData(cond::persistency::Session& session,
0032                     const boost::posix_time::ptime& beginFillTime,
0033                     const boost::posix_time::ptime& endFillTime);
0034   bool getEcalData(cond::persistency::Session& session,
0035                    const boost::posix_time::ptime& lowerTime,
0036                    const boost::posix_time::ptime& upperTime,
0037                    bool update);
0038 
0039 private:
0040   bool m_debug;
0041   // starting date for sampling
0042   boost::posix_time::ptime m_startTime;
0043   boost::posix_time::ptime m_endTime;
0044   // sampling interval in seconds
0045   unsigned int m_samplingInterval;
0046   bool m_endFill = true;
0047   std::string m_name;
0048   //for reading from relational database source
0049   std::string m_connectionString, m_ecalConnectionString;
0050   std::string m_dipSchema, m_authpath;
0051   std::string m_omsBaseUrl;
0052   std::unique_ptr<LHCInfo> m_fillPayload;
0053   std::shared_ptr<LHCInfo> m_prevPayload;
0054   std::vector<std::pair<cond::Time_t, std::shared_ptr<LHCInfo> > > m_tmpBuffer;
0055   bool m_lastPayloadEmpty = false;
0056 };
0057 
0058 #endif