6 boost::posix_time::ptime parseTimeFromIsoString(
const std::string& isoString) {
7 boost::posix_time::time_input_facet* tif =
new boost::posix_time::time_input_facet;
8 tif->set_iso_extended_format();
9 std::istringstream iss(isoString);
10 iss.imbue(std::locale(std::locale::classic(), tif));
11 boost::posix_time::ptime
ret;
16 void getRunTimeParams(
const RunInfo&
runInfo, boost::posix_time::ptime&
start, boost::posix_time::ptime&
end) {
18 if (startStr !=
"null") {
19 start = parseTimeFromIsoString(startStr);
23 if (stopStr !=
"null") {
24 end = parseTimeFromIsoString(stopStr);
35 boost::posix_time::ptime
start;
36 boost::posix_time::ptime
end;
37 getRunTimeParams(runInfo, start, end);
38 edm::LogInfo(
"RunInfoUpdate") <<
"[RunInfoUpdate::" << __func__ <<
"]: Checking run " << runInfo.
m_run
39 <<
" for insertion in Condition DB" << std::endl;
41 size_t newRuns = runInfoWriter.
flush();
42 edm::LogInfo(
"RunInfoUpdate") <<
"[RunInfoUpdate::" << __func__ <<
"]: " << newRuns <<
" new run(s) inserted."
51 std::cout <<
"# Loading tag " << sourceTag <<
"..." << std::endl;
56 std::cout <<
"# Last run found in RunInfo db : " << lastRun << std::endl;
57 auto it =
iovs.begin();
59 it =
iovs.find(lastRun + 1);
62 std::cout <<
"# No more run found to be imported." << std::endl;
66 while (it !=
iovs.end() && n_entries <= maxEntries) {
67 auto h = (*it).payloadId;
69 if (runInfo->m_run != -1) {
71 std::cout <<
"# Inserting run #" << runInfo->m_run <<
" (from since=" << (*it).since <<
")" << std::endl;
72 boost::posix_time::ptime
start;
73 boost::posix_time::ptime
end;
74 getRunTimeParams(*runInfo, start, end);
75 editor.
insert(runInfo->m_run, start, end);
77 std::cout <<
"# Skipping fake run #" << std::endl;
RunInfoUpdate(cond::persistency::Session &dbSession)
void insert(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end)
tuple ret
prodAgent to be discontinued
RunInfoEditor editRunInfo()
void insertNew(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end)
size_t import(size_t maxEntries, const std::string &tag, cond::persistency::Session &sourceSession)
std::unique_ptr< T > fetchPayload(const cond::Hash &payloadHash)
unsigned long long Time_t
std::string m_start_time_str
void appendNewRun(const RunInfo &run)
IOVProxy readIov(const std::string &tag)
Log< level::Info, false > LogInfo
cond::persistency::Session & m_dbSession
std::string m_stop_time_str
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
cond::Time_t getLastInserted()