CMS 3D CMS Logo

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