Skip to content

Commit

Permalink
Merge pull request #39238 from CTPPS/jc_2nd_fill_skip_fix
Browse files Browse the repository at this point in the history
fixed LHCInfo PopCon skipping fills
  • Loading branch information
rappoccio committed Sep 1, 2022
2 parents 5fb55fe + 4e55f06 commit e3a73ac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CondTools/RunInfo/interface/OMSAccess.h
Expand Up @@ -168,7 +168,9 @@ namespace cond {
static constexpr const char* const NEQ = "NEQ";
static constexpr const char* const EQ = "EQ";
static constexpr const char* const LT = "LT";
static constexpr const char* const LE = "LE";
static constexpr const char* const GT = "GT";
static constexpr const char* const GE = "GE";
static constexpr const char* const SNULL = "null";

public:
Expand Down Expand Up @@ -206,9 +208,17 @@ namespace cond {
return filter<T>(GT, varName, value);
}
template <typename T>
inline OMSServiceQuery& filterGE(const std::string& varName, const T& value) {
return filter<T>(GE, varName, value);
}
template <typename T>
inline OMSServiceQuery& filterLT(const std::string& varName, const T& value) {
return filter<T>(LT, varName, value);
}
template <typename T>
inline OMSServiceQuery& filterLE(const std::string& varName, const T& value) {
return filter<T>(LE, varName, value);
}
// not null filter
inline OMSServiceQuery& filterNotNull(const std::string& varName) { return filterNEQ(varName, SNULL); }

Expand Down
9 changes: 7 additions & 2 deletions CondTools/RunInfo/src/LHCInfoPopConSourceHandler.cc
Expand Up @@ -686,8 +686,13 @@ void LHCInfoPopConSourceHandler::getNewObjects() {
startSampleTime = cond::time::to_boost(lastSince);
} else {
edm::LogInfo(m_name) << "Searching new fill after " << boost::posix_time::to_simple_string(targetTime);
boost::posix_time::ptime startTime = targetTime + boost::posix_time::seconds(1);
query->filterNotNull("start_stable_beam").filterGT("start_time", startTime).filterNotNull("fill_number");
query->filterNotNull("start_stable_beam").filterNotNull("fill_number");
if (targetTime > cond::time::to_boost(m_prevPayload->createTime())) {
query->filterGE("start_time", targetTime);
} else {
query->filterGT("start_time", targetTime);
}

if (m_endFill)
query->filterNotNull("end_time");
bool foundFill = query->execute();
Expand Down

0 comments on commit e3a73ac

Please sign in to comment.