CMS 3D CMS Logo

L1GtPsbSetupConfigOnlineProd.h
Go to the documentation of this file.
1 #ifndef L1GtConfigProducers_L1GtPsbSetupConfigOnlineProd_h
2 #define L1GtConfigProducers_L1GtPsbSetupConfigOnlineProd_h
3 
18 // system include files
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
23 // user include files
24 // base class
26 
31 
32 // forward declarations
33 
34 // class declaration
35 class L1GtPsbSetupConfigOnlineProd : public L1ConfigOnlineProdBase<L1GtPsbSetupRcd, L1GtPsbSetup> {
36 public:
39 
42 
44  std::unique_ptr<L1GtPsbSetup> newObject(const std::string& objectKey) override;
45 
46 private:
49  static bool notPsbColumnName(const std::string& columnName);
50 
52  void addPsbFromDb(const std::string& psbKey, std::vector<L1GtPsbConfig>& psbSetup);
53 
55  void addDefaultPsb(const std::string& psbColumn, std::vector<L1GtPsbConfig>& psbSetup) const;
56 
58  bool checkOneLineResult(const l1t::OMDSReader::QueryResults& result, const std::string& queryDescription) const;
59 
62  template <class T>
64  if (!result.fillVariable(colName, value)) {
65  throw cms::Exception("NullValue") << "Required field " << colName << " is NULL in database!";
66  }
67  }
68 
71  std::vector<bool> extractBoolVector(const l1t::OMDSReader::QueryResults& query,
72  const std::string& prefix,
73  const std::string& suffix,
74  unsigned nColumns) const;
75 
78 
80  std::string numberedColumnName(const std::string& prefix, unsigned number) const;
81  unsigned numberFromString(const std::string& aString) const;
82 };
83 
84 #endif
static bool notPsbColumnName(const std::string &columnName)
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.
std::string numberedColumnName(const std::string &prefix, unsigned number, const std::string &suffix) const
Concatenates prefix, number and suffix into a string.
std::unique_ptr< L1GtPsbSetup > newObject(const std::string &objectKey) override
public methods
~L1GtPsbSetupConfigOnlineProd() override
destructor
Definition: query.py:1
bool checkOneLineResult(const l1t::OMDSReader::QueryResults &result, const std::string &queryDescription) const
Ensures that result contains exactly one line, returning false otherwise.
Definition: value.py:1
void getRequiredValue(const l1t::OMDSReader::QueryResults &result, const std::string &colName, T &value) const
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
unsigned numberFromString(const std::string &aString) const
void addPsbFromDb(const std::string &psbKey, std::vector< L1GtPsbConfig > &psbSetup)
Creates a new PSB object from a GT_PSB_SETUP entry and adds.
long double T