Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:02

0001 #include "L1TriggerConfig/CSCTFConfigProducers/interface/CSCTFAlignmentOnlineProd.h"
0002 
0003 std::unique_ptr<L1MuCSCTFAlignment> CSCTFAlignmentOnlineProd::newObject(const std::string& objectKey) {
0004   // Execute SQL queries to get data from OMDS (using key) and make C++ object
0005 
0006   //  SELECT Multiple columns  FROM TABLE with correct key:
0007   std::vector<std::string> columns;
0008   columns.push_back("ALIPAR1");
0009   columns.push_back("ALIPAR2");
0010   columns.push_back("ALIPAR3");
0011   columns.push_back("ALIPAR4");
0012   columns.push_back("ALIPAR5");
0013   columns.push_back("ALIPAR6");
0014   columns.push_back("ALIPAR7");
0015   columns.push_back("ALIPAR8");
0016   columns.push_back("ALIPAR9");
0017   columns.push_back("ALIPAR10");
0018   columns.push_back("ALIPAR11");
0019   columns.push_back("ALIPAR12");
0020   columns.push_back("ALIPAR13");
0021   columns.push_back("ALIPAR14");
0022   columns.push_back("ALIPAR15");
0023   columns.push_back("ALIPAR16");
0024 
0025   l1t::OMDSReader::QueryResults results = m_omdsReader.basicQuery(columns,
0026                                                                   "CMS_CSC_TF",
0027                                                                   "CSCTF_ALIGN_PARAM",
0028                                                                   "CSCTF_ALIGN_PARAM.ALIGN_KEY",
0029                                                                   m_omdsReader.singleAttribute(objectKey));
0030 
0031   if (results.queryFailed())  // check if query was successful
0032   {
0033     edm::LogError("L1-O2O") << "Problem with CSCTF_ALIGN_PARAM query.";
0034     return std::make_unique<L1MuCSCTFAlignment>();
0035   }
0036 
0037   // oracle doesn't support double so some tweaks
0038   //    float datum ;
0039   std::vector<float> par_align;
0040   std::vector<double> par_align_double;
0041   results.fillVariable("ALIPAR1", par_align[0]);
0042   results.fillVariable("ALIPAR2", par_align[1]);
0043   results.fillVariable("ALIPAR3", par_align[2]);
0044   results.fillVariable("ALIPAR4", par_align[3]);
0045   results.fillVariable("ALIPAR5", par_align[4]);
0046   results.fillVariable("ALIPAR6", par_align[5]);
0047   results.fillVariable("ALIPAR7", par_align[6]);
0048   results.fillVariable("ALIPAR8", par_align[7]);
0049   results.fillVariable("ALIPAR9", par_align[8]);
0050   results.fillVariable("ALIPAR10", par_align[9]);
0051   results.fillVariable("ALIPAR11", par_align[10]);
0052   results.fillVariable("ALIPAR12", par_align[11]);
0053   results.fillVariable("ALIPAR13", par_align[12]);
0054   results.fillVariable("ALIPAR14", par_align[13]);
0055   results.fillVariable("ALIPAR15", par_align[14]);
0056   results.fillVariable("ALIPAR16", par_align[15]);
0057 
0058   //   std::cout<<conf_stat<<std::endl;
0059   for (int i = 0; i < 16; i++) {
0060     edm::LogInfo("algn_par queried") << par_align[i];
0061     par_align_double[i] = par_align[i];
0062   }
0063   return std::make_unique<L1MuCSCTFAlignment>(par_align_double);
0064 }