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
 
- 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::DbConnection m_dbConnection
 
cond::DbSession 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

$Date$ $Revision$

Definition at line 50 of file L1GtTriggerMenuConfigOnlineProd.h.

Constructor & Destructor Documentation

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

destructor

Definition at line 52 of file L1GtTriggerMenuConfigOnlineProd.cc.

52  {
53 
54  // empty
55 
56 }

Member Function Documentation

void L1GtTriggerMenuConfigOnlineProd::addBptxCondition ( const TableMenuCond condDB)
private

Definition at line 1553 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addConditions().

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

Definition at line 1220 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(), VarParsing::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().

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

Definition at line 1510 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addConditions().

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

1919  {
1920 
1921  // loop over m_tableMenuCond
1922  for (std::vector<TableMenuCond>::const_iterator constIt = m_tableMenuCond.begin(); constIt
1923  != m_tableMenuCond.end(); constIt++) {
1924 
1925  L1GtConditionCategory conCategory = strToEnumCondCategory((*constIt).condCategory);
1926 
1927  switch (conCategory) {
1928  case CondMuon: {
1929 
1930  addMuonCondition(*constIt);
1931 
1932  }
1933  break;
1934  case CondCalo: {
1935 
1936  addCaloCondition(*constIt);
1937 
1938  }
1939  break;
1940  case CondEnergySum: {
1941 
1942  addEnergySumCondition(*constIt);
1943 
1944  }
1945  break;
1946  case CondJetCounts: {
1947  addJetCountsCondition(*constIt);
1948 
1949  }
1950  break;
1951  case CondHfBitCounts: {
1952  addHfBitCountsCondition(*constIt);
1953 
1954  }
1955  break;
1956  case CondHfRingEtSums: {
1957  addHfRingEtSumsCondition(*constIt);
1958 
1959  }
1960  break;
1961  case CondCastor: {
1962 
1963  addCastorCondition(*constIt);
1964 
1965  }
1966  break;
1967  case CondBptx: {
1968 
1969  addBptxCondition(*constIt);
1970 
1971  }
1972  break;
1973  case CondExternal: {
1974 
1975  addExternalCondition(*constIt);
1976 
1977  }
1978  break;
1979  case CondCorrelation: {
1980 
1981  addCorrelationCondition(*constIt);
1982 
1983  }
1984  break;
1985  case CondNull: {
1986 
1987  // do nothing
1988 
1989  }
1990  break;
1991  default: {
1992 
1993  // do nothing
1994 
1995  }
1996  break;
1997  }
1998 
1999  }
2000 
2001 }
L1GtConditionCategory
condition categories
Definition: L1GtFwd.h:63
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 1643 of file L1GtTriggerMenuConfigOnlineProd.cc.

References BPTX, Castor, CenJet, 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, VarParsing::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, strToEnumCondType(), strToEnumL1GtObject(), TauJet, TechTrig, Type1s, TypeETM, and TypeHTM.

Referenced by addConditions().

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

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

Referenced by addConditions().

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

Definition at line 1598 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addConditions().

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

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

Referenced by addConditions().

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

Referenced by addConditions().

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

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

Referenced by addConditions().

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

Definition at line 1125 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(), strToEnumCondType(), and L1GtCondition::wsc().

Referenced by addConditions().

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

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

Referenced by newObject().

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

References m_tableMenuTechTrig, and m_technicalTriggerMap.

Referenced by newObject().

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

Referenced by buildAlgorithmMap(), and listChipNumber().

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

References LogTrace, m_isDebugEnabled, and m_tableMenuAlgoCond.

Referenced by buildAlgorithmMap().

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

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

Referenced by buildAlgorithmMap().

824  {
825 
826  std::string expressionNames;
827 
828  L1GtLogicParser parserIndices = L1GtLogicParser(expressionIndices);
829  parserIndices.convertIntToNameLogicalExpression(mapCondIndexName);
830  expressionNames = parserIndices.logicalExpression();
831 
832  return expressionNames;
833 
834 }
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 1201 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addCaloCondition(), and addCorrelationCondition().

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

Definition at line 1291 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addCorrelationCondition(), and addEnergySumCondition().

1293  {
1294 
1295  // loop over m_tableMenuCond
1296  for (std::vector<TableMenuObjectParameters>::const_iterator constIt =
1297  m_tableMenuObjectParameters.begin(); constIt != m_tableMenuObjectParameters.end(); constIt++) {
1298 
1299  if (opFK == ( *constIt ).opId) {
1300  objPar.etThreshold = static_cast<unsigned int> ( ( *constIt ).etThreshold);
1301  objPar.energyOverflow = static_cast<bool> ( ( *constIt ).energyOverflow); // not used
1302 
1303  std::string word0;
1304  std::string word1;
1305  splitHexStringInTwo64bitWords( ( *constIt ).phiRange, word0, word1);
1306 
1307  if (obj == ETM) {
1308  objPar.phiRange0Word = lexical_cast_from_hex<unsigned long long> (word0);
1309  objPar.phiRange1Word = lexical_cast_from_hex<unsigned long long> (word1);
1310 
1311  } else if (obj == HTM) {
1312  objPar.phiRange0Word = lexical_cast_from_hex<unsigned long long> (word0);
1313  }
1314 
1315  // can break after it is found - DB consistency
1316  break;
1317  }
1318  }
1319 
1320 }
tuple obj
Example code starts here #.
Definition: VarParsing.py:655
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 1099 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().

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

initialize the class (mainly reserve/resize)

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

61  {
62 
63  // resize the vectors of condition maps
64  // the number of condition chips should be correctly set
65 
66  m_vecMuonTemplate.resize(numberConditionChips);
67  m_vecCaloTemplate.resize(numberConditionChips);
68  m_vecEnergySumTemplate.resize(numberConditionChips);
69  m_vecJetCountsTemplate.resize(numberConditionChips);
70  m_vecCastorTemplate.resize(numberConditionChips);
71  m_vecHfBitCountsTemplate.resize(numberConditionChips);
72  m_vecHfRingEtSumsTemplate.resize(numberConditionChips);
73  m_vecBptxTemplate.resize(numberConditionChips);
74  m_vecExternalTemplate.resize(numberConditionChips);
75 
76  m_vecCorrelationTemplate.resize(numberConditionChips);
77  m_corMuonTemplate.resize(numberConditionChips);
78  m_corCaloTemplate.resize(numberConditionChips);
79  m_corEnergySumTemplate.resize(numberConditionChips);
80 
81 
82 }
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 274 of file L1GtTriggerMenuConfigOnlineProd.h.

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

274  {
275 
276  std::stringstream convertor;
277  convertor << value;
278 
279  Result result;
280  if (! ( convertor >> std::hex >> result ) || !convertor.eof()) {
281  throw boost::bad_lexical_cast();
282  }
283 
284  return result;
285 }
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 1081 of file L1GtTriggerMenuConfigOnlineProd.cc.

References chipNumber(), and m_tableMenuAlgoCond.

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

1081  {
1082 
1083  std::list<int> chipList;
1084 
1085  // loop over m_tableMenuAlgoCond
1086  for (std::vector<TableMenuAlgoCond>::const_iterator constIt = m_tableMenuAlgoCond.begin(); constIt
1087  != m_tableMenuAlgoCond.end(); constIt++) {
1088 
1089  if (condFK == ( *constIt ).condFK) {
1090  int chipNr = chipNumber( ( *constIt ).bitNumberSh);
1091  chipList.push_back(chipNr);
1092  }
1093  }
1094 
1095  return chipList;
1096 
1097 }
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 84 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, tableMenuAlgoCondFromDB(), tableMenuAlgoFromDB(), tableMenuCondFromDB(), tableMenuGeneralFromDB(), tableMenuObjectParametersFromDB(), tableMenuTechTrigFromDB(), and verbosity.

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

References LogTrace.

Referenced by addMuonCondition(), and fillEnergySumObjectParameter().

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

string to enum L1GtConditionCategory conversion

Definition at line 919 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

Referenced by addConditions().

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

string to enum L1GtConditionType conversion

Definition at line 956 of file L1GtTriggerMenuConfigOnlineProd.cc.

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

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

string to enum L1GtObject conversion

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

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

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

Referenced by newObject().

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

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

Referenced by newObject().

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

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

Referenced by newObject().

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

References L1GtTriggerMenuConfigOnlineProd::TableMenuGeneral::algoImplTag, l1t::OMDSReader::basicQueryView(), l1t::OMDSReader::columnNamesView(), l1t::OMDSReader::QueryResults::fillVariable(), 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().

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

References l1t::OMDSReader::basicQueryView(), L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::charge, l1t::OMDSReader::columnNamesView(), L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::enableIso, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::enableMip, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::energyOverflow, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::etaRange, L1GtTriggerMenuConfigOnlineProd::TableMenuObjectParameters::etThreshold, l1t::OMDSReader::QueryResults::fillVariableFromRow(), LogTrace, m_isDebugEnabled, L1ConfigOnlineProdBase< L1GtTriggerMenuRcd, L1GtTriggerMenu >::m_omdsReader, m_tableMenuObjectParameters, l1t::OMDSReader::QueryResults::numberRows(), 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().

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

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

Referenced by newObject().

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

Referenced by buildAlgorithmMap(), and newObject().

AlgorithmMap L1GtTriggerMenuConfigOnlineProd::m_algorithmMap
private

map containing the physics algorithms (by name)

Definition at line 256 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by buildAlgorithmMap(), and newObject().

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

Definition at line 252 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 253 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 251 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 236 of file L1GtTriggerMenuConfigOnlineProd.h.

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

Definition at line 220 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 222 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 219 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 262 of file L1GtTriggerMenuConfigOnlineProd.h.

Referenced by buildTechnicalTriggerMap(), and newObject().

std::string L1GtTriggerMenuConfigOnlineProd::m_triggerMenuImplementation
private

Definition at line 233 of file L1GtTriggerMenuConfigOnlineProd.h.

std::string L1GtTriggerMenuConfigOnlineProd::m_triggerMenuInterface
private

menu representation

menu names

Definition at line 231 of file L1GtTriggerMenuConfigOnlineProd.h.

std::string L1GtTriggerMenuConfigOnlineProd::m_triggerMenuName
private

Definition at line 232 of file L1GtTriggerMenuConfigOnlineProd.h.

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

Definition at line 247 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 241 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 244 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 250 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 242 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 248 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 245 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 246 of file L1GtTriggerMenuConfigOnlineProd.h.

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

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

Definition at line 243 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 240 of file L1GtTriggerMenuConfigOnlineProd.h.

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