File indexing completed on 2023-03-17 11:14:14
0001 #ifndef L1GtConfigProducers_L1GtPsbSetupConfigOnlineProd_h
0002 #define L1GtConfigProducers_L1GtPsbSetupConfigOnlineProd_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <memory>
0020 #include <string>
0021 #include <vector>
0022
0023
0024
0025 #include "CondTools/L1Trigger/interface/L1ConfigOnlineProdBase.h"
0026
0027 #include "CondTools/L1Trigger/interface/OMDSReader.h"
0028 #include "CondFormats/L1TObjects/interface/L1GtPsbSetup.h"
0029 #include "CondFormats/DataRecord/interface/L1GtPsbSetupRcd.h"
0030 #include "CondFormats/L1TObjects/interface/L1GtPsbConfig.h"
0031
0032
0033
0034
0035 class L1GtPsbSetupConfigOnlineProd : public L1ConfigOnlineProdBase<L1GtPsbSetupRcd, L1GtPsbSetup> {
0036 public:
0037
0038 L1GtPsbSetupConfigOnlineProd(const edm::ParameterSet&);
0039
0040
0041 ~L1GtPsbSetupConfigOnlineProd() override;
0042
0043
0044 std::unique_ptr<L1GtPsbSetup> newObject(const std::string& objectKey) override;
0045
0046 private:
0047
0048
0049 static bool notPsbColumnName(const std::string& columnName);
0050
0051
0052 void addPsbFromDb(const std::string& psbKey, std::vector<L1GtPsbConfig>& psbSetup);
0053
0054
0055 void addDefaultPsb(const std::string& psbColumn, std::vector<L1GtPsbConfig>& psbSetup) const;
0056
0057
0058 bool checkOneLineResult(const l1t::OMDSReader::QueryResults& result, const std::string& queryDescription) const;
0059
0060
0061
0062 template <class T>
0063 void getRequiredValue(const l1t::OMDSReader::QueryResults& result, const std::string& colName, T& value) const {
0064 if (!result.fillVariable(colName, value)) {
0065 throw cms::Exception("NullValue") << "Required field " << colName << " is NULL in database!";
0066 }
0067 }
0068
0069
0070
0071 std::vector<bool> extractBoolVector(const l1t::OMDSReader::QueryResults& query,
0072 const std::string& prefix,
0073 const std::string& suffix,
0074 unsigned nColumns) const;
0075
0076
0077 std::string numberedColumnName(const std::string& prefix, unsigned number, const std::string& suffix) const;
0078
0079
0080 std::string numberedColumnName(const std::string& prefix, unsigned number) const;
0081 unsigned numberFromString(const std::string& aString) const;
0082 };
0083
0084 #endif