CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/L1TriggerConfig/RCTConfigProducers/src/L1RCT_RSKeysOnlineProd.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    L1TriggerConfig
00004 // Class:      RCTObjectKeysOnlineProd
00005 // 
00013 //
00014 // Original Author:  Werner Man-Li Sun
00015 //         Created:  Fri Aug 22 19:51:36 CEST 2008
00016 // $Id: L1RCT_RSKeysOnlineProd.cc,v 1.1 2009/03/11 10:15:45 jleonard Exp $
00017 //
00018 //
00019 
00020 
00021 // system include files
00022 
00023 // user include files
00024 #include "CondTools/L1Trigger/interface/L1ObjectKeysOnlineProdBase.h"
00025 #include <sstream>
00026 #include "CoralBase/TimeStamp.h"
00027 #include <math.h>
00028 
00029 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00030 
00031 //
00032 // class declaration
00033 //
00034 
00035 class L1RCT_RSKeysOnlineProd : public L1ObjectKeysOnlineProdBase {
00036 public: 
00037   L1RCT_RSKeysOnlineProd(const edm::ParameterSet& iConfig);
00038   ~L1RCT_RSKeysOnlineProd() {}
00039 
00040       virtual void fillObjectKeys( ReturnType pL1TriggerKey ) ;
00041    private:
00042       // ----------member data ---------------------------
00043        bool m_enableL1RCTChannelMask;
00044 
00045 };
00046 
00047 //
00048 // constants, enums and typedefs
00049 //
00050 
00051 //
00052 // static data member definitions
00053 //
00054 
00055 //
00056 // constructors and destructor
00057 //
00058 L1RCT_RSKeysOnlineProd::L1RCT_RSKeysOnlineProd(const edm::ParameterSet& iConfig)
00059   : L1ObjectKeysOnlineProdBase( iConfig ),
00060     m_enableL1RCTChannelMask ( iConfig.getParameter< bool >( "enableL1RCTChannelMask" ) )
00061 {}
00062 
00063 
00064 
00065 //
00066 // member functions
00067 //
00068 
00069 // ------------ method called to produce the data  ------------
00070 void
00071 L1RCT_RSKeysOnlineProd::fillObjectKeys( ReturnType pL1TriggerKey )
00072 {
00073 
00074   if( m_enableL1RCTChannelMask )
00075     {
00076 
00077       l1t::OMDSReader::QueryResults objectKeyResults =
00078         m_omdsReader.basicQuery( "ID",
00079                                  "CMS_RCT",
00080                                  "RCT_RUN_SETTINGS_KEY_CURRENT");
00081 
00082       std::string objectKey;
00083 
00084 
00085       if( objectKeyResults.queryFailed())
00086 
00087         {
00088           edm::LogError( "L1-O2O" ) << "Problem with jey for record L1RCTCHannelMaskRcd: query failed." ;
00089         }
00090       else if(objectKeyResults.numberRows() != 1){
00091               edm::LogError("L1-O2O")
00092               << "Problem with key for record L1RCTChannelMaskRcd: "
00093               << (objectKeyResults.numberRows()) << " rows were returned";
00094       }
00095       else
00096         {
00097 
00098           objectKeyResults.fillVariable( objectKey ) ;
00099 
00100         }
00101       pL1TriggerKey->add( "L1RCTChannelMaskRcd",
00102                           "L1RCTChannelMask",
00103                           objectKey ) ;
00104     }
00105 }
00106   
00107 //define this as a plug-in
00108 DEFINE_FWK_EVENTSETUP_MODULE(L1RCT_RSKeysOnlineProd);