File indexing completed on 2024-11-07 06:12:39
0001 #include "CondCore/PopCon/interface/PopConSourceHandler.h"
0002 #include "CondFormats/RunInfo/interface/LHCInfoPerFill.h"
0003 #include "CondTools/RunInfo/interface/OMSAccess.h"
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005
0006 class LHCInfoPerFillPopConSourceHandler : public popcon::PopConSourceHandler<LHCInfoPerFill> {
0007 public:
0008 LHCInfoPerFillPopConSourceHandler(edm::ParameterSet const& pset);
0009 ~LHCInfoPerFillPopConSourceHandler() override = default;
0010
0011 void getNewObjects() override;
0012 std::string id() const override;
0013
0014 private:
0015 void addEmptyPayload(cond::Time_t iov);
0016
0017
0018 void addPayloadToBuffer(cond::OMSServiceResultRef& row);
0019 void convertBufferedIovsToLumiid(std::map<cond::Time_t, cond::Time_t> timestampToLumiid);
0020
0021 size_t getLumiData(const cond::OMSService& oms,
0022 unsigned short fillId,
0023 const boost::posix_time::ptime& beginFillTime,
0024 const boost::posix_time::ptime& endFillTime);
0025
0026 void getDipData(const cond::OMSService& oms,
0027 const boost::posix_time::ptime& beginFillTime,
0028 const boost::posix_time::ptime& endFillTime);
0029
0030 bool getCTPPSData(cond::persistency::Session& session,
0031 const boost::posix_time::ptime& beginFillTime,
0032 const boost::posix_time::ptime& endFillTime);
0033
0034 bool getEcalData(cond::persistency::Session& session,
0035 const boost::posix_time::ptime& lowerTime,
0036 const boost::posix_time::ptime& upperTime);
0037
0038 private:
0039 bool m_debug;
0040
0041 boost::posix_time::ptime m_startTime;
0042 boost::posix_time::ptime m_endTime;
0043 bool m_endFillMode = true;
0044 std::string m_name;
0045
0046 std::string m_connectionString, m_ecalConnectionString;
0047 std::string m_authpath;
0048 std::string m_omsBaseUrl;
0049 std::unique_ptr<LHCInfoPerFill> m_fillPayload;
0050 std::shared_ptr<LHCInfoPerFill> m_prevPayload;
0051 std::vector<std::pair<cond::Time_t, std::shared_ptr<LHCInfoPerFill>>> m_tmpBuffer;
0052 bool m_lastPayloadEmpty = false;
0053
0054 std::map<cond::Time_t, cond::Time_t> m_timestampToLumiid;
0055 };