CMS 3D CMS Logo

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