CMS 3D CMS Logo

Functions | Variables
cond::lhcInfoHelper Namespace Reference

Functions

cond::Time_t getFillLastLumiIOV (const cond::OMSService &oms, unsigned short fillId)
 
std::pair< int, unsigned short > getFillLastRunAndLS (const cond::OMSService &oms, unsigned short fillId)
 

Variables

static constexpr unsigned int kLumisectionsQueryLimit = 4000
 

Function Documentation

◆ getFillLastLumiIOV()

cond::Time_t cond::lhcInfoHelper::getFillLastLumiIOV ( const cond::OMSService oms,
unsigned short  fillId 
)

Definition at line 35 of file LHCInfoHelper.cc.

References getFillLastRunAndLS(), beamSpotPI::lastLumi, PixelBaryCentreAnalyzer_cfg::lastRun, and cond::time::lumiTime().

Referenced by LHCInfoPerFillPopConSourceHandler::getNewObjects().

35  {
36  auto [lastRun, lastLumi] = getFillLastRunAndLS(oms, fillId);
38 }
std::pair< int, unsigned short > getFillLastRunAndLS(const cond::OMSService &oms, unsigned short fillId)
Definition: LHCInfoHelper.cc:9
Time_t lumiTime(unsigned int run, unsigned int lumiId)
Definition: Time.cc:66

◆ getFillLastRunAndLS()

std::pair< int, unsigned short > cond::lhcInfoHelper::getFillLastRunAndLS ( const cond::OMSService oms,
unsigned short  fillId 
)

Definition at line 9 of file LHCInfoHelper.cc.

References Exception, kLumisectionsQueryLimit, beamSpotPI::lastLumi, PixelBaryCentreAnalyzer_cfg::lastRun, and cond::OMSService::query().

Referenced by LHCInfoPerLSPopConSourceHandler::addDefaultPayload(), and getFillLastLumiIOV().

10  {
11  // Define query
12  auto query = oms.query("lumisections");
13  query->addOutputVars({"lumisection_number", "run_number"});
14  query->filterEQ("fill_number", fillId);
16 
17  // Execute query
18  if (!query->execute()) {
19  throw cms::Exception("OMSQueryFailure")
20  << "OMS query of fill " << fillId << " failed, status:" << query->status() << "\n";
21  }
22 
23  // Get query result
24  auto queryResult = query->result();
25  if (queryResult.empty()) {
26  throw cms::Exception("OMSQueryFailure") << "OMS query of fill " << fillId << " returned empty result!\n";
27  }
28 
29  // Return the final IOV
30  auto lastRun = queryResult.back().get<int>("run_number");
31  auto lastLumi = queryResult.back().get<unsigned short>("lumisection_number");
32  return std::make_pair(lastRun, lastLumi);
33 }
std::unique_ptr< OMSServiceQuery > query(const std::string &function) const
Definition: OMSAccess.cc:129
Definition: query.py:1
static constexpr unsigned int kLumisectionsQueryLimit
Definition: LHCInfoHelper.h:12

Variable Documentation

◆ kLumisectionsQueryLimit

constexpr unsigned int cond::lhcInfoHelper::kLumisectionsQueryLimit = 4000
static