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
l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
L1GtPsbSetupConfigOnlineProd::notPsbColumnName
static bool notPsbColumnName(const std::string &columnName)
Definition: L1GtPsbSetupConfigOnlineProd.cc:87
OMDSReader.h
L1GtPsbSetupConfigOnlineProd::numberedColumnName
std::string numberedColumnName(const std::string &prefix, unsigned number, const std::string &suffix) const
Concatenates prefix, number and suffix into a string.
Definition: L1GtPsbSetupConfigOnlineProd.cc:252
L1GtPsbSetupConfigOnlineProd::newObject
std::unique_ptr< L1GtPsbSetup > newObject(const std::string &objectKey) override
public methods
Definition: L1GtPsbSetupConfigOnlineProd.cc:39
L1ConfigOnlineProdBase
Definition: L1ConfigOnlineProdBase.h:52
createPayload.suffix
suffix
Definition: createPayload.py:281
L1GtPsbSetupConfigOnlineProd::checkOneLineResult
bool checkOneLineResult(const l1t::OMDSReader::QueryResults &result, const std::string &queryDescription) const
Ensures that result contains exactly one line, returning false otherwise.
Definition: L1GtPsbSetupConfigOnlineProd.cc:232
L1GtPsbSetupConfigOnlineProd::addDefaultPsb
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.
Definition: L1GtPsbSetupConfigOnlineProd.cc:198
L1GtPsbSetupConfigOnlineProd::~L1GtPsbSetupConfigOnlineProd
~L1GtPsbSetupConfigOnlineProd() override
destructor
Definition: L1GtPsbSetupConfigOnlineProd.cc:33
L1GtPsbSetup.h
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
query
Definition: query.py:1
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1GtPsbConfig.h
edm::ParameterSet
Definition: ParameterSet.h:36
L1GtPsbSetupConfigOnlineProd::L1GtPsbSetupConfigOnlineProd
L1GtPsbSetupConfigOnlineProd(const edm::ParameterSet &)
constructor
Definition: L1GtPsbSetupConfigOnlineProd.cc:27
L1GtPsbSetupConfigOnlineProd::numberFromString
unsigned numberFromString(const std::string &aString) const
Definition: L1GtPsbSetupConfigOnlineProd.cc:261
L1GtPsbSetupRcd.h
value
Definition: value.py:1
L1GtPsbSetupConfigOnlineProd::addPsbFromDb
void addPsbFromDb(const std::string &psbKey, std::vector< L1GtPsbConfig > &psbSetup)
Creates a new PSB object from a GT_PSB_SETUP entry and adds.
Definition: L1GtPsbSetupConfigOnlineProd.cc:101
L1GtPsbSetupConfigOnlineProd
Definition: L1GtPsbSetupConfigOnlineProd.h:35
L1GtPsbSetupConfigOnlineProd::extractBoolVector
std::vector< bool > extractBoolVector(const l1t::OMDSReader::QueryResults &query, const std::string &prefix, const std::string &suffix, unsigned nColumns) const
Definition: L1GtPsbSetupConfigOnlineProd.cc:217
T
long double T
Definition: Basic3DVectorLD.h:48
Exception
Definition: hltDiff.cc:246
L1GtPsbSetupConfigOnlineProd::getRequiredValue
void getRequiredValue(const l1t::OMDSReader::QueryResults &result, const std::string &colName, T &value) const
Definition: L1GtPsbSetupConfigOnlineProd.h:63
mps_fire.result
result
Definition: mps_fire.py:303
L1ConfigOnlineProdBase.h
ZMuMuAnalysisNtupler_cff.prefix
prefix
Definition: ZMuMuAnalysisNtupler_cff.py:14