CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/L1TriggerConfig/L1GtConfigProducers/interface/L1GtPsbSetupConfigOnlineProd.h

Go to the documentation of this file.
00001 #ifndef L1GtConfigProducers_L1GtPsbSetupConfigOnlineProd_h
00002 #define L1GtConfigProducers_L1GtPsbSetupConfigOnlineProd_h
00003 
00020 // system include files
00021 #include "boost/shared_ptr.hpp"
00022 #include <string>
00023 #include <vector>
00024 
00025 // user include files
00026 //   base class
00027 #include "CondTools/L1Trigger/interface/L1ConfigOnlineProdBase.h"
00028 
00029 #include "CondTools/L1Trigger/interface/OMDSReader.h"
00030 #include "CondFormats/L1TObjects/interface/L1GtPsbSetup.h"
00031 #include "CondFormats/DataRecord/interface/L1GtPsbSetupRcd.h"
00032 #include "CondFormats/L1TObjects/interface/L1GtPsbConfig.h"
00033 
00034 // forward declarations
00035 
00036 // class declaration
00037 class L1GtPsbSetupConfigOnlineProd :
00038         public L1ConfigOnlineProdBase<L1GtPsbSetupRcd, L1GtPsbSetup>
00039 {
00040 
00041 public:
00042 
00044     L1GtPsbSetupConfigOnlineProd(const edm::ParameterSet&);
00045 
00047     ~L1GtPsbSetupConfigOnlineProd();
00048 
00050     virtual boost::shared_ptr<L1GtPsbSetup> newObject(const std::string& objectKey);
00051 
00052 private:
00053 
00056     static bool notPsbColumnName(const std::string& columnName);
00057 
00059     void addPsbFromDb(const std::string& psbKey, std::vector<L1GtPsbConfig>& psbSetup) const;
00060 
00062     void addDefaultPsb(const std::string& psbColumn, std::vector<L1GtPsbConfig>& psbSetup) const;
00063 
00065     bool checkOneLineResult(
00066             const l1t::OMDSReader::QueryResults& result, const std::string& queryDescription) const;
00067 
00070     template<class T> void getRequiredValue(
00071             const l1t::OMDSReader::QueryResults& result, const std::string& colName, T& value) const {
00072         if (!result.fillVariable(colName, value)) {
00073             throw cms::Exception("NullValue") << "Required field " << colName
00074                     << " is NULL in database!";
00075         }
00076     }
00077 
00080     std::vector<bool> extractBoolVector(
00081             const l1t::OMDSReader::QueryResults& query, const std::string& prefix,
00082             const std::string& suffix, unsigned nColumns) const;
00083 
00085     std::string numberedColumnName(
00086             const std::string& prefix, unsigned number, const std::string& suffix) const;
00087 
00089     std::string numberedColumnName(const std::string& prefix, unsigned number) const;
00090     unsigned numberFromString(const std::string& aString) const;
00091 
00092 };
00093 
00094 #endif