CMS 3D CMS Logo

LHCInfoHelper.cc
Go to the documentation of this file.
3 
4 //*****************************************************************
5 // Returns lumi-type IOV (packed using cond::time::lumiTime) from
6 // last LS of last Run of the specified Fill
7 //*****************************************************************
9  // Define query
10  auto query = oms.query("lumisections");
11  query->addOutputVars({"lumisection_number", "run_number"});
12  query->filterEQ("fill_number", fillId);
14 
15  // Execute query
16  if (!query->execute()) {
17  throw cms::Exception("OMSQueryFailure")
18  << "OMS query of fill " << fillId << " failed, status:" << query->status() << "\n";
19  }
20 
21  // Get query result
22  auto queryResult = query->result();
23  if (queryResult.empty()) {
24  throw cms::Exception("OMSQueryFailure") << "OMS query of fill " << fillId << " returned empty result!\n";
25  }
26 
27  // Return the final IOV
28  auto lastRun = queryResult.back().get<int>("run_number");
29  auto lastLumi = queryResult.back().get<unsigned short>("lumisection_number");
31 }
std::unique_ptr< OMSServiceQuery > query(const std::string &function) const
Definition: OMSAccess.cc:129
Definition: query.py:1
unsigned long long Time_t
Definition: Time.h:14
Time_t lumiTime(unsigned int run, unsigned int lumiId)
Definition: Time.cc:66
static constexpr unsigned int kLumisectionsQueryLimit
Definition: LHCInfoHelper.h:12
cond::Time_t getFillLastLumiIOV(const cond::OMSService &oms, unsigned short fillId)
Definition: LHCInfoHelper.cc:8