CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/L1TriggerConfig/CSCTFConfigProducers/src/CSCTFObjectKeysOnlineProd.cc

Go to the documentation of this file.
00001 #include "L1TriggerConfig/CSCTFConfigProducers/interface/CSCTFObjectKeysOnlineProd.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 
00004 CSCTFObjectKeysOnlineProd::CSCTFObjectKeysOnlineProd( const edm::ParameterSet& iConfig )
00005   : L1ObjectKeysOnlineProdBase( iConfig ),
00006     m_enableConfiguration( iConfig.getParameter< bool >( "enableConfiguration" ) ),
00007     m_enablePtLut( iConfig.getParameter< bool >( "enablePtLut" ) )
00008 {}
00009 
00010 void CSCTFObjectKeysOnlineProd::fillObjectKeys( ReturnType pL1TriggerKey )
00011 {
00012   std::string csctfKey = pL1TriggerKey->subsystemKey( L1TriggerKey::kCSCTF ) ;
00013 
00014 
00015 
00016   if( !csctfKey.empty() )
00017     {
00018       if( m_enableConfiguration )
00019         {
00020           //----------------------------------------------------------------------------
00021           // register the main CSCTF key
00022           pL1TriggerKey->add( "L1MuCSCTFConfigurationRcd", 
00023                               "L1MuCSCTFConfiguration", 
00024                               csctfKey ) ;
00025           //----------------------------------------------------------------------------
00026         }
00027 
00028       if( m_enablePtLut )
00029         {
00030           //----------------------------------------------------------------------------
00031           // PT LUT
00032           //
00033           // while the sp configuration can change from sector to sector, the pt LUT file 
00034           //loaded in the CSCTF boards is the same for each SP => the same PTLUT_VERSION
00035           // RETRIEVE THE VERSION FROM THE SP1 CONFIGURATION 
00036           //
00037           // e.g., SELECT PTLUT_VERSION FROM CMS_CSC_TF.CSCTF_SP_CONF WHERE CSCTF_SP_CONF.SP_KEY = '1702100001'
00038           // e.g., CSCTF key of the type day/month/year, e.g. 170210 = 17th February 2010
00039           std::string sp1key = csctfKey + "0001";
00040 
00041           // query
00042           l1t::OMDSReader::QueryResults objectKeyResults =
00043             m_omdsReader.basicQuery(
00044                                     "PTLUT_VERSION",
00045                                     "CMS_CSC_TF",
00046                                     "CSCTF_SP_CONF",
00047                                     "CSCTF_SP_CONF.SP_KEY",
00048                                     m_omdsReader.singleAttribute( sp1key  ) );
00049 
00050           // check if query was successful
00051           if( objectKeyResults.queryFailed() || objectKeyResults.numberRows() != 1 ) 
00052             {
00053               edm::LogError( "L1-O2O" ) << "Problem with CSCTF key while retrieving "
00054                                         << "the PTLUT_VERSION" ;
00055               return ;
00056             }
00057          
00058           // register the pt LUT key
00059           std::string ptLutKey;
00060           objectKeyResults.fillVariable( ptLutKey ) ;
00061           pL1TriggerKey->add( "L1MuCSCPtLutRcd", "L1MuCSCPtLut", ptLutKey ) ;
00062           //----------------------------------------------------------------------------
00063         }
00064     }
00065 }
00066