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::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

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 ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () 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

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1GtPsbSetupRcd, L1GtPsbSetup >
bool getObjectKey (const L1GtPsbSetupRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
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 TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Attributes inherited from L1ConfigOnlineProdBase< L1GtPsbSetupRcd, L1GtPsbSetup >
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 ( const edm::ParameterSet parSet)

constructor

Definition at line 27 of file L1GtPsbSetupConfigOnlineProd.cc.

L1GtPsbSetupConfigOnlineProd::~L1GtPsbSetupConfigOnlineProd ( )
override

destructor

Definition at line 35 of file L1GtPsbSetupConfigOnlineProd.cc.

35  {
36 
37  // empty
38 
39 }

Member Function Documentation

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 214 of file L1GtPsbSetupConfigOnlineProd.cc.

References numberFromString(), L1GtPsbConfig::PsbNumberLvdsGroups, L1GtPsbConfig::PsbSerLinkNumberChannels, L1GtPsbConfig::setGtBoardSlot(), L1GtPsbConfig::setGtPsbCh0SendLvds(), L1GtPsbConfig::setGtPsbCh1SendLvds(), L1GtPsbConfig::setGtPsbEnableRecLvds(), L1GtPsbConfig::setGtPsbEnableRecSerLink(), and pfDeepCMVAJetTags_cfi::toAdd.

Referenced by newObject().

215  {
216 
217  // deduce the assigned board from the column name
218  unsigned boardSlot = numberFromString(psbColumn);
219 
220  // create a default PsbConfig with the appropriate board slot and all links disabled
222  static std::vector<bool> allFalseLvds(L1GtPsbConfig::PsbNumberLvdsGroups, false);
223  static std::vector<bool> allFalseSerLink(L1GtPsbConfig::PsbSerLinkNumberChannels, false);
224 
225  toAdd.setGtBoardSlot(boardSlot);
226  toAdd.setGtPsbCh0SendLvds(false);
227  toAdd.setGtPsbCh1SendLvds(false);
228  toAdd.setGtPsbEnableRecLvds(allFalseLvds);
229  toAdd.setGtPsbEnableRecSerLink(allFalseSerLink);
230 
231  psbSetup.push_back(toAdd);
232 }
void setGtPsbEnableRecLvds(const std::vector< bool > &)
void setGtPsbCh0SendLvds(const bool &)
static const int PsbSerLinkNumberChannels
number of channels per board
Definition: L1GtPsbConfig.h:67
static const int PsbNumberLvdsGroups
number of LVDS groups per board
Definition: L1GtPsbConfig.h:64
void setGtPsbEnableRecSerLink(const std::vector< bool > &)
void setGtBoardSlot(const int &)
void setGtPsbCh1SendLvds(const bool &)
unsigned numberFromString(const std::string &aString) const
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 113 of file L1GtPsbSetupConfigOnlineProd.cc.

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

Referenced by newObject().

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

References l1t::OMDSReader::QueryResults::numberRows(), and l1t::OMDSReader::QueryResults::queryFailed().

Referenced by addPsbFromDb(), and newObject().

250  {
251 
252  // check if query was successful
253  if (result.queryFailed()) {
254  edm::LogError("L1-O2O") << "\n " << queryDescription + " failed: no match found!";
255  return false;
256 
257  } else if (result.numberRows() != 1) {
258  edm::LogError("L1-O2O") << "\nProblem with " << queryDescription << ": "
259  << ( result.numberRows() ) << " rows were returned, expected 1.";
260  return false;
261  }
262 
263  return true;
264 }
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 234 of file L1GtPsbSetupConfigOnlineProd.cc.

References getRequiredValue(), mps_fire::i, numberedColumnName(), and mps_fire::result.

Referenced by addPsbFromDb(), and getRequiredValue().

236  {
237 
238  std::vector<bool> result(nColumns);
239 
240  for (unsigned i = 0; i < nColumns; ++i) {
241  bool dbValue;
242  getRequiredValue(query, numberedColumnName(prefix, i, suffix), dbValue);
243  result[i] = dbValue;
244  }
245 
246  return result;
247 }
std::string numberedColumnName(const std::string &prefix, unsigned number, const std::string &suffix) const
Concatenates prefix, number and suffix into a string.
void getRequiredValue(const l1t::OMDSReader::QueryResults &result, const std::string &colName, T &value) const
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 68 of file L1GtPsbSetupConfigOnlineProd.h.

References Exception, extractBoolVector(), l1t::OMDSReader::QueryResults::fillVariable(), numberedColumnName(), numberFromString(), tablePrinter::prefix, AlCaHLTBitMon_QueryRunRegistry::string, and createPayload::suffix.

Referenced by addPsbFromDb(), and extractBoolVector().

69  {
70  if (!result.fillVariable(colName, value)) {
71  throw cms::Exception("NullValue") << "Required field " << colName
72  << " is NULL in database!";
73  }
74  }
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
Definition: value.py:1
std::unique_ptr< L1GtPsbSetup > L1GtPsbSetupConfigOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

public methods

Implements L1ConfigOnlineProdBase< L1GtPsbSetupRcd, L1GtPsbSetup >.

Definition at line 43 of file L1GtPsbSetupConfigOnlineProd.cc.

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

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

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by newObject().

98  {
99 
100  static std::string startMatch("PSB_SLOT_");
101  static std::string endMatch("_SETUP_FK");
102 
103  unsigned len = columnName.size();
104 
105  // it's not a PSB column name if it's too short
106  return len <= ( startMatch.size() + endMatch.size() ) ||
107  // or the start doesn't match
108  columnName.substr(0, startMatch.size()) != startMatch ||
109  // or the end doesn't match
110  columnName.substr(len - endMatch.size(), endMatch.size()) != endMatch;
111 }
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 274 of file L1GtPsbSetupConfigOnlineProd.cc.

References createPayload::suffix.

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

275  {
276 
277  std::ostringstream colName;
278  colName << prefix << number << suffix;
279 
280  return colName.str();
281 }
std::string L1GtPsbSetupConfigOnlineProd::numberedColumnName ( const std::string &  prefix,
unsigned  number 
) const
private

Special case for empty suffix.

Definition at line 267 of file L1GtPsbSetupConfigOnlineProd.cc.

References numberedColumnName().

268  {
269 
270  return numberedColumnName(prefix, number, "");
271 
272 }
std::string numberedColumnName(const std::string &prefix, unsigned number, const std::string &suffix) const
Concatenates prefix, number and suffix into a string.
unsigned L1GtPsbSetupConfigOnlineProd::numberFromString ( const std::string &  aString) const
private

Definition at line 283 of file L1GtPsbSetupConfigOnlineProd.cc.

References DEFINE_FWK_EVENTSETUP_MODULE, Exception, mps_fire::i, and mps_fire::result.

Referenced by addDefaultPsb(), and getRequiredValue().

283  {
284 
285  std::istringstream stream(aString);
286  unsigned result;
287 
288  for (unsigned i = 0; i < aString.size(); ++i) {
289  if (stream >> result) {
290  // we got a value
291  return result;
292  } else {
293  // clear error flags from failed >>
294  stream.clear();
295  // skip another character
296  stream.seekg(i);
297  }
298  }
299 
300  // throw here
301  throw cms::Exception("NumberNotFound") << "Failed to extract numeric value from " << aString;
302 }