CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/L1TriggerConfig/CSCTFConfigProducers/src/CSCTFAlignmentOnlineProd.cc

Go to the documentation of this file.
00001 #include "L1TriggerConfig/CSCTFConfigProducers/interface/CSCTFAlignmentOnlineProd.h"
00002 
00003 boost::shared_ptr< L1MuCSCTFAlignment >
00004 CSCTFAlignmentOnlineProd::newObject( const std::string& objectKey )
00005 {
00006    // Execute SQL queries to get data from OMDS (using key) and make C++ object
00007   
00008      //  SELECT Multiple columns  FROM TABLE with correct key: 
00009      std::vector< std::string > columns ;
00010      columns.push_back( "ALIPAR1" ) ;
00011      columns.push_back( "ALIPAR2" ) ;
00012      columns.push_back( "ALIPAR3" ) ;
00013      columns.push_back( "ALIPAR4" ) ;
00014      columns.push_back( "ALIPAR5" ) ;
00015      columns.push_back( "ALIPAR6" ) ;
00016      columns.push_back( "ALIPAR7" ) ;
00017      columns.push_back( "ALIPAR8" ) ;
00018      columns.push_back( "ALIPAR9" ) ;
00019      columns.push_back( "ALIPAR10" ) ;
00020      columns.push_back( "ALIPAR11" ) ;
00021      columns.push_back( "ALIPAR12" ) ;
00022      columns.push_back( "ALIPAR13" ) ;
00023      columns.push_back( "ALIPAR14" ) ;
00024      columns.push_back( "ALIPAR15" ) ;
00025      columns.push_back( "ALIPAR16" ) ;
00026 
00027      l1t::OMDSReader::QueryResults results = m_omdsReader.basicQuery(
00028           columns,
00029          "CMS_CSC_TF",
00030           "CSCTF_ALIGN_PARAM",
00031           "CSCTF_ALIGN_PARAM.ALIGN_KEY",
00032           m_omdsReader.singleAttribute( objectKey )
00033           ) ;
00034 
00035    if( results.queryFailed() ) // check if query was successful
00036    {
00037       edm::LogError( "L1-O2O" ) << "Problem with CSCTF_ALIGN_PARAM query." ;
00038       return boost::shared_ptr< L1MuCSCTFAlignment >( new L1MuCSCTFAlignment( ) ) ;
00039    }
00040 
00041 // oracle doesn't support double so some tweaks
00042 //    float datum ;
00043    std::vector<float>  par_align;
00044    std::vector<double>  par_align_double;
00045    results.fillVariable( "ALIPAR1", par_align[0] ) ;
00046    results.fillVariable( "ALIPAR2", par_align[1] ) ;
00047    results.fillVariable( "ALIPAR3", par_align[2] ) ;
00048    results.fillVariable( "ALIPAR4", par_align[3] ) ;
00049    results.fillVariable( "ALIPAR5", par_align[4] ) ;
00050    results.fillVariable( "ALIPAR6", par_align[5] ) ;
00051    results.fillVariable( "ALIPAR7", par_align[6] ) ;
00052    results.fillVariable( "ALIPAR8", par_align[7] ) ;
00053    results.fillVariable( "ALIPAR9", par_align[8] ) ;
00054    results.fillVariable( "ALIPAR10", par_align[9] ) ;
00055    results.fillVariable( "ALIPAR11", par_align[10] ) ;
00056    results.fillVariable( "ALIPAR12", par_align[11] ) ;
00057    results.fillVariable( "ALIPAR13", par_align[12] ) ;
00058    results.fillVariable( "ALIPAR14", par_align[13] ) ;
00059    results.fillVariable( "ALIPAR15", par_align[14] ) ;
00060    results.fillVariable( "ALIPAR16", par_align[15] ) ;
00061 
00062 
00063 
00064 //   std::cout<<conf_stat<<std::endl;
00065    for (int i=0;i<16;i++) {
00066         edm::LogInfo( "algn_par queried" ) << par_align[i] ;
00067         par_align_double[i]=par_align[i] ;
00068    }
00069    return boost::shared_ptr< L1MuCSCTFAlignment >( new L1MuCSCTFAlignment(par_align_double) ) ;
00070 }
00071 
00072