CMS 3D CMS Logo

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