Go to the documentation of this file.00001
00017
00018 #include "L1TriggerConfig/L1GtConfigProducers/interface/L1GtTscObjectKeysOnlineProd.h"
00019
00020
00021
00022
00023 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00024
00025
00026 L1GtTscObjectKeysOnlineProd::L1GtTscObjectKeysOnlineProd(const edm::ParameterSet& parSet) :
00027 L1ObjectKeysOnlineProdBase(parSet),
00028 m_enableL1GtParameters(
00029 parSet.getParameter<bool> ("EnableL1GtParameters")),
00030 m_enableL1GtTriggerMenu(
00031 parSet.getParameter<bool> ("EnableL1GtTriggerMenu")),
00032 m_enableL1GtPsbSetup(
00033 parSet.getParameter<bool> ("EnableL1GtPsbSetup")) {
00034
00035
00036
00037 }
00038
00039
00040 L1GtTscObjectKeysOnlineProd::~L1GtTscObjectKeysOnlineProd() {
00041
00042
00043
00044 }
00045
00046
00047
00048 std::string L1GtTscObjectKeysOnlineProd::keyL1GtParameters(
00049 const std::string& subsystemKey, const std::string& gtSchema) {
00050
00051 std::string objectKey;
00052
00053 if (!subsystemKey.empty()) {
00054
00055
00056
00057
00058 l1t::OMDSReader::QueryResults objectKeyResults = m_omdsReader.basicQuery(
00059 "GTFE_SETUP_FK", gtSchema, "GT_SETUP", "GT_SETUP.ID", m_omdsReader.singleAttribute(
00060 subsystemKey));
00061
00062
00063 if (objectKeyResults.queryFailed()) {
00064 edm::LogError("L1-O2O")
00065 << "Problem with key for record L1GtParametersRcd: query failed ";
00066 return objectKey;
00067 } else if ( ( objectKeyResults.numberRows() != 1 )) {
00068 edm::LogError("L1-O2O") << "Problem with key for record L1GtParametersRcd: "
00069 << ( objectKeyResults.numberRows() ) << " rows were returned";
00070 return objectKey;
00071 }
00072
00073 objectKeyResults.fillVariable(objectKey);
00074 }
00075
00076 return objectKey;
00077 }
00078
00079 std::string L1GtTscObjectKeysOnlineProd::keyL1GtTriggerMenu(
00080 const std::string& subsystemKey, const std::string& gtSchema) {
00081
00082 std::string objectKey;
00083
00084 if (!subsystemKey.empty()) {
00085
00086
00087
00088
00089 l1t::OMDSReader::QueryResults objectKeyResults = m_omdsReader.basicQuery(
00090 "L1T_MENU_FK", gtSchema, "GT_SETUP", "GT_SETUP.ID", m_omdsReader.singleAttribute(
00091 subsystemKey));
00092
00093
00094 if (objectKeyResults.queryFailed()) {
00095 edm::LogError("L1-O2O")
00096 << "Problem with key for record L1GtTriggerMenuRcd: query failed ";
00097 return objectKey;
00098 } else if ( ( objectKeyResults.numberRows() != 1 )) {
00099 edm::LogError("L1-O2O") << "Problem with key for record L1GtTriggerMenuRcd: "
00100 << ( objectKeyResults.numberRows() ) << " rows were returned";
00101 return objectKey;
00102 }
00103
00104 objectKeyResults.fillVariable(objectKey);
00105 }
00106
00107 return objectKey;
00108
00109 }
00110
00111 std::string L1GtTscObjectKeysOnlineProd::keyL1GtPsbSetup(
00112 const std::string& subsystemKey, const std::string& gtSchema) {
00113
00114 std::string objectKey;
00115
00116 if (!subsystemKey.empty()) {
00117
00118
00119
00120 objectKey = subsystemKey;
00121
00122 }
00123
00124 return objectKey;
00125
00126 }
00127
00128
00129 void L1GtTscObjectKeysOnlineProd::fillObjectKeys(ReturnType pL1TriggerKey) {
00130
00131
00132
00133
00134 std::string subsystemKey = pL1TriggerKey->subsystemKey(L1TriggerKey::kGT);
00135 const std::string gtSchema = "CMS_GT";
00136
00137
00138 if (m_enableL1GtParameters) {
00139 const std::string& objectKey = keyL1GtParameters(subsystemKey, gtSchema);
00140 if (!objectKey.empty()) {
00141 pL1TriggerKey->add("L1GtParametersRcd", "L1GtParameters", objectKey);
00142 }
00143 }
00144
00145
00146 if (m_enableL1GtTriggerMenu) {
00147 const std::string& objectKey = keyL1GtTriggerMenu(subsystemKey, gtSchema);
00148 if (!objectKey.empty()) {
00149 pL1TriggerKey->add("L1GtTriggerMenuRcd", "L1GtTriggerMenu", objectKey);
00150 }
00151 }
00152
00153
00154 if (m_enableL1GtPsbSetup) {
00155 const std::string& objectKey = keyL1GtPsbSetup(subsystemKey, gtSchema);
00156 if (!objectKey.empty()) {
00157 pL1TriggerKey->add("L1GtPsbSetupRcd", "L1GtPsbSetup", objectKey);
00158 }
00159 }
00160
00161 }
00162
00163 DEFINE_FWK_EVENTSETUP_MODULE( L1GtTscObjectKeysOnlineProd);