CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtTscObjectKeysOnlineProd.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 
20 // user include files
22 
23 // constructor
26  m_enableL1GtParameters(
27  parSet.getParameter<bool> ("EnableL1GtParameters")),
28  m_enableL1GtTriggerMenu(
29  parSet.getParameter<bool> ("EnableL1GtTriggerMenu")),
30  m_enableL1GtPsbSetup(
31  parSet.getParameter<bool> ("EnableL1GtPsbSetup")) {
32 
33  // empty
34 
35 }
36 
37 // destructor
39 
40  // empty
41 
42 }
43 
44 // private methods
45 
47  const std::string& subsystemKey, const std::string& gtSchema) {
48 
49  std::string objectKey;
50 
51  if (!subsystemKey.empty()) {
52 
53  // Execute SQL queries to get keys from OMDS.
54 
55  // SELECT GTFE_SETUP_FK FROM CMS_GT.GT_SETUP WHERE GT_SETUP.ID = MyKey
57  "GTFE_SETUP_FK", gtSchema, "GT_SETUP", "GT_SETUP.ID", m_omdsReader.singleAttribute(
58  subsystemKey));
59 
60  // check if query was successful
61  if (objectKeyResults.queryFailed()) {
62  edm::LogError("L1-O2O")
63  << "Problem with key for record L1GtParametersRcd: query failed ";
64  return objectKey;
65  } else if ( ( objectKeyResults.numberRows() != 1 )) {
66  edm::LogError("L1-O2O") << "Problem with key for record L1GtParametersRcd: "
67  << ( objectKeyResults.numberRows() ) << " rows were returned";
68  return objectKey;
69  }
70 
71  objectKeyResults.fillVariable(objectKey);
72  }
73 
74  return objectKey;
75 }
76 
78  const std::string& subsystemKey, const std::string& gtSchema) {
79 
80  std::string objectKey;
81 
82  if (!subsystemKey.empty()) {
83 
84  // Execute SQL queries to get keys from OMDS.
85 
86  // SELECT L1T_MENU_FK FROM CMS_GT.GT_SETUP WHERE GT_SETUP.ID = MyKey
88  "L1T_MENU_FK", gtSchema, "GT_SETUP", "GT_SETUP.ID", m_omdsReader.singleAttribute(
89  subsystemKey));
90 
91  // check if query was successful
92  if (objectKeyResults.queryFailed()) {
93  edm::LogError("L1-O2O")
94  << "Problem with key for record L1GtTriggerMenuRcd: query failed ";
95  return objectKey;
96  } else if ( ( objectKeyResults.numberRows() != 1 )) {
97  edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMenuRcd: "
98  << ( objectKeyResults.numberRows() ) << " rows were returned";
99  return objectKey;
100  }
101 
102  objectKeyResults.fillVariable(objectKey);
103  }
104 
105  return objectKey;
106 
107 }
108 
110  const std::string& subsystemKey, const std::string& gtSchema) {
111 
112  std::string objectKey;
113 
114  if (!subsystemKey.empty()) {
115 
116  // no need to query OMDS, one uses the GT_SETUP key to get the individual PSB keys.
117  // the L1GtPsbSetup key is GT_SETUP key
118  objectKey = subsystemKey;
119 
120  }
121 
122  return objectKey;
123 
124 }
125 
126 // public methods
128 
129  // kMYSUBSYSTEM = kCSCTF, kDTTF, kRPC, kGMT, kRCT, mkGCT, kGT, or kTSP0
130  // subsystemKey = TRIGGERSUP_CONF.{CSCTF_KEY, DTTF_KEY, RPC_KEY, GMT_KEY, RCT_KEY, GCT_KEY, GT_KEY}
131 
132  std::string subsystemKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kGT);
133  const std::string gtSchema = "CMS_GT";
134 
135  //
137  const std::string& objectKey = keyL1GtParameters(subsystemKey, gtSchema);
138  if (!objectKey.empty()) {
139  pL1TriggerKey->add("L1GtParametersRcd", "L1GtParameters", objectKey);
140  }
141  }
142 
143  //
145  const std::string& objectKey = keyL1GtTriggerMenu(subsystemKey, gtSchema);
146  if (!objectKey.empty()) {
147  pL1TriggerKey->add("L1GtTriggerMenuRcd", "L1GtTriggerMenu", objectKey);
148  }
149  }
150 
151  //
152  if (m_enableL1GtPsbSetup) {
153  const std::string& objectKey = keyL1GtPsbSetup(subsystemKey, gtSchema);
154  if (!objectKey.empty()) {
155  pL1TriggerKey->add("L1GtPsbSetupRcd", "L1GtPsbSetup", objectKey);
156  }
157  }
158 
159 }
160 
std::string keyL1GtPsbSetup(const std::string &subsystemKey, const std::string &gtSchema)
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
L1GtTscObjectKeysOnlineProd(const edm::ParameterSet &)
constructor
virtual void fillObjectKeys(ReturnType pL1TriggerKey)
public methods
std::string keyL1GtParameters(const std::string &subsystemKey, const std::string &gtSchema)
keys for individual objects
bool m_enableL1GtParameters
enable key search for each record
boost::shared_ptr< L1TriggerKey > ReturnType
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="") const
Definition: OMDSReader.cc:87
std::string keyL1GtTriggerMenu(const std::string &subsystemKey, const std::string &gtSchema)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60