CMS 3D CMS Logo

CSCTFAlignmentOnlineProd.cc
Go to the documentation of this file.
2 
3 std::unique_ptr<L1MuCSCTFAlignment> CSCTFAlignmentOnlineProd::newObject(const std::string& objectKey) {
4  // Execute SQL queries to get data from OMDS (using key) and make C++ object
5 
6  // SELECT Multiple columns FROM TABLE with correct key:
7  std::vector<std::string> columns;
8  columns.push_back("ALIPAR1");
9  columns.push_back("ALIPAR2");
10  columns.push_back("ALIPAR3");
11  columns.push_back("ALIPAR4");
12  columns.push_back("ALIPAR5");
13  columns.push_back("ALIPAR6");
14  columns.push_back("ALIPAR7");
15  columns.push_back("ALIPAR8");
16  columns.push_back("ALIPAR9");
17  columns.push_back("ALIPAR10");
18  columns.push_back("ALIPAR11");
19  columns.push_back("ALIPAR12");
20  columns.push_back("ALIPAR13");
21  columns.push_back("ALIPAR14");
22  columns.push_back("ALIPAR15");
23  columns.push_back("ALIPAR16");
24 
26  "CMS_CSC_TF",
27  "CSCTF_ALIGN_PARAM",
28  "CSCTF_ALIGN_PARAM.ALIGN_KEY",
29  m_omdsReader.singleAttribute(objectKey));
30 
31  if (results.queryFailed()) // check if query was successful
32  {
33  edm::LogError("L1-O2O") << "Problem with CSCTF_ALIGN_PARAM query.";
34  return std::make_unique<L1MuCSCTFAlignment>();
35  }
36 
37  // oracle doesn't support double so some tweaks
38  // float datum ;
39  std::vector<float> par_align;
40  std::vector<double> par_align_double;
41  results.fillVariable("ALIPAR1", par_align[0]);
42  results.fillVariable("ALIPAR2", par_align[1]);
43  results.fillVariable("ALIPAR3", par_align[2]);
44  results.fillVariable("ALIPAR4", par_align[3]);
45  results.fillVariable("ALIPAR5", par_align[4]);
46  results.fillVariable("ALIPAR6", par_align[5]);
47  results.fillVariable("ALIPAR7", par_align[6]);
48  results.fillVariable("ALIPAR8", par_align[7]);
49  results.fillVariable("ALIPAR9", par_align[8]);
50  results.fillVariable("ALIPAR10", par_align[9]);
51  results.fillVariable("ALIPAR11", par_align[10]);
52  results.fillVariable("ALIPAR12", par_align[11]);
53  results.fillVariable("ALIPAR13", par_align[12]);
54  results.fillVariable("ALIPAR14", par_align[13]);
55  results.fillVariable("ALIPAR15", par_align[14]);
56  results.fillVariable("ALIPAR16", par_align[15]);
57 
58  // std::cout<<conf_stat<<std::endl;
59  for (int i = 0; i < 16; i++) {
60  edm::LogInfo("algn_par queried") << par_align[i];
61  par_align_double[i] = par_align[i];
62  }
63  return std::make_unique<L1MuCSCTFAlignment>(par_align_double);
64 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
Log< level::Error, false > LogError
std::unique_ptr< L1MuCSCTFAlignment > newObject(const std::string &objectKey) override
const QueryResults basicQuery(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &tableName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:75
Log< level::Info, false > LogInfo
results
Definition: mysort.py:8