CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
L1GtTriggerMenuConfigOnlineProd Class Reference

#include <L1GtTriggerMenuConfigOnlineProd.h>

Inheritance diagram for L1GtTriggerMenuConfigOnlineProd:
L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu > edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Classes

struct  TableMenuAlgo
 
struct  TableMenuAlgoCond
 
struct  TableMenuCond
 
struct  TableMenuGeneral
 define simple structures to get the tables from DB More...
 
struct  TableMenuObjectParameters
 
struct  TableMenuTechTrig
 

Public Member Functions

void init (const int numberConditionChips)
 initialize the class (mainly reserve/resize) More...
 
 L1GtTriggerMenuConfigOnlineProd (const edm::ParameterSet &)
 constructor More...
 
std::unique_ptr< L1GtTriggerMenunewObject (const std::string &objectKey) override
 public methods More...
 
 ~L1GtTriggerMenuConfigOnlineProd () override
 destructor More...
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1GtTriggerMenuproduce (const L1GtTriggerMenuRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Private Member Functions

void addBptxCondition (const TableMenuCond &)
 
void addCaloCondition (const TableMenuCond &)
 
void addCastorCondition (const TableMenuCond &)
 
void addConditions ()
 add the conditions from a menu to the corresponding list More...
 
void addCorrelationCondition (const TableMenuCond &)
 
void addEnergySumCondition (const TableMenuCond &)
 
void addExternalCondition (const TableMenuCond &)
 
void addHfBitCountsCondition (const TableMenuCond &)
 
void addHfRingEtSumsCondition (const TableMenuCond &)
 
void addJetCountsCondition (const TableMenuCond &)
 
void addMuonCondition (const TableMenuCond &)
 
void buildAlgorithmMap ()
 build the algorithm map in the menu More...
 
void buildTechnicalTriggerMap ()
 build the technical trigger map in the menu More...
 
int chipNumber (short) const
 return the chip number for an algorithm with index bitNumberSh More...
 
const std::map< int, std::string > condIndexNameMap (const short bitNr) const
 
std::string convertLogicalExpression (const std::string &, const std::map< int, std::string > &) const
 convert a logical expression with indices to a logical expression with names More...
 
void fillCaloObjectParameter (const std::string &opFK, L1GtCaloTemplate::ObjectParameter &)
 
void fillEnergySumObjectParameter (const std::string &opFK, L1GtEnergySumTemplate::ObjectParameter &, const L1GtObject &)
 
void fillMuonObjectParameter (const std::string &opFK, L1GtMuonTemplate::ObjectParameter &)
 
template<typename Result , typename Source >
Result lexical_cast_from_hex (Source &value) const
 
std::list< int > listChipNumber (const std::string &)
 get a list of chip numbers from the m_tableMenuAlgoCond table for a condition More...
 
void splitHexStringInTwo64bitWords (const std::string &hexStr, std::string &hex0WordStr, std::string &hex1WordStr)
 split a hex string in two 64-bit words returned as hex strings More...
 
L1GtConditionCategory strToEnumCondCategory (const std::string &strCategory)
 string to enum L1GtConditionCategory conversion More...
 
L1GtConditionType strToEnumCondType (const std::string &strType)
 string to enum L1GtConditionType conversion More...
 
L1GtObject strToEnumL1GtObject (const std::string &strObject)
 string to enum L1GtObject conversion More...
 
bool tableMenuAlgoCondFromDB (const std::string &gtSchema, const std::string &objKey)
 retrieve table with conditions associated to physics algorithms from DB More...
 
bool tableMenuAlgoFromDB (const std::string &gtSchema, const std::string &objKey)
 retrieve table with physics algorithms from DB More...
 
bool tableMenuCondFromDB (const std::string &gtSchema, const std::string &objKey)
 retrieve table with list of conditions in the menu More...
 
bool tableMenuGeneralFromDB (const std::string &gtSchema, const std::string &objKey)
 methods to retrieve the tables from DB More...
 
bool tableMenuObjectParametersFromDB (const std::string &gtSchema, const std::string &objKey)
 retrieve table with object parameters from DB More...
 
bool tableMenuTechTrigFromDB (const std::string &gtSchema, const std::string &objKey)
 retrieve table with technical triggers from DB More...
 

Private Attributes

AlgorithmMap m_algorithmAliasMap
 map containing the physics algorithms (by alias) More...
 
AlgorithmMap m_algorithmMap
 map containing the physics algorithms (by name) More...
 
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
 
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
 
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
 
bool m_isDebugEnabled
 
std::string m_scaleDbKey
 menu associated scale key More...
 
std::vector< TableMenuAlgom_tableMenuAlgo
 
std::vector< TableMenuAlgoCondm_tableMenuAlgoCond
 
std::vector< TableMenuCondm_tableMenuCond
 
TableMenuGeneral m_tableMenuGeneral
 member to keep various tables retrieved from DB More...
 
std::vector< TableMenuObjectParametersm_tableMenuObjectParameters
 
std::vector< TableMenuTechTrigm_tableMenuTechTrig
 
AlgorithmMap m_technicalTriggerMap
 map containing the technical triggers More...
 
std::string m_triggerMenuImplementation
 
std::string m_triggerMenuInterface
 menu representation More...
 
std::string m_triggerMenuName
 
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
 
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate
 
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
 
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
 
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
 
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
 
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
 
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
 
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
 
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >
bool getObjectKey (const L1GtTriggerMenuRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Attributes inherited from L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >
std::optional< edm::ESConsumesCollectorT< L1GtTriggerMenuRcd > > m_consumesCollector
 
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Description: online producer for L1GtTriggerMenu.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 47 of file L1GtTriggerMenuConfigOnlineProd.h.

Constructor & Destructor Documentation

◆ L1GtTriggerMenuConfigOnlineProd()

L1GtTriggerMenuConfigOnlineProd::L1GtTriggerMenuConfigOnlineProd ( const edm::ParameterSet parSet)

◆ ~L1GtTriggerMenuConfigOnlineProd()

L1GtTriggerMenuConfigOnlineProd::~L1GtTriggerMenuConfigOnlineProd ( )
override

destructor

Definition at line 44 of file L1GtTriggerMenuConfigOnlineProd.cc.

44  {
45  // empty
46 }

Member Function Documentation

◆ addBptxCondition()

void L1GtTriggerMenuConfigOnlineProd::addBptxCondition ( const TableMenuCond condDB)
private

Definition at line 1364 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject1, listChipNumber(), LogTrace, m_isDebugEnabled, m_vecBptxTemplate, getGTfromDQMFile::obj, electrons_cff::objType, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), and strToEnumL1GtObject().

Referenced by addConditions().

1364  {
1365  L1GtBptxTemplate bptxCond(condDB.cond);
1366  bptxCond.setCondType(strToEnumCondType(condDB.condType));
1367 
1368  // object types - logical conditions have no objects associated in GT
1369  // one put however a "Bptx" object type
1370  int nrObj = 1;
1371 
1372  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1373  std::vector<L1GtObject> objType(nrObj, obj);
1374  bptxCond.setObjectType(objType);
1375 
1376  // irrelevant, set to false for completeness
1377  bptxCond.setCondGEq(false);
1378 
1379  // logical conditions have no ObjectParameter, no CorrelationParameter
1380 
1381  // get chip number list
1382  std::list<int> chipList = listChipNumber(condDB.cond);
1383 
1384  // eliminate duplicates
1385  chipList.sort();
1386  chipList.unique();
1387 
1388  // add the same condition once to every chip where required
1389  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1390  bptxCond.setCondChipNr(*itChip);
1391 
1392  // no check for uniqueness - done by DB
1393  (m_vecBptxTemplate[*itChip]).push_back(bptxCond);
1394 
1395  if (m_isDebugEnabled) {
1396  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1397  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1398 
1399  LogTrace("L1GtTriggerMenuConfigOnlineProd") << bptxCond << "\n" << std::endl;
1400  }
1401  }
1402 }
#define LogTrace(id)
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion

◆ addCaloCondition()

void L1GtTriggerMenuConfigOnlineProd::addCaloCondition ( const TableMenuCond condDB)
private

Definition at line 1054 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condGEq, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, L1GtCaloTemplate::CorrelationParameter::deltaEtaRange, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::deltaEtaRange, L1GtCaloTemplate::CorrelationParameter::deltaPhiMaxbits, L1GtCaloTemplate::CorrelationParameter::deltaPhiRange, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::deltaPhiRange, fillCaloObjectParameter(), L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject1, listChipNumber(), LogTrace, m_isDebugEnabled, m_vecCaloTemplate, L1GtCondition::nrObjects(), getGTfromDQMFile::obj, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter1FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter2FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter3FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter4FK, electrons_cff::objType, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtCaloTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), strToEnumL1GtObject(), and L1GtCondition::wsc().

Referenced by addConditions().

1054  {
1055  L1GtCaloTemplate caloCond(condDB.cond);
1056  caloCond.setCondType(strToEnumCondType(condDB.condType));
1057 
1058  // object types - all have the same type, so reading it for first object is OK
1059  int nrObj = caloCond.nrObjects();
1060 
1061  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1062  std::vector<L1GtObject> objType(nrObj, obj);
1063  caloCond.setObjectType(objType);
1064 
1065  caloCond.setCondGEq(condDB.condGEq);
1066 
1067  // temporary storage of the parameters
1068  std::vector<L1GtCaloTemplate::ObjectParameter> objParameter(nrObj);
1069 
1070  for (int iObj = 0; iObj < nrObj; ++iObj) {
1071  if (iObj == 0) {
1072  fillCaloObjectParameter(condDB.objectParameter1FK, objParameter[iObj]);
1073  } else if (iObj == 1) {
1074  fillCaloObjectParameter(condDB.objectParameter2FK, objParameter[iObj]);
1075  } else if (iObj == 2) {
1076  fillCaloObjectParameter(condDB.objectParameter3FK, objParameter[iObj]);
1077  } else if (iObj == 3) {
1078  fillCaloObjectParameter(condDB.objectParameter4FK, objParameter[iObj]);
1079  } else {
1080  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1081  << "\n Warning: number of objects requested " << nrObj << " not available in DB."
1082  << "\n Maximum 4 object parameters implemented. \n"
1083  << std::endl;
1084  }
1085  }
1086 
1088  if (caloCond.wsc()) {
1089  corrParameter.deltaEtaRange = lexical_cast_from_hex<unsigned long long>(condDB.deltaEtaRange);
1090 
1091  corrParameter.deltaPhiRange = lexical_cast_from_hex<unsigned long long>(condDB.deltaPhiRange);
1092  corrParameter.deltaPhiMaxbits = 0; // FIXME check correlations
1093  }
1094 
1095  caloCond.setConditionParameter(objParameter, corrParameter);
1096 
1097  // get chip number list
1098  std::list<int> chipList = listChipNumber(condDB.cond);
1099 
1100  // eliminate duplicates
1101  chipList.sort();
1102  chipList.unique();
1103 
1104  // add the same condition once to every chip where required
1105  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1106  caloCond.setCondChipNr(*itChip);
1107 
1108  // no check for uniqueness - done by DB
1109  (m_vecCaloTemplate[*itChip]).push_back(caloCond);
1110 
1111  if (m_isDebugEnabled) {
1112  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1113  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1114 
1115  LogTrace("L1GtTriggerMenuConfigOnlineProd") << caloCond << "\n" << std::endl;
1116  }
1117  }
1118 }
void fillCaloObjectParameter(const std::string &opFK, L1GtCaloTemplate::ObjectParameter &)
#define LogTrace(id)
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
typedef for correlation parameters
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion

◆ addCastorCondition()

void L1GtTriggerMenuConfigOnlineProd::addCastorCondition ( const TableMenuCond condDB)
private

Definition at line 1324 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject1, listChipNumber(), LogTrace, m_isDebugEnabled, m_vecCastorTemplate, getGTfromDQMFile::obj, electrons_cff::objType, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), and strToEnumL1GtObject().

Referenced by addConditions().

1324  {
1325  L1GtCastorTemplate castorCond(condDB.cond);
1326  castorCond.setCondType(strToEnumCondType(condDB.condType));
1327 
1328  // object types - logical conditions have no objects associated in GT
1329  // one put however a "Castor" object type
1330  int nrObj = 1;
1331 
1332  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1333  std::vector<L1GtObject> objType(nrObj, obj);
1334  castorCond.setObjectType(objType);
1335 
1336  // irrelevant, set to false for completeness
1337  castorCond.setCondGEq(false);
1338 
1339  // logical conditions have no ObjectParameter, no CorrelationParameter
1340 
1341  // get chip number list
1342  std::list<int> chipList = listChipNumber(condDB.cond);
1343 
1344  // eliminate duplicates
1345  chipList.sort();
1346  chipList.unique();
1347 
1348  // add the same condition once to every chip where required
1349  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1350  castorCond.setCondChipNr(*itChip);
1351 
1352  // no check for uniqueness - done by DB
1353  (m_vecCastorTemplate[*itChip]).push_back(castorCond);
1354 
1355  if (m_isDebugEnabled) {
1356  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1357  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1358 
1359  LogTrace("L1GtTriggerMenuConfigOnlineProd") << castorCond << "\n" << std::endl;
1360  }
1361  }
1362 }
#define LogTrace(id)
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion

◆ addConditions()

void L1GtTriggerMenuConfigOnlineProd::addConditions ( )
private

add the conditions from a menu to the corresponding list

Definition at line 1693 of file L1GtTriggerMenuConfigOnlineProd.cc.

References addBptxCondition(), addCaloCondition(), addCastorCondition(), addCorrelationCondition(), addEnergySumCondition(), addExternalCondition(), addHfBitCountsCondition(), addHfRingEtSumsCondition(), addJetCountsCondition(), addMuonCondition(), CondBptx, CondCalo, CondCastor, CondCorrelation, CondEnergySum, CondExternal, CondHfBitCounts, CondHfRingEtSums, CondJetCounts, CondMuon, CondNull, m_tableMenuCond, and strToEnumCondCategory().

Referenced by newObject().

1693  {
1694  // loop over m_tableMenuCond
1695  for (std::vector<TableMenuCond>::const_iterator constIt = m_tableMenuCond.begin(); constIt != m_tableMenuCond.end();
1696  constIt++) {
1697  L1GtConditionCategory conCategory = strToEnumCondCategory((*constIt).condCategory);
1698 
1699  switch (conCategory) {
1700  case CondMuon: {
1701  addMuonCondition(*constIt);
1702 
1703  } break;
1704  case CondCalo: {
1705  addCaloCondition(*constIt);
1706 
1707  } break;
1708  case CondEnergySum: {
1709  addEnergySumCondition(*constIt);
1710 
1711  } break;
1712  case CondJetCounts: {
1713  addJetCountsCondition(*constIt);
1714 
1715  } break;
1716  case CondHfBitCounts: {
1717  addHfBitCountsCondition(*constIt);
1718 
1719  } break;
1720  case CondHfRingEtSums: {
1721  addHfRingEtSumsCondition(*constIt);
1722 
1723  } break;
1724  case CondCastor: {
1725  addCastorCondition(*constIt);
1726 
1727  } break;
1728  case CondBptx: {
1729  addBptxCondition(*constIt);
1730 
1731  } break;
1732  case CondExternal: {
1733  addExternalCondition(*constIt);
1734 
1735  } break;
1736  case CondCorrelation: {
1737  addCorrelationCondition(*constIt);
1738 
1739  } break;
1740  case CondNull: {
1741  // do nothing
1742 
1743  } break;
1744  default: {
1745  // do nothing
1746 
1747  } break;
1748  }
1749  }
1750 }
void addHfRingEtSumsCondition(const TableMenuCond &)
L1GtConditionCategory
condition categories
L1GtConditionCategory strToEnumCondCategory(const std::string &strCategory)
string to enum L1GtConditionCategory conversion

◆ addCorrelationCondition()

void L1GtTriggerMenuConfigOnlineProd::addCorrelationCondition ( const TableMenuCond condDB)
private

Definition at line 1444 of file L1GtTriggerMenuConfigOnlineProd.cc.

References BPTX, Castor, CenJet, L1GtMuonTemplate::CorrelationParameter::chargeCorrelation, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, CondCalo, CondEnergySum, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condGEq, CondMuon, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, L1GtCorrelationTemplate::CorrelationParameter::deltaEtaRange, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::deltaEtaRange, L1GtCorrelationTemplate::CorrelationParameter::deltaPhiMaxbits, L1GtCorrelationTemplate::CorrelationParameter::deltaPhiRange, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::deltaPhiRange, ETM, ETT, fillCaloObjectParameter(), fillEnergySumObjectParameter(), fillMuonObjectParameter(), ForJet, GtExternal, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject1, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject2, HfBitCounts, HfRingEtSums, HTM, HTT, IsoEG, JetCounts, listChipNumber(), LogTrace, m_corCaloTemplate, m_corEnergySumTemplate, m_corMuonTemplate, m_isDebugEnabled, m_vecCorrelationTemplate, Mu, NoIsoEG, getGTfromDQMFile::obj, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter1FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter2FK, electrons_cff::objType, push_back(), L1GtCorrelationTemplate::setCond0Category(), L1GtCorrelationTemplate::setCond0Index(), L1GtCorrelationTemplate::setCond1Category(), L1GtCorrelationTemplate::setCond1Index(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtEnergySumTemplate::setConditionParameter(), L1GtCaloTemplate::setConditionParameter(), L1GtMuonTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCorrelationTemplate::setCorrelationParameter(), L1GtCondition::setObjectType(), findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, strToEnumCondType(), strToEnumL1GtObject(), TauJet, TechTrig, Type1s, TypeETM, and TypeHTM.

Referenced by addConditions().

1444  {
1445  // create a new correlation condition
1446  L1GtCorrelationTemplate correlationCond(condDB.cond);
1447  correlationCond.setCondType(strToEnumCondType(condDB.condType));
1448 
1449  // two objects (for sure) - type taken from DB
1450  const int nrObj = 2;
1451 
1452  std::vector<L1GtObject> objType(nrObj);
1453  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1454  objType[0] = obj;
1455 
1456  obj = strToEnumL1GtObject(condDB.gtObject2);
1457  objType[1] = obj;
1458 
1459  correlationCond.setObjectType(objType);
1460 
1461  // irrelevant, it is set for each subcondition
1462  correlationCond.setCondGEq(condDB.condGEq);
1463 
1464  // get chip number list, eliminate duplicates
1465  std::list<int> chipList = listChipNumber(condDB.cond);
1466  chipList.sort();
1467  chipList.unique();
1468 
1469  // temporary vectors for sub-conditions
1470  std::vector<L1GtConditionCategory> subcondCategory(nrObj);
1471  std::vector<int> subcondIndex(nrObj);
1472 
1473  bool wrongSubcondition = false;
1474 
1475  for (int iObj = 0; iObj < nrObj; ++iObj) {
1476  L1GtObject gtObj = objType[iObj];
1477 
1478  // sub-conditions (all have the same condGEq as the correlation condition).
1479  switch (gtObj) {
1480  case Mu: {
1481  subcondCategory[iObj] = CondMuon;
1482 
1483  // temporary storage of the parameters
1484  std::vector<L1GtMuonTemplate::ObjectParameter> objParameter(1);
1485 
1486  std::string subcondName;
1487  if (iObj == 0) {
1488  fillMuonObjectParameter(condDB.objectParameter1FK, objParameter[0]);
1489  subcondName = condDB.objectParameter1FK;
1490  } else if (iObj == 1) {
1491  subcondName = condDB.objectParameter2FK;
1492  fillMuonObjectParameter(condDB.objectParameter2FK, objParameter[0]);
1493  }
1494 
1495  // chargeCorrelation must be set for muons
1496  // put it to ignore
1498  corrPar.chargeCorrelation = 1;
1499 
1500  L1GtMuonTemplate subcond(subcondName, Type1s);
1501  subcond.setCondGEq(condDB.condGEq);
1502  subcond.setObjectType(std::vector<L1GtObject>(1, gtObj));
1503  subcond.setConditionParameter(objParameter, corrPar);
1504 
1505  // add the same sub-condition once to every chip where required
1506  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1507  subcond.setCondChipNr(*itChip);
1508 
1509  // no check for uniqueness - done by DB
1510  (m_corMuonTemplate[*itChip]).push_back(subcond);
1511 
1512  // index
1513  subcondIndex[iObj] = (m_corMuonTemplate[*itChip]).size() - 1;
1514 
1515  if (m_isDebugEnabled) {
1516  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1517  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1518 
1519  LogTrace("L1GtTriggerMenuConfigOnlineProd") << subcond << "\n" << std::endl;
1520  }
1521  }
1522 
1523  } break;
1524 
1525  case IsoEG:
1526  case NoIsoEG:
1527  case CenJet:
1528  case ForJet:
1529  case TauJet: {
1530  subcondCategory[iObj] = CondCalo;
1531 
1532  // temporary storage of the parameters
1533  std::vector<L1GtCaloTemplate::ObjectParameter> objParameter(1);
1534 
1535  std::string subcondName;
1536  if (iObj == 0) {
1537  fillCaloObjectParameter(condDB.objectParameter1FK, objParameter[0]);
1538  subcondName = condDB.objectParameter1FK;
1539  } else if (iObj == 1) {
1540  subcondName = condDB.objectParameter2FK;
1541  fillCaloObjectParameter(condDB.objectParameter2FK, objParameter[0]);
1542  }
1543 
1544  L1GtCaloTemplate::CorrelationParameter corrPar; // dummy
1545 
1546  L1GtCaloTemplate subcond(subcondName, Type1s);
1547  subcond.setCondGEq(condDB.condGEq);
1548  subcond.setObjectType(std::vector<L1GtObject>(1, gtObj));
1549  subcond.setConditionParameter(objParameter, corrPar);
1550 
1551  // add the same sub-condition once to every chip where required
1552  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1553  subcond.setCondChipNr(*itChip);
1554 
1555  // no check for uniqueness - done by DB
1556  (m_corCaloTemplate[*itChip]).push_back(subcond);
1557 
1558  // index
1559  subcondIndex[iObj] = (m_corCaloTemplate[*itChip]).size() - 1;
1560 
1561  if (m_isDebugEnabled) {
1562  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1563  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1564 
1565  LogTrace("L1GtTriggerMenuConfigOnlineProd") << subcond << "\n" << std::endl;
1566  }
1567  }
1568  } break;
1569 
1570  case ETM:
1571  case HTM: {
1572  subcondCategory[iObj] = CondEnergySum;
1573 
1574  // temporary storage of the parameters
1575  std::vector<L1GtEnergySumTemplate::ObjectParameter> objParameter(1);
1576 
1577  std::string subcondName;
1578  if (iObj == 0) {
1579  fillEnergySumObjectParameter(condDB.objectParameter1FK, objParameter[0], gtObj);
1580  subcondName = condDB.objectParameter1FK;
1581  } else if (iObj == 1) {
1582  subcondName = condDB.objectParameter2FK;
1583  fillEnergySumObjectParameter(condDB.objectParameter2FK, objParameter[0], gtObj);
1584  }
1585 
1586  L1GtConditionType condType;
1587 
1588  switch (gtObj) {
1589  case ETM: {
1590  condType = TypeETM;
1591  } break;
1592  case HTM: {
1593  condType = TypeHTM;
1594  } break;
1595  default: {
1596  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
1597  << "\n Warning: wrong L1GtConditionType " << gtObj << std::endl;
1598 
1599  } break;
1600  }
1601 
1602  L1GtEnergySumTemplate subcond(subcondName, condType);
1603  subcond.setCondGEq(condDB.condGEq);
1604  subcond.setObjectType(std::vector<L1GtObject>(1, gtObj));
1605  subcond.setConditionParameter(objParameter);
1606 
1607  // add the same sub-condition once to every chip where required
1608  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1609  subcond.setCondChipNr(*itChip);
1610 
1611  // no check for uniqueness - done by DB
1612  (m_corEnergySumTemplate[*itChip]).push_back(subcond);
1613 
1614  // index
1615  subcondIndex[iObj] = (m_corEnergySumTemplate[*itChip]).size() - 1;
1616 
1617  if (m_isDebugEnabled) {
1618  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1619  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1620 
1621  LogTrace("L1GtTriggerMenuConfigOnlineProd") << subcond << "\n" << std::endl;
1622  }
1623  }
1624  } break;
1625  case ETT:
1626  case HTT:
1627  case JetCounts:
1628  case HfBitCounts:
1629  case HfRingEtSums:
1630  case Castor:
1631  case BPTX:
1632  case GtExternal:
1633  case TechTrig: {
1634  // wrongSubcondition = true;
1635  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
1636  << "\n Warning: correlation condition " << (condDB.cond) << " with invalid sub-condition object type "
1637  << gtObj << "\n Condition ignored!" << std::endl;
1638  }
1639  [[fallthrough]];
1640  default: {
1641  wrongSubcondition = true;
1642  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
1643  << "\n Warning: correlation condition " << (condDB.cond) << " with invalid sub-condition object type "
1644  << gtObj << "\n Condition ignored!" << std::endl;
1645 
1646  //
1647 
1648  } break;
1649  }
1650  }
1651 
1652  if (wrongSubcondition) {
1653  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
1654  << "\n Warning: wrong sub-condition for correlation condition " << (condDB.cond)
1655  << "\n Condition not inserted in menu. \n A sub-condition may be left in the menu" << std::endl;
1656  return;
1657  }
1658 
1659  // get the correlation parameters for the correlation condition (std::string)
1661  corrParameter.deltaEtaRange = condDB.deltaEtaRange;
1662  corrParameter.deltaPhiRange = condDB.deltaPhiRange;
1663 
1664  // set condition categories
1665  correlationCond.setCond0Category(subcondCategory[0]);
1666  correlationCond.setCond1Category(subcondCategory[1]);
1667 
1668  // set condition indices in correlation vector
1669  correlationCond.setCond0Index(subcondIndex[0]);
1670  correlationCond.setCond1Index(subcondIndex[1]);
1671 
1672  // set correlation parameter
1673  corrParameter.deltaPhiMaxbits = 0; // TODO
1674  correlationCond.setCorrelationParameter(corrParameter);
1675 
1676  // add the same condition once to every chip where required
1677  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1678  correlationCond.setCondChipNr(*itChip);
1679 
1680  // no check for uniqueness - done by DB
1681  (m_vecCorrelationTemplate[*itChip]).push_back(correlationCond);
1682 
1683  if (m_isDebugEnabled) {
1684  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1685  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1686 
1687  LogTrace("L1GtTriggerMenuConfigOnlineProd") << correlationCond << "\n" << std::endl;
1688  }
1689  }
1690 }
size
Write out results.
Definition: L1GtObject.h:38
void fillMuonObjectParameter(const std::string &opFK, L1GtMuonTemplate::ObjectParameter &)
Definition: L1GtObject.h:36
void fillCaloObjectParameter(const std::string &opFK, L1GtCaloTemplate::ObjectParameter &)
L1GtConditionType
Definition: L1GtObject.h:29
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
void fillEnergySumObjectParameter(const std::string &opFK, L1GtEnergySumTemplate::ObjectParameter &, const L1GtObject &)
#define LogTrace(id)
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
Definition: L1GtObject.h:35
typedef for correlation parameters
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
Definition: L1GtObject.h:37
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
Log< level::Warning, false > LogWarning
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion

◆ addEnergySumCondition()

void L1GtTriggerMenuConfigOnlineProd::addEnergySumCondition ( const TableMenuCond condDB)
private

Definition at line 1149 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condGEq, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, fillEnergySumObjectParameter(), L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject1, listChipNumber(), LogTrace, m_isDebugEnabled, m_vecEnergySumTemplate, getGTfromDQMFile::obj, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter1FK, electrons_cff::objType, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtEnergySumTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), and strToEnumL1GtObject().

Referenced by addConditions().

1149  {
1150  L1GtEnergySumTemplate esumCond(condDB.cond);
1151  esumCond.setCondType(strToEnumCondType(condDB.condType));
1152 
1153  // object types - all energy sums are global - so 1 object
1154  int nrObj = 1;
1155 
1156  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1157  std::vector<L1GtObject> objType(nrObj, obj);
1158  esumCond.setObjectType(objType);
1159 
1160  esumCond.setCondGEq(condDB.condGEq);
1161 
1162  // temporary storage of the parameters - no CorrelationParameter
1163  std::vector<L1GtEnergySumTemplate::ObjectParameter> objParameter(nrObj);
1164  fillEnergySumObjectParameter(condDB.objectParameter1FK, objParameter[0], objType[0]);
1165 
1166  esumCond.setConditionParameter(objParameter);
1167 
1168  // get chip number list
1169  std::list<int> chipList = listChipNumber(condDB.cond);
1170 
1171  // eliminate duplicates
1172  chipList.sort();
1173  chipList.unique();
1174 
1175  // add the same condition once to every chip where required
1176  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1177  esumCond.setCondChipNr(*itChip);
1178 
1179  // no check for uniqueness - done by DB
1180  (m_vecEnergySumTemplate[*itChip]).push_back(esumCond);
1181 
1182  if (m_isDebugEnabled) {
1183  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1184  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1185 
1186  LogTrace("L1GtTriggerMenuConfigOnlineProd") << esumCond << "\n" << std::endl;
1187  }
1188  }
1189 }
void fillEnergySumObjectParameter(const std::string &opFK, L1GtEnergySumTemplate::ObjectParameter &, const L1GtObject &)
#define LogTrace(id)
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion

◆ addExternalCondition()

void L1GtTriggerMenuConfigOnlineProd::addExternalCondition ( const TableMenuCond condDB)
private

Definition at line 1404 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject1, listChipNumber(), LogTrace, m_isDebugEnabled, m_vecExternalTemplate, getGTfromDQMFile::obj, electrons_cff::objType, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), and strToEnumL1GtObject().

Referenced by addConditions().

1404  {
1405  L1GtExternalTemplate externalCond(condDB.cond);
1406  externalCond.setCondType(strToEnumCondType(condDB.condType));
1407 
1408  // object types - logical conditions have no objects associated in GT
1409  // one put however a "External" object type
1410  int nrObj = 1;
1411 
1412  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1413  std::vector<L1GtObject> objType(nrObj, obj);
1414  externalCond.setObjectType(objType);
1415 
1416  // irrelevant, set to false for completeness
1417  externalCond.setCondGEq(false);
1418 
1419  // logical conditions have no ObjectParameter, no CorrelationParameter
1420 
1421  // get chip number list
1422  std::list<int> chipList = listChipNumber(condDB.cond);
1423 
1424  // eliminate duplicates
1425  chipList.sort();
1426  chipList.unique();
1427 
1428  // add the same condition once to every chip where required
1429  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1430  externalCond.setCondChipNr(*itChip);
1431 
1432  // no check for uniqueness - done by DB
1433  (m_vecExternalTemplate[*itChip]).push_back(externalCond);
1434 
1435  if (m_isDebugEnabled) {
1436  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1437  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1438 
1439  LogTrace("L1GtTriggerMenuConfigOnlineProd") << externalCond << "\n" << std::endl;
1440  }
1441  }
1442 }
#define LogTrace(id)
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion

◆ addHfBitCountsCondition()

void L1GtTriggerMenuConfigOnlineProd::addHfBitCountsCondition ( const TableMenuCond condDB)
private

Definition at line 1236 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condGEq, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::countIndex, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::countThreshold, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject1, listChipNumber(), LogTrace, m_isDebugEnabled, m_vecHfBitCountsTemplate, getGTfromDQMFile::obj, electrons_cff::objType, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtHfBitCountsTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), and strToEnumL1GtObject().

Referenced by addConditions().

1236  {
1237  L1GtHfBitCountsTemplate countsCond(condDB.cond);
1238  countsCond.setCondType(strToEnumCondType(condDB.condType));
1239 
1240  // object types - HF bit counts are "global"
1241  int nrObj = 1;
1242 
1243  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1244  std::vector<L1GtObject> objType(nrObj, obj);
1245  countsCond.setObjectType(objType);
1246 
1247  countsCond.setCondGEq(condDB.condGEq);
1248 
1249  // temporary storage of the parameters - no CorrelationParameter
1250  // for counts, the DB implementation is without OP, directly in TableMenuCond
1251  std::vector<L1GtHfBitCountsTemplate::ObjectParameter> objParameter(nrObj);
1252  objParameter.at(0).countIndex = static_cast<unsigned int>(condDB.countIndex);
1253  objParameter.at(0).countThreshold = static_cast<unsigned int>(condDB.countThreshold);
1254 
1255  countsCond.setConditionParameter(objParameter);
1256 
1257  // get chip number list
1258  std::list<int> chipList = listChipNumber(condDB.cond);
1259 
1260  // eliminate duplicates
1261  chipList.sort();
1262  chipList.unique();
1263 
1264  // add the same condition once to every chip where required
1265  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1266  countsCond.setCondChipNr(*itChip);
1267 
1268  // no check for uniqueness - done by DB
1269  (m_vecHfBitCountsTemplate[*itChip]).push_back(countsCond);
1270 
1271  if (m_isDebugEnabled) {
1272  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1273  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1274 
1275  LogTrace("L1GtTriggerMenuConfigOnlineProd") << countsCond << "\n" << std::endl;
1276  }
1277  }
1278 }
#define LogTrace(id)
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion

◆ addHfRingEtSumsCondition()

void L1GtTriggerMenuConfigOnlineProd::addHfRingEtSumsCondition ( const TableMenuCond condDB)
private

Definition at line 1280 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condGEq, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::countIndex, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::countThreshold, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject1, listChipNumber(), LogTrace, m_isDebugEnabled, m_vecHfRingEtSumsTemplate, getGTfromDQMFile::obj, electrons_cff::objType, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtHfRingEtSumsTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), and strToEnumL1GtObject().

Referenced by addConditions().

1280  {
1281  L1GtHfRingEtSumsTemplate esumCond(condDB.cond);
1282  esumCond.setCondType(strToEnumCondType(condDB.condType));
1283 
1284  // object types - HF energy sums are "global"
1285  int nrObj = 1;
1286 
1287  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1288  std::vector<L1GtObject> objType(nrObj, obj);
1289  esumCond.setObjectType(objType);
1290 
1291  esumCond.setCondGEq(condDB.condGEq);
1292 
1293  // temporary storage of the parameters - no CorrelationParameter
1294  // for HF energy sums, the DB implementation is without OP, directly in TableMenuCond
1295  std::vector<L1GtHfRingEtSumsTemplate::ObjectParameter> objParameter(nrObj);
1296  objParameter.at(0).etSumIndex = static_cast<unsigned int>(condDB.countIndex);
1297  objParameter.at(0).etSumThreshold = static_cast<unsigned int>(condDB.countThreshold);
1298 
1299  esumCond.setConditionParameter(objParameter);
1300 
1301  // get chip number list
1302  std::list<int> chipList = listChipNumber(condDB.cond);
1303 
1304  // eliminate duplicates
1305  chipList.sort();
1306  chipList.unique();
1307 
1308  // add the same condition once to every chip where required
1309  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1310  esumCond.setCondChipNr(*itChip);
1311 
1312  // no check for uniqueness - done by DB
1313  (m_vecHfRingEtSumsTemplate[*itChip]).push_back(esumCond);
1314 
1315  if (m_isDebugEnabled) {
1316  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1317  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1318 
1319  LogTrace("L1GtTriggerMenuConfigOnlineProd") << esumCond << "\n" << std::endl;
1320  }
1321  }
1322 }
#define LogTrace(id)
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion

◆ addJetCountsCondition()

void L1GtTriggerMenuConfigOnlineProd::addJetCountsCondition ( const TableMenuCond condDB)
private

Definition at line 1191 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condGEq, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::countIndex, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::countThreshold, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject1, listChipNumber(), LogTrace, m_isDebugEnabled, m_vecJetCountsTemplate, getGTfromDQMFile::obj, electrons_cff::objType, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtJetCountsTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), and strToEnumL1GtObject().

Referenced by addConditions().

1191  {
1192  L1GtJetCountsTemplate jcCond(condDB.cond);
1193  jcCond.setCondType(strToEnumCondType(condDB.condType));
1194 
1195  // object types - jet counts are "global"
1196  int nrObj = 1;
1197 
1198  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1199  std::vector<L1GtObject> objType(nrObj, obj);
1200  jcCond.setObjectType(objType);
1201 
1202  jcCond.setCondGEq(condDB.condGEq);
1203 
1204  // temporary storage of the parameters - no CorrelationParameter
1205  // for counts, the DB implementation is without OP, directly in TableMenuCond
1206  std::vector<L1GtJetCountsTemplate::ObjectParameter> objParameter(nrObj);
1207  objParameter.at(0).countIndex = static_cast<unsigned int>(condDB.countIndex);
1208  objParameter.at(0).countThreshold = static_cast<unsigned int>(condDB.countThreshold);
1209  objParameter.at(0).countOverflow = false; // not used
1210 
1211  jcCond.setConditionParameter(objParameter);
1212 
1213  // get chip number list
1214  std::list<int> chipList = listChipNumber(condDB.cond);
1215 
1216  // eliminate duplicates
1217  chipList.sort();
1218  chipList.unique();
1219 
1220  // add the same condition once to every chip where required
1221  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1222  jcCond.setCondChipNr(*itChip);
1223 
1224  // no check for uniqueness - done by DB
1225  (m_vecJetCountsTemplate[*itChip]).push_back(jcCond);
1226 
1227  if (m_isDebugEnabled) {
1228  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1229  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1230 
1231  LogTrace("L1GtTriggerMenuConfigOnlineProd") << jcCond << "\n" << std::endl;
1232  }
1233  }
1234 }
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
#define LogTrace(id)
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion

◆ addMuonCondition()

void L1GtTriggerMenuConfigOnlineProd::addMuonCondition ( const TableMenuCond condDB)
private

Definition at line 966 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtMuonTemplate::CorrelationParameter::chargeCorrelation, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::chargeCorrelation, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condGEq, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, L1GtMuonTemplate::CorrelationParameter::deltaEtaRange, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::deltaEtaRange, L1GtMuonTemplate::CorrelationParameter::deltaPhiMaxbits, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::deltaPhiRange, L1GtMuonTemplate::CorrelationParameter::deltaPhiRange0Word, L1GtMuonTemplate::CorrelationParameter::deltaPhiRange1Word, fillMuonObjectParameter(), listChipNumber(), LogTrace, m_isDebugEnabled, m_vecMuonTemplate, Mu, L1GtCondition::nrObjects(), L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter1FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter2FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter3FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter4FK, electrons_cff::objType, push_back(), L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtMuonTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), splitHexStringInTwo64bitWords(), AlCaHLTBitMon_QueryRunRegistry::string, strToEnumCondType(), and L1GtCondition::wsc().

Referenced by addConditions().

966  {
967  L1GtMuonTemplate muonCond(condDB.cond);
968  muonCond.setCondType(strToEnumCondType(condDB.condType));
969 
970  // object types - all muons
971  int nrObj = muonCond.nrObjects();
972  std::vector<L1GtObject> objType(nrObj, Mu);
973  muonCond.setObjectType(objType);
974 
975  muonCond.setCondGEq(condDB.condGEq);
976 
977  // temporary storage of the parameters
978  std::vector<L1GtMuonTemplate::ObjectParameter> objParameter(nrObj);
979 
980  for (int iObj = 0; iObj < nrObj; ++iObj) {
981  if (iObj == 0) {
982  fillMuonObjectParameter(condDB.objectParameter1FK, objParameter[iObj]);
983  } else if (iObj == 1) {
984  fillMuonObjectParameter(condDB.objectParameter2FK, objParameter[iObj]);
985  } else if (iObj == 2) {
986  fillMuonObjectParameter(condDB.objectParameter3FK, objParameter[iObj]);
987  } else if (iObj == 3) {
988  fillMuonObjectParameter(condDB.objectParameter4FK, objParameter[iObj]);
989  } else {
990  LogTrace("L1GtTriggerMenuConfigOnlineProd")
991  << "\n Warning: number of objects requested " << nrObj << " not available in DB."
992  << "\n Maximum 4 object parameters implemented. \n"
993  << std::endl;
994  }
995  }
996 
998  corrParameter.chargeCorrelation = static_cast<unsigned int>(condDB.chargeCorrelation);
999  if (muonCond.wsc()) {
1000  corrParameter.deltaEtaRange = lexical_cast_from_hex<unsigned long long>(condDB.deltaEtaRange);
1001 
1002  std::string word0;
1003  std::string word1;
1004  splitHexStringInTwo64bitWords(condDB.deltaPhiRange, word0, word1);
1005 
1006  corrParameter.deltaPhiRange0Word = lexical_cast_from_hex<unsigned long long>(word0);
1007  corrParameter.deltaPhiRange1Word = lexical_cast_from_hex<unsigned long long>(word1);
1008 
1009  corrParameter.deltaPhiMaxbits = 0; // not used anymore
1010  }
1011 
1012  muonCond.setConditionParameter(objParameter, corrParameter);
1013 
1014  // get chip number list
1015  std::list<int> chipList = listChipNumber(condDB.cond);
1016 
1017  // eliminate duplicates
1018  chipList.sort();
1019  chipList.unique();
1020 
1021  // add the same condition once to every chip where required
1022  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1023  muonCond.setCondChipNr(*itChip);
1024 
1025  // no check for uniqueness - done by DB
1026  (m_vecMuonTemplate[*itChip]).push_back(muonCond);
1027 
1028  if (m_isDebugEnabled) {
1029  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1030  << "\n Adding condition " << (condDB.cond) << " on chip " << (*itChip) << "\n " << std::endl;
1031 
1032  LogTrace("L1GtTriggerMenuConfigOnlineProd") << muonCond << "\n" << std::endl;
1033  }
1034  }
1035 }
void fillMuonObjectParameter(const std::string &opFK, L1GtMuonTemplate::ObjectParameter &)
Definition: L1GtObject.h:29
#define LogTrace(id)
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate
void splitHexStringInTwo64bitWords(const std::string &hexStr, std::string &hex0WordStr, std::string &hex1WordStr)
split a hex string in two 64-bit words returned as hex strings
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})

◆ buildAlgorithmMap()

void L1GtTriggerMenuConfigOnlineProd::buildAlgorithmMap ( )
private

build the algorithm map in the menu

Definition at line 719 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1TBPTX_cfi::bitNumber, chipNumber(), condIndexNameMap(), convertLogicalExpression(), hltDoubleTkMuon157L1TkMuonFilter_cfi::logicalExpression, m_algorithmAliasMap, m_algorithmMap, m_tableMenuAlgo, L1GtAlgorithm::setAlgoAlias(), L1GtAlgorithm::setAlgoChipNumber(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by newObject().

719  {
720  // temporary value
721  int bitNumber = -1;
723 
724  // loop over m_tableMenuAlgo
725  for (std::vector<TableMenuAlgo>::const_iterator constIt = m_tableMenuAlgo.begin(); constIt != m_tableMenuAlgo.end();
726  constIt++) {
727  bitNumber = static_cast<int>((*constIt).bitNumberSh);
728 
729  const std::map<int, std::string>& condIndexName = condIndexNameMap((*constIt).bitNumberSh);
730  logicalExpression = convertLogicalExpression((*constIt).logExpression, condIndexName);
731 
732  // create a new algorithm and insert it into algorithm map
733  L1GtAlgorithm alg((*constIt).algName, logicalExpression, bitNumber);
734  alg.setAlgoAlias((*constIt).algAlias);
735 
736  // set algorithm chip number:
737  int algChipNr = chipNumber((*constIt).bitNumberSh);
738  alg.setAlgoChipNumber(algChipNr);
739 
740  // insert algorithm
741  m_algorithmMap[(*constIt).algName] = alg;
742  m_algorithmAliasMap[(*constIt).algAlias] = alg;
743  }
744 }
const std::map< int, std::string > condIndexNameMap(const short bitNr) const
std::string convertLogicalExpression(const std::string &, const std::map< int, std::string > &) const
convert a logical expression with indices to a logical expression with names
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
int chipNumber(short) const
return the chip number for an algorithm with index bitNumberSh
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)

◆ buildTechnicalTriggerMap()

void L1GtTriggerMenuConfigOnlineProd::buildTechnicalTriggerMap ( )
private

build the technical trigger map in the menu

Definition at line 747 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1TBPTX_cfi::bitNumber, hltDoubleTkMuon157L1TkMuonFilter_cfi::logicalExpression, m_tableMenuTechTrig, m_technicalTriggerMap, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by newObject().

747  {
748  // temporary value
749  int bitNumber = -1;
751 
752  // loop over m_tableMenuTechTrig
753  for (std::vector<TableMenuTechTrig>::const_iterator constIt = m_tableMenuTechTrig.begin();
754  constIt != m_tableMenuTechTrig.end();
755  constIt++) {
756  bitNumber = static_cast<int>((*constIt).bitNumberSh);
757 
758  // create a new technical trigger and insert it into technical trigger map
759  // technical triggers have L1GtAlgorithm class
760  L1GtAlgorithm techTrig((*constIt).techName, logicalExpression, bitNumber);
761 
762  // chip number set in constructor to -1 - no meaning for technical triggers
763 
764  // insert technical trigger
765  m_technicalTriggerMap[(*constIt).techName] = techTrig;
766 
767  // no alias is defined for technical triggers
768  }
769 }
std::vector< TableMenuTechTrig > m_tableMenuTechTrig
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers

◆ chipNumber()

int L1GtTriggerMenuConfigOnlineProd::chipNumber ( short  bitNumberSh) const
private

return the chip number for an algorithm with index bitNumberSh

Definition at line 699 of file L1GtTriggerMenuConfigOnlineProd.cc.

Referenced by buildAlgorithmMap(), and listChipNumber().

699  {
700  // FIXME get it from Event Setup
701  const unsigned numberConditionChips = 2;
702  const unsigned pinsOnConditionChip = 96;
703  std::vector<int> orderConditionChip;
704  orderConditionChip.push_back(2);
705  orderConditionChip.push_back(1);
706 
707  int posChip = (static_cast<unsigned>(bitNumberSh) / pinsOnConditionChip) + 1;
708  for (unsigned int iChip = 0; iChip < numberConditionChips; ++iChip) {
709  if (posChip == orderConditionChip[iChip]) {
710  return static_cast<int>(iChip);
711  }
712  }
713 
714  // chip number not found
715  return -1;
716 }

◆ condIndexNameMap()

const std::map< int, std::string > L1GtTriggerMenuConfigOnlineProd::condIndexNameMap ( const short  bitNr) const
private

return for an algorithm with bitNr the mapping between the integer index in logical expression and the condition name (FK)

Definition at line 662 of file L1GtTriggerMenuConfigOnlineProd.cc.

References LogTrace, m_isDebugEnabled, and m_tableMenuAlgoCond.

Referenced by buildAlgorithmMap().

662  {
663  std::map<int, std::string> mapIndexName;
664 
665  for (std::vector<TableMenuAlgoCond>::const_iterator constIt = m_tableMenuAlgoCond.begin();
666  constIt != m_tableMenuAlgoCond.end();
667  ++constIt) {
668  if (bitNr == (*constIt).bitNumberSh) {
669  mapIndexName[static_cast<int>((*constIt).condIndexF)] = (*constIt).condFK;
670  }
671  }
672 
673  if (m_isDebugEnabled) {
674  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Bit number : " << bitNr << std::endl;
675 
676  for (std::map<int, std::string>::const_iterator constIt = mapIndexName.begin(); constIt != mapIndexName.end();
677  ++constIt) {
678  LogTrace("L1GtTriggerMenuConfigOnlineProd")
679  << " Condition index -> name: " << ((*constIt).first) << " " << ((*constIt).second) << std::endl;
680  }
681  }
682 
683  return mapIndexName;
684 }
#define LogTrace(id)
std::vector< TableMenuAlgoCond > m_tableMenuAlgoCond

◆ convertLogicalExpression()

std::string L1GtTriggerMenuConfigOnlineProd::convertLogicalExpression ( const std::string &  expressionIndices,
const std::map< int, std::string > &  mapCondIndexName 
) const
private

convert a logical expression with indices to a logical expression with names

Definition at line 687 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtLogicParser::convertIntToNameLogicalExpression(), L1GtLogicParser::logicalExpression(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by buildAlgorithmMap().

688  {
689  std::string expressionNames;
690 
691  L1GtLogicParser parserIndices = L1GtLogicParser(expressionIndices);
692  parserIndices.convertIntToNameLogicalExpression(mapCondIndexName);
693  expressionNames = parserIndices.logicalExpression();
694 
695  return expressionNames;
696 }
void convertIntToNameLogicalExpression(const std::map< int, std::string > &intToNameMap)
std::string logicalExpression() const
return the logical expression

◆ fillCaloObjectParameter()

void L1GtTriggerMenuConfigOnlineProd::fillCaloObjectParameter ( const std::string &  opFK,
L1GtCaloTemplate::ObjectParameter objPar 
)
private

Definition at line 1037 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtCaloTemplate::ObjectParameter::etaRange, L1GtCaloTemplate::ObjectParameter::etThreshold, m_tableMenuObjectParameters, and L1GtCaloTemplate::ObjectParameter::phiRange.

Referenced by addCaloCondition(), and addCorrelationCondition().

1038  {
1039  // loop over m_tableMenuCond
1040  for (std::vector<TableMenuObjectParameters>::const_iterator constIt = m_tableMenuObjectParameters.begin();
1041  constIt != m_tableMenuObjectParameters.end();
1042  constIt++) {
1043  if (opFK == (*constIt).opId) {
1044  objPar.etThreshold = static_cast<unsigned int>((*constIt).etThreshold);
1045  objPar.etaRange = lexical_cast_from_hex<unsigned int>((*constIt).etaRange);
1046  objPar.phiRange = lexical_cast_from_hex<unsigned int>((*constIt).phiRange);
1047 
1048  // can break after it is found - DB consistency
1049  break;
1050  }
1051  }
1052 }
std::vector< TableMenuObjectParameters > m_tableMenuObjectParameters

◆ fillEnergySumObjectParameter()

void L1GtTriggerMenuConfigOnlineProd::fillEnergySumObjectParameter ( const std::string &  opFK,
L1GtEnergySumTemplate::ObjectParameter objPar,
const L1GtObject obj 
)
private

Definition at line 1120 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtEnergySumTemplate::ObjectParameter::energyOverflow, ETM, L1GtEnergySumTemplate::ObjectParameter::etThreshold, HTM, m_tableMenuObjectParameters, getGTfromDQMFile::obj, L1GtEnergySumTemplate::ObjectParameter::phiRange0Word, L1GtEnergySumTemplate::ObjectParameter::phiRange1Word, splitHexStringInTwo64bitWords(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by addCorrelationCondition(), and addEnergySumCondition().

1122  {
1123  // loop over m_tableMenuCond
1124  for (std::vector<TableMenuObjectParameters>::const_iterator constIt = m_tableMenuObjectParameters.begin();
1125  constIt != m_tableMenuObjectParameters.end();
1126  constIt++) {
1127  if (opFK == (*constIt).opId) {
1128  objPar.etThreshold = static_cast<unsigned int>((*constIt).etThreshold);
1129  objPar.energyOverflow = static_cast<bool>((*constIt).energyOverflow); // not used
1130 
1131  std::string word0;
1132  std::string word1;
1133  splitHexStringInTwo64bitWords((*constIt).phiRange, word0, word1);
1134 
1135  if (obj == ETM) {
1136  objPar.phiRange0Word = lexical_cast_from_hex<unsigned long long>(word0);
1137  objPar.phiRange1Word = lexical_cast_from_hex<unsigned long long>(word1);
1138 
1139  } else if (obj == HTM) {
1140  objPar.phiRange0Word = lexical_cast_from_hex<unsigned long long>(word0);
1141  }
1142 
1143  // can break after it is found - DB consistency
1144  break;
1145  }
1146  }
1147 }
Definition: L1GtObject.h:38
Definition: L1GtObject.h:35
std::vector< TableMenuObjectParameters > m_tableMenuObjectParameters
void splitHexStringInTwo64bitWords(const std::string &hexStr, std::string &hex0WordStr, std::string &hex1WordStr)
split a hex string in two 64-bit words returned as hex strings

◆ fillMuonObjectParameter()

void L1GtTriggerMenuConfigOnlineProd::fillMuonObjectParameter ( const std::string &  opFK,
L1GtMuonTemplate::ObjectParameter objPar 
)
private

Definition at line 942 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtMuonTemplate::ObjectParameter::enableIso, L1GtMuonTemplate::ObjectParameter::enableMip, L1GtMuonTemplate::ObjectParameter::etaRange, m_tableMenuObjectParameters, L1GtMuonTemplate::ObjectParameter::phiHigh, L1GtMuonTemplate::ObjectParameter::phiLow, L1GtMuonTemplate::ObjectParameter::ptHighThreshold, L1GtMuonTemplate::ObjectParameter::ptLowThreshold, L1GtMuonTemplate::ObjectParameter::qualityRange, and L1GtMuonTemplate::ObjectParameter::requestIso.

Referenced by addCorrelationCondition(), and addMuonCondition().

943  {
944  // loop over m_tableMenuCond
945  for (std::vector<TableMenuObjectParameters>::const_iterator constIt = m_tableMenuObjectParameters.begin();
946  constIt != m_tableMenuObjectParameters.end();
947  constIt++) {
948  if (opFK == (*constIt).opId) {
949  objPar.ptHighThreshold = static_cast<unsigned int>((*constIt).ptHighThreshold);
950  objPar.ptLowThreshold = static_cast<unsigned int>((*constIt).ptLowThreshold);
951  objPar.enableMip = static_cast<bool>((*constIt).enableMip);
952  objPar.enableIso = static_cast<bool>((*constIt).enableIso);
953  objPar.requestIso = static_cast<bool>((*constIt).requestIso);
954  objPar.etaRange = lexical_cast_from_hex<unsigned long long>((*constIt).etaRange);
955  objPar.phiHigh = static_cast<unsigned int>((*constIt).phiHigh);
956  objPar.phiLow = static_cast<unsigned int>((*constIt).phiLow);
957  objPar.qualityRange = lexical_cast_from_hex<unsigned int>((*constIt).qualityRange);
958  //objPar.charge = static_cast<unsigned int> ( ( *constIt ).charge);
959 
960  // can break after it is found - DB consistency
961  break;
962  }
963  }
964 }
std::vector< TableMenuObjectParameters > m_tableMenuObjectParameters

◆ init()

void L1GtTriggerMenuConfigOnlineProd::init ( const int  numberConditionChips)

initialize the class (mainly reserve/resize)

Definition at line 51 of file L1GtTriggerMenuConfigOnlineProd.cc.

References m_corCaloTemplate, m_corEnergySumTemplate, m_corMuonTemplate, m_vecBptxTemplate, m_vecCaloTemplate, m_vecCastorTemplate, m_vecCorrelationTemplate, m_vecEnergySumTemplate, m_vecExternalTemplate, m_vecHfBitCountsTemplate, m_vecHfRingEtSumsTemplate, m_vecJetCountsTemplate, and m_vecMuonTemplate.

Referenced by newObject().

51  {
52  // resize the vectors of condition maps
53  // the number of condition chips should be correctly set
54 
55  m_vecMuonTemplate.resize(numberConditionChips);
56  m_vecCaloTemplate.resize(numberConditionChips);
57  m_vecEnergySumTemplate.resize(numberConditionChips);
58  m_vecJetCountsTemplate.resize(numberConditionChips);
59  m_vecCastorTemplate.resize(numberConditionChips);
60  m_vecHfBitCountsTemplate.resize(numberConditionChips);
61  m_vecHfRingEtSumsTemplate.resize(numberConditionChips);
62  m_vecBptxTemplate.resize(numberConditionChips);
63  m_vecExternalTemplate.resize(numberConditionChips);
64 
65  m_vecCorrelationTemplate.resize(numberConditionChips);
66  m_corMuonTemplate.resize(numberConditionChips);
67  m_corCaloTemplate.resize(numberConditionChips);
68  m_corEnergySumTemplate.resize(numberConditionChips);
69 }
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate

◆ lexical_cast_from_hex()

template<typename Result , typename Source >
Result L1GtTriggerMenuConfigOnlineProd::lexical_cast_from_hex ( Source &  value) const
private

Definition at line 258 of file L1GtTriggerMenuConfigOnlineProd.h.

References cppFunctionSkipper::exception, mps_fire::result, and relativeConstraints::value.

258  {
259  std::stringstream convertor;
260  convertor << value;
261 
262  Result result;
263  if (!(convertor >> std::hex >> result) || !convertor.eof()) {
264  throw std::exception();
265  }
266 
267  return result;
268 }

◆ listChipNumber()

std::list< int > L1GtTriggerMenuConfigOnlineProd::listChipNumber ( const std::string &  condFK)
private

get a list of chip numbers from the m_tableMenuAlgoCond table for a condition

Definition at line 926 of file L1GtTriggerMenuConfigOnlineProd.cc.

References chipNumber(), and m_tableMenuAlgoCond.

Referenced by addBptxCondition(), addCaloCondition(), addCastorCondition(), addCorrelationCondition(), addEnergySumCondition(), addExternalCondition(), addHfBitCountsCondition(), addHfRingEtSumsCondition(), addJetCountsCondition(), and addMuonCondition().

926  {
927  std::list<int> chipList;
928 
929  // loop over m_tableMenuAlgoCond
930  for (std::vector<TableMenuAlgoCond>::const_iterator constIt = m_tableMenuAlgoCond.begin();
931  constIt != m_tableMenuAlgoCond.end();
932  constIt++) {
933  if (condFK == (*constIt).condFK) {
934  int chipNr = chipNumber((*constIt).bitNumberSh);
935  chipList.push_back(chipNr);
936  }
937  }
938 
939  return chipList;
940 }
int chipNumber(short) const
return the chip number for an algorithm with index bitNumberSh
std::vector< TableMenuAlgoCond > m_tableMenuAlgoCond

◆ newObject()

std::unique_ptr< L1GtTriggerMenu > L1GtTriggerMenuConfigOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

public methods

Implements L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >.

Definition at line 71 of file L1GtTriggerMenuConfigOnlineProd.cc.

References addConditions(), L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::algoImplTag, buildAlgorithmMap(), buildTechnicalTriggerMap(), init(), edm::isDebugEnabled(), LogTrace, m_algorithmAliasMap, m_algorithmMap, m_corCaloTemplate, m_corEnergySumTemplate, m_corMuonTemplate, m_isDebugEnabled, m_tableMenuGeneral, m_technicalTriggerMap, m_vecBptxTemplate, m_vecCaloTemplate, m_vecCastorTemplate, m_vecCorrelationTemplate, m_vecEnergySumTemplate, m_vecExternalTemplate, m_vecHfBitCountsTemplate, m_vecHfRingEtSumsTemplate, m_vecJetCountsTemplate, m_vecMuonTemplate, L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::menuImplementation, L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::menuInterface, L1TriggerKeyDummy_cfi::objectKey, L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::scalesKey, AlCaHLTBitMon_QueryRunRegistry::string, tableMenuAlgoCondFromDB(), tableMenuAlgoFromDB(), tableMenuCondFromDB(), tableMenuGeneralFromDB(), tableMenuObjectParametersFromDB(), tableMenuTechTrigFromDB(), and verbosity.

71  {
72  // FIXME seems to not work anymore in constructor...
74 
75  auto pL1GtTriggerMenuEmpty = std::make_unique<L1GtTriggerMenu>();
76 
77  // FIXME get it from L1GtStableParameters?
78  // initialize once, from outside
79  const unsigned int numberConditionChips = 2;
80  init(numberConditionChips);
81 
82  const std::string gtSchema = "CMS_GT";
83 
84  // l1GtTriggerMenu: parameters in table GTFE_SETUP_FK
85  // the objectKey for the menu obtained from GT_SETUP is the L1T_MENU_IMPL key
86 
87  // SQL queries:
88 
89  // retrieve table with general menu parameters from DB, view L1T_MENU_GENERAL_VIEW
90  if (!tableMenuGeneralFromDB(gtSchema, objectKey)) {
91  return pL1GtTriggerMenuEmpty;
92  }
93 
94  // build the menu name
95  std::string menuName =
97 
98  // retrieve table with physics algorithms from DB, view L1T_MENU_ALGO_VIEW
99  if (!tableMenuAlgoFromDB(gtSchema, objectKey)) {
100  return pL1GtTriggerMenuEmpty;
101  }
102 
103  // retrieve table with conditions associated to physics algorithms from DB
104  if (!tableMenuAlgoCondFromDB(gtSchema, objectKey)) {
105  return pL1GtTriggerMenuEmpty;
106  }
107 
108  // retrieve table with list of conditions in the menu
109  if (!tableMenuCondFromDB(gtSchema, objectKey)) {
110  return pL1GtTriggerMenuEmpty;
111  }
112 
113  // retrieve table with object parameters from DB, view CMS_GT.L1T_MENU_OP_VIEW
114  if (!tableMenuObjectParametersFromDB(gtSchema, objectKey)) {
115  return pL1GtTriggerMenuEmpty;
116  }
117 
118  // retrieve table with technical triggers from DB, view L1T_MENU_TECHTRIG_VIEW
119  if (!tableMenuTechTrigFromDB(gtSchema, objectKey)) {
120  return pL1GtTriggerMenuEmpty;
121  }
122 
123  // build the algorithm map in the menu
125 
126  // build the technical trigger map in the menu
128 
129  // add the conditions from a menu to the corresponding list
130  addConditions();
131 
132  // fill the record
133  auto pL1GtTriggerMenu = std::make_unique<L1GtTriggerMenu>(menuName,
134  numberConditionChips,
148 
149  pL1GtTriggerMenu->setGtTriggerMenuInterface(m_tableMenuGeneral.menuInterface);
150  pL1GtTriggerMenu->setGtTriggerMenuImplementation(m_tableMenuGeneral.menuImplementation);
151  pL1GtTriggerMenu->setGtScaleDbKey(m_tableMenuGeneral.scalesKey);
152 
153  pL1GtTriggerMenu->setGtAlgorithmMap(m_algorithmMap);
154  pL1GtTriggerMenu->setGtAlgorithmAliasMap(m_algorithmAliasMap);
155  pL1GtTriggerMenu->setGtTechnicalTriggerMap(m_technicalTriggerMap);
156 
157  if (m_isDebugEnabled) {
158  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\nThe following L1GtTriggerMenu record was read from OMDS: \n"
159  << std::endl;
160 
161  std::ostringstream myCoutStream;
162  int verbosity = 0;
163  pL1GtTriggerMenu->print(myCoutStream, verbosity);
164  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n" << std::endl;
165 
166  verbosity = 2;
167  pL1GtTriggerMenu->print(myCoutStream, verbosity);
168  LogTrace("L1GtTriggerMenuConfigOnlineProd") << myCoutStream.str() << "\n" << std::endl;
169  }
170 
171  return pL1GtTriggerMenu;
172 }
bool isDebugEnabled()
bool tableMenuAlgoCondFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with conditions associated to physics algorithms from DB
bool tableMenuAlgoFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with physics algorithms from DB
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
bool tableMenuCondFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with list of conditions in the menu
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
#define LogTrace(id)
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
TableMenuGeneral m_tableMenuGeneral
member to keep various tables retrieved from DB
void buildAlgorithmMap()
build the algorithm map in the menu
void addConditions()
add the conditions from a menu to the corresponding list
bool tableMenuTechTrigFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with technical triggers from DB
const int verbosity
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers
bool tableMenuGeneralFromDB(const std::string &gtSchema, const std::string &objKey)
methods to retrieve the tables from DB
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate
void buildTechnicalTriggerMap()
build the technical trigger map in the menu
void init(const int numberConditionChips)
initialize the class (mainly reserve/resize)
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
bool tableMenuObjectParametersFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with object parameters from DB

◆ splitHexStringInTwo64bitWords()

void L1GtTriggerMenuConfigOnlineProd::splitHexStringInTwo64bitWords ( const std::string &  hexStr,
std::string &  hex0WordStr,
std::string &  hex1WordStr 
)
private

split a hex string in two 64-bit words returned as hex strings

Definition at line 895 of file L1GtTriggerMenuConfigOnlineProd.cc.

References LogTrace.

Referenced by addMuonCondition(), and fillEnergySumObjectParameter().

897  {
898  unsigned int lenHexStr = hexStr.length();
899 
900  if (lenHexStr < 3) {
901  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Warning: string " << hexStr << " has length less than 3."
902  << "\n Not possible to split it in two 64-bit words."
903  << "\n Return two zero strings." << std::endl;
904  hex0WordStr = "0x0";
905  hex1WordStr = "0x0";
906 
907  return;
908  }
909 
910  unsigned int lenHex = lenHexStr - 2;
911  unsigned int len0Word = lenHex > 16 ? 16 : lenHex;
912  unsigned int len1Word = lenHex - len0Word;
913 
914  unsigned int pos0Word = lenHexStr - len0Word;
915  hex0WordStr = "0x" + hexStr.substr(pos0Word, len0Word);
916 
917  if (len1Word > 0) {
918  unsigned int pos1Word = pos0Word - len1Word;
919  hex1WordStr = "0x" + hexStr.substr(pos1Word, len1Word);
920  } else {
921  hex1WordStr = "0x0";
922  }
923 }
#define LogTrace(id)

◆ strToEnumCondCategory()

L1GtConditionCategory L1GtTriggerMenuConfigOnlineProd::strToEnumCondCategory ( const std::string &  strCategory)
private

string to enum L1GtConditionCategory conversion

Definition at line 771 of file L1GtTriggerMenuConfigOnlineProd.cc.

References CondBptx, CondCalo, CondCastor, CondCorrelation, CondEnergySum, CondExternal, CondHfBitCounts, CondHfRingEtSums, CondJetCounts, CondMuon, and CondNull.

Referenced by addConditions().

771  {
772  if (strCategory == "CondMuon") {
773  return CondMuon;
774  } else if (strCategory == "CondCalo") {
775  return CondCalo;
776  } else if (strCategory == "CondEnergySum") {
777  return CondEnergySum;
778  } else if (strCategory == "CondJetCounts") {
779  return CondJetCounts;
780  } else if (strCategory == "CondCorrelation") {
781  return CondCorrelation;
782  } else if (strCategory == "CondCastor") {
783  return CondCastor;
784  } else if (strCategory == "CondHfBitCounts") {
785  return CondHfBitCounts;
786  } else if (strCategory == "CondHfRingEtSums") {
787  return CondHfRingEtSums;
788  } else if (strCategory == "CondBptx") {
789  return CondBptx;
790  } else if (strCategory == "CondExternal") {
791  return CondExternal;
792  } else if (strCategory == "CondNull") {
793  return CondNull;
794  } else {
795  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
796  << "\n Warning: string " << strCategory << " not defined. Returning CondNull.\n"
797  << std::endl;
798  return CondNull;
799  }
800 
801  return CondNull;
802 }
Log< level::Warning, false > LogWarning

◆ strToEnumCondType()

L1GtConditionType L1GtTriggerMenuConfigOnlineProd::strToEnumCondType ( const std::string &  strType)
private

string to enum L1GtConditionType conversion

Definition at line 805 of file L1GtTriggerMenuConfigOnlineProd.cc.

References Type1s, Type2cor, Type2s, Type2wsc, Type3s, Type4s, TypeBptx, TypeCastor, TypeETM, TypeETT, TypeExternal, TypeHfBitCounts, TypeHfRingEtSums, TypeHTM, TypeHTT, TypeJetCounts, and TypeNull.

Referenced by addBptxCondition(), addCaloCondition(), addCastorCondition(), addCorrelationCondition(), addEnergySumCondition(), addExternalCondition(), addHfBitCountsCondition(), addHfRingEtSumsCondition(), addJetCountsCondition(), and addMuonCondition().

805  {
806  if (strType == "1s") {
807  return Type1s;
808  } else if (strType == "2s") {
809  return Type2s;
810  } else if (strType == "2wsc") {
811  return Type2wsc;
812  } else if (strType == "2cor") {
813  return Type2cor;
814  } else if (strType == "3s") {
815  return Type3s;
816  } else if (strType == "4s") {
817  return Type4s;
818  } else if (strType == "ETM") {
819  return TypeETM;
820  } else if (strType == "ETT") {
821  return TypeETT;
822  } else if (strType == "HTT") {
823  return TypeHTT;
824  } else if (strType == "HTM") {
825  return TypeHTM;
826  } else if (strType == "JetCounts") {
827  return TypeJetCounts;
828  } else if (strType == "Castor") {
829  return TypeCastor;
830  } else if (strType == "HfBitCounts") {
831  return TypeHfBitCounts;
832  } else if (strType == "HfRingEtSums") {
833  return TypeHfRingEtSums;
834  } else if (strType == "Bptx") {
835  return TypeBptx;
836  } else if (strType == "TypeExternal") {
837  return TypeExternal;
838  } else {
839  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
840  << "\n Warning: string " << strType << " not associated to any L1GtConditionType. Returning TypeNull.\n"
841  << std::endl;
842  return TypeNull;
843  }
844 
845  return TypeNull;
846 }
Log< level::Warning, false > LogWarning

◆ strToEnumL1GtObject()

L1GtObject L1GtTriggerMenuConfigOnlineProd::strToEnumL1GtObject ( const std::string &  strObject)
private

string to enum L1GtObject conversion

Definition at line 849 of file L1GtTriggerMenuConfigOnlineProd.cc.

References BPTX, Castor, CenJet, ETM, ETT, ForJet, GtExternal, HfBitCounts, HfRingEtSums, HTM, HTT, IsoEG, JetCounts, Mu, NoIsoEG, TauJet, and TechTrig.

Referenced by addBptxCondition(), addCaloCondition(), addCastorCondition(), addCorrelationCondition(), addEnergySumCondition(), addExternalCondition(), addHfBitCountsCondition(), addHfRingEtSumsCondition(), and addJetCountsCondition().

849  {
850  if (strObject == "Mu") {
851  return Mu;
852  } else if (strObject == "NoIsoEG") {
853  return NoIsoEG;
854  } else if (strObject == "IsoEG") {
855  return IsoEG;
856  } else if (strObject == "CenJet") {
857  return CenJet;
858  } else if (strObject == "ForJet") {
859  return ForJet;
860  } else if (strObject == "TauJet") {
861  return TauJet;
862  } else if (strObject == "ETM") {
863  return ETM;
864  } else if (strObject == "ETT") {
865  return ETT;
866  } else if (strObject == "HTT") {
867  return HTT;
868  } else if (strObject == "HTM") {
869  return HTM;
870  } else if (strObject == "JetCounts") {
871  return JetCounts;
872  } else if (strObject == "HfBitCounts") {
873  return HfBitCounts;
874  } else if (strObject == "HfRingEtSums") {
875  return HfRingEtSums;
876  } else if (strObject == "TechTrig") {
877  return TechTrig;
878  } else if (strObject == "Castor") {
879  return Castor;
880  } else if (strObject == "BPTX") {
881  return BPTX;
882  } else if (strObject == "GtExternal") {
883  return GtExternal;
884  } else {
885  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
886  << "\n Warning: string " << strObject << " not associated to any L1GtObject. Returning Mu (no Null type).\n"
887  << std::endl;
888  return Mu;
889  }
890 
891  // no null type, so returning Mu - should never arrive here
892  return Mu;
893 }
Definition: L1GtObject.h:38
Definition: L1GtObject.h:36
Definition: L1GtObject.h:29
Definition: L1GtObject.h:35
Definition: L1GtObject.h:37
Log< level::Warning, false > LogWarning

◆ tableMenuAlgoCondFromDB()

bool L1GtTriggerMenuConfigOnlineProd::tableMenuAlgoCondFromDB ( const std::string &  gtSchema,
const std::string &  objKey 
)
private

retrieve table with conditions associated to physics algorithms from DB

Definition at line 306 of file L1GtTriggerMenuConfigOnlineProd.cc.

References l1t::OMDSReader::basicQueryView(), L1GtTriggerMenuConfigOnlineProd::TableMenuAlgoCond::bitNumberSh, l1t::OMDSReader::columnNamesView(), L1GtTriggerMenuConfigOnlineProd::TableMenuAlgoCond::condFK, L1GtTriggerMenuConfigOnlineProd::TableMenuAlgoCond::condIndexF, l1t::OMDSReader::QueryResults::fillVariableFromRow(), LogTrace, m_isDebugEnabled, L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >::m_omdsReader, m_tableMenuAlgoCond, l1t::OMDSReader::QueryResults::numberRows(), L1TriggerKeyDummy_cfi::objectKey, l1t::OMDSReader::QueryResults::queryFailed(), and l1t::OMDSReader::singleAttribute().

Referenced by newObject().

307  {
308  // get list of conditions associated with the algorithms
309 
310  // select * from CMS_GT.L1T_MENU_ALGO_COND_VIEW
311  // where L1T_MENU_ALGO_COND_VIEW.MENU_IMPLEMENTATION = objectKey
312 
313  const std::vector<std::string>& columnsMenuAlgoCond =
314  m_omdsReader.columnNamesView(gtSchema, "L1T_MENU_ALGO_COND_VIEW");
315 
316  if (m_isDebugEnabled) {
317  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n List of columns in L1T_MENU_ALGO_COND_VIEW:\n" << std::endl;
318  for (std::vector<std::string>::const_iterator iter = columnsMenuAlgoCond.begin(); iter != columnsMenuAlgoCond.end();
319  iter++) {
320  LogTrace("L1GtTriggerMenuConfigOnlineProd") << (*iter) << std::endl;
321  }
322  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
323  }
324 
325  l1t::OMDSReader::QueryResults resultsMenuAlgoCond =
326  m_omdsReader.basicQueryView(columnsMenuAlgoCond,
327  gtSchema,
328  "L1T_MENU_ALGO_COND_VIEW",
329  "L1T_MENU_ALGO_COND_VIEW.MENU_IMPLEMENTATION",
331 
332  // check if query was successful is based on size of returned list
333  // BUT one can have menus w/o algorithms and conditions - no error for empty list, but a warning!
334  if (resultsMenuAlgoCond.queryFailed()) {
335  edm::LogWarning("L1-O2O") << "Warning: Content of L1T_MENU_ALGO_COND_VIEW for L1GtTriggerMenu implementation key: "
336  << "\n " << objectKey << "\nis empty!"
337  << "\nNo list of condition associated to each algorithm are found for this menu.";
338  }
339 
340  //
341  TableMenuAlgoCond menuAlgoCond;
342  int resultsMenuAlgoCondRows = resultsMenuAlgoCond.numberRows();
343 
344  for (int iRow = 0; iRow < resultsMenuAlgoCondRows; ++iRow) {
345  for (std::vector<std::string>::const_iterator constIt = columnsMenuAlgoCond.begin();
346  constIt != columnsMenuAlgoCond.end();
347  ++constIt) {
348  if ((*constIt) == "ALGO_INDEX") {
349  resultsMenuAlgoCond.fillVariableFromRow(*constIt, iRow, menuAlgoCond.bitNumberSh);
350 
351  } else if ((*constIt) == "COND_INDEX") {
352  resultsMenuAlgoCond.fillVariableFromRow(*constIt, iRow, menuAlgoCond.condIndexF);
353 
354  } else if ((*constIt) == "COND_FK") {
355  resultsMenuAlgoCond.fillVariableFromRow(*constIt, iRow, menuAlgoCond.condFK);
356 
357  } else {
358  // do nothing
359  }
360  }
361 
362  LogTrace("L1GtTriggerMenuConfigOnlineProd")
363  << "Row " << iRow << ": ALGO_INDEX = " << menuAlgoCond.bitNumberSh
364  << " COND_INDEX = " << menuAlgoCond.condIndexF << " COND_FK = " << menuAlgoCond.condFK << std::endl;
365 
366  m_tableMenuAlgoCond.push_back(menuAlgoCond);
367  }
368 
369  if (m_isDebugEnabled) {
370  LogTrace("L1GtTriggerMenuConfigOnlineProd")
371  << "\n Number of rows read from L1T_MENU_ALGO_COND_VIEW: " << resultsMenuAlgoCondRows << std::endl;
372  }
373 
374  return true;
375 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
#define LogTrace(id)
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:279
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName)
Definition: OMDSReader.cc:234
const QueryResults basicQueryView(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &viewName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:158
std::vector< TableMenuAlgoCond > m_tableMenuAlgoCond
Log< level::Warning, false > LogWarning

◆ tableMenuAlgoFromDB()

bool L1GtTriggerMenuConfigOnlineProd::tableMenuAlgoFromDB ( const std::string &  gtSchema,
const std::string &  objKey 
)
private

retrieve table with physics algorithms from DB

Definition at line 238 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuAlgo::algAlias, L1GtTriggerMenuConfigOnlineProd::TableMenuAlgo::algName, l1t::OMDSReader::basicQueryView(), L1GtTriggerMenuConfigOnlineProd::TableMenuAlgo::bitNumberSh, l1t::OMDSReader::columnNamesView(), l1t::OMDSReader::QueryResults::fillVariableFromRow(), L1GtTriggerMenuConfigOnlineProd::TableMenuAlgo::logExpression, LogTrace, m_isDebugEnabled, L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >::m_omdsReader, m_tableMenuAlgo, l1t::OMDSReader::QueryResults::numberRows(), L1TriggerKeyDummy_cfi::objectKey, l1t::OMDSReader::QueryResults::queryFailed(), and l1t::OMDSReader::singleAttribute().

Referenced by newObject().

238  {
239  // select * from CMS_GT.L1T_MENU_ALGO_VIEW
240  // where L1T_MENU_ALGO_VIEW.MENU_IMPLEMENTATION = objectKey
241 
242  const std::vector<std::string>& columnsMenuAlgo = m_omdsReader.columnNamesView(gtSchema, "L1T_MENU_ALGO_VIEW");
243 
244  if (m_isDebugEnabled) {
245  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n List of columns in L1T_MENU_ALGO_VIEW:\n" << std::endl;
246  for (std::vector<std::string>::const_iterator iter = columnsMenuAlgo.begin(); iter != columnsMenuAlgo.end();
247  iter++) {
248  LogTrace("L1GtTriggerMenuConfigOnlineProd") << (*iter) << std::endl;
249  }
250  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
251  }
252 
253  l1t::OMDSReader::QueryResults resultsMenuAlgo = m_omdsReader.basicQueryView(columnsMenuAlgo,
254  gtSchema,
255  "L1T_MENU_ALGO_VIEW",
256  "L1T_MENU_ALGO_VIEW.MENU_IMPLEMENTATION",
258 
259  // check if query was successful is based on size of returned list
260  // BUT one can have menus w/o physics algorithms - no error for empty list, but a warning!
261  if (resultsMenuAlgo.queryFailed()) {
262  edm::LogWarning("L1-O2O") << "Warning: Content of L1T_MENU_ALGO_VIEW for L1GtTriggerMenu implementation key: "
263  << "\n " << objectKey << "\nis empty!"
264  << "\nNo physics algorithms are found for this menu.";
265  }
266 
267  TableMenuAlgo menuAlgo;
268  int resultsMenuAlgoRows = resultsMenuAlgo.numberRows();
269 
270  for (int iRow = 0; iRow < resultsMenuAlgoRows; ++iRow) {
271  for (std::vector<std::string>::const_iterator constIt = columnsMenuAlgo.begin(); constIt != columnsMenuAlgo.end();
272  ++constIt) {
273  if ((*constIt) == "ALGO_INDEX") {
274  resultsMenuAlgo.fillVariableFromRow(*constIt, iRow, menuAlgo.bitNumberSh);
275 
276  } else if ((*constIt) == "NAME") {
277  resultsMenuAlgo.fillVariableFromRow(*constIt, iRow, menuAlgo.algName);
278 
279  } else if ((*constIt) == "ALIAS") {
280  resultsMenuAlgo.fillVariableFromRow(*constIt, iRow, menuAlgo.algAlias);
281 
282  } else if ((*constIt) == "LOGICEXPR") {
283  resultsMenuAlgo.fillVariableFromRow(*constIt, iRow, menuAlgo.logExpression);
284 
285  } else {
286  // do nothing
287  }
288  }
289 
290  LogTrace("L1GtTriggerMenuConfigOnlineProd")
291  << "Row " << iRow << ": index = " << menuAlgo.bitNumberSh << " algName = " << menuAlgo.algName
292  << " algAlias = " << menuAlgo.algAlias << " logExpression = '" << menuAlgo.logExpression << "'" << std::endl;
293 
294  m_tableMenuAlgo.push_back(menuAlgo);
295  }
296 
297  if (m_isDebugEnabled) {
298  LogTrace("L1GtTriggerMenuConfigOnlineProd")
299  << "\n Number of rows read from L1T_MENU_ALGO_VIEW: " << resultsMenuAlgoRows << std::endl;
300  }
301 
302  return true;
303 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
#define LogTrace(id)
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:279
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName)
Definition: OMDSReader.cc:234
const QueryResults basicQueryView(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &viewName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:158
Log< level::Warning, false > LogWarning

◆ tableMenuCondFromDB()

bool L1GtTriggerMenuConfigOnlineProd::tableMenuCondFromDB ( const std::string &  gtSchema,
const std::string &  objKey 
)
private

retrieve table with list of conditions in the menu

Definition at line 378 of file L1GtTriggerMenuConfigOnlineProd.cc.

References l1t::OMDSReader::basicQueryView(), L1GtTriggerMenuConfigOnlineProd::TableMenuCond::chargeCorrelation, l1t::OMDSReader::columnNamesView(), L1GtTriggerMenuConfigOnlineProd::TableMenuCond::cond, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condCategory, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condGEq, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::condType, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::countIndex, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::countThreshold, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::deltaEtaRange, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::deltaPhiRange, l1t::OMDSReader::QueryResults::fillVariableFromRow(), L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject1, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::gtObject2, LogTrace, m_isDebugEnabled, L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >::m_omdsReader, m_tableMenuCond, l1t::OMDSReader::QueryResults::numberRows(), L1TriggerKeyDummy_cfi::objectKey, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter1FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter2FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter3FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter4FK, l1t::OMDSReader::QueryResults::queryFailed(), and l1t::OMDSReader::singleAttribute().

Referenced by newObject().

378  {
379  // select * from CMS_GT.L1T_MENU_COND_VIEW
380  // where L1T_MENU_COND_VIEW.MENU_IMPLEMENTATION = objectKey
381 
382  const std::vector<std::string>& columnsMenuCond = m_omdsReader.columnNamesView(gtSchema, "L1T_MENU_COND_VIEW");
383 
384  if (m_isDebugEnabled) {
385  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n List of columns in L1T_MENU_COND_VIEW:\n" << std::endl;
386  for (std::vector<std::string>::const_iterator iter = columnsMenuCond.begin(); iter != columnsMenuCond.end();
387  iter++) {
388  LogTrace("L1GtTriggerMenuConfigOnlineProd") << (*iter) << std::endl;
389  }
390  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
391  }
392 
393  l1t::OMDSReader::QueryResults resultsMenuCond = m_omdsReader.basicQueryView(columnsMenuCond,
394  gtSchema,
395  "L1T_MENU_COND_VIEW",
396  "L1T_MENU_COND_VIEW.MENU_IMPLEMENTATION",
398 
399  // check if query was successful is based on size of returned list
400  // BUT one can have menus w/o conditions - no error for empty list, but a warning!
401  if (resultsMenuCond.queryFailed()) {
402  edm::LogWarning("L1-O2O") << "Warning: Content of L1T_MENU_COND_VIEW for L1GtTriggerMenu implementation key: "
403  << "\n " << objectKey << "\nis empty!"
404  << "\nNo conditions associated to menu are found for this menu.";
405  }
406 
407  //
408  TableMenuCond menuCond;
409  int resultsMenuCondRows = resultsMenuCond.numberRows();
410 
411  for (int iRow = 0; iRow < resultsMenuCondRows; ++iRow) {
412  for (std::vector<std::string>::const_iterator constIt = columnsMenuCond.begin(); constIt != columnsMenuCond.end();
413  ++constIt) {
414  if ((*constIt) == "COND") {
415  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.cond);
416 
417  } else if ((*constIt) == "COND_CATEGORY") {
418  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.condCategory);
419 
420  } else if ((*constIt) == "COND_TYPE") {
421  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.condType);
422 
423  } else if ((*constIt) == "GT_OBJECT_1") {
424  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.gtObject1);
425 
426  } else if ((*constIt) == "GT_OBJECT_2") {
427  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.gtObject2);
428 
429  } else if ((*constIt) == "COND_GEQ") {
430  //float condGEqFloat = -1;
431  //resultsMenuCond.fillVariableFromRow(*constIt, iRow, condGEqFloat);
432  //menuCond.condGEq = (condGEqFloat > 0.5) ? true : false;
433  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.condGEq);
434 
435  } else if ((*constIt) == "COUNT_INDEX") {
436  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.countIndex);
437 
438  } else if ((*constIt) == "COUNT_THRESHOLD") {
439  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.countThreshold);
440 
441  } else if ((*constIt) == "CHARGE_CORRELATION") {
442  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.chargeCorrelation);
443 
444  } else if ((*constIt) == "OBJECT_PARAMETER_1_FK") {
445  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.objectParameter1FK);
446 
447  } else if ((*constIt) == "OBJECT_PARAMETER_2_FK") {
448  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.objectParameter2FK);
449 
450  } else if ((*constIt) == "OBJECT_PARAMETER_3_FK") {
451  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.objectParameter3FK);
452 
453  } else if ((*constIt) == "OBJECT_PARAMETER_4_FK") {
454  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.objectParameter4FK);
455 
456  } else if ((*constIt) == "DELTA_ETA_RANGE") {
457  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.deltaEtaRange);
458 
459  } else if ((*constIt) == "DELTA_PHI_RANGE") {
460  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.deltaPhiRange);
461 
462  } else {
463  // do nothing
464  }
465  }
466 
467  LogTrace("L1GtTriggerMenuConfigOnlineProd")
468  << " COND " << menuCond.cond << " COND_CATEGORY " << menuCond.condCategory << " COND_TYPE " << menuCond.condType
469  << " GT_OBJECT_1 " << menuCond.gtObject1 << " GT_OBJECT_2 " << menuCond.gtObject2 << " COND_GEQ "
470  << menuCond.condGEq << "\n"
471  << " COUNT_INDEX " << menuCond.countIndex << " COUNT_THRESHOLD " << menuCond.countThreshold << "\n"
472  << " CHARGE_CORRELATION " << menuCond.chargeCorrelation << "\n"
473  << " OBJECT_PARAMETER_1_FK " << menuCond.objectParameter1FK << " OBJECT_PARAMETER_2_FK "
474  << menuCond.objectParameter2FK << " OBJECT_PARAMETER_3_FK " << menuCond.objectParameter3FK
475  << " OBJECT_PARAMETER_4_FK " << menuCond.objectParameter4FK << "\n"
476  << " DELTA_ETA_RANGE " << menuCond.deltaEtaRange << " DELTA_PHI_RANGE " << menuCond.deltaPhiRange;
477 
478  m_tableMenuCond.push_back(menuCond);
479  }
480 
481  if (m_isDebugEnabled) {
482  LogTrace("L1GtTriggerMenuConfigOnlineProd")
483  << "\n Number of rows read from L1T_MENU_COND_VIEW: " << resultsMenuCondRows << std::endl;
484  }
485 
486  return true;
487 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
#define LogTrace(id)
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:279
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName)
Definition: OMDSReader.cc:234
const QueryResults basicQueryView(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &viewName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:158
Log< level::Warning, false > LogWarning

◆ tableMenuGeneralFromDB()

bool L1GtTriggerMenuConfigOnlineProd::tableMenuGeneralFromDB ( const std::string &  gtSchema,
const std::string &  objKey 
)
private

methods to retrieve the tables from DB

retrieve table with general menu parameters from DB

Definition at line 175 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::algoImplTag, l1t::OMDSReader::basicQueryView(), l1t::OMDSReader::columnNamesView(), mps_check::columns, LogTrace, m_isDebugEnabled, L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >::m_omdsReader, m_tableMenuGeneral, L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::menuImplementation, L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::menuInterface, L1TriggerKeyDummy_cfi::objectKey, mysort::results, L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::scalesKey, and l1t::OMDSReader::singleAttribute().

Referenced by newObject().

176  {
177  // select * from CMS_GT.L1T_MENU_GENERAL_VIEW
178  // where L1T_MENU_GENERAL_VIEW.MENU_IMPLEMENTATION = objectKey
179 
180  const std::vector<std::string>& columns = m_omdsReader.columnNamesView(gtSchema, "L1T_MENU_GENERAL_VIEW");
181 
182  if (m_isDebugEnabled) {
183  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n List of columns in L1T_MENU_GENERAL_VIEW:\n" << std::endl;
184  for (std::vector<std::string>::const_iterator iter = columns.begin(); iter != columns.end(); iter++) {
185  LogTrace("L1GtTriggerMenuConfigOnlineProd") << (*iter) << std::endl;
186  }
187  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
188  }
189 
191  gtSchema,
192  "L1T_MENU_GENERAL_VIEW",
193  "L1T_MENU_GENERAL_VIEW.MENU_IMPLEMENTATION",
195 
196  // check if query was successful
197  if (results.queryFailed()) {
198  edm::LogError("L1-O2O")
199  << "Problem to get content of L1T_MENU_GENERAL_VIEW for L1GtTriggerMenu implementation key: " << objectKey;
200  return false;
201  }
202 
203  // retrieve menu interface name, scales key, algorithm implementation tag
204 
205  for (std::vector<std::string>::const_iterator constIt = columns.begin(); constIt != columns.end(); ++constIt) {
206  if ((*constIt) == "MENU_IMPLEMENTATION") {
207  results.fillVariable(*constIt, m_tableMenuGeneral.menuImplementation);
208 
209  } else if ((*constIt) == "INTERFACE") {
210  results.fillVariable(*constIt, m_tableMenuGeneral.menuInterface);
211 
212  } else if ((*constIt) == "SCALES_KEY") {
213  results.fillVariable(*constIt, m_tableMenuGeneral.scalesKey);
214 
215  } else if ((*constIt) == "ALGO_IMPL_TAG") {
216  results.fillVariable(*constIt, m_tableMenuGeneral.algoImplTag);
217 
218  } else {
219  // do nothing
220  }
221  }
222 
223  // cross checks
225  LogTrace("L1GtTriggerMenuConfigOnlineProd")
226  << "\n L1 trigger menu implementation read from querying view not identical"
227  << "\n with menu key:"
228  << "\n from view: " << m_tableMenuGeneral.menuImplementation << "\n from key: " << objectKey
229  << "\n Menu implementation name set from key." << std::endl;
231  }
232 
233  //
234  return true;
235 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
Log< level::Error, false > LogError
#define LogTrace(id)
TableMenuGeneral m_tableMenuGeneral
member to keep various tables retrieved from DB
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName)
Definition: OMDSReader.cc:234
const QueryResults basicQueryView(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &viewName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:158
results
Definition: mysort.py:8

◆ tableMenuObjectParametersFromDB()

bool L1GtTriggerMenuConfigOnlineProd::tableMenuObjectParametersFromDB ( const std::string &  gtSchema,
const std::string &  objKey 
)
private

retrieve table with object parameters from DB

Definition at line 490 of file L1GtTriggerMenuConfigOnlineProd.cc.

References l1t::OMDSReader::basicQueryView(), L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::charge, l1t::OMDSReader::columnNamesView(), L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::enableIso, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::enableMip, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::energyOverflow, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::etaRange, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::etThreshold, l1t::OMDSReader::QueryResults::fillVariableFromRow(), LogTrace, m_isDebugEnabled, L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >::m_omdsReader, m_tableMenuObjectParameters, l1t::OMDSReader::QueryResults::numberRows(), L1TriggerKeyDummy_cfi::objectKey, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::opId, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::phiHigh, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::phiLow, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::phiRange, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::ptHighThreshold, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::ptLowThreshold, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::qualityRange, l1t::OMDSReader::QueryResults::queryFailed(), L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::requestIso, and l1t::OMDSReader::singleAttribute().

Referenced by newObject().

491  {
492  // get the list of object parameters in the menu
493 
494  // select * from CMS_GT.L1T_MENU_OP_VIEW
495  // where L1T_MENU_OP_VIEW.MENU_IMPLEMENTATION = objectKey
496 
497  const std::vector<std::string>& columnsMenuOp = m_omdsReader.columnNamesView(gtSchema, "L1T_MENU_OP_VIEW");
498 
499  if (m_isDebugEnabled) {
500  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n List of columns in L1T_MENU_OP_VIEW:\n" << std::endl;
501  for (std::vector<std::string>::const_iterator iter = columnsMenuOp.begin(); iter != columnsMenuOp.end(); iter++) {
502  LogTrace("L1GtTriggerMenuConfigOnlineProd") << (*iter) << std::endl;
503  }
504  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
505  }
506 
507  l1t::OMDSReader::QueryResults resultsMenuOp = m_omdsReader.basicQueryView(columnsMenuOp,
508  gtSchema,
509  "L1T_MENU_OP_VIEW",
510  "L1T_MENU_OP_VIEW.MENU_IMPLEMENTATION",
512 
513  // check if query was successful is based on size of returned list
514  // BUT one can have menus w/o object parameters - no error for empty list, but a warning!
515  if (resultsMenuOp.queryFailed()) {
516  edm::LogWarning("L1-O2O") << "Warning: Content of L1T_MENU_OP_VIEW for L1GtTriggerMenu implementation key: "
517  << "\n " << objectKey << "\nis empty!"
518  << "\nNo object parameters associated to menu are found for this menu.";
519  }
520 
521  TableMenuObjectParameters menuObjectParameters;
522  int resultsMenuOpRows = resultsMenuOp.numberRows();
523 
524  for (int iRow = 0; iRow < resultsMenuOpRows; ++iRow) {
525  for (std::vector<std::string>::const_iterator constIt = columnsMenuOp.begin(); constIt != columnsMenuOp.end();
526  ++constIt) {
527  if ((*constIt) == "ID") {
528  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.opId);
529 
530  } else if ((*constIt) == "PT_HIGH_THRESHOLD") {
531  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.ptHighThreshold);
532 
533  } else if ((*constIt) == "PT_LOW_THRESHOLD") {
534  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.ptLowThreshold);
535 
536  } else if ((*constIt) == "ENABLE_MIP") {
537  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.enableMip);
538 
539  } else if ((*constIt) == "ENABLE_ISO") {
540  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.enableIso);
541 
542  } else if ((*constIt) == "REQUEST_ISO") {
543  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.requestIso);
544 
545  } else if ((*constIt) == "ENERGY_OVERFLOW") {
546  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.energyOverflow);
547 
548  } else if ((*constIt) == "ET_THRESHOLD") {
549  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.etThreshold);
550 
551  } else if ((*constIt) == "ETA_RANGE") {
552  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.etaRange);
553 
554  } else if ((*constIt) == "PHI_RANGE") {
555  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.phiRange);
556 
557  } else if ((*constIt) == "PHI_LOW") {
558  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.phiLow);
559 
560  } else if ((*constIt) == "PHI_HIGH") {
561  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.phiHigh);
562 
563  } else if ((*constIt) == "QUALITY_RANGE") {
564  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.qualityRange);
565 
566  } else if ((*constIt) == "CHARGE") {
567  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.charge);
568 
569  } else {
570  // do nothing
571  }
572  }
573 
574  LogTrace("L1GtTriggerMenuConfigOnlineProd")
575  << " ID " << menuObjectParameters.opId << " PT_HIGH_THRESHOLD " << menuObjectParameters.ptHighThreshold
576  << " PT_LOW_THRESHOLD " << menuObjectParameters.ptLowThreshold << " ENABLE_MIP "
577  << menuObjectParameters.enableMip << " ENABLE_ISO " << menuObjectParameters.enableIso << " REQUEST_ISO "
578  << menuObjectParameters.requestIso << " ENERGY_OVERFLOW " << menuObjectParameters.energyOverflow
579  << " ET_THRESHOLD " << menuObjectParameters.etThreshold << " ETA_RANGE " << menuObjectParameters.etaRange
580  << " PHI_RANGE " << menuObjectParameters.phiRange << " PHI_LOW " << menuObjectParameters.phiLow << " PHI_HIGH "
581  << menuObjectParameters.phiHigh << " QUALITY_RANGE " << menuObjectParameters.qualityRange << " CHARGE "
582  << menuObjectParameters.charge << std::endl;
583 
584  m_tableMenuObjectParameters.push_back(menuObjectParameters);
585  }
586 
587  if (m_isDebugEnabled) {
588  LogTrace("L1GtTriggerMenuConfigOnlineProd")
589  << "\n Number of rows read from L1T_MENU_OP_VIEW: " << resultsMenuOpRows << std::endl;
590  }
591 
592  return true;
593 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
#define LogTrace(id)
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:279
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName)
Definition: OMDSReader.cc:234
std::vector< TableMenuObjectParameters > m_tableMenuObjectParameters
const QueryResults basicQueryView(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &viewName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:158
Log< level::Warning, false > LogWarning

◆ tableMenuTechTrigFromDB()

bool L1GtTriggerMenuConfigOnlineProd::tableMenuTechTrigFromDB ( const std::string &  gtSchema,
const std::string &  objKey 
)
private

retrieve table with technical triggers from DB

Definition at line 596 of file L1GtTriggerMenuConfigOnlineProd.cc.

References l1t::OMDSReader::basicQueryView(), L1GtTriggerMenuConfigOnlineProd::TableMenuTechTrig::bitNumberSh, l1t::OMDSReader::columnNamesView(), l1t::OMDSReader::QueryResults::fillVariableFromRow(), LogTrace, m_isDebugEnabled, L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >::m_omdsReader, m_tableMenuTechTrig, l1t::OMDSReader::QueryResults::numberRows(), L1TriggerKeyDummy_cfi::objectKey, l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), and L1GtTriggerMenuConfigOnlineProd::TableMenuTechTrig::techName.

Referenced by newObject().

597  {
598  // select * from CMS_GT.L1T_MENU_TECHTRIG_VIEW
599  // where L1T_MENU_TECHTRIG_VIEW.MENU_IMPLEMENTATION = objectKey
600 
601  const std::vector<std::string>& columnsMenuTechTrig =
602  m_omdsReader.columnNamesView(gtSchema, "L1T_MENU_TECHTRIG_VIEW");
603 
604  if (m_isDebugEnabled) {
605  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n List of columns in L1T_MENU_TECHTRIG_VIEW:\n" << std::endl;
606  for (std::vector<std::string>::const_iterator iter = columnsMenuTechTrig.begin(); iter != columnsMenuTechTrig.end();
607  iter++) {
608  LogTrace("L1GtTriggerMenuConfigOnlineProd") << (*iter) << std::endl;
609  }
610  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
611  }
612 
613  l1t::OMDSReader::QueryResults resultsMenuTechTrig =
614  m_omdsReader.basicQueryView(columnsMenuTechTrig,
615  gtSchema,
616  "L1T_MENU_TECHTRIG_VIEW",
617  "L1T_MENU_TECHTRIG_VIEW.MENU_IMPLEMENTATION",
619 
620  // check if query was successful is based on size of returned list
621  // BUT one can have menus w/o technical triggers - no error for empty list, but a warning!
622  if (resultsMenuTechTrig.queryFailed()) {
623  edm::LogWarning("L1-O2O") << "Warning: Content of L1T_MENU_TECHTRIG_VIEW for L1GtTriggerMenu implementation key: "
624  << "\n " << objectKey << "\nis empty!"
625  << "\nNo technical triggers are found for this menu.";
626  }
627 
628  TableMenuTechTrig menuTechTrig;
629  int resultsMenuTechTrigRows = resultsMenuTechTrig.numberRows();
630 
631  for (int iRow = 0; iRow < resultsMenuTechTrigRows; ++iRow) {
632  for (std::vector<std::string>::const_iterator constIt = columnsMenuTechTrig.begin();
633  constIt != columnsMenuTechTrig.end();
634  ++constIt) {
635  if ((*constIt) == "TECHTRIG_INDEX") {
636  resultsMenuTechTrig.fillVariableFromRow(*constIt, iRow, menuTechTrig.bitNumberSh);
637 
638  } else if ((*constIt) == "NAME") {
639  resultsMenuTechTrig.fillVariableFromRow(*constIt, iRow, menuTechTrig.techName);
640 
641  } else {
642  // do nothing
643  }
644  }
645 
646  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "Row " << iRow << ": index = " << menuTechTrig.bitNumberSh
647  << " techName = " << menuTechTrig.techName << std::endl;
648 
649  m_tableMenuTechTrig.push_back(menuTechTrig);
650  }
651 
652  if (m_isDebugEnabled) {
653  LogTrace("L1GtTriggerMenuConfigOnlineProd")
654  << "\n Number of rows read from L1T_MENU_TECHTRIG_VIEW: " << resultsMenuTechTrigRows << std::endl;
655  }
656 
657  return true;
658 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
#define LogTrace(id)
std::vector< TableMenuTechTrig > m_tableMenuTechTrig
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:279
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName)
Definition: OMDSReader.cc:234
const QueryResults basicQueryView(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &viewName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:158
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ m_algorithmAliasMap

AlgorithmMap L1GtTriggerMenuConfigOnlineProd::m_algorithmAliasMap
private

map containing the physics algorithms (by alias)

Definition at line 248 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by buildAlgorithmMap(), and newObject().

◆ m_algorithmMap

AlgorithmMap L1GtTriggerMenuConfigOnlineProd::m_algorithmMap
private

map containing the physics algorithms (by name)

Definition at line 245 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by buildAlgorithmMap(), and newObject().

◆ m_corCaloTemplate

std::vector<std::vector<L1GtCaloTemplate> > L1GtTriggerMenuConfigOnlineProd::m_corCaloTemplate
private

Definition at line 241 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addCorrelationCondition(), init(), and newObject().

◆ m_corEnergySumTemplate

std::vector<std::vector<L1GtEnergySumTemplate> > L1GtTriggerMenuConfigOnlineProd::m_corEnergySumTemplate
private

Definition at line 242 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addCorrelationCondition(), init(), and newObject().

◆ m_corMuonTemplate

std::vector<std::vector<L1GtMuonTemplate> > L1GtTriggerMenuConfigOnlineProd::m_corMuonTemplate
private

Definition at line 240 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addCorrelationCondition(), init(), and newObject().

◆ m_isDebugEnabled

bool L1GtTriggerMenuConfigOnlineProd::m_isDebugEnabled
private

◆ m_scaleDbKey

std::string L1GtTriggerMenuConfigOnlineProd::m_scaleDbKey
private

menu associated scale key

Definition at line 225 of file L1GtTriggerMenuConfigOnlineProd.h.

◆ m_tableMenuAlgo

std::vector<TableMenuAlgo> L1GtTriggerMenuConfigOnlineProd::m_tableMenuAlgo
private

Definition at line 210 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by buildAlgorithmMap(), and tableMenuAlgoFromDB().

◆ m_tableMenuAlgoCond

std::vector<TableMenuAlgoCond> L1GtTriggerMenuConfigOnlineProd::m_tableMenuAlgoCond
private

◆ m_tableMenuCond

std::vector<TableMenuCond> L1GtTriggerMenuConfigOnlineProd::m_tableMenuCond
private

Definition at line 212 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addConditions(), and tableMenuCondFromDB().

◆ m_tableMenuGeneral

TableMenuGeneral L1GtTriggerMenuConfigOnlineProd::m_tableMenuGeneral
private

member to keep various tables retrieved from DB

Definition at line 209 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by newObject(), and tableMenuGeneralFromDB().

◆ m_tableMenuObjectParameters

std::vector<TableMenuObjectParameters> L1GtTriggerMenuConfigOnlineProd::m_tableMenuObjectParameters
private

◆ m_tableMenuTechTrig

std::vector<TableMenuTechTrig> L1GtTriggerMenuConfigOnlineProd::m_tableMenuTechTrig
private

◆ m_technicalTriggerMap

AlgorithmMap L1GtTriggerMenuConfigOnlineProd::m_technicalTriggerMap
private

map containing the technical triggers

Definition at line 251 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by buildTechnicalTriggerMap(), and newObject().

◆ m_triggerMenuImplementation

std::string L1GtTriggerMenuConfigOnlineProd::m_triggerMenuImplementation
private

Definition at line 222 of file L1GtTriggerMenuConfigOnlineProd.h.

◆ m_triggerMenuInterface

std::string L1GtTriggerMenuConfigOnlineProd::m_triggerMenuInterface
private

menu representation

menu names

Definition at line 220 of file L1GtTriggerMenuConfigOnlineProd.h.

◆ m_triggerMenuName

std::string L1GtTriggerMenuConfigOnlineProd::m_triggerMenuName
private

Definition at line 221 of file L1GtTriggerMenuConfigOnlineProd.h.

◆ m_vecBptxTemplate

std::vector<std::vector<L1GtBptxTemplate> > L1GtTriggerMenuConfigOnlineProd::m_vecBptxTemplate
private

Definition at line 236 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addBptxCondition(), init(), and newObject().

◆ m_vecCaloTemplate

std::vector<std::vector<L1GtCaloTemplate> > L1GtTriggerMenuConfigOnlineProd::m_vecCaloTemplate
private

Definition at line 230 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addCaloCondition(), init(), and newObject().

◆ m_vecCastorTemplate

std::vector<std::vector<L1GtCastorTemplate> > L1GtTriggerMenuConfigOnlineProd::m_vecCastorTemplate
private

Definition at line 233 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addCastorCondition(), init(), and newObject().

◆ m_vecCorrelationTemplate

std::vector<std::vector<L1GtCorrelationTemplate> > L1GtTriggerMenuConfigOnlineProd::m_vecCorrelationTemplate
private

Definition at line 239 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addCorrelationCondition(), init(), and newObject().

◆ m_vecEnergySumTemplate

std::vector<std::vector<L1GtEnergySumTemplate> > L1GtTriggerMenuConfigOnlineProd::m_vecEnergySumTemplate
private

Definition at line 231 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addEnergySumCondition(), init(), and newObject().

◆ m_vecExternalTemplate

std::vector<std::vector<L1GtExternalTemplate> > L1GtTriggerMenuConfigOnlineProd::m_vecExternalTemplate
private

Definition at line 237 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addExternalCondition(), init(), and newObject().

◆ m_vecHfBitCountsTemplate

std::vector<std::vector<L1GtHfBitCountsTemplate> > L1GtTriggerMenuConfigOnlineProd::m_vecHfBitCountsTemplate
private

Definition at line 234 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addHfBitCountsCondition(), init(), and newObject().

◆ m_vecHfRingEtSumsTemplate

std::vector<std::vector<L1GtHfRingEtSumsTemplate> > L1GtTriggerMenuConfigOnlineProd::m_vecHfRingEtSumsTemplate
private

Definition at line 235 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addHfRingEtSumsCondition(), init(), and newObject().

◆ m_vecJetCountsTemplate

std::vector<std::vector<L1GtJetCountsTemplate> > L1GtTriggerMenuConfigOnlineProd::m_vecJetCountsTemplate
private

Definition at line 232 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addJetCountsCondition(), init(), and newObject().

◆ m_vecMuonTemplate

std::vector<std::vector<L1GtMuonTemplate> > L1GtTriggerMenuConfigOnlineProd::m_vecMuonTemplate
private

vectors containing the conditions explicit, due to persistency...

Definition at line 229 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addMuonCondition(), init(), and newObject().