CMS 3D CMS Logo

L1TMuonOverlapObjectKeysOnlineProd.cc
Go to the documentation of this file.
1 #include <iostream>
4 
6 private:
8 
9 public:
10  void fillObjectKeys(L1TriggerKeyExt* pL1TriggerKey) override;
11 
14 };
15 
18  transactionSafe = iConfig.getParameter<bool>("transactionSafe");
19 }
20 
22  std::string OMTFKey = pL1TriggerKey->subsystemKey(L1TriggerKeyExt::kOMTF);
23 
24  std::string stage2Schema = "CMS_TRG_L1_CONF";
25 
26  std::string tscKey = OMTFKey.substr(0, OMTFKey.find(":"));
27 
28  std::vector<std::string> queryStrings;
29  queryStrings.push_back("ALGO");
30 
31  std::string algo_key;
32 
33  // select ALGO from CMS_TRG_L1_CONF.OMTF_KEYS where ID = tscKey ;
35  queryStrings, stage2Schema, "OMTF_KEYS", "OMTF_KEYS.ID", m_omdsReader.singleAttribute(tscKey));
36 
37  if (queryResult.queryFailed() || queryResult.numberRows() != 1 || !queryResult.fillVariable("ALGO", algo_key)) {
38  edm::LogError("L1-O2O L1TMuonOverlapObjectKeysOnlineProd") << "Cannot get OMTF_KEYS.ALGO ";
39 
40  if (transactionSafe)
41  throw std::runtime_error("SummaryForFunctionManager: OMTF | Faulty | Broken key");
42  else {
43  edm::LogError("L1-O2O: L1TMuonOverlapObjectKeysOnlineProd")
44  << "forcing L1TMuonOverlapParams key to be = 'OMTF_ALGO_EMPTY' (known to exist)";
45  pL1TriggerKey->add("L1TMuonOverlapParamsO2ORcd", "L1TMuonOverlapParams", "OMTF_ALGO_EMPTY");
46  return;
47  }
48  }
49 
50  // simply assign the algo key to the record
51  pL1TriggerKey->add("L1TMuonOverlapParamsO2ORcd", "L1TMuonOverlapParams", algo_key);
52 }
53 
54 //define this as a plug-in
l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
L1TMuonOverlapObjectKeysOnlineProd::transactionSafe
bool transactionSafe
Definition: L1TMuonOverlapObjectKeysOnlineProd.cc:7
L1TriggerKeyExt::add
void add(const std::string &record, const std::string &type, const std::string &key)
Definition: L1TriggerKeyExt.h:42
MessageLogger.h
L1TriggerKeyExt::subsystemKey
const std::string & subsystemKey(L1Subsystems subsystem) const
Definition: L1TriggerKeyExt.h:71
l1t::OMDSReader::singleAttribute
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
L1TMuonOverlapObjectKeysOnlineProd::~L1TMuonOverlapObjectKeysOnlineProd
~L1TMuonOverlapObjectKeysOnlineProd(void) override
Definition: L1TMuonOverlapObjectKeysOnlineProd.cc:13
L1TriggerKeyExt::kOMTF
Definition: L1TriggerKeyExt.h:27
l1t::OMDSReader::QueryResults::fillVariable
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
L1ObjectKeysOnlineProdBaseExt::m_omdsReader
l1t::OMDSReader m_omdsReader
Definition: L1ObjectKeysOnlineProdBaseExt.h:35
L1TriggerKeyExt
Definition: L1TriggerKeyExt.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1TMuonOverlapObjectKeysOnlineProd
Definition: L1TMuonOverlapObjectKeysOnlineProd.cc:5
edm::ParameterSet
Definition: ParameterSet.h:36
L1TMuonOverlapObjectKeysOnlineProd::L1TMuonOverlapObjectKeysOnlineProd
L1TMuonOverlapObjectKeysOnlineProd(const edm::ParameterSet &)
Definition: L1TMuonOverlapObjectKeysOnlineProd.cc:16
edm::LogError
Definition: MessageLogger.h:183
l1t::OMDSReader::QueryResults::numberRows
int numberRows() const
Definition: OMDSReader.h:60
l1t::OMDSReader::basicQuery
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
L1TMuonOverlapObjectKeysOnlineProd::fillObjectKeys
void fillObjectKeys(L1TriggerKeyExt *pL1TriggerKey) override
Definition: L1TMuonOverlapObjectKeysOnlineProd.cc:21
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
L1ObjectKeysOnlineProdBaseExt.h
L1ObjectKeysOnlineProdBaseExt
Definition: L1ObjectKeysOnlineProdBaseExt.h:19
l1t::OMDSReader::QueryResults::queryFailed
bool queryFailed() const
Definition: OMDSReader.h:59