CMS 3D CMS Logo

L1MuTriggerScaleKeysOnlineProd.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // \class L1MuGMTParametersOnlineProd
4 //
5 // Description: A key producer to deduce the GMT LUT keys from the master
6 // GMT configuration key, closely following the example of
7 //
8 // https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideL1ConfigOnlineProd r11
9 //
10 //
11 // Author :
12 // Thomas Themel
13 //
14 //--------------------------------------------------
15 
18 
20 public:
22  : L1ObjectKeysOnlineProdBase(iConfig),
23  m_objectTypes(iConfig.getParameter<std::vector<std::string> >("objectTypes")),
24  m_recordTypes(iConfig.getParameter<std::vector<std::string> >("recordTypes")) {
25  if (m_objectTypes.size() != m_recordTypes.size()) {
26  throw cond::Exception("mismatch: need equal number objectType and recordType entries!");
27  }
28  }
29 
31 
32  void fillObjectKeys(FillType pL1TriggerKey) override;
33 
34 private:
35  std::vector<std::string> m_objectTypes;
36  std::vector<std::string> m_recordTypes;
37 };
38 
40  std::string subsystemKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kGMT);
41 
42  if (!subsystemKey.empty()) {
43  // Lookup GT scales key from GMT main config key
45  // SELECTed column
46  "SCALES_KEY",
47  // schema name
48  "CMS_GMT",
49  // table name
50  "GMT_CONFIG",
51  // WHERE lhs
52  "GMT_CONFIG.KEY",
53  // WHERE rhs
54  m_omdsReader.singleAttribute(subsystemKey));
55 
56  if (scalesKeyResults.numberRows() != 1) // check if query was successful
57  {
58  edm::LogError("L1-O2O") << "Problem extracting GMT scales key from GMT config key.";
59  return;
60  }
61 
62  std::string objectKey;
63  scalesKeyResults.fillVariable(objectKey);
64 
65  edm::LogError("L1-O2O") << "Registering " << m_recordTypes.size() << " keys ";
66  // register the scales key for all the scales types we need to produce
67  for (unsigned i = 0; i < m_recordTypes.size(); ++i) {
68  edm::LogError("L1-O2O") << "Registering scales key " << objectKey << " for " << m_recordTypes[i];
69  pL1TriggerKey->add(m_recordTypes[i], m_objectTypes[i], objectKey);
70  }
71  }
72 }
73 
l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
L1MuTriggerScaleKeysOnlineProd::L1MuTriggerScaleKeysOnlineProd
L1MuTriggerScaleKeysOnlineProd(const edm::ParameterSet &iConfig)
Definition: L1MuTriggerScaleKeysOnlineProd.cc:21
L1TriggerKey::kGMT
Definition: L1TriggerKey.h:27
L1ObjectKeysOnlineProdBase::m_omdsReader
l1t::OMDSReader m_omdsReader
Definition: L1ObjectKeysOnlineProdBase.h:54
l1t::OMDSReader::singleAttribute
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
L1MuTriggerScaleKeysOnlineProd::m_objectTypes
std::vector< std::string > m_objectTypes
Definition: L1MuTriggerScaleKeysOnlineProd.cc:35
l1t::OMDSReader::QueryResults::fillVariable
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1ObjectKeysOnlineProdBase
Definition: L1ObjectKeysOnlineProdBase.h:39
edm::ParameterSet
Definition: ParameterSet.h:47
L1MuTriggerScaleKeysOnlineProd
Definition: L1MuTriggerScaleKeysOnlineProd.cc:19
l1t::OMDSReader::QueryResults::numberRows
int numberRows() const
Definition: OMDSReader.h:60
cond::Exception
persistency::Exception Exception
Definition: Exception.h:25
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
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
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
std
Definition: JetResolutionObject.h:76
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
L1MuTriggerScaleKeysOnlineProd::~L1MuTriggerScaleKeysOnlineProd
~L1MuTriggerScaleKeysOnlineProd() override
Definition: L1MuTriggerScaleKeysOnlineProd.cc:30
L1ObjectKeysOnlineProdBase.h
L1MuTriggerScaleKeysOnlineProd::m_recordTypes
std::vector< std::string > m_recordTypes
Definition: L1MuTriggerScaleKeysOnlineProd.cc:36
L1ObjectKeysOnlineProdBase::FillType
std::unique_ptr< L1TriggerKey >::pointer FillType
Definition: L1ObjectKeysOnlineProdBase.h:45
L1MuTriggerScaleKeysOnlineProd::fillObjectKeys
void fillObjectKeys(FillType pL1TriggerKey) override
Definition: L1MuTriggerScaleKeysOnlineProd.cc:39