CMS 3D CMS Logo

L1GtTriggerMaskTechTrigConfigOnlineProd.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <vector>
20 #include "boost/lexical_cast.hpp"
21 
22 // user include files
24 
25 // constructor
28  m_partitionNumber(parSet.getParameter<int>("PartitionNumber")) {
29  // empty
30 }
31 
32 // destructor
34  // empty
35 }
36 
37 // public methods
38 
39 std::unique_ptr<L1GtTriggerMask> L1GtTriggerMaskTechTrigConfigOnlineProd::newObject(const std::string& objectKey) {
40  auto pL1GtTriggerMask = std::make_unique<L1GtTriggerMask>();
41 
42  // l1GtTriggerMaskTechTrig: FINOR_TT_FK key in GT_PARTITION_FINOR_TT
43 
44  const std::string gtSchema = "CMS_GT";
45 
46  // SQL query:
47  //
48  // select * from CMS_GT.GT_PARTITION_FINOR_TT WHERE GT_PARTITION_FINOR_TT.ID = objectKey
49 
50  const std::vector<std::string>& columns = m_omdsReader.columnNames(gtSchema, "GT_PARTITION_FINOR_TT");
51 
52  if (edm::isDebugEnabled()) {
53  for (std::vector<std::string>::const_iterator iter = columns.begin(); iter != columns.end(); iter++) {
54  LogTrace("L1GtTriggerMaskTechTrigConfigOnlineProd") << (*iter) << std::endl;
55  }
56  }
57 
59  columns, gtSchema, "GT_PARTITION_FINOR_TT", "GT_PARTITION_FINOR_TT.ID", m_omdsReader.singleAttribute(objectKey));
60 
61  // check if query was successful
62  if (results.queryFailed()) {
63  edm::LogError("L1-O2O") << "Problem with L1GtTriggerMaskTechTrigRcd key:" << objectKey;
64  return pL1GtTriggerMask;
65  }
66 
67  // mask for other partitions than m_partitionNumber set to 1 (algorithm masked)
68  int maskSize = columns.size() - 1; // table ID is also in columns
69  std::vector<bool> trigMaskBool(maskSize, false);
70  std::vector<unsigned int> trigMask(maskSize, 0);
71 
72  for (int i = 0; i < maskSize; i++) {
73  bool tMask = trigMaskBool[i];
74  results.fillVariable(columns[i + 1], tMask);
75  trigMask[i] = 0xFF & (~(static_cast<unsigned int>(tMask) << m_partitionNumber));
76  }
77 
78  // fill the record
79  pL1GtTriggerMask->setGtTriggerMask(trigMask);
80 
81  if (edm::isDebugEnabled()) {
82  std::ostringstream myCoutStream;
83  pL1GtTriggerMask->print(myCoutStream);
84  LogTrace("L1GtTriggerMaskTechTrigConfigOnlineProd")
85  << "\nThe following L1GtTriggerMaskTechTrigRcd record was read from OMDS: \n"
86  << myCoutStream.str() << "\n"
87  << std::endl;
88  }
89 
90  return pL1GtTriggerMask;
91 }
92 
l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
L1GtTriggerMaskTechTrigConfigOnlineProd.h
L1GtTriggerMaskTechTrigConfigOnlineProd::newObject
std::unique_ptr< L1GtTriggerMask > newObject(const std::string &objectKey) override
public methods
Definition: L1GtTriggerMaskTechTrigConfigOnlineProd.cc:39
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
L1ConfigOnlineProdBase< L1GtTriggerMaskTechTrigRcd, L1GtTriggerMask >::m_omdsReader
l1t::OMDSReader m_omdsReader
Definition: L1ConfigOnlineProdBase.h:65
L1GtTriggerMaskTechTrigConfigOnlineProd::m_partitionNumber
int m_partitionNumber
partition number
Definition: L1GtTriggerMaskTechTrigConfigOnlineProd.h:46
bookConverter.results
results
Definition: bookConverter.py:144
l1t::OMDSReader::singleAttribute
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
L1ConfigOnlineProdBase
Definition: L1ConfigOnlineProdBase.h:52
L1GtTriggerMaskTechTrigConfigOnlineProd
Definition: L1GtTriggerMaskTechTrigConfigOnlineProd.h:32
L1GtTriggerMaskTechTrigConfigOnlineProd::~L1GtTriggerMaskTechTrigConfigOnlineProd
~L1GtTriggerMaskTechTrigConfigOnlineProd() override
destructor
Definition: L1GtTriggerMaskTechTrigConfigOnlineProd.cc:33
L1GtTriggerMaskTechTrigConfigOnlineProd::L1GtTriggerMaskTechTrigConfigOnlineProd
L1GtTriggerMaskTechTrigConfigOnlineProd(const edm::ParameterSet &)
constructor
Definition: L1GtTriggerMaskTechTrigConfigOnlineProd.cc:26
l1t::OMDSReader::columnNames
std::vector< std::string > columnNames(const std::string &schemaName, const std::string &tableName)
Definition: OMDSReader.cc:138
L1GtTriggerMaskTechTrigRcd
Definition: L1GtTriggerMaskTechTrigRcd.h:39
L1GtTriggerMask
Definition: L1GtTriggerMask.h:33
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
createfilelist.int
int
Definition: createfilelist.py:10
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
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
mps_check.columns
columns
Definition: mps_check.py:244
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:12
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234