File indexing completed on 2024-04-06 12:22:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "L1TriggerConfig/L1GtConfigProducers/interface/L1GtTriggerMaskVetoTechTrigConfigOnlineProd.h"
0017
0018
0019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0020
0021
0022 L1GtTriggerMaskVetoTechTrigConfigOnlineProd::L1GtTriggerMaskVetoTechTrigConfigOnlineProd(const edm::ParameterSet& parSet)
0023 : L1ConfigOnlineProdBase<L1GtTriggerMaskVetoTechTrigRcd, L1GtTriggerMask>(parSet),
0024 m_partitionNumber(parSet.getParameter<int>("PartitionNumber")) {
0025
0026 }
0027
0028
0029 L1GtTriggerMaskVetoTechTrigConfigOnlineProd::~L1GtTriggerMaskVetoTechTrigConfigOnlineProd() {
0030
0031 }
0032
0033
0034
0035 std::unique_ptr<L1GtTriggerMask> L1GtTriggerMaskVetoTechTrigConfigOnlineProd::newObject(const std::string& objectKey) {
0036 auto pL1GtTriggerMask = std::make_unique<L1GtTriggerMask>();
0037
0038
0039
0040 const std::string gtSchema = "CMS_GT";
0041
0042
0043
0044
0045
0046 const std::vector<std::string>& columns = m_omdsReader.columnNames(gtSchema, "GT_PARTITION_VETO_TT");
0047
0048 if (edm::isDebugEnabled()) {
0049 for (std::vector<std::string>::const_iterator iter = columns.begin(); iter != columns.end(); iter++) {
0050 LogTrace("L1GtTriggerMaskVetoTechTrigConfigOnlineProd") << (*iter) << std::endl;
0051 }
0052 }
0053
0054 l1t::OMDSReader::QueryResults results = m_omdsReader.basicQuery(
0055 columns, gtSchema, "GT_PARTITION_VETO_TT", "GT_PARTITION_VETO_TT.ID", m_omdsReader.singleAttribute(objectKey));
0056
0057
0058 if (results.queryFailed()) {
0059 edm::LogError("L1-O2O") << "Problem with L1GtTriggerMaskVetoTechTrigRcd key:" << objectKey;
0060 return pL1GtTriggerMask;
0061 }
0062
0063
0064 int maskSize = columns.size() - 1;
0065 std::vector<bool> trigMaskBool(maskSize, false);
0066 std::vector<unsigned int> trigMask(maskSize, 0);
0067
0068 for (int i = 0; i < maskSize; i++) {
0069 bool tMask = trigMaskBool[i];
0070 results.fillVariable(columns[i + 1], tMask);
0071 trigMask[i] = 0xFF & (~(static_cast<unsigned int>(tMask) << m_partitionNumber));
0072 }
0073
0074
0075 pL1GtTriggerMask->setGtTriggerMask(trigMask);
0076
0077 if (edm::isDebugEnabled()) {
0078 std::ostringstream myCoutStream;
0079 pL1GtTriggerMask->print(myCoutStream);
0080 LogTrace("L1GtTriggerMaskVetoTechTrigConfigOnlineProd")
0081 << "\nThe following L1GtTriggerMaskVetoTechTrigRcd record was read from OMDS: \n"
0082 << myCoutStream.str() << "\n"
0083 << std::endl;
0084 }
0085
0086 return pL1GtTriggerMask;
0087 }
0088
0089 DEFINE_FWK_EVENTSETUP_MODULE(L1GtTriggerMaskVetoTechTrigConfigOnlineProd);