CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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>
63  void getRequiredValue(const l1t::OMDSReader::QueryResults& result, const std::string& colName, T& value) const {
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
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:274
void getRequiredValue(const l1t::OMDSReader::QueryResults &result, const std::string &colName, T &value) const
std::unique_ptr< L1GtPsbSetup > newObject(const std::string &objectKey) override
public methods
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.
~L1GtPsbSetupConfigOnlineProd() override
destructor
tuple result
Definition: mps_fire.py:311
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
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
unsigned numberFromString(const std::string &aString) const