CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

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...
 
virtual boost::shared_ptr
< L1GtTriggerMenu
newObject (const std::string &objectKey)
 public methods More...
 
 ~L1GtTriggerMenuConfigOnlineProd ()
 destructor More...
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
boost::shared_ptr
< L1GtTriggerMenu
produce (const L1GtTriggerMenuRcd &iRecord)
 
 ~L1ConfigOnlineProdBase ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

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
< TableMenuObjectParameters
m_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

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >
bool getObjectKey (const L1GtTriggerMenuRcd &record, boost::shared_ptr< L1GtTriggerMenu > data, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Attributes inherited from L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >
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 48 of file L1GtTriggerMenuConfigOnlineProd.h.

Constructor & Destructor Documentation

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

destructor

Definition at line 50 of file L1GtTriggerMenuConfigOnlineProd.cc.

50  {
51 
52  // empty
53 
54 }

Member Function Documentation

void L1GtTriggerMenuConfigOnlineProd::addBptxCondition ( const TableMenuCond condDB)
private

Definition at line 1554 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addConditions().

1554  {
1555 
1556  L1GtBptxTemplate bptxCond(condDB.cond);
1557  bptxCond.setCondType(strToEnumCondType(condDB.condType));
1558 
1559  // object types - logical conditions have no objects associated in GT
1560  // one put however a "Bptx" object type
1561  int nrObj = 1;
1562 
1563  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1564  std::vector<L1GtObject> objType(nrObj, obj);
1565  bptxCond.setObjectType(objType);
1566 
1567  // irrelevant, set to false for completeness
1568  bptxCond.setCondGEq(false);
1569 
1570  // logical conditions have no ObjectParameter, no CorrelationParameter
1571 
1572  // get chip number list
1573  std::list<int> chipList = listChipNumber(condDB.cond);
1574 
1575 
1576 
1577  // eliminate duplicates
1578  chipList.sort();
1579  chipList.unique();
1580 
1581  // add the same condition once to every chip where required
1582  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1583 
1584  bptxCond.setCondChipNr(*itChip);
1585 
1586  // no check for uniqueness - done by DB
1587  ( m_vecBptxTemplate[*itChip] ).push_back(bptxCond);
1588 
1589  if (m_isDebugEnabled) {
1590  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition " << ( condDB.cond )
1591  << " on chip " << ( *itChip ) << "\n " << std::endl;
1592 
1593  LogTrace("L1GtTriggerMenuConfigOnlineProd") << bptxCond << "\n" << std::endl;
1594  }
1595  }
1596 
1597 }
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
#define LogTrace(id)
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion
void L1GtTriggerMenuConfigOnlineProd::addCaloCondition ( const TableMenuCond condDB)
private

Definition at line 1221 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, L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtCaloTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), strToEnumL1GtObject(), and L1GtCondition::wsc().

Referenced by addConditions().

1221  {
1222 
1223  L1GtCaloTemplate caloCond(condDB.cond);
1224  caloCond.setCondType(strToEnumCondType(condDB.condType));
1225 
1226  // object types - all have the same type, so reading it for first object is OK
1227  int nrObj = caloCond.nrObjects();
1228 
1229  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1230  std::vector<L1GtObject> objType(nrObj, obj);
1231  caloCond.setObjectType(objType);
1232 
1233  caloCond.setCondGEq(condDB.condGEq);
1234 
1235  // temporary storage of the parameters
1236  std::vector<L1GtCaloTemplate::ObjectParameter> objParameter(nrObj);
1237 
1238  for (int iObj = 0; iObj < nrObj; ++iObj) {
1239  if (iObj == 0) {
1240  fillCaloObjectParameter(condDB.objectParameter1FK, objParameter[iObj]);
1241  } else if (iObj == 1) {
1242  fillCaloObjectParameter(condDB.objectParameter2FK, objParameter[iObj]);
1243  } else if (iObj == 2) {
1244  fillCaloObjectParameter(condDB.objectParameter3FK, objParameter[iObj]);
1245  } else if (iObj == 3) {
1246  fillCaloObjectParameter(condDB.objectParameter4FK, objParameter[iObj]);
1247  } else {
1248  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1249  << "\n Warning: number of objects requested " << nrObj
1250  << " not available in DB." << "\n Maximum 4 object parameters implemented. \n"
1251  << std::endl;
1252  }
1253  }
1254 
1256  if (caloCond.wsc()) {
1257  corrParameter.deltaEtaRange = lexical_cast_from_hex<unsigned long long> (
1258  condDB.deltaEtaRange);
1259 
1260  corrParameter.deltaPhiRange = lexical_cast_from_hex<unsigned long long> (
1261  condDB.deltaPhiRange);
1262  corrParameter.deltaPhiMaxbits = 0; // FIXME check correlations
1263  }
1264 
1265  caloCond.setConditionParameter(objParameter, corrParameter);
1266 
1267  // get chip number list
1268  std::list<int> chipList = listChipNumber(condDB.cond);
1269 
1270  // eliminate duplicates
1271  chipList.sort();
1272  chipList.unique();
1273 
1274  // add the same condition once to every chip where required
1275  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1276 
1277  caloCond.setCondChipNr(*itChip);
1278 
1279  // no check for uniqueness - done by DB
1280  ( m_vecCaloTemplate[*itChip] ).push_back(caloCond);
1281 
1282  if (m_isDebugEnabled) {
1283  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition " << ( condDB.cond )
1284  << " on chip " << ( *itChip ) << "\n " << std::endl;
1285 
1286  LogTrace("L1GtTriggerMenuConfigOnlineProd") << caloCond << "\n" << std::endl;
1287  }
1288  }
1289 
1290 }
void fillCaloObjectParameter(const std::string &opFK, L1GtCaloTemplate::ObjectParameter &)
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
#define LogTrace(id)
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion
void L1GtTriggerMenuConfigOnlineProd::addCastorCondition ( const TableMenuCond condDB)
private

Definition at line 1511 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addConditions().

1511  {
1512 
1513  L1GtCastorTemplate castorCond(condDB.cond);
1514  castorCond.setCondType(strToEnumCondType(condDB.condType));
1515 
1516  // object types - logical conditions have no objects associated in GT
1517  // one put however a "Castor" object type
1518  int nrObj = 1;
1519 
1520  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1521  std::vector<L1GtObject> objType(nrObj, obj);
1522  castorCond.setObjectType(objType);
1523 
1524  // irrelevant, set to false for completeness
1525  castorCond.setCondGEq(false);
1526 
1527  // logical conditions have no ObjectParameter, no CorrelationParameter
1528 
1529  // get chip number list
1530  std::list<int> chipList = listChipNumber(condDB.cond);
1531 
1532  // eliminate duplicates
1533  chipList.sort();
1534  chipList.unique();
1535 
1536  // add the same condition once to every chip where required
1537  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1538 
1539  castorCond.setCondChipNr(*itChip);
1540 
1541  // no check for uniqueness - done by DB
1542  ( m_vecCastorTemplate[*itChip] ).push_back(castorCond);
1543 
1544  if (m_isDebugEnabled) {
1545  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition " << ( condDB.cond )
1546  << " on chip " << ( *itChip ) << "\n " << std::endl;
1547 
1548  LogTrace("L1GtTriggerMenuConfigOnlineProd") << castorCond << "\n" << std::endl;
1549  }
1550  }
1551 
1552 }
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
#define LogTrace(id)
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion
void L1GtTriggerMenuConfigOnlineProd::addConditions ( )
private

add the conditions from a menu to the corresponding list

Definition at line 1926 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().

1926  {
1927 
1928  // loop over m_tableMenuCond
1929  for (std::vector<TableMenuCond>::const_iterator constIt = m_tableMenuCond.begin(); constIt
1930  != m_tableMenuCond.end(); constIt++) {
1931 
1932  L1GtConditionCategory conCategory = strToEnumCondCategory((*constIt).condCategory);
1933 
1934  switch (conCategory) {
1935  case CondMuon: {
1936 
1937  addMuonCondition(*constIt);
1938 
1939  }
1940  break;
1941  case CondCalo: {
1942 
1943  addCaloCondition(*constIt);
1944 
1945  }
1946  break;
1947  case CondEnergySum: {
1948 
1949  addEnergySumCondition(*constIt);
1950 
1951  }
1952  break;
1953  case CondJetCounts: {
1954  addJetCountsCondition(*constIt);
1955 
1956  }
1957  break;
1958  case CondHfBitCounts: {
1959  addHfBitCountsCondition(*constIt);
1960 
1961  }
1962  break;
1963  case CondHfRingEtSums: {
1964  addHfRingEtSumsCondition(*constIt);
1965 
1966  }
1967  break;
1968  case CondCastor: {
1969 
1970  addCastorCondition(*constIt);
1971 
1972  }
1973  break;
1974  case CondBptx: {
1975 
1976  addBptxCondition(*constIt);
1977 
1978  }
1979  break;
1980  case CondExternal: {
1981 
1982  addExternalCondition(*constIt);
1983 
1984  }
1985  break;
1986  case CondCorrelation: {
1987 
1988  addCorrelationCondition(*constIt);
1989 
1990  }
1991  break;
1992  case CondNull: {
1993 
1994  // do nothing
1995 
1996  }
1997  break;
1998  default: {
1999 
2000  // do nothing
2001 
2002  }
2003  break;
2004  }
2005 
2006  }
2007 
2008 }
L1GtConditionCategory
condition categories
void addHfRingEtSumsCondition(const TableMenuCond &)
L1GtConditionCategory strToEnumCondCategory(const std::string &strCategory)
string to enum L1GtConditionCategory conversion
void L1GtTriggerMenuConfigOnlineProd::addCorrelationCondition ( const TableMenuCond condDB)
private

Definition at line 1644 of file L1GtTriggerMenuConfigOnlineProd.cc.

References BPTX, 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, 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().

1644  {
1645 
1646  // create a new correlation condition
1647  L1GtCorrelationTemplate correlationCond(condDB.cond);
1648  correlationCond.setCondType(strToEnumCondType(condDB.condType));
1649 
1650  // two objects (for sure) - type taken from DB
1651  const int nrObj = 2;
1652 
1653  std::vector<L1GtObject> objType(nrObj);
1654  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1655  objType[0] = obj;
1656 
1657  obj = strToEnumL1GtObject(condDB.gtObject2);
1658  objType[1] = obj;
1659 
1660  correlationCond.setObjectType(objType);
1661 
1662  // irrelevant, it is set for each subcondition
1663  correlationCond.setCondGEq(condDB.condGEq);
1664 
1665  // get chip number list, eliminate duplicates
1666  std::list<int> chipList = listChipNumber(condDB.cond);
1667  chipList.sort();
1668  chipList.unique();
1669 
1670  // temporary vectors for sub-conditions
1671  std::vector<L1GtConditionCategory> subcondCategory(nrObj);
1672  std::vector<int> subcondIndex(nrObj);
1673 
1674  bool wrongSubcondition = false;
1675 
1676  for (int iObj = 0; iObj < nrObj; ++iObj) {
1677 
1678  L1GtObject gtObj = objType[iObj];
1679 
1680  // sub-conditions (all have the same condGEq as the correlation condition).
1681  switch (gtObj) {
1682  case Mu: {
1683  subcondCategory[iObj] = CondMuon;
1684 
1685  // temporary storage of the parameters
1686  std::vector<L1GtMuonTemplate::ObjectParameter> objParameter(1);
1687 
1688  std::string subcondName;
1689  if (iObj == 0) {
1690  fillMuonObjectParameter(condDB.objectParameter1FK, objParameter[0]);
1691  subcondName = condDB.objectParameter1FK;
1692  } else if (iObj == 1) {
1693  subcondName = condDB.objectParameter2FK;
1694  fillMuonObjectParameter(condDB.objectParameter2FK, objParameter[0]);
1695  }
1696 
1697  // chargeCorrelation must be set for muons
1698  // put it to ignore
1700  corrPar.chargeCorrelation = 1;
1701 
1702  L1GtMuonTemplate subcond(subcondName, Type1s);
1703  subcond.setCondGEq(condDB.condGEq);
1704  subcond.setObjectType(std::vector<L1GtObject> (1, gtObj));
1705  subcond.setConditionParameter(objParameter, corrPar);
1706 
1707  // add the same sub-condition once to every chip where required
1708  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip
1709  != chipList.end(); ++itChip) {
1710 
1711  subcond.setCondChipNr(*itChip);
1712 
1713  // no check for uniqueness - done by DB
1714  ( m_corMuonTemplate[*itChip] ).push_back(subcond);
1715 
1716  // index
1717  subcondIndex[iObj] = ( m_corMuonTemplate[*itChip] ).size() - 1;
1718 
1719  if (m_isDebugEnabled) {
1720  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition "
1721  << ( condDB.cond ) << " on chip " << ( *itChip ) << "\n "
1722  << std::endl;
1723 
1724  LogTrace("L1GtTriggerMenuConfigOnlineProd") << subcond << "\n" << std::endl;
1725  }
1726  }
1727 
1728  }
1729  break;
1730 
1731  case IsoEG:
1732  case NoIsoEG:
1733  case CenJet:
1734  case ForJet:
1735  case TauJet: {
1736 
1737  subcondCategory[iObj] = CondCalo;
1738 
1739  // temporary storage of the parameters
1740  std::vector<L1GtCaloTemplate::ObjectParameter> objParameter(1);
1741 
1742  std::string subcondName;
1743  if (iObj == 0) {
1744  fillCaloObjectParameter(condDB.objectParameter1FK, objParameter[0]);
1745  subcondName = condDB.objectParameter1FK;
1746  } else if (iObj == 1) {
1747  subcondName = condDB.objectParameter2FK;
1748  fillCaloObjectParameter(condDB.objectParameter2FK, objParameter[0]);
1749  }
1750 
1751  L1GtCaloTemplate::CorrelationParameter corrPar; // dummy
1752 
1753  L1GtCaloTemplate subcond(subcondName, Type1s);
1754  subcond.setCondGEq(condDB.condGEq);
1755  subcond.setObjectType(std::vector<L1GtObject> (1, gtObj));
1756  subcond.setConditionParameter(objParameter, corrPar);
1757 
1758  // add the same sub-condition once to every chip where required
1759  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip
1760  != chipList.end(); ++itChip) {
1761 
1762  subcond.setCondChipNr(*itChip);
1763 
1764  // no check for uniqueness - done by DB
1765  ( m_corCaloTemplate[*itChip] ).push_back(subcond);
1766 
1767  // index
1768  subcondIndex[iObj] = ( m_corCaloTemplate[*itChip] ).size() - 1;
1769 
1770  if (m_isDebugEnabled) {
1771  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition "
1772  << ( condDB.cond ) << " on chip " << ( *itChip ) << "\n "
1773  << std::endl;
1774 
1775  LogTrace("L1GtTriggerMenuConfigOnlineProd") << subcond << "\n" << std::endl;
1776  }
1777  }
1778  }
1779  break;
1780 
1781  case ETM:
1782  case HTM: {
1783 
1784  subcondCategory[iObj] = CondEnergySum;
1785 
1786  // temporary storage of the parameters
1787  std::vector<L1GtEnergySumTemplate::ObjectParameter> objParameter(1);
1788 
1789  std::string subcondName;
1790  if (iObj == 0) {
1791  fillEnergySumObjectParameter(condDB.objectParameter1FK, objParameter[0], gtObj);
1792  subcondName = condDB.objectParameter1FK;
1793  } else if (iObj == 1) {
1794  subcondName = condDB.objectParameter2FK;
1795  fillEnergySumObjectParameter(condDB.objectParameter2FK, objParameter[0], gtObj);
1796  }
1797 
1798  L1GtConditionType condType;
1799 
1800  switch (gtObj) {
1801  case ETM: {
1802  condType = TypeETM;
1803  }
1804  break;
1805  case HTM: {
1806  condType = TypeHTM;
1807  }
1808  break;
1809  default: {
1810  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
1811  << "\n Warning: wrong L1GtConditionType "
1812  << gtObj << std::endl;
1813 
1814  }
1815  break;
1816  }
1817 
1818  L1GtEnergySumTemplate subcond(subcondName, condType);
1819  subcond.setCondGEq(condDB.condGEq);
1820  subcond.setObjectType(std::vector<L1GtObject> (1, gtObj));
1821  subcond.setConditionParameter(objParameter);
1822 
1823  // add the same sub-condition once to every chip where required
1824  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip
1825  != chipList.end(); ++itChip) {
1826 
1827  subcond.setCondChipNr(*itChip);
1828 
1829  // no check for uniqueness - done by DB
1830  ( m_corEnergySumTemplate[*itChip] ).push_back(subcond);
1831 
1832  // index
1833  subcondIndex[iObj] = ( m_corEnergySumTemplate[*itChip] ).size() - 1;
1834 
1835  if (m_isDebugEnabled) {
1836  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition "
1837  << ( condDB.cond ) << " on chip " << ( *itChip ) << "\n "
1838  << std::endl;
1839 
1840  LogTrace("L1GtTriggerMenuConfigOnlineProd") << subcond << "\n" << std::endl;
1841  }
1842  }
1843  }
1844  break;
1845  case ETT:
1846  case HTT:
1847  case JetCounts:
1848  case HfBitCounts:
1849  case HfRingEtSums:
1850  case Castor:
1851  case BPTX:
1852  case GtExternal:
1853  case TechTrig: {
1854  wrongSubcondition = true;
1855  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
1856  << "\n Warning: correlation condition "
1857  << (condDB.cond)
1858  << " with invalid sub-condition object type " << gtObj
1859  << "\n Condition ignored!" << std::endl;
1860  }
1861  default: {
1862  wrongSubcondition = true;
1863  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
1864  << "\n Warning: correlation condition "
1865  << (condDB.cond)
1866  << " with invalid sub-condition object type " << gtObj
1867  << "\n Condition ignored!" << std::endl;
1868 
1869  //
1870 
1871  }
1872  break;
1873  }
1874 
1875  }
1876 
1877  if (wrongSubcondition) {
1878  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
1879  << "\n Warning: wrong sub-condition for correlation condition "
1880  << (condDB.cond)
1881  << "\n Condition not inserted in menu. \n A sub-condition may be left in the menu"
1882  << std::endl;
1883  return;
1884 
1885  }
1886 
1887  // get the correlation parameters for the correlation condition (std::string)
1889  corrParameter.deltaEtaRange = condDB.deltaEtaRange;
1890  corrParameter.deltaPhiRange = condDB.deltaPhiRange;
1891 
1892  // set condition categories
1893  correlationCond.setCond0Category(subcondCategory[0]);
1894  correlationCond.setCond1Category(subcondCategory[1]);
1895 
1896  // set condition indices in correlation vector
1897  correlationCond.setCond0Index(subcondIndex[0]);
1898  correlationCond.setCond1Index(subcondIndex[1]);
1899 
1900  // set correlation parameter
1901  corrParameter.deltaPhiMaxbits = 0; // TODO
1902  correlationCond.setCorrelationParameter(corrParameter);
1903 
1904 
1905  // add the same condition once to every chip where required
1906  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1907 
1908  correlationCond.setCondChipNr(*itChip);
1909 
1910  // no check for uniqueness - done by DB
1911  ( m_vecCorrelationTemplate[*itChip] ).push_back(correlationCond);
1912 
1913  if (m_isDebugEnabled) {
1914  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition " << ( condDB.cond )
1915  << " on chip " << ( *itChip ) << "\n " << std::endl;
1916 
1917  LogTrace("L1GtTriggerMenuConfigOnlineProd") << correlationCond << "\n" << std::endl;
1918  }
1919  }
1920 
1921 }
void fillMuonObjectParameter(const std::string &opFK, L1GtMuonTemplate::ObjectParameter &)
Definition: L1GtObject.h:39
Definition: L1GtObject.h:36
void fillCaloObjectParameter(const std::string &opFK, L1GtCaloTemplate::ObjectParameter &)
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
L1GtConditionType
void fillEnergySumObjectParameter(const std::string &opFK, L1GtEnergySumTemplate::ObjectParameter &, const L1GtObject &)
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
Definition: L1GtObject.h:38
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
#define LogTrace(id)
Definition: L1GtObject.h:30
Definition: L1GtObject.h:37
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
tuple size
Write out results.
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion
void L1GtTriggerMenuConfigOnlineProd::addEnergySumCondition ( const TableMenuCond condDB)
private

Definition at line 1323 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, L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtEnergySumTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), and strToEnumL1GtObject().

Referenced by addConditions().

1323  {
1324 
1325  L1GtEnergySumTemplate esumCond(condDB.cond);
1326  esumCond.setCondType(strToEnumCondType(condDB.condType));
1327 
1328  // object types - all energy sums are global - so 1 object
1329  int nrObj = 1;
1330 
1331  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1332  std::vector<L1GtObject> objType(nrObj, obj);
1333  esumCond.setObjectType(objType);
1334 
1335  esumCond.setCondGEq(condDB.condGEq);
1336 
1337  // temporary storage of the parameters - no CorrelationParameter
1338  std::vector<L1GtEnergySumTemplate::ObjectParameter> objParameter(nrObj);
1339  fillEnergySumObjectParameter(condDB.objectParameter1FK, objParameter[0], objType[0]);
1340 
1341  esumCond.setConditionParameter(objParameter);
1342 
1343  // get chip number list
1344  std::list<int> chipList = listChipNumber(condDB.cond);
1345 
1346  // eliminate duplicates
1347  chipList.sort();
1348  chipList.unique();
1349 
1350  // add the same condition once to every chip where required
1351  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1352 
1353  esumCond.setCondChipNr(*itChip);
1354 
1355  // no check for uniqueness - done by DB
1356  ( m_vecEnergySumTemplate[*itChip] ).push_back(esumCond);
1357 
1358  if (m_isDebugEnabled) {
1359  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition " << ( condDB.cond )
1360  << " on chip " << ( *itChip ) << "\n " << std::endl;
1361 
1362  LogTrace("L1GtTriggerMenuConfigOnlineProd") << esumCond << "\n" << std::endl;
1363  }
1364  }
1365 
1366 }
void fillEnergySumObjectParameter(const std::string &opFK, L1GtEnergySumTemplate::ObjectParameter &, const L1GtObject &)
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
#define LogTrace(id)
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion
void L1GtTriggerMenuConfigOnlineProd::addExternalCondition ( const TableMenuCond condDB)
private

Definition at line 1599 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addConditions().

1599  {
1600 
1601  L1GtExternalTemplate externalCond(condDB.cond);
1602  externalCond.setCondType(strToEnumCondType(condDB.condType));
1603 
1604  // object types - logical conditions have no objects associated in GT
1605  // one put however a "External" object type
1606  int nrObj = 1;
1607 
1608  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1609  std::vector<L1GtObject> objType(nrObj, obj);
1610  externalCond.setObjectType(objType);
1611 
1612  // irrelevant, set to false for completeness
1613  externalCond.setCondGEq(false);
1614 
1615  // logical conditions have no ObjectParameter, no CorrelationParameter
1616 
1617  // get chip number list
1618  std::list<int> chipList = listChipNumber(condDB.cond);
1619 
1620 
1621 
1622  // eliminate duplicates
1623  chipList.sort();
1624  chipList.unique();
1625 
1626  // add the same condition once to every chip where required
1627  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1628 
1629  externalCond.setCondChipNr(*itChip);
1630 
1631  // no check for uniqueness - done by DB
1632  ( m_vecExternalTemplate[*itChip] ).push_back(externalCond);
1633 
1634  if (m_isDebugEnabled) {
1635  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition " << ( condDB.cond )
1636  << " on chip " << ( *itChip ) << "\n " << std::endl;
1637 
1638  LogTrace("L1GtTriggerMenuConfigOnlineProd") << externalCond << "\n" << std::endl;
1639  }
1640  }
1641 
1642 }
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
#define LogTrace(id)
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion
void L1GtTriggerMenuConfigOnlineProd::addHfBitCountsCondition ( const TableMenuCond condDB)
private

Definition at line 1417 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, L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtHfBitCountsTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), and strToEnumL1GtObject().

Referenced by addConditions().

1417  {
1418 
1419  L1GtHfBitCountsTemplate countsCond(condDB.cond);
1420  countsCond.setCondType(strToEnumCondType(condDB.condType));
1421 
1422  // object types - HF bit counts are "global"
1423  int nrObj = 1;
1424 
1425  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1426  std::vector<L1GtObject> objType(nrObj, obj);
1427  countsCond.setObjectType(objType);
1428 
1429  countsCond.setCondGEq(condDB.condGEq);
1430 
1431  // temporary storage of the parameters - no CorrelationParameter
1432  // for counts, the DB implementation is without OP, directly in TableMenuCond
1433  std::vector<L1GtHfBitCountsTemplate::ObjectParameter> objParameter(nrObj);
1434  objParameter.at(0).countIndex = static_cast<unsigned int>(condDB.countIndex);
1435  objParameter.at(0).countThreshold = static_cast<unsigned int>(condDB.countThreshold);
1436 
1437  countsCond.setConditionParameter(objParameter);
1438 
1439  // get chip number list
1440  std::list<int> chipList = listChipNumber(condDB.cond);
1441 
1442  // eliminate duplicates
1443  chipList.sort();
1444  chipList.unique();
1445 
1446  // add the same condition once to every chip where required
1447  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1448 
1449  countsCond.setCondChipNr(*itChip);
1450 
1451  // no check for uniqueness - done by DB
1452  ( m_vecHfBitCountsTemplate[*itChip] ).push_back(countsCond);
1453 
1454  if (m_isDebugEnabled) {
1455  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition " << ( condDB.cond )
1456  << " on chip " << ( *itChip ) << "\n " << std::endl;
1457 
1458  LogTrace("L1GtTriggerMenuConfigOnlineProd") << countsCond << "\n" << std::endl;
1459  }
1460  }
1461 
1462 }
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
#define LogTrace(id)
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion
void L1GtTriggerMenuConfigOnlineProd::addHfRingEtSumsCondition ( const TableMenuCond condDB)
private

Definition at line 1464 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, L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtHfRingEtSumsTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), strToEnumCondType(), and strToEnumL1GtObject().

Referenced by addConditions().

1464  {
1465 
1466  L1GtHfRingEtSumsTemplate esumCond(condDB.cond);
1467  esumCond.setCondType(strToEnumCondType(condDB.condType));
1468 
1469  // object types - HF energy sums are "global"
1470  int nrObj = 1;
1471 
1472  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1473  std::vector<L1GtObject> objType(nrObj, obj);
1474  esumCond.setObjectType(objType);
1475 
1476  esumCond.setCondGEq(condDB.condGEq);
1477 
1478  // temporary storage of the parameters - no CorrelationParameter
1479  // for HF energy sums, the DB implementation is without OP, directly in TableMenuCond
1480  std::vector<L1GtHfRingEtSumsTemplate::ObjectParameter> objParameter(nrObj);
1481  objParameter.at(0).etSumIndex = static_cast<unsigned int>(condDB.countIndex);
1482  objParameter.at(0).etSumThreshold = static_cast<unsigned int>(condDB.countThreshold);
1483 
1484  esumCond.setConditionParameter(objParameter);
1485 
1486  // get chip number list
1487  std::list<int> chipList = listChipNumber(condDB.cond);
1488 
1489  // eliminate duplicates
1490  chipList.sort();
1491  chipList.unique();
1492 
1493  // add the same condition once to every chip where required
1494  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1495 
1496  esumCond.setCondChipNr(*itChip);
1497 
1498  // no check for uniqueness - done by DB
1499  ( m_vecHfRingEtSumsTemplate[*itChip] ).push_back(esumCond);
1500 
1501  if (m_isDebugEnabled) {
1502  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition " << ( condDB.cond )
1503  << " on chip " << ( *itChip ) << "\n " << std::endl;
1504 
1505  LogTrace("L1GtTriggerMenuConfigOnlineProd") << esumCond << "\n" << std::endl;
1506  }
1507  }
1508 
1509 }
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
#define LogTrace(id)
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion
void L1GtTriggerMenuConfigOnlineProd::addJetCountsCondition ( const TableMenuCond condDB)
private

Definition at line 1369 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addConditions().

1369  {
1370 
1371  L1GtJetCountsTemplate jcCond(condDB.cond);
1372  jcCond.setCondType(strToEnumCondType(condDB.condType));
1373 
1374  // object types - jet counts are "global"
1375  int nrObj = 1;
1376 
1377  L1GtObject obj = strToEnumL1GtObject(condDB.gtObject1);
1378  std::vector<L1GtObject> objType(nrObj, obj);
1379  jcCond.setObjectType(objType);
1380 
1381  jcCond.setCondGEq(condDB.condGEq);
1382 
1383  // temporary storage of the parameters - no CorrelationParameter
1384  // for counts, the DB implementation is without OP, directly in TableMenuCond
1385  std::vector<L1GtJetCountsTemplate::ObjectParameter> objParameter(nrObj);
1386  objParameter.at(0).countIndex = static_cast<unsigned int>(condDB.countIndex);
1387  objParameter.at(0).countThreshold = static_cast<unsigned int>(condDB.countThreshold);
1388  objParameter.at(0).countOverflow = false ; // not used
1389 
1390  jcCond.setConditionParameter(objParameter);
1391 
1392  // get chip number list
1393  std::list<int> chipList = listChipNumber(condDB.cond);
1394 
1395  // eliminate duplicates
1396  chipList.sort();
1397  chipList.unique();
1398 
1399  // add the same condition once to every chip where required
1400  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1401 
1402  jcCond.setCondChipNr(*itChip);
1403 
1404  // no check for uniqueness - done by DB
1405  ( m_vecJetCountsTemplate[*itChip] ).push_back(jcCond);
1406 
1407  if (m_isDebugEnabled) {
1408  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition " << ( condDB.cond )
1409  << " on chip " << ( *itChip ) << "\n " << std::endl;
1410 
1411  LogTrace("L1GtTriggerMenuConfigOnlineProd") << jcCond << "\n" << std::endl;
1412  }
1413  }
1414 
1415 }
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
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
#define LogTrace(id)
volatile std::atomic< bool > shutdown_flag false
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion
void L1GtTriggerMenuConfigOnlineProd::addMuonCondition ( const TableMenuCond condDB)
private

Definition at line 1126 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, L1GtCondition::setCondChipNr(), L1GtCondition::setCondGEq(), L1GtMuonTemplate::setConditionParameter(), L1GtCondition::setCondType(), L1GtCondition::setObjectType(), splitHexStringInTwo64bitWords(), AlCaHLTBitMon_QueryRunRegistry::string, strToEnumCondType(), and L1GtCondition::wsc().

Referenced by addConditions().

1126  {
1127 
1128 
1129  L1GtMuonTemplate muonCond(condDB.cond);
1130  muonCond.setCondType(strToEnumCondType(condDB.condType));
1131 
1132  // object types - all muons
1133  int nrObj = muonCond.nrObjects();
1134  std::vector<L1GtObject> objType(nrObj, Mu);
1135  muonCond.setObjectType(objType);
1136 
1137  muonCond.setCondGEq(condDB.condGEq);
1138 
1139  // temporary storage of the parameters
1140  std::vector<L1GtMuonTemplate::ObjectParameter> objParameter(nrObj);
1141 
1142  for (int iObj = 0; iObj < nrObj; ++iObj) {
1143  if (iObj == 0) {
1144  fillMuonObjectParameter(condDB.objectParameter1FK, objParameter[iObj]);
1145  } else if (iObj == 1) {
1146  fillMuonObjectParameter(condDB.objectParameter2FK, objParameter[iObj]);
1147  } else if (iObj == 2) {
1148  fillMuonObjectParameter(condDB.objectParameter3FK, objParameter[iObj]);
1149  } else if (iObj == 3) {
1150  fillMuonObjectParameter(condDB.objectParameter4FK, objParameter[iObj]);
1151  } else {
1152  LogTrace("L1GtTriggerMenuConfigOnlineProd")
1153  << "\n Warning: number of objects requested " << nrObj
1154  << " not available in DB." << "\n Maximum 4 object parameters implemented. \n"
1155  << std::endl;
1156  }
1157  }
1158 
1160  corrParameter.chargeCorrelation = static_cast<unsigned int> (condDB.chargeCorrelation);
1161  if (muonCond.wsc()) {
1162  corrParameter.deltaEtaRange = lexical_cast_from_hex<unsigned long long> (
1163  condDB.deltaEtaRange);
1164 
1165  std::string word0;
1166  std::string word1;
1167  splitHexStringInTwo64bitWords(condDB.deltaPhiRange, word0, word1);
1168 
1169  corrParameter.deltaPhiRange0Word = lexical_cast_from_hex<unsigned long long> (word0);
1170  corrParameter.deltaPhiRange1Word = lexical_cast_from_hex<unsigned long long> (word1);
1171 
1172  corrParameter.deltaPhiMaxbits = 0; // not used anymore
1173  }
1174 
1175  muonCond.setConditionParameter(objParameter, corrParameter);
1176 
1177  // get chip number list
1178  std::list<int> chipList = listChipNumber(condDB.cond);
1179 
1180  // eliminate duplicates
1181  chipList.sort();
1182  chipList.unique();
1183 
1184  // add the same condition once to every chip where required
1185  for (std::list<int>::const_iterator itChip = chipList.begin(); itChip != chipList.end(); ++itChip) {
1186 
1187  muonCond.setCondChipNr(*itChip);
1188 
1189  // no check for uniqueness - done by DB
1190  ( m_vecMuonTemplate[*itChip] ).push_back(muonCond);
1191 
1192  if (m_isDebugEnabled) {
1193  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Adding condition " << ( condDB.cond )
1194  << " on chip " << ( *itChip ) << "\n " << std::endl;
1195 
1196  LogTrace("L1GtTriggerMenuConfigOnlineProd") << muonCond << "\n" << std::endl;
1197  }
1198  }
1199 
1200 }
void fillMuonObjectParameter(const std::string &opFK, L1GtMuonTemplate::ObjectParameter &)
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
#define LogTrace(id)
Definition: L1GtObject.h:30
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
void L1GtTriggerMenuConfigOnlineProd::buildAlgorithmMap ( )
private

build the algorithm map in the menu

Definition at line 858 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by newObject().

858  {
859 
860 
861  // temporary value
862  int bitNumber = -1;
863  std::string logicalExpression;
864 
865  // loop over m_tableMenuAlgo
866  for (std::vector<TableMenuAlgo>::const_iterator constIt = m_tableMenuAlgo.begin(); constIt
867  != m_tableMenuAlgo.end(); constIt++) {
868 
869  bitNumber = static_cast<int> ((*constIt).bitNumberSh);
870 
871  const std::map<int, std::string>& condIndexName = condIndexNameMap((*constIt).bitNumberSh);
872  logicalExpression = convertLogicalExpression((*constIt).logExpression, condIndexName);
873 
874  // create a new algorithm and insert it into algorithm map
875  L1GtAlgorithm alg((*constIt).algName, logicalExpression, bitNumber);
876  alg.setAlgoAlias((*constIt).algAlias);
877 
878  // set algorithm chip number:
879  int algChipNr = chipNumber((*constIt).bitNumberSh);
880  alg.setAlgoChipNumber(algChipNr);
881 
882  // insert algorithm
883  m_algorithmMap[(*constIt).algName] = alg;
884  m_algorithmAliasMap[(*constIt).algAlias] = alg;
885 
886  }
887 
888 }
const std::map< int, std::string > condIndexNameMap(const short bitNr) const
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
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
int chipNumber(short) const
return the chip number for an algorithm with index bitNumberSh
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
void L1GtTriggerMenuConfigOnlineProd::buildTechnicalTriggerMap ( )
private

build the technical trigger map in the menu

Definition at line 891 of file L1GtTriggerMenuConfigOnlineProd.cc.

References m_tableMenuTechTrig, m_technicalTriggerMap, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by newObject().

891  {
892 
893  // temporary value
894  int bitNumber = -1;
895  std::string logicalExpression;
896 
897  // loop over m_tableMenuTechTrig
898  for (std::vector<TableMenuTechTrig>::const_iterator constIt =
899  m_tableMenuTechTrig.begin(); constIt != m_tableMenuTechTrig.end(); constIt++) {
900 
901  bitNumber = static_cast<int> ((*constIt).bitNumberSh);
902 
903  // create a new technical trigger and insert it into technical trigger map
904  // technical triggers have L1GtAlgorithm class
905  L1GtAlgorithm techTrig((*constIt).techName, logicalExpression, bitNumber);
906 
907  // chip number set in constructor to -1 - no meaning for technical triggers
908 
909  // insert technical trigger
910  m_technicalTriggerMap[(*constIt).techName] = techTrig;
911 
912  // no alias is defined for technical triggers
913  }
914 
915 }
std::vector< TableMenuTechTrig > m_tableMenuTechTrig
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers
int L1GtTriggerMenuConfigOnlineProd::chipNumber ( short  bitNumberSh) const
private

return the chip number for an algorithm with index bitNumberSh

Definition at line 836 of file L1GtTriggerMenuConfigOnlineProd.cc.

Referenced by buildAlgorithmMap(), and listChipNumber().

836  {
837 
838  // FIXME get it from Event Setup
839  const unsigned numberConditionChips = 2;
840  const unsigned pinsOnConditionChip = 96;
841  std::vector<int> orderConditionChip;
842  orderConditionChip.push_back(2);
843  orderConditionChip.push_back(1);
844 
845  int posChip = ( static_cast<unsigned> (bitNumberSh) / pinsOnConditionChip ) + 1;
846  for (unsigned int iChip = 0; iChip < numberConditionChips; ++iChip) {
847  if (posChip == orderConditionChip[iChip]) {
848  return static_cast<int>(iChip);
849  }
850  }
851 
852  // chip number not found
853  return -1;
854 
855 }
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 788 of file L1GtTriggerMenuConfigOnlineProd.cc.

References LogTrace, m_isDebugEnabled, and m_tableMenuAlgoCond.

Referenced by buildAlgorithmMap().

789  {
790 
791  std::map<int, std::string> mapIndexName;
792 
793  for (std::vector<TableMenuAlgoCond>::const_iterator constIt = m_tableMenuAlgoCond.begin(); constIt
794  != m_tableMenuAlgoCond.end(); ++constIt) {
795 
796  if (bitNr == (*constIt).bitNumberSh) {
797  mapIndexName[static_cast<int>((*constIt).condIndexF)] = (*constIt).condFK;
798  }
799 
800  }
801 
802  if (m_isDebugEnabled) {
803 
804  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Bit number : " << bitNr << std::endl;
805 
806  for (std::map<int, std::string>::const_iterator constIt = mapIndexName.begin(); constIt
807  != mapIndexName.end(); ++constIt) {
808 
809  LogTrace("L1GtTriggerMenuConfigOnlineProd") << " Condition index -> name: "
810  << ( ( *constIt ).first ) << " " << ( ( *constIt ).second ) << std::endl;
811 
812  }
813 
814  }
815 
816 
817  return mapIndexName;
818 
819 }
#define LogTrace(id)
std::vector< TableMenuAlgoCond > m_tableMenuAlgoCond
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 822 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by buildAlgorithmMap().

823  {
824 
825  std::string expressionNames;
826 
827  L1GtLogicParser parserIndices = L1GtLogicParser(expressionIndices);
828  parserIndices.convertIntToNameLogicalExpression(mapCondIndexName);
829  expressionNames = parserIndices.logicalExpression();
830 
831  return expressionNames;
832 
833 }
std::string logicalExpression() const
return the logical expression
void convertIntToNameLogicalExpression(const std::map< int, std::string > &intToNameMap)
void L1GtTriggerMenuConfigOnlineProd::fillCaloObjectParameter ( const std::string &  opFK,
L1GtCaloTemplate::ObjectParameter objPar 
)
private

Definition at line 1202 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addCaloCondition(), and addCorrelationCondition().

1203  {
1204 
1205  // loop over m_tableMenuCond
1206  for (std::vector<TableMenuObjectParameters>::const_iterator constIt =
1207  m_tableMenuObjectParameters.begin(); constIt != m_tableMenuObjectParameters.end(); constIt++) {
1208 
1209  if (opFK == ( *constIt ).opId) {
1210  objPar.etThreshold = static_cast<unsigned int> ( ( *constIt ).etThreshold);
1211  objPar.etaRange = lexical_cast_from_hex<unsigned int> ( ( *constIt ).etaRange);
1212  objPar.phiRange = lexical_cast_from_hex<unsigned int> ( ( *constIt ).phiRange);
1213 
1214  // can break after it is found - DB consistency
1215  break;
1216  }
1217  }
1218 
1219 }
std::vector< TableMenuObjectParameters > m_tableMenuObjectParameters
void L1GtTriggerMenuConfigOnlineProd::fillEnergySumObjectParameter ( const std::string &  opFK,
L1GtEnergySumTemplate::ObjectParameter objPar,
const L1GtObject obj 
)
private

Definition at line 1292 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addCorrelationCondition(), and addEnergySumCondition().

1294  {
1295 
1296  // loop over m_tableMenuCond
1297  for (std::vector<TableMenuObjectParameters>::const_iterator constIt =
1298  m_tableMenuObjectParameters.begin(); constIt != m_tableMenuObjectParameters.end(); constIt++) {
1299 
1300  if (opFK == ( *constIt ).opId) {
1301  objPar.etThreshold = static_cast<unsigned int> ( ( *constIt ).etThreshold);
1302  objPar.energyOverflow = static_cast<bool> ( ( *constIt ).energyOverflow); // not used
1303 
1304  std::string word0;
1305  std::string word1;
1306  splitHexStringInTwo64bitWords( ( *constIt ).phiRange, word0, word1);
1307 
1308  if (obj == ETM) {
1309  objPar.phiRange0Word = lexical_cast_from_hex<unsigned long long> (word0);
1310  objPar.phiRange1Word = lexical_cast_from_hex<unsigned long long> (word1);
1311 
1312  } else if (obj == HTM) {
1313  objPar.phiRange0Word = lexical_cast_from_hex<unsigned long long> (word0);
1314  }
1315 
1316  // can break after it is found - DB consistency
1317  break;
1318  }
1319  }
1320 
1321 }
Definition: L1GtObject.h:39
Definition: L1GtObject.h:36
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
void L1GtTriggerMenuConfigOnlineProd::fillMuonObjectParameter ( const std::string &  opFK,
L1GtMuonTemplate::ObjectParameter objPar 
)
private

Definition at line 1100 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().

1101  {
1102 
1103  // loop over m_tableMenuCond
1104  for (std::vector<TableMenuObjectParameters>::const_iterator constIt =
1105  m_tableMenuObjectParameters.begin(); constIt != m_tableMenuObjectParameters.end(); constIt++) {
1106 
1107  if (opFK == ( *constIt ).opId) {
1108  objPar.ptHighThreshold = static_cast<unsigned int> ( ( *constIt ).ptHighThreshold);
1109  objPar.ptLowThreshold = static_cast<unsigned int> ( ( *constIt ).ptLowThreshold);
1110  objPar.enableMip = static_cast<bool> ( ( *constIt ).enableMip);
1111  objPar.enableIso = static_cast<bool> ( ( *constIt ).enableIso);
1112  objPar.requestIso = static_cast<bool> ( ( *constIt ).requestIso);
1113  objPar.etaRange = lexical_cast_from_hex<unsigned long long>( ( *constIt ).etaRange);
1114  objPar.phiHigh = static_cast<unsigned int> ( ( *constIt ).phiHigh);
1115  objPar.phiLow = static_cast<unsigned int> ( ( *constIt ).phiLow);
1116  objPar.qualityRange = lexical_cast_from_hex<unsigned int>( ( *constIt ).qualityRange);
1117  //objPar.charge = static_cast<unsigned int> ( ( *constIt ).charge);
1118 
1119  // can break after it is found - DB consistency
1120  break;
1121  }
1122  }
1123 
1124 }
std::vector< TableMenuObjectParameters > m_tableMenuObjectParameters
void L1GtTriggerMenuConfigOnlineProd::init ( const int  numberConditionChips)

initialize the class (mainly reserve/resize)

Definition at line 59 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().

59  {
60 
61  // resize the vectors of condition maps
62  // the number of condition chips should be correctly set
63 
64  m_vecMuonTemplate.resize(numberConditionChips);
65  m_vecCaloTemplate.resize(numberConditionChips);
66  m_vecEnergySumTemplate.resize(numberConditionChips);
67  m_vecJetCountsTemplate.resize(numberConditionChips);
68  m_vecCastorTemplate.resize(numberConditionChips);
69  m_vecHfBitCountsTemplate.resize(numberConditionChips);
70  m_vecHfRingEtSumsTemplate.resize(numberConditionChips);
71  m_vecBptxTemplate.resize(numberConditionChips);
72  m_vecExternalTemplate.resize(numberConditionChips);
73 
74  m_vecCorrelationTemplate.resize(numberConditionChips);
75  m_corMuonTemplate.resize(numberConditionChips);
76  m_corCaloTemplate.resize(numberConditionChips);
77  m_corEnergySumTemplate.resize(numberConditionChips);
78 
79 
80 }
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
template<typename Result , typename Source >
Result L1GtTriggerMenuConfigOnlineProd::lexical_cast_from_hex ( Source &  value) const
private

Definition at line 276 of file L1GtTriggerMenuConfigOnlineProd.h.

References query::result, and relativeConstraints::value.

276  {
277 
278  std::stringstream convertor;
279  convertor << value;
280 
281  Result result;
282  if (! ( convertor >> std::hex >> result ) || !convertor.eof()) {
283  throw boost::bad_lexical_cast();
284  }
285 
286  return result;
287 }
tuple result
Definition: query.py:137
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 1082 of file L1GtTriggerMenuConfigOnlineProd.cc.

References chipNumber(), and m_tableMenuAlgoCond.

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

1082  {
1083 
1084  std::list<int> chipList;
1085 
1086  // loop over m_tableMenuAlgoCond
1087  for (std::vector<TableMenuAlgoCond>::const_iterator constIt = m_tableMenuAlgoCond.begin(); constIt
1088  != m_tableMenuAlgoCond.end(); constIt++) {
1089 
1090  if (condFK == ( *constIt ).condFK) {
1091  int chipNr = chipNumber( ( *constIt ).bitNumberSh);
1092  chipList.push_back(chipNr);
1093  }
1094  }
1095 
1096  return chipList;
1097 
1098 }
int chipNumber(short) const
return the chip number for an algorithm with index bitNumberSh
std::vector< TableMenuAlgoCond > m_tableMenuAlgoCond
boost::shared_ptr< L1GtTriggerMenu > L1GtTriggerMenuConfigOnlineProd::newObject ( const std::string &  objectKey)
virtual

public methods

Implements L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >.

Definition at line 82 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, L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::scalesKey, AlCaHLTBitMon_QueryRunRegistry::string, tableMenuAlgoCondFromDB(), tableMenuAlgoFromDB(), tableMenuCondFromDB(), tableMenuGeneralFromDB(), tableMenuObjectParametersFromDB(), tableMenuTechTrigFromDB(), and mvaPFMET_cff::verbosity.

83  {
84 
85  // FIXME seems to not work anymore in constructor...
87 
88  // shared pointer for L1GtTriggerMenu - empty menu
89  boost::shared_ptr<L1GtTriggerMenu> pL1GtTriggerMenuEmpty =
90  boost::shared_ptr<L1GtTriggerMenu>(new L1GtTriggerMenu());
91 
92  // FIXME get it from L1GtStableParameters?
93  // initialize once, from outside
94  const unsigned int numberConditionChips = 2;
95  init(numberConditionChips);
96 
97  const std::string gtSchema = "CMS_GT";
98 
99  // l1GtTriggerMenu: parameters in table GTFE_SETUP_FK
100  // the objectKey for the menu obtained from GT_SETUP is the L1T_MENU_IMPL key
101 
102  // SQL queries:
103 
104  // retrieve table with general menu parameters from DB, view L1T_MENU_GENERAL_VIEW
105  if (!tableMenuGeneralFromDB(gtSchema, objectKey)) {
106  return pL1GtTriggerMenuEmpty;
107 
108  }
109 
110  // build the menu name
113 
114 
115  // retrieve table with physics algorithms from DB, view L1T_MENU_ALGO_VIEW
116  if (!tableMenuAlgoFromDB(gtSchema, objectKey)) {
117  return pL1GtTriggerMenuEmpty;
118 
119  }
120 
121  // retrieve table with conditions associated to physics algorithms from DB
122  if (!tableMenuAlgoCondFromDB(gtSchema, objectKey)) {
123  return pL1GtTriggerMenuEmpty;
124 
125  }
126 
127  // retrieve table with list of conditions in the menu
128  if (!tableMenuCondFromDB(gtSchema, objectKey)) {
129  return pL1GtTriggerMenuEmpty;
130 
131  }
132 
133 
134  // retrieve table with object parameters from DB, view CMS_GT.L1T_MENU_OP_VIEW
135  if (!tableMenuObjectParametersFromDB(gtSchema, objectKey)) {
136  return pL1GtTriggerMenuEmpty;
137 
138  }
139 
140  // retrieve table with technical triggers from DB, view L1T_MENU_TECHTRIG_VIEW
141  if (!tableMenuTechTrigFromDB(gtSchema, objectKey)) {
142  return pL1GtTriggerMenuEmpty;
143 
144  }
145 
146  // build the algorithm map in the menu
148 
149  // build the technical trigger map in the menu
151 
152  // add the conditions from a menu to the corresponding list
153  addConditions();
154 
155  // fill the record
156  boost::shared_ptr<L1GtTriggerMenu> pL1GtTriggerMenu = boost::shared_ptr<L1GtTriggerMenu>(
157  new L1GtTriggerMenu(menuName, numberConditionChips,
171 
172  pL1GtTriggerMenu->setGtTriggerMenuInterface(m_tableMenuGeneral.menuInterface);
173  pL1GtTriggerMenu->setGtTriggerMenuImplementation(m_tableMenuGeneral.menuImplementation);
174  pL1GtTriggerMenu->setGtScaleDbKey(m_tableMenuGeneral.scalesKey);
175 
176  pL1GtTriggerMenu->setGtAlgorithmMap(m_algorithmMap);
177  pL1GtTriggerMenu->setGtAlgorithmAliasMap(m_algorithmAliasMap);
178  pL1GtTriggerMenu->setGtTechnicalTriggerMap(m_technicalTriggerMap);
179 
180 
181  if (m_isDebugEnabled) {
182  LogTrace("L1GtTriggerMenuConfigOnlineProd")
183  << "\nThe following L1GtTriggerMenu record was read from OMDS: \n"
184  << std::endl;
185 
186  std::ostringstream myCoutStream;
187  int verbosity = 0;
188  pL1GtTriggerMenu->print(myCoutStream, verbosity);
189  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n" << std::endl;
190 
191  verbosity = 2;
192  pL1GtTriggerMenu->print(myCoutStream, verbosity);
193  LogTrace("L1GtTriggerMenuConfigOnlineProd") << myCoutStream.str() << "\n" << std::endl;
194 
195  }
196 
197  return pL1GtTriggerMenu;
198 }
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
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
#define LogTrace(id)
bool tableMenuTechTrigFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with technical triggers from DB
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
tuple verbosity
Definition: mvaPFMET_cff.py:80
bool tableMenuObjectParametersFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with object parameters from DB
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 1051 of file L1GtTriggerMenuConfigOnlineProd.cc.

References LogTrace.

Referenced by addMuonCondition(), and fillEnergySumObjectParameter().

1052  {
1053 
1054  unsigned int lenHexStr = hexStr.length();
1055 
1056  if (lenHexStr < 3) {
1057  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n Warning: string " << hexStr
1058  << " has length less than 3." << "\n Not possible to split it in two 64-bit words."
1059  << "\n Return two zero strings." << std::endl;
1060  hex0WordStr = "0x0";
1061  hex1WordStr = "0x0";
1062 
1063  return;
1064  }
1065 
1066  unsigned int lenHex = lenHexStr - 2;
1067  unsigned int len0Word = lenHex > 16 ? 16 : lenHex;
1068  unsigned int len1Word = lenHex - len0Word;
1069 
1070  unsigned int pos0Word = lenHexStr - len0Word;
1071  hex0WordStr = "0x" + hexStr.substr(pos0Word, len0Word);
1072 
1073  if (len1Word > 0) {
1074  unsigned int pos1Word = pos0Word - len1Word;
1075  hex1WordStr = "0x" + hexStr.substr(pos1Word, len1Word);
1076  } else {
1077  hex1WordStr = "0x0";
1078  }
1079 }
#define LogTrace(id)
L1GtConditionCategory L1GtTriggerMenuConfigOnlineProd::strToEnumCondCategory ( const std::string &  strCategory)
private

string to enum L1GtConditionCategory conversion

Definition at line 918 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addConditions().

919  {
920 
921  if (strCategory == "CondMuon") {
922  return CondMuon;
923  } else if (strCategory == "CondCalo") {
924  return CondCalo;
925  } else if (strCategory == "CondEnergySum") {
926  return CondEnergySum;
927  } else if (strCategory == "CondJetCounts") {
928  return CondJetCounts;
929  } else if (strCategory == "CondCorrelation") {
930  return CondCorrelation;
931  } else if (strCategory == "CondCastor") {
932  return CondCastor;
933  } else if (strCategory == "CondHfBitCounts") {
934  return CondHfBitCounts;
935  } else if (strCategory == "CondHfRingEtSums") {
936  return CondHfRingEtSums;
937  } else if (strCategory == "CondBptx") {
938  return CondBptx;
939  } else if (strCategory == "CondExternal") {
940  return CondExternal;
941  } else if (strCategory == "CondNull") {
942  return CondNull;
943  } else {
944  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
945  << "\n Warning: string " << strCategory
946  << " not defined. Returning CondNull.\n" << std::endl;
947  return CondNull;
948  }
949 
950  return CondNull;
951 
952 }
L1GtConditionType L1GtTriggerMenuConfigOnlineProd::strToEnumCondType ( const std::string &  strType)
private

string to enum L1GtConditionType conversion

Definition at line 955 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().

955  {
956 
957  if (strType == "1s") {
958  return Type1s;
959  } else if (strType == "2s") {
960  return Type2s;
961  } else if (strType == "2wsc") {
962  return Type2wsc;
963  } else if (strType == "2cor") {
964  return Type2cor;
965  } else if (strType == "3s") {
966  return Type3s;
967  } else if (strType == "4s") {
968  return Type4s;
969  } else if (strType == "ETM") {
970  return TypeETM;
971  } else if (strType == "ETT") {
972  return TypeETT;
973  } else if (strType == "HTT") {
974  return TypeHTT;
975  } else if (strType == "HTM") {
976  return TypeHTM;
977  } else if (strType == "JetCounts") {
978  return TypeJetCounts;
979  } else if (strType == "Castor") {
980  return TypeCastor;
981  } else if (strType == "HfBitCounts") {
982  return TypeHfBitCounts;
983  } else if (strType == "HfRingEtSums") {
984  return TypeHfRingEtSums;
985  } else if (strType == "Bptx") {
986  return TypeBptx;
987  } else if (strType == "TypeExternal") {
988  return TypeExternal;
989  } else {
990  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
991  << "\n Warning: string " << strType
992  << " not associated to any L1GtConditionType. Returning TypeNull.\n"
993  << std::endl;
994  return TypeNull;
995  }
996 
997  return TypeNull;
998 
999 }
L1GtObject L1GtTriggerMenuConfigOnlineProd::strToEnumL1GtObject ( const std::string &  strObject)
private

string to enum L1GtObject conversion

Definition at line 1002 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().

1002  {
1003 
1004  if (strObject == "Mu") {
1005  return Mu;
1006  } else if (strObject == "NoIsoEG") {
1007  return NoIsoEG;
1008  } else if (strObject == "IsoEG") {
1009  return IsoEG;
1010  } else if (strObject == "CenJet") {
1011  return CenJet;
1012  } else if (strObject == "ForJet") {
1013  return ForJet;
1014  } else if (strObject == "TauJet") {
1015  return TauJet;
1016  } else if (strObject == "ETM") {
1017  return ETM;
1018  } else if (strObject == "ETT") {
1019  return ETT;
1020  } else if (strObject == "HTT") {
1021  return HTT;
1022  } else if (strObject == "HTM") {
1023  return HTM;
1024  } else if (strObject == "JetCounts") {
1025  return JetCounts;
1026  } else if (strObject == "HfBitCounts") {
1027  return HfBitCounts;
1028  } else if (strObject == "HfRingEtSums") {
1029  return HfRingEtSums;
1030  } else if (strObject == "TechTrig") {
1031  return TechTrig;
1032  } else if (strObject == "Castor") {
1033  return Castor;
1034  } else if (strObject == "BPTX") {
1035  return BPTX;
1036  } else if (strObject == "GtExternal") {
1037  return GtExternal;
1038  } else {
1039  edm::LogWarning("L1GtTriggerMenuConfigOnlineProd")
1040  << "\n Warning: string " << strObject
1041  << " not associated to any L1GtObject. Returning Mu (no Null type).\n"
1042  << std::endl;
1043  return Mu;
1044  }
1045 
1046  // no null type, so returning Mu - should never arrive here
1047  return Mu;
1048 
1049 }
Definition: L1GtObject.h:39
Definition: L1GtObject.h:36
Definition: L1GtObject.h:38
Definition: L1GtObject.h:30
Definition: L1GtObject.h:37
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 358 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by newObject().

359  {
360 
361  // get list of conditions associated with the algorithms
362 
363  // select * from CMS_GT.L1T_MENU_ALGO_COND_VIEW
364  // where L1T_MENU_ALGO_COND_VIEW.MENU_IMPLEMENTATION = objectKey
365 
366  const std::vector<std::string>& columnsMenuAlgoCond = m_omdsReader.columnNamesView(
367  gtSchema, "L1T_MENU_ALGO_COND_VIEW");
368 
369  if (m_isDebugEnabled) {
370  LogTrace("L1GtTriggerMenuConfigOnlineProd")
371  << "\n List of columns in L1T_MENU_ALGO_COND_VIEW:\n" << std::endl;
372  for (std::vector<std::string>::const_iterator iter = columnsMenuAlgoCond.begin(); iter
373  != columnsMenuAlgoCond.end(); iter++) {
374  LogTrace("L1GtTriggerMenuConfigOnlineProd") << ( *iter ) << std::endl;
375 
376  }
377  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
378  }
379 
381  columnsMenuAlgoCond, gtSchema, "L1T_MENU_ALGO_COND_VIEW",
382  "L1T_MENU_ALGO_COND_VIEW.MENU_IMPLEMENTATION", m_omdsReader.singleAttribute(objectKey));
383 
384  // check if query was successful is based on size of returned list
385  // BUT one can have menus w/o algorithms and conditions - no error for empty list, but a warning!
386  if (resultsMenuAlgoCond.queryFailed()) {
387  edm::LogWarning("L1-O2O")
388  << "Warning: Content of L1T_MENU_ALGO_COND_VIEW for L1GtTriggerMenu implementation key: "
389  << "\n " << objectKey << "\nis empty!"
390  << "\nNo list of condition associated to each algorithm are found for this menu.";
391 
392  }
393 
394  //
395  TableMenuAlgoCond menuAlgoCond;
396  int resultsMenuAlgoCondRows = resultsMenuAlgoCond.numberRows();
397 
398  for (int iRow = 0; iRow < resultsMenuAlgoCondRows; ++iRow) {
399 
400  for (std::vector<std::string>::const_iterator constIt = columnsMenuAlgoCond.begin(); constIt
401  != columnsMenuAlgoCond.end(); ++constIt) {
402 
403  if ( ( *constIt ) == "ALGO_INDEX") {
404  resultsMenuAlgoCond.fillVariableFromRow(
405  *constIt, iRow, menuAlgoCond.bitNumberSh);
406 
407  } else if ( ( *constIt ) == "COND_INDEX") {
408  resultsMenuAlgoCond.fillVariableFromRow(
409  *constIt, iRow, menuAlgoCond.condIndexF);
410 
411  } else if ( ( *constIt ) == "COND_FK") {
412  resultsMenuAlgoCond.fillVariableFromRow(*constIt, iRow, menuAlgoCond.condFK);
413 
414  } else {
415  // do nothing
416 
417  }
418 
419  }
420 
421  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "Row " << iRow << ": ALGO_INDEX = "
422  << menuAlgoCond.bitNumberSh << " COND_INDEX = " << menuAlgoCond.condIndexF
423  << " COND_FK = " << menuAlgoCond.condFK << std::endl;
424 
425  m_tableMenuAlgoCond.push_back(menuAlgoCond);
426 
427  }
428 
429  if (m_isDebugEnabled) {
430  LogTrace("L1GtTriggerMenuConfigOnlineProd")
431  << "\n Number of rows read from L1T_MENU_ALGO_COND_VIEW: "
432  << resultsMenuAlgoCondRows << std::endl;
433  }
434 
435 
436  return true;
437 
438 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName) const
Definition: OMDSReader.cc:278
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:319
#define LogTrace(id)
std::vector< TableMenuAlgoCond > m_tableMenuAlgoCond
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="") const
Definition: OMDSReader.cc:191
bool L1GtTriggerMenuConfigOnlineProd::tableMenuAlgoFromDB ( const std::string &  gtSchema,
const std::string &  objKey 
)
private

retrieve table with physics algorithms from DB

Definition at line 275 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by newObject().

276  {
277 
278  // select * from CMS_GT.L1T_MENU_ALGO_VIEW
279  // where L1T_MENU_ALGO_VIEW.MENU_IMPLEMENTATION = objectKey
280 
281  const std::vector<std::string>& columnsMenuAlgo = m_omdsReader.columnNamesView(
282  gtSchema, "L1T_MENU_ALGO_VIEW");
283 
284  if (m_isDebugEnabled) {
285  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n List of columns in L1T_MENU_ALGO_VIEW:\n"
286  << std::endl;
287  for (std::vector<std::string>::const_iterator iter = columnsMenuAlgo.begin(); iter != columnsMenuAlgo.end(); iter++) {
288  LogTrace("L1GtTriggerMenuConfigOnlineProd") << ( *iter ) << std::endl;
289 
290  }
291  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
292  }
293 
295  columnsMenuAlgo, gtSchema, "L1T_MENU_ALGO_VIEW", "L1T_MENU_ALGO_VIEW.MENU_IMPLEMENTATION",
296  m_omdsReader.singleAttribute(objectKey));
297 
298 
299  // check if query was successful is based on size of returned list
300  // BUT one can have menus w/o physics algorithms - no error for empty list, but a warning!
301  if (resultsMenuAlgo.queryFailed()) {
302  edm::LogWarning("L1-O2O")
303  << "Warning: Content of L1T_MENU_ALGO_VIEW for L1GtTriggerMenu implementation key: "
304  << "\n " << objectKey << "\nis empty!"
305  << "\nNo physics algorithms are found for this menu.";
306 
307  }
308 
309  TableMenuAlgo menuAlgo;
310  int resultsMenuAlgoRows = resultsMenuAlgo.numberRows();
311 
312  for (int iRow = 0; iRow < resultsMenuAlgoRows; ++iRow) {
313 
314  for (std::vector<std::string>::const_iterator constIt = columnsMenuAlgo.begin(); constIt
315  != columnsMenuAlgo.end(); ++constIt) {
316 
317  if ( ( *constIt ) == "ALGO_INDEX") {
318  resultsMenuAlgo.fillVariableFromRow(*constIt, iRow, menuAlgo.bitNumberSh);
319 
320  } else if ( ( *constIt ) == "NAME") {
321  resultsMenuAlgo.fillVariableFromRow(*constIt, iRow, menuAlgo.algName);
322 
323  } else if ( ( *constIt ) == "ALIAS") {
324  resultsMenuAlgo.fillVariableFromRow(*constIt, iRow, menuAlgo.algAlias);
325 
326  } else if ( ( *constIt ) == "LOGICEXPR") {
327  resultsMenuAlgo.fillVariableFromRow(*constIt, iRow, menuAlgo.logExpression);
328 
329  } else {
330  // do nothing
331 
332  }
333 
334  }
335 
336  LogTrace("L1GtTriggerMenuConfigOnlineProd")
337  << "Row " << iRow << ": index = " << menuAlgo.bitNumberSh << " algName = " << menuAlgo.algName
338  << " algAlias = " << menuAlgo.algAlias << " logExpression = '" << menuAlgo.logExpression << "'"
339  << std::endl;
340 
341  m_tableMenuAlgo.push_back(menuAlgo);
342 
343 
344  }
345 
346  if (m_isDebugEnabled) {
347  LogTrace("L1GtTriggerMenuConfigOnlineProd")
348  << "\n Number of rows read from L1T_MENU_ALGO_VIEW: " << resultsMenuAlgoRows
349  << std::endl;
350 
351  }
352 
353  return true;
354 
355 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName) const
Definition: OMDSReader.cc:278
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:319
#define LogTrace(id)
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="") const
Definition: OMDSReader.cc:191
bool L1GtTriggerMenuConfigOnlineProd::tableMenuCondFromDB ( const std::string &  gtSchema,
const std::string &  objKey 
)
private

retrieve table with list of conditions in the menu

Definition at line 441 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, getDQMSummary::iter, LogTrace, m_isDebugEnabled, L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >::m_omdsReader, m_tableMenuCond, l1t::OMDSReader::QueryResults::numberRows(), L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter1FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter2FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter3FK, L1GtTriggerMenuConfigOnlineProd::TableMenuCond::objectParameter4FK, l1t::OMDSReader::QueryResults::queryFailed(), and l1t::OMDSReader::singleAttribute().

Referenced by newObject().

442  {
443 
444  // select * from CMS_GT.L1T_MENU_COND_VIEW
445  // where L1T_MENU_COND_VIEW.MENU_IMPLEMENTATION = objectKey
446 
447  const std::vector<std::string>& columnsMenuCond = m_omdsReader.columnNamesView(
448  gtSchema, "L1T_MENU_COND_VIEW");
449 
450  if (m_isDebugEnabled) {
451  LogTrace("L1GtTriggerMenuConfigOnlineProd")
452  << "\n List of columns in L1T_MENU_COND_VIEW:\n" << std::endl;
453  for (std::vector<std::string>::const_iterator iter = columnsMenuCond.begin(); iter
454  != columnsMenuCond.end(); iter++) {
455  LogTrace("L1GtTriggerMenuConfigOnlineProd") << ( *iter ) << std::endl;
456 
457  }
458  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
459  }
460 
462  columnsMenuCond, gtSchema, "L1T_MENU_COND_VIEW",
463  "L1T_MENU_COND_VIEW.MENU_IMPLEMENTATION", m_omdsReader.singleAttribute(objectKey));
464 
465  // check if query was successful is based on size of returned list
466  // BUT one can have menus w/o conditions - no error for empty list, but a warning!
467  if (resultsMenuCond.queryFailed()) {
468  edm::LogWarning("L1-O2O")
469  << "Warning: Content of L1T_MENU_COND_VIEW for L1GtTriggerMenu implementation key: "
470  << "\n " << objectKey << "\nis empty!"
471  << "\nNo conditions associated to menu are found for this menu.";
472 
473  }
474 
475  //
476  TableMenuCond menuCond;
477  int resultsMenuCondRows = resultsMenuCond.numberRows();
478 
479  for (int iRow = 0; iRow < resultsMenuCondRows; ++iRow) {
480 
481  for (std::vector<std::string>::const_iterator constIt = columnsMenuCond.begin(); constIt
482  != columnsMenuCond.end(); ++constIt) {
483 
484  if ( ( *constIt ) == "COND") {
485  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.cond);
486 
487  } else if ( ( *constIt ) == "COND_CATEGORY") {
488  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.condCategory);
489 
490  } else if ( ( *constIt ) == "COND_TYPE") {
491  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.condType);
492 
493  } else if ( ( *constIt ) == "GT_OBJECT_1") {
494  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.gtObject1);
495 
496  } else if ( ( *constIt ) == "GT_OBJECT_2") {
497  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.gtObject2);
498 
499  } else if ( ( *constIt ) == "COND_GEQ") {
500  //float condGEqFloat = -1;
501  //resultsMenuCond.fillVariableFromRow(*constIt, iRow, condGEqFloat);
502  //menuCond.condGEq = (condGEqFloat > 0.5) ? true : false;
503  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.condGEq);
504 
505  } else if ( ( *constIt ) == "COUNT_INDEX") {
506  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.countIndex);
507 
508  } else if ( ( *constIt ) == "COUNT_THRESHOLD") {
509  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.countThreshold);
510 
511  } else if ( ( *constIt ) == "CHARGE_CORRELATION") {
512  resultsMenuCond.fillVariableFromRow(
513  *constIt, iRow, menuCond.chargeCorrelation);
514 
515  } else if ( ( *constIt ) == "OBJECT_PARAMETER_1_FK") {
516  resultsMenuCond.fillVariableFromRow(
517  *constIt, iRow, menuCond.objectParameter1FK);
518 
519  } else if ( ( *constIt ) == "OBJECT_PARAMETER_2_FK") {
520  resultsMenuCond.fillVariableFromRow(
521  *constIt, iRow, menuCond.objectParameter2FK);
522 
523  } else if ( ( *constIt ) == "OBJECT_PARAMETER_3_FK") {
524  resultsMenuCond.fillVariableFromRow(
525  *constIt, iRow, menuCond.objectParameter3FK);
526 
527  } else if ( ( *constIt ) == "OBJECT_PARAMETER_4_FK") {
528  resultsMenuCond.fillVariableFromRow(
529  *constIt, iRow, menuCond.objectParameter4FK);
530 
531  } else if ( ( *constIt ) == "DELTA_ETA_RANGE") {
532  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.deltaEtaRange);
533 
534  } else if ( ( *constIt ) == "DELTA_PHI_RANGE") {
535  resultsMenuCond.fillVariableFromRow(*constIt, iRow, menuCond.deltaPhiRange);
536 
537  } else {
538  // do nothing
539 
540  }
541 
542  }
543 
544  LogTrace("L1GtTriggerMenuConfigOnlineProd")
545  << " COND " << menuCond.cond
546  << " COND_CATEGORY " << menuCond.condCategory
547  << " COND_TYPE " << menuCond.condType
548  << " GT_OBJECT_1 " << menuCond.gtObject1
549  << " GT_OBJECT_2 " << menuCond.gtObject2
550  << " COND_GEQ " << menuCond.condGEq << "\n"
551  << " COUNT_INDEX " << menuCond.countIndex
552  << " COUNT_THRESHOLD " << menuCond.countThreshold << "\n"
553  << " CHARGE_CORRELATION " << menuCond.chargeCorrelation << "\n"
554  << " OBJECT_PARAMETER_1_FK " << menuCond.objectParameter1FK
555  << " OBJECT_PARAMETER_2_FK " << menuCond.objectParameter2FK
556  << " OBJECT_PARAMETER_3_FK " << menuCond.objectParameter3FK
557  << " OBJECT_PARAMETER_4_FK " << menuCond.objectParameter4FK << "\n"
558  << " DELTA_ETA_RANGE " << menuCond.deltaEtaRange
559  << " DELTA_PHI_RANGE " << menuCond.deltaPhiRange;
560 
561  m_tableMenuCond.push_back(menuCond);
562 
563 
564  }
565 
566  if (m_isDebugEnabled) {
567  LogTrace("L1GtTriggerMenuConfigOnlineProd")
568  << "\n Number of rows read from L1T_MENU_COND_VIEW: " << resultsMenuCondRows
569  << std::endl;
570 
571  }
572 
573  return true;
574 
575 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName) const
Definition: OMDSReader.cc:278
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:319
#define LogTrace(id)
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="") const
Definition: OMDSReader.cc:191
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 201 of file L1GtTriggerMenuConfigOnlineProd.cc.

References L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::algoImplTag, l1t::OMDSReader::basicQueryView(), l1t::OMDSReader::columnNamesView(), l1t::OMDSReader::QueryResults::fillVariable(), getDQMSummary::iter, LogTrace, m_isDebugEnabled, L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >::m_omdsReader, m_tableMenuGeneral, L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::menuImplementation, L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::menuInterface, l1t::OMDSReader::QueryResults::queryFailed(), python.entryComment::results, L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::scalesKey, and l1t::OMDSReader::singleAttribute().

Referenced by newObject().

202  {
203 
204  // select * from CMS_GT.L1T_MENU_GENERAL_VIEW
205  // where L1T_MENU_GENERAL_VIEW.MENU_IMPLEMENTATION = objectKey
206 
207  const std::vector<std::string>& columns = m_omdsReader.columnNamesView(
208  gtSchema, "L1T_MENU_GENERAL_VIEW");
209 
210  if (m_isDebugEnabled) {
211  LogTrace("L1GtTriggerMenuConfigOnlineProd")
212  << "\n List of columns in L1T_MENU_GENERAL_VIEW:\n" << std::endl;
213  for (std::vector<std::string>::const_iterator iter = columns.begin(); iter != columns.end(); iter++) {
214  LogTrace("L1GtTriggerMenuConfigOnlineProd") << ( *iter ) << std::endl;
215 
216  }
217  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
218  }
219 
221  columns, gtSchema, "L1T_MENU_GENERAL_VIEW",
222  "L1T_MENU_GENERAL_VIEW.MENU_IMPLEMENTATION", m_omdsReader.singleAttribute(objectKey));
223 
224  // check if query was successful
225  if (results.queryFailed()) {
226  edm::LogError("L1-O2O")
227  << "Problem to get content of L1T_MENU_GENERAL_VIEW for L1GtTriggerMenu implementation key: "
228  << objectKey;
229  return false;
230  }
231 
232  // retrieve menu interface name, scales key, algorithm implementation tag
233 
234  for (std::vector<std::string>::const_iterator constIt = columns.begin(); constIt
235  != columns.end(); ++constIt) {
236 
237  if ( ( *constIt ) == "MENU_IMPLEMENTATION") {
239 
240  } else if ( ( *constIt ) == "INTERFACE") {
241  results.fillVariable(*constIt, m_tableMenuGeneral.menuInterface);
242 
243  } else if ( ( *constIt ) == "SCALES_KEY") {
244  results.fillVariable(*constIt, m_tableMenuGeneral.scalesKey);
245 
246  } else if ( ( *constIt ) == "ALGO_IMPL_TAG") {
247  results.fillVariable(*constIt, m_tableMenuGeneral.algoImplTag);
248 
249  } else {
250  // do nothing
251 
252  }
253 
254  }
255 
256  // cross checks
257  if (m_tableMenuGeneral.menuImplementation != objectKey) {
258 
259  LogTrace("L1GtTriggerMenuConfigOnlineProd")
260  << "\n L1 trigger menu implementation read from querying view not identical"
261  << "\n with menu key:"
262  << "\n from view: " << m_tableMenuGeneral.menuImplementation
263  << "\n from key: " << objectKey
264  << "\n Menu implementation name set from key."
265  << std::endl;
267  }
268 
269  //
270  return true;
271 
272 }
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName) const
Definition: OMDSReader.cc:278
TableMenuGeneral m_tableMenuGeneral
member to keep various tables retrieved from DB
#define LogTrace(id)
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="") const
Definition: OMDSReader.cc:191
bool L1GtTriggerMenuConfigOnlineProd::tableMenuObjectParametersFromDB ( const std::string &  gtSchema,
const std::string &  objKey 
)
private

retrieve table with object parameters from DB

Definition at line 578 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(), getDQMSummary::iter, LogTrace, m_isDebugEnabled, L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >::m_omdsReader, m_tableMenuObjectParameters, l1t::OMDSReader::QueryResults::numberRows(), 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().

579  {
580 
581  // get the list of object parameters in the menu
582 
583  // select * from CMS_GT.L1T_MENU_OP_VIEW
584  // where L1T_MENU_OP_VIEW.MENU_IMPLEMENTATION = objectKey
585 
586  const std::vector<std::string>& columnsMenuOp = m_omdsReader.columnNamesView(
587  gtSchema, "L1T_MENU_OP_VIEW");
588 
589  if (m_isDebugEnabled) {
590  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n List of columns in L1T_MENU_OP_VIEW:\n"
591  << std::endl;
592  for (std::vector<std::string>::const_iterator iter = columnsMenuOp.begin(); iter
593  != columnsMenuOp.end(); iter++) {
594  LogTrace("L1GtTriggerMenuConfigOnlineProd") << ( *iter ) << std::endl;
595 
596  }
597  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
598  }
599 
601  columnsMenuOp, gtSchema, "L1T_MENU_OP_VIEW", "L1T_MENU_OP_VIEW.MENU_IMPLEMENTATION",
602  m_omdsReader.singleAttribute(objectKey));
603 
604  // check if query was successful is based on size of returned list
605  // BUT one can have menus w/o object parameters - no error for empty list, but a warning!
606  if (resultsMenuOp.queryFailed()) {
607  edm::LogWarning("L1-O2O")
608  << "Warning: Content of L1T_MENU_OP_VIEW for L1GtTriggerMenu implementation key: "
609  << "\n " << objectKey << "\nis empty!"
610  << "\nNo object parameters associated to menu are found for this menu.";
611 
612  }
613 
614  TableMenuObjectParameters menuObjectParameters;
615  int resultsMenuOpRows = resultsMenuOp.numberRows();
616 
617  for (int iRow = 0; iRow < resultsMenuOpRows; ++iRow) {
618 
619  for (std::vector<std::string>::const_iterator constIt = columnsMenuOp.begin(); constIt
620  != columnsMenuOp.end(); ++constIt) {
621 
622  if ( ( *constIt ) == "ID") {
623  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.opId);
624 
625  } else if ( ( *constIt ) == "PT_HIGH_THRESHOLD") {
626  resultsMenuOp.fillVariableFromRow(
627  *constIt, iRow, menuObjectParameters.ptHighThreshold);
628 
629  } else if ( ( *constIt ) == "PT_LOW_THRESHOLD") {
630  resultsMenuOp.fillVariableFromRow(
631  *constIt, iRow, menuObjectParameters.ptLowThreshold);
632 
633  } else if ( ( *constIt ) == "ENABLE_MIP") {
634  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.enableMip);
635 
636  } else if ( ( *constIt ) == "ENABLE_ISO") {
637  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.enableIso);
638 
639  } else if ( ( *constIt ) == "REQUEST_ISO") {
640  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.requestIso);
641 
642  } else if ( ( *constIt ) == "ENERGY_OVERFLOW") {
643  resultsMenuOp.fillVariableFromRow(
644  *constIt, iRow, menuObjectParameters.energyOverflow);
645 
646  } else if ( ( *constIt ) == "ET_THRESHOLD") {
647  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.etThreshold);
648 
649  } else if ( ( *constIt ) == "ETA_RANGE") {
650  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.etaRange);
651 
652  } else if ( ( *constIt ) == "PHI_RANGE") {
653  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.phiRange);
654 
655  } else if ( ( *constIt ) == "PHI_LOW") {
656  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.phiLow);
657 
658  } else if ( ( *constIt ) == "PHI_HIGH") {
659  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.phiHigh);
660 
661  } else if ( ( *constIt ) == "QUALITY_RANGE") {
662  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.qualityRange);
663 
664  } else if ( ( *constIt ) == "CHARGE") {
665  resultsMenuOp.fillVariableFromRow(*constIt, iRow, menuObjectParameters.charge);
666 
667  } else {
668  // do nothing
669 
670  }
671 
672  }
673 
674  LogTrace("L1GtTriggerMenuConfigOnlineProd")
675  << " ID " << menuObjectParameters.opId
676  << " PT_HIGH_THRESHOLD " << menuObjectParameters.ptHighThreshold
677  << " PT_LOW_THRESHOLD " << menuObjectParameters.ptLowThreshold
678  << " ENABLE_MIP " << menuObjectParameters.enableMip
679  << " ENABLE_ISO " << menuObjectParameters.enableIso
680  << " REQUEST_ISO " << menuObjectParameters.requestIso
681  << " ENERGY_OVERFLOW " << menuObjectParameters.energyOverflow
682  << " ET_THRESHOLD " << menuObjectParameters.etThreshold
683  << " ETA_RANGE " << menuObjectParameters.etaRange
684  << " PHI_RANGE " << menuObjectParameters.phiRange
685  << " PHI_LOW " << menuObjectParameters.phiLow
686  << " PHI_HIGH " << menuObjectParameters.phiHigh
687  << " QUALITY_RANGE " << menuObjectParameters.qualityRange
688  << " CHARGE " << menuObjectParameters.charge
689  << std::endl;
690 
691  m_tableMenuObjectParameters.push_back(menuObjectParameters);
692  }
693 
694  if (m_isDebugEnabled) {
695  LogTrace("L1GtTriggerMenuConfigOnlineProd")
696  << "\n Number of rows read from L1T_MENU_OP_VIEW: " << resultsMenuOpRows
697  << std::endl;
698 
699  }
700 
701  return true;
702 
703 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName) const
Definition: OMDSReader.cc:278
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:319
#define LogTrace(id)
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="") const
Definition: OMDSReader.cc:191
bool L1GtTriggerMenuConfigOnlineProd::tableMenuTechTrigFromDB ( const std::string &  gtSchema,
const std::string &  objKey 
)
private

retrieve table with technical triggers from DB

Definition at line 706 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by newObject().

707  {
708 
709  // select * from CMS_GT.L1T_MENU_TECHTRIG_VIEW
710  // where L1T_MENU_TECHTRIG_VIEW.MENU_IMPLEMENTATION = objectKey
711 
712  const std::vector<std::string>& columnsMenuTechTrig =
713  m_omdsReader.columnNamesView(gtSchema, "L1T_MENU_TECHTRIG_VIEW");
714 
715  if (m_isDebugEnabled) {
716  LogTrace("L1GtTriggerMenuConfigOnlineProd")
717  << "\n List of columns in L1T_MENU_TECHTRIG_VIEW:\n"
718  << std::endl;
719  for (std::vector<std::string>::const_iterator iter =
720  columnsMenuTechTrig.begin(); iter != columnsMenuTechTrig.end(); iter++) {
721  LogTrace("L1GtTriggerMenuConfigOnlineProd") << (*iter) << std::endl;
722 
723  }
724  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "\n\n" << std::endl;
725  }
726 
727  l1t::OMDSReader::QueryResults resultsMenuTechTrig =
728  m_omdsReader.basicQueryView(columnsMenuTechTrig, gtSchema,
729  "L1T_MENU_TECHTRIG_VIEW",
730  "L1T_MENU_TECHTRIG_VIEW.MENU_IMPLEMENTATION",
731  m_omdsReader.singleAttribute(objectKey));
732 
733  // check if query was successful is based on size of returned list
734  // BUT one can have menus w/o technical triggers - no error for empty list, but a warning!
735  if (resultsMenuTechTrig.queryFailed()) {
736  edm::LogWarning("L1-O2O")
737  << "Warning: Content of L1T_MENU_TECHTRIG_VIEW for L1GtTriggerMenu implementation key: "
738  << "\n " << objectKey << "\nis empty!"
739  << "\nNo technical triggers are found for this menu.";
740 
741  }
742 
743  TableMenuTechTrig menuTechTrig;
744  int resultsMenuTechTrigRows = resultsMenuTechTrig.numberRows();
745 
746  for (int iRow = 0; iRow < resultsMenuTechTrigRows; ++iRow) {
747 
748  for (std::vector<std::string>::const_iterator constIt =
749  columnsMenuTechTrig.begin(); constIt
750  != columnsMenuTechTrig.end(); ++constIt) {
751 
752  if ((*constIt) == "TECHTRIG_INDEX") {
753  resultsMenuTechTrig.fillVariableFromRow(*constIt, iRow,
754  menuTechTrig.bitNumberSh);
755 
756  } else if ((*constIt) == "NAME") {
757  resultsMenuTechTrig.fillVariableFromRow(*constIt, iRow,
758  menuTechTrig.techName);
759 
760  } else {
761  // do nothing
762 
763  }
764 
765  }
766 
767  LogTrace("L1GtTriggerMenuConfigOnlineProd") << "Row " << iRow
768  << ": index = " << menuTechTrig.bitNumberSh << " techName = "
769  << menuTechTrig.techName << std::endl;
770 
771  m_tableMenuTechTrig.push_back(menuTechTrig);
772 
773  }
774 
775  if (m_isDebugEnabled) {
776  LogTrace("L1GtTriggerMenuConfigOnlineProd")
777  << "\n Number of rows read from L1T_MENU_TECHTRIG_VIEW: "
778  << resultsMenuTechTrigRows << std::endl;
779 
780  }
781 
782  return true;
783 
784 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
std::vector< std::string > columnNamesView(const std::string &schemaName, const std::string &viewName) const
Definition: OMDSReader.cc:278
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:319
std::vector< TableMenuTechTrig > m_tableMenuTechTrig
#define LogTrace(id)
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="") const
Definition: OMDSReader.cc:191

Member Data Documentation

AlgorithmMap L1GtTriggerMenuConfigOnlineProd::m_algorithmAliasMap
private

map containing the physics algorithms (by alias)

Definition at line 261 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by buildAlgorithmMap(), and newObject().

AlgorithmMap L1GtTriggerMenuConfigOnlineProd::m_algorithmMap
private

map containing the physics algorithms (by name)

Definition at line 258 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by buildAlgorithmMap(), and newObject().

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

Definition at line 254 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 255 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 253 of file L1GtTriggerMenuConfigOnlineProd.h.

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

bool L1GtTriggerMenuConfigOnlineProd::m_isDebugEnabled
private
std::string L1GtTriggerMenuConfigOnlineProd::m_scaleDbKey
private

menu associated scale key

Definition at line 238 of file L1GtTriggerMenuConfigOnlineProd.h.

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

Definition at line 222 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by buildAlgorithmMap(), and tableMenuAlgoFromDB().

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

Definition at line 224 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by addConditions(), and tableMenuCondFromDB().

TableMenuGeneral L1GtTriggerMenuConfigOnlineProd::m_tableMenuGeneral
private

member to keep various tables retrieved from DB

Definition at line 221 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by newObject(), and tableMenuGeneralFromDB().

std::vector<TableMenuObjectParameters> L1GtTriggerMenuConfigOnlineProd::m_tableMenuObjectParameters
private
std::vector<TableMenuTechTrig> L1GtTriggerMenuConfigOnlineProd::m_tableMenuTechTrig
private
AlgorithmMap L1GtTriggerMenuConfigOnlineProd::m_technicalTriggerMap
private

map containing the technical triggers

Definition at line 264 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by buildTechnicalTriggerMap(), and newObject().

std::string L1GtTriggerMenuConfigOnlineProd::m_triggerMenuImplementation
private

Definition at line 235 of file L1GtTriggerMenuConfigOnlineProd.h.

std::string L1GtTriggerMenuConfigOnlineProd::m_triggerMenuInterface
private

menu representation

menu names

Definition at line 233 of file L1GtTriggerMenuConfigOnlineProd.h.

std::string L1GtTriggerMenuConfigOnlineProd::m_triggerMenuName
private

Definition at line 234 of file L1GtTriggerMenuConfigOnlineProd.h.

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

Definition at line 249 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 243 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 246 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 252 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 244 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 250 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 247 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 248 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 245 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

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

Definition at line 242 of file L1GtTriggerMenuConfigOnlineProd.h.

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