Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:17

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   static constexpr unsigned int kLumisectionsQueryLimit = 4000;  // enough for fills not exceeding 25h
0022 
0023 private:
0024   void addEmptyPayload(cond::Time_t iov);
0025 
0026   size_t getLumiData(const cond::OMSService& service,
0027                      unsigned short fillId,
0028                      const boost::posix_time::ptime& beginFillTime,
0029                      const boost::posix_time::ptime& endFillTime);
0030   void getDipData(const cond::OMSService& service,
0031                   const boost::posix_time::ptime& beginFillTime,
0032                   const boost::posix_time::ptime& endFillTime);
0033   bool getCTPPSData(cond::persistency::Session& session,
0034                     const boost::posix_time::ptime& beginFillTime,
0035                     const boost::posix_time::ptime& endFillTime);
0036   bool getEcalData(cond::persistency::Session& session,
0037                    const boost::posix_time::ptime& lowerTime,
0038                    const boost::posix_time::ptime& upperTime,
0039                    bool update);
0040 
0041 private:
0042   bool m_debug;
0043   // starting date for sampling
0044   boost::posix_time::ptime m_startTime;
0045   boost::posix_time::ptime m_endTime;
0046   // sampling interval in seconds
0047   unsigned int m_samplingInterval;
0048   bool m_endFill = true;
0049   std::string m_name;
0050   //for reading from relational database source
0051   std::string m_connectionString, m_ecalConnectionString;
0052   std::string m_dipSchema, m_authpath;
0053   std::string m_omsBaseUrl;
0054   std::unique_ptr<LHCInfo> m_fillPayload;
0055   std::shared_ptr<LHCInfo> m_prevPayload;
0056   std::vector<std::pair<cond::Time_t, std::shared_ptr<LHCInfo> > > m_tmpBuffer;
0057   bool m_lastPayloadEmpty = false;
0058 };
0059 
0060 #endif