-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix LHCInfoPer* PopCons to produce lumi type IOVs when running in dur…
…ingFill mode
- Loading branch information
1 parent
c4e1915
commit b33550a
Showing
6 changed files
with
112 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef CondTools_RunInfo_LHCInfoHelper_h | ||
#define CondTools_RunInfo_LHCInfoHelper_h | ||
|
||
#include "CondCore/CondDB/interface/Time.h" | ||
#include "CondTools/RunInfo/interface/OMSAccess.h" | ||
|
||
namespace cond { | ||
|
||
namespace lhcInfoHelper { | ||
|
||
// Large number of LS for the OMS query, covering around 25 hours | ||
static constexpr unsigned int kLumisectionsQueryLimit = 4000; | ||
|
||
// Returns lumi-type IOV from last LS of last Run of the specified Fill | ||
cond::Time_t getFillLastLumiIOV(const cond::OMSService& oms, unsigned short fillId); | ||
|
||
} // namespace lhcInfoHelper | ||
|
||
} // namespace cond | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "CondTools/RunInfo/interface/LHCInfoHelper.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
|
||
//***************************************************************** | ||
// Returns lumi-type IOV (packed using cond::time::lumiTime) from | ||
// last LS of last Run of the specified Fill | ||
//***************************************************************** | ||
cond::Time_t cond::lhcInfoHelper::getFillLastLumiIOV(const cond::OMSService& oms, unsigned short fillId) { | ||
// Define query | ||
auto query = oms.query("lumisections"); | ||
query->addOutputVars({"lumisection_number", "run_number"}); | ||
query->filterEQ("fill_number", fillId); | ||
query->limit(cond::lhcInfoHelper::kLumisectionsQueryLimit); | ||
|
||
// Execute query | ||
if (!query->execute()) { | ||
throw cms::Exception("OMSQueryFailure") | ||
<< "OMS query of fill " << fillId << " failed, status:" << query->status() << "\n"; | ||
} | ||
|
||
// Get query result | ||
auto queryResult = query->result(); | ||
if (queryResult.empty()) | ||
throw cms::Exception("OMSQueryFailure") << "OMS query of fill " << fillId << " returned empty result!\n"; | ||
|
||
// Return the final IOV | ||
auto lastRun = queryResult.back().get<int>("run_number"); | ||
auto lastLumi = queryResult.back().get<unsigned short>("lumisection_number"); | ||
return cond::time::lumiTime(lastRun, lastLumi); | ||
} |