Skip to content

Commit

Permalink
Merge pull request #42888 from CTPPS/132X_LHCInfoPerLS_PopCon_IOV_mis…
Browse files Browse the repository at this point in the history
…alignment_fix_and_duringFill_fix

[13_2_X] Fix LHCInfoPerLS PopCon incorrectly matching LS between OMS and PPS db and fix LHCInfoPer* PopCons not recoginizing ongoing fills in duringFill mode
  • Loading branch information
cmsbuild authored Oct 9, 2023
2 parents c5404da + 1a1b777 commit f23a227
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 69 deletions.
2 changes: 1 addition & 1 deletion CondTools/RunInfo/interface/LHCInfoPopConSourceHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LHCInfoPopConSourceHandler : public popcon::PopConSourceHandler<LHCInfo> {
void getDipData(const cond::OMSService& service,
const boost::posix_time::ptime& beginFillTime,
const boost::posix_time::ptime& endFillTime);
bool getCTTPSData(cond::persistency::Session& session,
bool getCTPPSData(cond::persistency::Session& session,
const boost::posix_time::ptime& beginFillTime,
const boost::posix_time::ptime& endFillTime);
bool getEcalData(cond::persistency::Session& session,
Expand Down
10 changes: 6 additions & 4 deletions CondTools/RunInfo/plugins/LHCInfoPerFillPopConAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ namespace theLHCInfoPerFillImpl {
auto energy = row.get<float>("energy");
auto creationTime = row.get<boost::posix_time::ptime>("start_time");
auto stableBeamStartTime = row.get<boost::posix_time::ptime>("start_stable_beam");
auto beamDumpTime = row.get<boost::posix_time::ptime>("end_time");
std::string endTimeStr = row.get<std::string>("end_time");
auto beamDumpTime =
(endTimeStr == "null") ? 0 : cond::time::from_boost(row.get<boost::posix_time::ptime>("end_time"));
auto injectionScheme = row.get<std::string>("injection_scheme");
targetPayload = std::make_unique<LHCInfoPerFill>();
targetPayload->setFillNumber(currentFill);
Expand All @@ -114,7 +116,7 @@ namespace theLHCInfoPerFillImpl {
targetPayload->setEnergy(energy);
targetPayload->setCreationTime(cond::time::from_boost(creationTime));
targetPayload->setBeginTime(cond::time::from_boost(stableBeamStartTime));
targetPayload->setEndTime(cond::time::from_boost(beamDumpTime));
targetPayload->setEndTime(beamDumpTime);
targetPayload->setInjectionScheme(injectionScheme);
ret = true;
}
Expand Down Expand Up @@ -354,7 +356,7 @@ class LHCInfoPerFillPopConSourceHandler : public popcon::PopConSourceHandler<LHC
boost::posix_time::ptime flumiStop = cond::time::to_boost(m_tmpBuffer.back().first);
edm::LogInfo(m_name) << "First lumi starts at " << flumiStart << " last lumi starts at " << flumiStop;
session.transaction().start(true);
getCTTPSData(session, startSampleTime, endSampleTime);
getCTPPSData(session, startSampleTime, endSampleTime);
session.transaction().commit();
session2.transaction().start(true);
getEcalData(session2, startSampleTime, endSampleTime, updateEcal);
Expand Down Expand Up @@ -497,7 +499,7 @@ class LHCInfoPerFillPopConSourceHandler : public popcon::PopConSourceHandler<LHC
}
}

bool getCTTPSData(cond::persistency::Session& session,
bool getCTPPSData(cond::persistency::Session& session,
const boost::posix_time::ptime& beginFillTime,
const boost::posix_time::ptime& endFillTime) {
//run the fifth query against the CTPPS schema
Expand Down
Loading

0 comments on commit f23a227

Please sign in to comment.