CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtPsbSetupConfigOnlineProd.h
Go to the documentation of this file.
1 #ifndef L1GtConfigProducers_L1GtPsbSetupConfigOnlineProd_h
2 #define L1GtConfigProducers_L1GtPsbSetupConfigOnlineProd_h
3 
20 // system include files
21 #include "boost/shared_ptr.hpp"
22 #include <string>
23 #include <vector>
24 
25 // user include files
26 // base class
28 
33 
34 // forward declarations
35 
36 // class declaration
38  public L1ConfigOnlineProdBase<L1GtPsbSetupRcd, L1GtPsbSetup>
39 {
40 
41 public:
42 
45 
48 
50  virtual boost::shared_ptr<L1GtPsbSetup> newObject(const std::string& objectKey);
51 
52 private:
53 
56  static bool notPsbColumnName(const std::string& columnName);
57 
59  void addPsbFromDb(const std::string& psbKey, std::vector<L1GtPsbConfig>& psbSetup) const;
60 
62  void addDefaultPsb(const std::string& psbColumn, std::vector<L1GtPsbConfig>& psbSetup) const;
63 
65  bool checkOneLineResult(
66  const l1t::OMDSReader::QueryResults& result, const std::string& queryDescription) const;
67 
70  template<class T> void getRequiredValue(
71  const l1t::OMDSReader::QueryResults& result, const std::string& colName, T& value) const {
72  if (!result.fillVariable(colName, value)) {
73  throw cms::Exception("NullValue") << "Required field " << colName
74  << " is NULL in database!";
75  }
76  }
77 
80  std::vector<bool> extractBoolVector(
81  const l1t::OMDSReader::QueryResults& query, const std::string& prefix,
82  const std::string& suffix, unsigned nColumns) const;
83 
85  std::string numberedColumnName(
86  const std::string& prefix, unsigned number, const std::string& suffix) const;
87 
89  std::string numberedColumnName(const std::string& prefix, unsigned number) const;
90  unsigned numberFromString(const std::string& aString) const;
91 
92 };
93 
94 #endif
bool checkOneLineResult(const l1t::OMDSReader::QueryResults &result, const std::string &queryDescription) const
Ensures that result contains exactly one line, returning false otherwise.
static bool notPsbColumnName(const std::string &columnName)
std::string numberedColumnName(const std::string &prefix, unsigned number, const std::string &suffix) const
Concatenates prefix, number and suffix into a string.
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
void getRequiredValue(const l1t::OMDSReader::QueryResults &result, const std::string &colName, T &value) const
void addDefaultPsb(const std::string &psbColumn, std::vector< L1GtPsbConfig > &psbSetup) const
Creates a default valued PSB from an empty foreign key in the GT_SETUP table.
virtual boost::shared_ptr< L1GtPsbSetup > newObject(const std::string &objectKey)
public methods
tuple result
Definition: query.py:137
std::vector< bool > extractBoolVector(const l1t::OMDSReader::QueryResults &query, const std::string &prefix, const std::string &suffix, unsigned nColumns) const
L1GtPsbSetupConfigOnlineProd(const edm::ParameterSet &)
constructor
tuple query
Definition: o2o.py:269
void addPsbFromDb(const std::string &psbKey, std::vector< L1GtPsbConfig > &psbSetup) const
Creates a new PSB object from a GT_PSB_SETUP entry and adds.
long double T
unsigned numberFromString(const std::string &aString) const