CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/L1TriggerConfig/GctConfigProducers/src/L1GctTSCObjectKeysOnlineProd.cc

Go to the documentation of this file.
00001 #include "CondTools/L1Trigger/interface/L1ObjectKeysOnlineProdBase.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 
00004 class L1GctTSCObjectKeysOnlineProd : public L1ObjectKeysOnlineProdBase {
00005    public:
00006       L1GctTSCObjectKeysOnlineProd(const edm::ParameterSet& iConfig)
00007          : L1ObjectKeysOnlineProdBase( iConfig ) {}
00008       ~L1GctTSCObjectKeysOnlineProd() {}
00009 
00010       virtual void fillObjectKeys( ReturnType pL1TriggerKey ) ;
00011    private:
00012 };
00013 
00014 void
00015 L1GctTSCObjectKeysOnlineProd::fillObjectKeys( ReturnType pL1TriggerKey )
00016 {
00017       // kMYSUBSYSTEM = kCSCTF, kDTTF, kRPC, kGMT, kRCT, kGCT, kGT, or kTSP0
00018       // subsystemKey = TRIGGERSUP_CONF.{CSCTF_KEY, DTTF_KEY, RPC_KEY, GMT_KEY, RCT_KEY, GCT_KEY, GT_KEY}
00019       std::string subsystemKey = pL1TriggerKey->subsystemKey( L1TriggerKey::kGCT ) ;
00020 
00021       if( !subsystemKey.empty() )
00022       {
00023          // Execute SQL queries to get data from OMDS (using key) and make C++ object.
00024          // Example: SELECT A_PARAMETER FROM CMS_XXX.XXX_CONF WHERE XXX_CONF.XXX_KEY = subsystemKey
00025 
00026         // get main crate key
00027          l1t::OMDSReader::QueryResults mainCrateKeyResults =
00028            m_omdsReader.basicQuery(
00029                                    "GCT_MAIN_CRATE_KEY",
00030                                    "CMS_GCT",
00031                                    "GCT_CONFIG",
00032                                    "GCT_CONFIG.CONFIG_KEY",
00033                                    m_omdsReader.singleAttribute( subsystemKey  ) );
00034 
00035 
00036          // get phys params key
00037          l1t::OMDSReader::QueryResults physParamsKeyResults =
00038            m_omdsReader.basicQuery(
00039                                    "GCT_PHYS_PARAMS_KEY",
00040                                    "CMS_GCT",
00041                                    "GCT_MAIN_CRATE",
00042                                    "GCT_MAIN_CRATE.CONFIG_KEY",
00043                                    mainCrateKeyResults );
00044          
00045          std::string physParamsKey ;
00046          
00047          if( physParamsKeyResults.queryFailed() ) {
00048            edm::LogError("L1-O2O")
00049              << "Problem with key for record L1GctJetFinderParamsRcd: query failed ";
00050          }
00051          else if( physParamsKeyResults.numberRows() != 1 ) {
00052            edm::LogError("L1-O2O")
00053              << "Problem with key for record L1GctJetFinderParamsRcd: "
00054              << (physParamsKeyResults.numberRows()) << " rows were returned";
00055          }
00056          else {
00057            physParamsKeyResults.fillVariable( physParamsKey ) ;
00058          }
00059          
00060          pL1TriggerKey->add( "L1GctJetFinderParamsRcd", "L1GctJetFinderParams", physParamsKey ) ;
00061          pL1TriggerKey->add( "L1JetEtScaleRcd", "L1CaloEtScale", physParamsKey ) ;
00062          pL1TriggerKey->add( "L1HtMissScaleRcd", "L1CaloEtScale", physParamsKey ) ;
00063          pL1TriggerKey->add( "L1HfRingEtScaleRcd", "L1CaloEtScale", physParamsKey ) ;
00064          
00065       }
00066 }
00067 
00068 DEFINE_FWK_EVENTSETUP_MODULE(L1GctTSCObjectKeysOnlineProd);