CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions
L1GtPsbSetupConfigOnlineProd Class Reference

#include <L1GtPsbSetupConfigOnlineProd.h>

Inheritance diagram for L1GtPsbSetupConfigOnlineProd:
L1ConfigOnlineProdBase< L1GtPsbSetupRcd, L1GtPsbSetup > edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Member Functions

 L1GtPsbSetupConfigOnlineProd (const edm::ParameterSet &)
 constructor More...
 
std::unique_ptr< L1GtPsbSetupnewObject (const std::string &objectKey) override
 public methods More...
 
 ~L1GtPsbSetupConfigOnlineProd () override
 destructor More...
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1GtPsbSetupRcd, L1GtPsbSetup >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1GtPsbSetupproduce (const L1GtPsbSetupRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Private Member Functions

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. More...
 
void addPsbFromDb (const std::string &psbKey, std::vector< L1GtPsbConfig > &psbSetup)
 Creates a new PSB object from a GT_PSB_SETUP entry and adds. More...
 
bool checkOneLineResult (const l1t::OMDSReader::QueryResults &result, const std::string &queryDescription) const
 Ensures that result contains exactly one line, returning false otherwise. More...
 
std::vector< bool > extractBoolVector (const l1t::OMDSReader::QueryResults &query, const std::string &prefix, const std::string &suffix, unsigned nColumns) const
 
template<class T >
void getRequiredValue (const l1t::OMDSReader::QueryResults &result, const std::string &colName, T &value) const
 
std::string numberedColumnName (const std::string &prefix, unsigned number, const std::string &suffix) const
 Concatenates prefix, number and suffix into a string. More...
 
std::string numberedColumnName (const std::string &prefix, unsigned number) const
 Special case for empty suffix. More...
 
unsigned numberFromString (const std::string &aString) const
 

Static Private Member Functions

static bool notPsbColumnName (const std::string &columnName)
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1GtPsbSetupRcd, L1GtPsbSetup >
bool getObjectKey (const L1GtPsbSetupRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Attributes inherited from L1ConfigOnlineProdBase< L1GtPsbSetupRcd, L1GtPsbSetup >
std::optional< edm::ESConsumesCollectorT< L1GtPsbSetupRcd > > m_consumesCollector
 
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Description: online producer for L1GtPsbSetup.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Description: online producer for L1GtPsbSetup.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna
: Thomas Themel - HEPHY Vienna

Definition at line 35 of file L1GtPsbSetupConfigOnlineProd.h.

Constructor & Destructor Documentation

◆ L1GtPsbSetupConfigOnlineProd()

L1GtPsbSetupConfigOnlineProd::L1GtPsbSetupConfigOnlineProd ( const edm::ParameterSet parSet)

◆ ~L1GtPsbSetupConfigOnlineProd()

L1GtPsbSetupConfigOnlineProd::~L1GtPsbSetupConfigOnlineProd ( )
override

destructor

Definition at line 32 of file L1GtPsbSetupConfigOnlineProd.cc.

32  {
33  // empty
34 }

Member Function Documentation

◆ addDefaultPsb()

void L1GtPsbSetupConfigOnlineProd::addDefaultPsb ( const std::string &  psbColumn,
std::vector< L1GtPsbConfig > &  psbSetup 
) const
private

Creates a default valued PSB from an empty foreign key in the GT_SETUP table.

Definition at line 197 of file L1GtPsbSetupConfigOnlineProd.cc.

References numberFromString(), L1GtPsbConfig::PsbNumberLvdsGroups, L1GtPsbConfig::PsbSerLinkNumberChannels, and HLT_2023v12_cff::toAdd.

Referenced by newObject().

198  {
199  // deduce the assigned board from the column name
200  unsigned boardSlot = numberFromString(psbColumn);
201 
202  // create a default PsbConfig with the appropriate board slot and all links disabled
204  static std::vector<bool> allFalseLvds(L1GtPsbConfig::PsbNumberLvdsGroups, false);
205  static std::vector<bool> allFalseSerLink(L1GtPsbConfig::PsbSerLinkNumberChannels, false);
206 
207  toAdd.setGtBoardSlot(boardSlot);
208  toAdd.setGtPsbCh0SendLvds(false);
209  toAdd.setGtPsbCh1SendLvds(false);
210  toAdd.setGtPsbEnableRecLvds(allFalseLvds);
211  toAdd.setGtPsbEnableRecSerLink(allFalseSerLink);
212 
213  psbSetup.push_back(toAdd);
214 }
static const int PsbSerLinkNumberChannels
number of channels per board
Definition: L1GtPsbConfig.h:63
static const int PsbNumberLvdsGroups
number of LVDS groups per board
Definition: L1GtPsbConfig.h:60
unsigned numberFromString(const std::string &aString) const

◆ addPsbFromDb()

void L1GtPsbSetupConfigOnlineProd::addPsbFromDb ( const std::string &  psbKey,
std::vector< L1GtPsbConfig > &  psbSetup 
)
private

Creates a new PSB object from a GT_PSB_SETUP entry and adds.

Definition at line 100 of file L1GtPsbSetupConfigOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), checkOneLineResult(), extractBoolVector(), getRequiredValue(), mps_fire::i, L1ConfigOnlineProdBase< L1GtPsbSetupRcd, L1GtPsbSetup >::m_omdsReader, numberedColumnName(), L1GtPsbConfig::PsbNumberLvdsGroups, L1GtPsbConfig::PsbSerLinkNumberChannels, l1t::OMDSReader::singleAttribute(), AlCaHLTBitMon_QueryRunRegistry::string, and HLT_2023v12_cff::toAdd.

Referenced by newObject().

100  {
101  // SQL> describe gt_psb_setup;
102  // (heavily pruned to just the stuff we need to set up a GtPsbConfig)
103  // Name Null? Type
104  // ----------------------------------------- -------- ----------------------------
105  // ID NOT NULL VARCHAR2(256)
106  // BOARD_SLOT NUMBER(3)
107  // CH0_SEND_LVDS_NOT_DS92LV16 NUMBER(1)
108  // CH1_SEND_LVDS_NOT_DS92LV16 NUMBER(1)
109  // ENABLE_TT_LVDS_0 NUMBER(1)
110  // ENABLE_TT_LVDS_1 NUMBER(1)
111  // ENABLE_TT_LVDS_2 NUMBER(1)
112  // ENABLE_TT_LVDS_3 NUMBER(1)
113  // ENABLE_TT_LVDS_4 NUMBER(1)
114  // ENABLE_TT_LVDS_5 NUMBER(1)
115  // ENABLE_TT_LVDS_6 NUMBER(1)
116  // ENABLE_TT_LVDS_7 NUMBER(1)
117  // ENABLE_TT_LVDS_8 NUMBER(1)
118  // ENABLE_TT_LVDS_9 NUMBER(1)
119  // ENABLE_TT_LVDS_10 NUMBER(1)
120  // ENABLE_TT_LVDS_11 NUMBER(1)
121  // ENABLE_TT_LVDS_12 NUMBER(1)
122  // ENABLE_TT_LVDS_13 NUMBER(1)
123  // ENABLE_TT_LVDS_14 NUMBER(1)
124  // ENABLE_TT_LVDS_15 NUMBER(1)
125  // SERLINK_CH0_REC_ENABLE NUMBER(1)
126  // SERLINK_CH1_REC_ENABLE NUMBER(1)
127  // SERLINK_CH2_REC_ENABLE NUMBER(1)
128  // SERLINK_CH3_REC_ENABLE NUMBER(1)
129  // SERLINK_CH4_REC_ENABLE NUMBER(1)
130  // SERLINK_CH5_REC_ENABLE NUMBER(1)
131  // SERLINK_CH6_REC_ENABLE NUMBER(1)
132  // SERLINK_CH7_REC_ENABLE NUMBER(1)
133 
134  const std::string gtSchema = "CMS_GT";
135 
136  // setup up columns to query
137  std::vector<std::string> columnNames;
138 
139  static const std::string lvdPrefix = "ENABLE_TT_LVDS_";
140  static const std::string lvdSuffix = "";
141  static const std::string serPrefix = "SERLINK_CH";
142  static const std::string serSuffix = "_REC_ENABLE";
143  static const std::string boardSlotColumn = "BOARD_SLOT";
144  static const std::string ch0FormatColumn = "CH0_SEND_LVDS_NOT_DS92LV16";
145  static const std::string ch1FormatColumn = "CH1_SEND_LVDS_NOT_DS92LV16";
146 
147  columnNames.push_back(boardSlotColumn);
148  columnNames.push_back(ch0FormatColumn);
149  columnNames.push_back(ch1FormatColumn);
150 
151  for (unsigned i = 0; i < (unsigned)L1GtPsbConfig::PsbNumberLvdsGroups; ++i) {
152  columnNames.push_back(numberedColumnName(lvdPrefix, i, lvdSuffix));
153  }
154 
155  for (unsigned i = 0; i < (unsigned)L1GtPsbConfig::PsbSerLinkNumberChannels; ++i) {
156  columnNames.push_back(numberedColumnName(serPrefix, i, serSuffix));
157  }
158 
159  // execute database query
161  columnNames, gtSchema, "GT_PSB_SETUP", "GT_PSB_SETUP.ID", m_omdsReader.singleAttribute(psbKey));
162 
163  // check if query was successful and we get only one line
164  if (!checkOneLineResult(psbQuery, "GT_PSB_SETUP query for PSB keys with ID = " + psbKey)) {
165  edm::LogError("L1-O2O") << "Problem to get setup for PSB keys with ID = " << psbKey;
166  return; // FIXME: change method to bool?
167  }
168 
169  // extract values
170  int16_t boardSlot;
171 
172  getRequiredValue(psbQuery, boardSlotColumn, boardSlot);
173 
174  bool sendLvds0, sendLvds1;
175 
176  getRequiredValue(psbQuery, ch0FormatColumn, sendLvds0);
177  getRequiredValue(psbQuery, ch1FormatColumn, sendLvds1);
178 
179  const std::vector<bool>& enableRecLvds =
180  extractBoolVector(psbQuery, lvdPrefix, lvdSuffix, L1GtPsbConfig::PsbNumberLvdsGroups);
181  const std::vector<bool>& serLinkRecEnable =
182  extractBoolVector(psbQuery, serPrefix, serSuffix, L1GtPsbConfig::PsbSerLinkNumberChannels);
183 
184  // create new PSB object with db values
186 
187  toAdd.setGtBoardSlot(boardSlot);
188  toAdd.setGtPsbCh0SendLvds(sendLvds0);
189  toAdd.setGtPsbCh1SendLvds(sendLvds1);
190  toAdd.setGtPsbEnableRecLvds(enableRecLvds);
191  toAdd.setGtPsbEnableRecSerLink(serLinkRecEnable);
192 
193  // add to vector
194  psbSetup.push_back(toAdd);
195 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
std::string numberedColumnName(const std::string &prefix, unsigned number, const std::string &suffix) const
Concatenates prefix, number and suffix into a string.
static const int PsbSerLinkNumberChannels
number of channels per board
Definition: L1GtPsbConfig.h:63
Log< level::Error, false > LogError
static const int PsbNumberLvdsGroups
number of LVDS groups per board
Definition: L1GtPsbConfig.h:60
bool checkOneLineResult(const l1t::OMDSReader::QueryResults &result, const std::string &queryDescription) const
Ensures that result contains exactly one line, returning false otherwise.
const QueryResults basicQuery(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &tableName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:75
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

◆ checkOneLineResult()

bool L1GtPsbSetupConfigOnlineProd::checkOneLineResult ( const l1t::OMDSReader::QueryResults result,
const std::string &  queryDescription 
) const
private

Ensures that result contains exactly one line, returning false otherwise.

Definition at line 231 of file L1GtPsbSetupConfigOnlineProd.cc.

References mps_fire::result.

Referenced by addPsbFromDb(), and newObject().

232  {
233  // check if query was successful
234  if (result.queryFailed()) {
235  edm::LogError("L1-O2O") << "\n " << queryDescription + " failed: no match found!";
236  return false;
237 
238  } else if (result.numberRows() != 1) {
239  edm::LogError("L1-O2O") << "\nProblem with " << queryDescription << ": " << (result.numberRows())
240  << " rows were returned, expected 1.";
241  return false;
242  }
243 
244  return true;
245 }
Log< level::Error, false > LogError

◆ extractBoolVector()

std::vector< bool > L1GtPsbSetupConfigOnlineProd::extractBoolVector ( const l1t::OMDSReader::QueryResults query,
const std::string &  prefix,
const std::string &  suffix,
unsigned  nColumns 
) const
private

A function to extract a vector of booleans from the GT database format (NUMBER(1) columns labeled prefix<nn>suffix).

Definition at line 216 of file L1GtPsbSetupConfigOnlineProd.cc.

References getRequiredValue(), mps_fire::i, numberedColumnName(), hcallasereventfilter2012_cfi::prefix, mps_fire::result, and makePlotsFromDump::suffix.

Referenced by addPsbFromDb().

219  {
220  std::vector<bool> result(nColumns);
221 
222  for (unsigned i = 0; i < nColumns; ++i) {
223  bool dbValue;
225  result[i] = dbValue;
226  }
227 
228  return result;
229 }
std::string numberedColumnName(const std::string &prefix, unsigned number, const std::string &suffix) const
Concatenates prefix, number and suffix into a string.
Definition: query.py:1
void getRequiredValue(const l1t::OMDSReader::QueryResults &result, const std::string &colName, T &value) const

◆ getRequiredValue()

template<class T >
void L1GtPsbSetupConfigOnlineProd::getRequiredValue ( const l1t::OMDSReader::QueryResults result,
const std::string &  colName,
T value 
) const
inlineprivate

A wrapper for OMDSReader::QueryResults::fillVariable that throws an exception when the field it accesses was NULL.

Definition at line 63 of file L1GtPsbSetupConfigOnlineProd.h.

References Exception, and mps_fire::result.

Referenced by addPsbFromDb(), and extractBoolVector().

63  {
64  if (!result.fillVariable(colName, value)) {
65  throw cms::Exception("NullValue") << "Required field " << colName << " is NULL in database!";
66  }
67  }
Definition: value.py:1

◆ newObject()

std::unique_ptr< L1GtPsbSetup > L1GtPsbSetupConfigOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

public methods

Implements L1ConfigOnlineProdBase< L1GtPsbSetupRcd, L1GtPsbSetup >.

Definition at line 38 of file L1GtPsbSetupConfigOnlineProd.cc.

References addDefaultPsb(), addPsbFromDb(), l1t::OMDSReader::basicQuery(), checkOneLineResult(), l1t::OMDSReader::columnNames(), l1t::OMDSReader::QueryResults::fillVariable(), edm::isDebugEnabled(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LogTrace, L1ConfigOnlineProdBase< L1GtPsbSetupRcd, L1GtPsbSetup >::m_omdsReader, notPsbColumnName(), l1t::OMDSReader::singleAttribute(), and AlCaHLTBitMon_QueryRunRegistry::string.

38  {
39  auto pL1GtPsbSetup = std::make_unique<L1GtPsbSetup>();
40 
41  const std::string gtSchema = "CMS_GT";
42 
43  // the setup's contents, to be filled from database
44  std::vector<L1GtPsbConfig> psbConfigurations;
45 
46  // SELECT PSB_SLOT_*_SETUP_FK FROM CMS_GT.GT_SETUP WHERE GT_SETUP.ID = MyKey
47  std::vector<std::string> psbColumns = m_omdsReader.columnNames(gtSchema, "GT_SETUP");
48 
49  std::vector<std::string>::iterator newEnd = std::remove_if(psbColumns.begin(), psbColumns.end(), &notPsbColumnName);
50  psbColumns.erase(newEnd, psbColumns.end());
51 
52  // select * from CMS_GT.GT_SETUP where GT_SETUP.ID = objectKey
54  m_omdsReader.basicQuery(psbColumns, gtSchema, "GT_SETUP", "GT_SETUP.ID", m_omdsReader.singleAttribute(objectKey));
55 
56  // check if query was successful and produced one line only
57  if (!checkOneLineResult(psbKeys, "GT_SETUP query for PSB keys with ID = " + objectKey)) {
58  edm::LogError("L1-O2O") << "Problem to get content of CMS_GT.GT_SETUP for GT_SETUP.ID key: " << objectKey;
59  return pL1GtPsbSetup;
60  }
61 
62  // fill the psbConfigurations vector
63  for (std::vector<std::string>::const_iterator it = psbColumns.begin(); it != psbColumns.end(); ++it) {
64  std::string psbKey;
65  psbKeys.fillVariable(*it, psbKey);
66 
67  if (psbKey.empty()) {
68  addDefaultPsb(*it, psbConfigurations);
69  } else {
70  addPsbFromDb(psbKey, psbConfigurations);
71  }
72  }
73 
74  // assign to the result object
75  pL1GtPsbSetup->setGtPsbSetup(psbConfigurations);
76 
77  if (edm::isDebugEnabled()) {
78  LogTrace("L1-O2O") << (*pL1GtPsbSetup) << std::endl;
79  }
80 
81  return pL1GtPsbSetup;
82 }
bool isDebugEnabled()
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.
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
Log< level::Error, false > LogError
#define LogTrace(id)
bool checkOneLineResult(const l1t::OMDSReader::QueryResults &result, const std::string &queryDescription) const
Ensures that result contains exactly one line, returning false otherwise.
std::vector< std::string > columnNames(const std::string &schemaName, const std::string &tableName)
Definition: OMDSReader.cc:138
const QueryResults basicQuery(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &tableName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:75
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
void addPsbFromDb(const std::string &psbKey, std::vector< L1GtPsbConfig > &psbSetup)
Creates a new PSB object from a GT_PSB_SETUP entry and adds.

◆ notPsbColumnName()

bool L1GtPsbSetupConfigOnlineProd::notPsbColumnName ( const std::string &  columnName)
staticprivate

A predicate to filter the column names of GT_SETUP for those that contain foreign keys to GT_PSB_SETUP.

Definition at line 86 of file L1GtPsbSetupConfigOnlineProd.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by newObject().

86  {
87  static std::string startMatch("PSB_SLOT_");
88  static std::string endMatch("_SETUP_FK");
89 
90  unsigned len = columnName.size();
91 
92  // it's not a PSB column name if it's too short
93  return len <= (startMatch.size() + endMatch.size()) ||
94  // or the start doesn't match
95  columnName.substr(0, startMatch.size()) != startMatch ||
96  // or the end doesn't match
97  columnName.substr(len - endMatch.size(), endMatch.size()) != endMatch;
98 }

◆ numberedColumnName() [1/2]

std::string L1GtPsbSetupConfigOnlineProd::numberedColumnName ( const std::string &  prefix,
unsigned  number,
const std::string &  suffix 
) const
private

Concatenates prefix, number and suffix into a string.

Definition at line 251 of file L1GtPsbSetupConfigOnlineProd.cc.

References contentValuesFiles::number, hcallasereventfilter2012_cfi::prefix, and makePlotsFromDump::suffix.

Referenced by addPsbFromDb(), extractBoolVector(), and numberedColumnName().

253  {
254  std::ostringstream colName;
255  colName << prefix << number << suffix;
256 
257  return colName.str();
258 }

◆ numberedColumnName() [2/2]

std::string L1GtPsbSetupConfigOnlineProd::numberedColumnName ( const std::string &  prefix,
unsigned  number 
) const
private

Special case for empty suffix.

Definition at line 247 of file L1GtPsbSetupConfigOnlineProd.cc.

References contentValuesFiles::number, numberedColumnName(), and hcallasereventfilter2012_cfi::prefix.

247  {
248  return numberedColumnName(prefix, number, "");
249 }
std::string numberedColumnName(const std::string &prefix, unsigned number, const std::string &suffix) const
Concatenates prefix, number and suffix into a string.

◆ numberFromString()

unsigned L1GtPsbSetupConfigOnlineProd::numberFromString ( const std::string &  aString) const
private

Definition at line 260 of file L1GtPsbSetupConfigOnlineProd.cc.

References Exception, mps_fire::i, mps_fire::result, and cms::cuda::stream.

Referenced by addDefaultPsb().

260  {
261  std::istringstream stream(aString);
262  unsigned result;
263 
264  for (unsigned i = 0; i < aString.size(); ++i) {
265  if (stream >> result) {
266  // we got a value
267  return result;
268  } else {
269  // clear error flags from failed >>
270  stream.clear();
271  // skip another character
272  stream.seekg(i);
273  }
274  }
275 
276  // throw here
277  throw cms::Exception("NumberNotFound") << "Failed to extract numeric value from " << aString;
278 }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream