diff --git a/CondTools/RunInfo/plugins/LHCInfoPerFillPopConAnalyzer.cc b/CondTools/RunInfo/plugins/LHCInfoPerFillPopConAnalyzer.cc index 9fa6e7642d681..c87e36815e557 100644 --- a/CondTools/RunInfo/plugins/LHCInfoPerFillPopConAnalyzer.cc +++ b/CondTools/RunInfo/plugins/LHCInfoPerFillPopConAnalyzer.cc @@ -205,12 +205,10 @@ class LHCInfoPerFillPopConSourceHandler : public popcon::PopConSourceHandler("debug", false)), m_startTime(), m_endTime(), - m_samplingInterval((unsigned int)pset.getUntrackedParameter("samplingInterval", 300)), m_endFillMode(pset.getUntrackedParameter("endFill", true)), m_name(pset.getUntrackedParameter("name", "LHCInfoPerFillPopConSourceHandler")), m_connectionString(pset.getUntrackedParameter("connectionString", "")), m_ecalConnectionString(pset.getUntrackedParameter("ecalConnectionString", "")), - m_dipSchema(pset.getUntrackedParameter("DIPSchema", "")), m_authpath(pset.getUntrackedParameter("authenticationPath", "")), m_omsBaseUrl(pset.getUntrackedParameter("omsBaseUrl", "")), m_fillPayload(), @@ -227,13 +225,10 @@ class LHCInfoPerFillPopConSourceHandler : public popcon::PopConSourceHandler targetSince) - targetSince = lastSince; - - edm::LogInfo(m_name) << "Starting sampling at " - << boost::posix_time::to_simple_string(cond::time::to_boost(targetSince)); - //retrieve the data from the relational database source cond::persistency::ConnectionPool connection; //configure the connection @@ -294,14 +277,23 @@ class LHCInfoPerFillPopConSourceHandler : public popcon::PopConSourceHandlercreateTime()); + + edm::LogInfo(m_name) << "Starting sampling at " + << boost::posix_time::to_simple_string(cond::time::to_boost(nextFillSearchTimestamp)); + while (true) { - if (targetSince >= executionTimeIov) { + if (nextFillSearchTimestamp >= executionTimeIov) { edm::LogInfo(m_name) << "Sampling ended at the time " << boost::posix_time::to_simple_string(cond::time::to_boost(executionTimeIov)); break; } - bool updateEcal = false; - boost::posix_time::ptime targetTime = cond::time::to_boost(targetSince); + boost::posix_time::ptime nextFillSearchTime = cond::time::to_boost(nextFillSearchTimestamp); boost::posix_time::ptime startSampleTime; boost::posix_time::ptime endSampleTime; @@ -309,12 +301,12 @@ class LHCInfoPerFillPopConSourceHandler : public popcon::PopConSourceHandlerfilterNotNull("start_stable_beam").filterNotNull("fill_number"); - if (targetTime > cond::time::to_boost(m_prevPayload->createTime())) { - query->filterGE("start_time", targetTime); + if (nextFillSearchTime > cond::time::to_boost(m_prevPayload->createTime())) { + query->filterGE("start_time", nextFillSearchTime); } else { - query->filterGT("start_time", targetTime); + query->filterGT("start_time", nextFillSearchTime); } query->filterLT("start_time", m_endTime); @@ -337,12 +329,12 @@ class LHCInfoPerFillPopConSourceHandler : public popcon::PopConSourceHandlerfirst, dipVal, elementNr, value, payload, initializedVectors); } } - //} } } } @@ -748,13 +738,11 @@ class LHCInfoPerFillPopConSourceHandler : public popcon::PopConSourceHandler m_fillPayload; std::shared_ptr m_prevPayload; diff --git a/CondTools/RunInfo/plugins/LHCInfoPerLSPopConAnalyzer.cc b/CondTools/RunInfo/plugins/LHCInfoPerLSPopConAnalyzer.cc index 992a6183b53b5..dc5fe9b298c8e 100644 --- a/CondTools/RunInfo/plugins/LHCInfoPerLSPopConAnalyzer.cc +++ b/CondTools/RunInfo/plugins/LHCInfoPerLSPopConAnalyzer.cc @@ -119,17 +119,16 @@ namespace theLHCInfoPerLSImpl { } } // namespace theLHCInfoPerLSImpl + class LHCInfoPerLSPopConSourceHandler : public popcon::PopConSourceHandler { public: LHCInfoPerLSPopConSourceHandler(edm::ParameterSet const& pset) : m_debug(pset.getUntrackedParameter("debug", false)), m_startTime(), m_endTime(), - m_samplingInterval((unsigned int)pset.getUntrackedParameter("samplingInterval", 300)), m_endFillMode(pset.getUntrackedParameter("endFill", true)), m_name(pset.getUntrackedParameter("name", "LHCInfoPerLSPopConSourceHandler")), m_connectionString(pset.getUntrackedParameter("connectionString", "")), - m_dipSchema(pset.getUntrackedParameter("DIPSchema", "")), m_authpath(pset.getUntrackedParameter("authenticationPath", "")), m_omsBaseUrl(pset.getUntrackedParameter("omsBaseUrl", "")), m_fillPayload(), @@ -146,9 +145,9 @@ class LHCInfoPerLSPopConSourceHandler : public popcon::PopConSourceHandler targetSince) - targetSince = lastSince; - - edm::LogInfo(m_name) << "Starting sampling at " - << boost::posix_time::to_simple_string(cond::time::to_boost(targetSince)); - //retrieve the data from the relational database source cond::persistency::ConnectionPool connection; //configure the connection @@ -241,13 +228,22 @@ class LHCInfoPerLSPopConSourceHandler : public popcon::PopConSourceHandler= executionTimeIov) { + if (nextFillSearchTimestamp >= executionTimeIov) { edm::LogInfo(m_name) << "Sampling ended at the time " << boost::posix_time::to_simple_string(cond::time::to_boost(executionTimeIov)); break; } - boost::posix_time::ptime targetTime = cond::time::to_boost(targetSince); + boost::posix_time::ptime nextFillSearchTime = cond::time::to_boost(nextFillSearchTimestamp); boost::posix_time::ptime startSampleTime; boost::posix_time::ptime endSampleTime; @@ -268,12 +264,12 @@ class LHCInfoPerLSPopConSourceHandler : public popcon::PopConSourceHandlerfilterNotNull("start_stable_beam").filterNotNull("fill_number"); - if (targetTime > cond::time::to_boost(m_prevStartFillTime)) { - query->filterGE("start_time", targetTime); + if (nextFillSearchTime > cond::time::to_boost(m_prevStartFillTime)) { + query->filterGE("start_time", nextFillSearchTime); } else { - query->filterGT("start_time", targetTime); + query->filterGT("start_time", nextFillSearchTime); } query->filterLT("start_time", m_endTime); @@ -295,12 +291,12 @@ class LHCInfoPerLSPopConSourceHandler : public popcon::PopConSourceHandler m_fillPayload; std::shared_ptr m_prevPayload; diff --git a/CondTools/RunInfo/python/LHCInfoPerFillPopConAnalyzer.py b/CondTools/RunInfo/python/LHCInfoPerFillPopConAnalyzer.py index 3cd88075c7e8c..d71362ecebfa8 100644 --- a/CondTools/RunInfo/python/LHCInfoPerFillPopConAnalyzer.py +++ b/CondTools/RunInfo/python/LHCInfoPerFillPopConAnalyzer.py @@ -103,12 +103,10 @@ Source = cms.PSet(fill = cms.untracked.uint32(6417), startTime = cms.untracked.string(options.startTime), endTime = cms.untracked.string(options.endTime), - samplingInterval = cms.untracked.uint32( 600 ), endFill = cms.untracked.bool(True if options.mode == "endFill" else False), name = cms.untracked.string("LHCInfoPerFillPopConSourceHandler"), connectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_RUNTIME_LOGGER"), ecalConnectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_DCS_ENV_PVSS_COND"), - DIPSchema = cms.untracked.string("CMS_BEAM_COND"), omsBaseUrl = cms.untracked.string("http://vocms0184.cern.ch/agg/api/v1"), authenticationPath = cms.untracked.string(""), debug=cms.untracked.bool(False) diff --git a/CondTools/RunInfo/python/LHCInfoPerLSPopConAnalyzer.py b/CondTools/RunInfo/python/LHCInfoPerLSPopConAnalyzer.py index c015f9bf2198a..603c7f514d4ee 100644 --- a/CondTools/RunInfo/python/LHCInfoPerLSPopConAnalyzer.py +++ b/CondTools/RunInfo/python/LHCInfoPerLSPopConAnalyzer.py @@ -103,11 +103,9 @@ Source = cms.PSet(fill = cms.untracked.uint32(6417), startTime = cms.untracked.string(options.startTime), endTime = cms.untracked.string(options.endTime), - samplingInterval = cms.untracked.uint32( 600 ), endFill = cms.untracked.bool(True if options.mode == "endFill" else False), name = cms.untracked.string("LHCInfoPerLSPopConSourceHandler"), connectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_RUNTIME_LOGGER"), - DIPSchema = cms.untracked.string("CMS_BEAM_COND"), omsBaseUrl = cms.untracked.string("http://vocms0184.cern.ch/agg/api/v1"), authenticationPath = cms.untracked.string(""), debug=cms.untracked.bool(False)