CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1GtUtils::LogicalExpressionL1Results Class Reference

#include <L1GtUtils.h>

Public Member Functions

const std::vector< std::pair< std::string, bool > > & decisionsAfterMask ()
 
const std::vector< std::pair< std::string, bool > > & decisionsBeforeMask ()
 
const std::vector< std::pair< std::string, int > > & errorCodes (const edm::Event &)
 
const std::vector< L1GtLogicParser::OperandToken > & expL1Triggers ()
 list of triggers in the logical expression, trigger decisions, prescale factors and masks, error codes More...
 
bool isValid ()
 return true if the logical expression is syntactically correct More...
 
 LogicalExpressionL1Results (const std::string &, L1GtUtils &)
 constructor(s) More...
 
const int logicalExpressionRunUpdate (const edm::Run &, const edm::EventSetup &, const std::string &)
 
const int logicalExpressionRunUpdate (const edm::Run &, const edm::EventSetup &)
 keep the logical expression given in the previous run More...
 
const std::vector< std::pair< std::string, int > > & prescaleFactors ()
 
const std::vector< std::pair< std::string, int > > & triggerMasks ()
 
 ~LogicalExpressionL1Results ()
 destructor More...
 

Private Member Functions

bool initialize ()
 
void l1Results (const edm::Event &iEvent)
 
void reset (const std::vector< std::pair< std::string, bool > > &) const
 reset for each L1 trigger the value from pair.second More...
 
void reset (const std::vector< std::pair< std::string, int > > &) const
 

Private Attributes

std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
 
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
 
std::vector< std::pair< std::string, int > > m_errorCodes
 
bool m_expBitsTechTrigger
 flag true, if the logical expression is built from technical trigger bits More...
 
std::vector< L1GtLogicParser::OperandTokenm_expL1Triggers
 
size_t m_expL1TriggersSize
 
std::vector< L1GtUtils::TriggerCategorym_expTriggerCategory
 trigger category for each L1 trigger in the logical expression More...
 
std::vector< bool > m_expTriggerInMenu
 
int m_l1ConfCode
 code for L1 trigger configuration More...
 
L1GtUtilsm_l1GtUtils
 
bool m_l1ResultsAlreadyCalled
 set to true if the method l1Results was called once More...
 
std::string m_logicalExpression
 private members as input parameters More...
 
std::vector< std::pair< std::string, int > > m_prescaleFactors
 
std::vector< std::pair< std::string, int > > m_triggerMasks
 
bool m_validL1Configuration
 true if valid L1 configuration - if not, reset all quantities and return More...
 
bool m_validLogicalExpression
 true if the logical expression uses accepted L1GtLogicParser operators More...
 

Detailed Description

Definition at line 113 of file L1GtUtils.h.

Constructor & Destructor Documentation

L1GtUtils::LogicalExpressionL1Results::LogicalExpressionL1Results ( const std::string &  expression,
L1GtUtils l1GtUtils 
)
explicit

constructor(s)

trigger decisions, prescale factors and masks from GT record(s)

Definition at line 1743 of file L1GtUtils.cc.

References initialize().

1744  :
1745 
1746  m_logicalExpression(expression),
1747 
1748  m_l1GtUtils(l1GtUtils),
1749 
1750  m_l1ConfCode(-1),
1751 
1752  m_validL1Configuration(false),
1753 
1754  m_validLogicalExpression(false),
1755 
1756  m_l1ResultsAlreadyCalled(false),
1757 
1759 
1760  m_expBitsTechTrigger(false) {
1761  initialize();
1762 }
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:173
int m_l1ConfCode
code for L1 trigger configuration
Definition: L1GtUtils.h:167
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:159
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:176
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:185
bool m_validL1Configuration
true if valid L1 configuration - if not, reset all quantities and return
Definition: L1GtUtils.h:170
L1GtUtils::LogicalExpressionL1Results::~LogicalExpressionL1Results ( )

destructor

Definition at line 1765 of file L1GtUtils.cc.

1765  {
1766  // empty
1767 }

Member Function Documentation

const std::vector< std::pair< std::string, bool > > & L1GtUtils::LogicalExpressionL1Results::decisionsAfterMask ( )

Definition at line 1969 of file L1GtUtils.cc.

References Exception, m_decisionsAfterMask, and m_l1ResultsAlreadyCalled.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), and expL1Triggers().

1969  {
1970  // throw an exception if the result is not computed once per event - user usage error
1971  if (!m_l1ResultsAlreadyCalled) {
1972  throw cms::Exception("FailModule")
1973  << "\nUsage error: "
1974  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
1975  << std::endl;
1976  }
1977 
1978  return m_decisionsAfterMask;
1979 }
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:176
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:193
const std::vector< std::pair< std::string, bool > > & L1GtUtils::LogicalExpressionL1Results::decisionsBeforeMask ( )

Definition at line 1957 of file L1GtUtils.cc.

References Exception, m_decisionsBeforeMask, and m_l1ResultsAlreadyCalled.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), and expL1Triggers().

1957  {
1958  // throw an exception if the result is not computed once per event - user usage error
1959  if (!m_l1ResultsAlreadyCalled) {
1960  throw cms::Exception("FailModule")
1961  << "\nUsage error: "
1962  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
1963  << std::endl;
1964  }
1965 
1966  return m_decisionsBeforeMask;
1967 }
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:192
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:176
const std::vector< std::pair< std::string, int > > & L1GtUtils::LogicalExpressionL1Results::errorCodes ( const edm::Event iEvent)

Definition at line 2005 of file L1GtUtils.cc.

References l1Results(), m_decisionsAfterMask, m_decisionsBeforeMask, m_errorCodes, m_l1ResultsAlreadyCalled, m_prescaleFactors, m_triggerMasks, m_validL1Configuration, and reset().

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), and expL1Triggers().

2006  {
2007  m_l1ResultsAlreadyCalled = false;
2008 
2009  // if not a valid L1 configuration, reset all quantities and return
2010  if (!m_validL1Configuration) {
2016 
2017  m_l1ResultsAlreadyCalled = true;
2018  return m_errorCodes;
2019  }
2020 
2021  l1Results(iEvent);
2022 
2023  m_l1ResultsAlreadyCalled = true;
2024 
2025  return m_errorCodes;
2026 }
void l1Results(const edm::Event &iEvent)
Definition: L1GtUtils.cc:2042
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:192
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:196
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:195
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:194
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:176
void reset(const std::vector< std::pair< std::string, bool > > &) const
reset for each L1 trigger the value from pair.second
Definition: L1GtUtils.cc:2028
bool m_validL1Configuration
true if valid L1 configuration - if not, reset all quantities and return
Definition: L1GtUtils.h:170
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:193
const std::vector<L1GtLogicParser::OperandToken>& L1GtUtils::LogicalExpressionL1Results::expL1Triggers ( )
inline

list of triggers in the logical expression, trigger decisions, prescale factors and masks, error codes

Definition at line 136 of file L1GtUtils.h.

References decisionsAfterMask(), decisionsBeforeMask(), errorCodes(), iEvent, initialize(), l1Results(), m_expL1Triggers, prescaleFactors(), reset(), and triggerMasks().

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore().

136 { return m_expL1Triggers; }
std::vector< L1GtLogicParser::OperandToken > m_expL1Triggers
Definition: L1GtUtils.h:178
bool L1GtUtils::LogicalExpressionL1Results::initialize ( void  )
private

parse the logical expression, initialize the private members to required size such that one can just reset them

Definition at line 1769 of file L1GtUtils.cc.

References L1GtUtils::AlgorithmTrigger, cms::Exception::explainSelf(), dqmdumpme::first, LogDebug, LogTrace, m_decisionsAfterMask, m_decisionsBeforeMask, m_errorCodes, m_expBitsTechTrigger, m_expL1Triggers, m_expL1TriggersSize, m_expTriggerCategory, m_expTriggerInMenu, m_logicalExpression, m_prescaleFactors, m_triggerMasks, m_validLogicalExpression, L1GtLogicParser::operandTokenVector(), edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, and cms::Exception::what().

Referenced by expL1Triggers(), LogicalExpressionL1Results(), and logicalExpressionRunUpdate().

1769  {
1770  // get the vector of triggers corresponding to the logical expression
1771  // check also the logical expression - add/remove spaces if needed
1772 
1773  try {
1774  L1GtLogicParser m_l1AlgoLogicParser = L1GtLogicParser(m_logicalExpression);
1775 
1776  // list of L1 triggers from the logical expression
1777  m_expL1Triggers = m_l1AlgoLogicParser.operandTokenVector();
1779 
1780  m_validLogicalExpression = true;
1781 
1782  } catch (cms::Exception& ex) {
1783  m_validLogicalExpression = false;
1784 
1785  edm::LogWarning("L1GtUtils") << ex;
1786  edm::LogWarning("L1GtUtils") << ex.what();
1787  edm::LogWarning("L1GtUtils") << ex.explainSelf();
1788  }
1789 
1790  // try to convert the string representing each L1 trigger to bit number,
1791  // to check if the logical expression is constructed from bit numbers
1792  // trade-off: cache it here, irrespective of the expression
1793  // when the conversion fails (normally for the first seed,
1794  // if not expression of technical trigger bits), stop and
1795  // set m_expBitsTechTrigger to false
1796 
1797  m_expBitsTechTrigger = true;
1798 
1799  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
1800  const std::string& bitString = (m_expL1Triggers[iTrig]).tokenName;
1801  std::istringstream bitStream(bitString);
1802  int bitInt;
1803 
1804  if ((bitStream >> bitInt).fail()) {
1805  m_expBitsTechTrigger = false;
1806 
1807  break;
1808  }
1809 
1810  (m_expL1Triggers[iTrig]).tokenNumber = bitInt;
1811  }
1812 
1813  // resize and fill
1814  m_decisionsBeforeMask.resize(m_expL1TriggersSize);
1815  m_decisionsAfterMask.resize(m_expL1TriggersSize);
1816  m_prescaleFactors.resize(m_expL1TriggersSize);
1817  m_triggerMasks.resize(m_expL1TriggersSize);
1818  m_errorCodes.resize(m_expL1TriggersSize);
1819  m_expTriggerCategory.resize(m_expL1TriggersSize);
1820  m_expTriggerInMenu.resize(m_expL1TriggersSize);
1821 
1822  LogDebug("L1GtUtils") << std::endl;
1823  LogTrace("L1GtUtils") << "\nLogical expression\n " << m_logicalExpression << "\n has " << m_expL1TriggersSize
1824  << " L1 triggers" << std::endl;
1825  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
1826  const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
1827  LogTrace("L1GtUtils") << " " << trigNameOrAlias << std::endl;
1828 
1829  (m_decisionsBeforeMask[iTrig]).first = trigNameOrAlias;
1830  (m_decisionsBeforeMask[iTrig]).second = false;
1831 
1832  (m_decisionsAfterMask[iTrig]).first = trigNameOrAlias;
1833  (m_decisionsAfterMask[iTrig]).second = false;
1834 
1835  (m_prescaleFactors[iTrig]).first = trigNameOrAlias;
1836  (m_prescaleFactors[iTrig]).second = -1;
1837 
1838  (m_triggerMasks[iTrig]).first = trigNameOrAlias;
1839  (m_triggerMasks[iTrig]).second = -1;
1840 
1841  (m_errorCodes[iTrig]).first = trigNameOrAlias;
1842  (m_errorCodes[iTrig]).second = -1;
1843 
1845 
1846  m_expTriggerInMenu[iTrig] = false;
1847  }
1848  LogTrace("L1GtUtils") << std::endl;
1849 
1850  return true;
1851 }
#define LogDebug(id)
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:173
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:192
std::vector< L1GtLogicParser::OperandToken > m_expL1Triggers
Definition: L1GtUtils.h:178
virtual std::string explainSelf() const
Definition: Exception.cc:108
char const * what() const override
Definition: Exception.cc:103
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:196
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:195
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:194
std::vector< OperandToken > & operandTokenVector()
return the vector of operand tokens
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:159
std::vector< bool > m_expTriggerInMenu
Definition: L1GtUtils.h:189
#define LogTrace(id)
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:185
std::vector< L1GtUtils::TriggerCategory > m_expTriggerCategory
trigger category for each L1 trigger in the logical expression
Definition: L1GtUtils.h:182
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:193
bool L1GtUtils::LogicalExpressionL1Results::isValid ( void  )
inline

return true if the logical expression is syntactically correct

Definition at line 125 of file L1GtUtils.h.

References logicalExpressionRunUpdate(), m_validLogicalExpression, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ntupleDataFormat._Object::_checkIsValid(), L1GtAnalyzer::beginRun(), and core.AutoHandle.AutoHandle::ReallyLoad().

125 { return m_validLogicalExpression; }
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:173
void L1GtUtils::LogicalExpressionL1Results::l1Results ( const edm::Event iEvent)
private

Definition at line 2042 of file L1GtUtils.cc.

References L1GtUtils::EmptyString, L1GtUtils::L1GtNotValidError, L1GtUtils::l1Results(), LogDebug, LogTrace, m_decisionsAfterMask, m_decisionsBeforeMask, m_errorCodes, m_expL1Triggers, m_expL1TriggersSize, m_expTriggerInMenu, m_l1ConfCode, m_l1GtUtils, m_logicalExpression, m_prescaleFactors, m_triggerMasks, reset(), edm::second(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by errorCodes(), and expL1Triggers().

2042  {
2043  // reset the vectors before filling them
2049 
2050  // initialization of actual values for each trigger
2051  bool decisionBeforeMaskValue = false;
2052  bool decisionAfterMaskValue = false;
2053  int prescaleFactorValue = -1;
2054  int triggerMaskValue = -1;
2055  int errorCode = -1;
2056 
2057  LogDebug("L1GtUtils") << std::endl;
2058  LogTrace("L1GtUtils") << "\nLogical expression\n " << m_logicalExpression << std::endl;
2059 
2060  // for each trigger, if it is in the L1 menu, get the prescale factor and trigger mask
2061 
2062  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2063  const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2064 
2065  if (m_expTriggerInMenu[iTrig]) {
2066  errorCode = m_l1GtUtils.l1Results(iEvent,
2067  trigNameOrAlias,
2068  decisionBeforeMaskValue,
2069  decisionAfterMaskValue,
2070  prescaleFactorValue,
2071  triggerMaskValue);
2072 
2073  if (errorCode != 0) {
2074  // error while retrieving the results
2075  // for this trigger: set prescale factor to -1, trigger mask to -1
2076 
2077  decisionBeforeMaskValue = false;
2078  decisionAfterMaskValue = false;
2079  prescaleFactorValue = -1;
2080  triggerMaskValue = -1;
2081  }
2082 
2083  } else {
2084  // no trigger name or trigger alias in the menu, no bits:
2085  // for this trigger: set prescale factor to -1, set the error code
2086 
2087  decisionBeforeMaskValue = false;
2088  decisionAfterMaskValue = false;
2089  prescaleFactorValue = -1;
2090  triggerMaskValue = -1;
2091  errorCode = m_l1ConfCode + 1;
2092  }
2093 
2094  LogTrace("L1GtUtils") << "\n" << trigNameOrAlias << ":" << std::endl;
2095 
2096  (m_decisionsBeforeMask[iTrig]).second = decisionBeforeMaskValue;
2097  LogTrace("L1GtUtils") << " decision before mask = " << decisionBeforeMaskValue << std::endl;
2098 
2099  (m_decisionsAfterMask[iTrig]).second = decisionAfterMaskValue;
2100  LogTrace("L1GtUtils") << " decision after mask = " << decisionAfterMaskValue << std::endl;
2101 
2102  (m_prescaleFactors[iTrig]).second = prescaleFactorValue;
2103  LogTrace("L1GtUtils") << " prescale factor = " << prescaleFactorValue << std::endl;
2104 
2105  (m_triggerMasks[iTrig]).second = triggerMaskValue;
2106  LogTrace("L1GtUtils") << " trigger mask = " << triggerMaskValue << std::endl;
2107 
2108  (m_errorCodes[iTrig]).second = errorCode;
2109  LogTrace("L1GtUtils") << " error code = " << errorCode << std::endl;
2110  }
2111 
2112  LogDebug("L1GtUtils") << std::endl;
2113 }
#define LogDebug(id)
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:192
std::vector< L1GtLogicParser::OperandToken > m_expL1Triggers
Definition: L1GtUtils.h:178
int m_l1ConfCode
code for L1 trigger configuration
Definition: L1GtUtils.h:167
U second(std::pair< T, U > const &p)
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:196
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:195
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:194
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:159
std::vector< bool > m_expTriggerInMenu
Definition: L1GtUtils.h:189
const int l1Results(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:624
#define LogTrace(id)
void reset(const std::vector< std::pair< std::string, bool > > &) const
reset for each L1 trigger the value from pair.second
Definition: L1GtUtils.cc:2028
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:193
const int L1GtUtils::LogicalExpressionL1Results::logicalExpressionRunUpdate ( const edm::Run iRun,
const edm::EventSetup evSetup,
const std::string &  logicExpression 
)

update quantities related to the logical expression at the beginning of the run new logical expression, replacing the logical expression given the in previous run

Definition at line 1853 of file L1GtUtils.cc.

References initialize(), m_decisionsAfterMask, m_decisionsBeforeMask, m_errorCodes, m_expBitsTechTrigger, m_expL1TriggersSize, m_expTriggerCategory, m_expTriggerInMenu, m_l1ResultsAlreadyCalled, m_logicalExpression, m_prescaleFactors, m_triggerMasks, and m_validLogicalExpression.

Referenced by L1GtAnalyzer::beginRun(), and isValid().

1855  {
1856  // initialize error code
1857  int errorCode = 0;
1858 
1859  // logical expression has changed - one must re-initialize all quantities related to the logical expression
1860  // and clear the vectors
1861 
1862  m_logicalExpression = logicExpression;
1863  m_validLogicalExpression = false;
1864 
1865  m_l1ResultsAlreadyCalled = false;
1866 
1867  m_expL1TriggersSize = 0;
1868  m_expBitsTechTrigger = false;
1869 
1870  //
1871  m_decisionsBeforeMask.clear();
1872  m_decisionsAfterMask.clear();
1873  m_prescaleFactors.clear();
1874  m_triggerMasks.clear();
1875  m_errorCodes.clear();
1876  m_expTriggerCategory.clear();
1877  m_expTriggerInMenu.clear();
1878 
1879  initialize();
1880 
1881  //
1882  errorCode = logicalExpressionRunUpdate(iRun, evSetup);
1883 
1884  return errorCode;
1885 }
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:173
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:192
const int logicalExpressionRunUpdate(const edm::Run &, const edm::EventSetup &, const std::string &)
Definition: L1GtUtils.cc:1853
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:196
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:195
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:194
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:159
std::vector< bool > m_expTriggerInMenu
Definition: L1GtUtils.h:189
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:176
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:185
std::vector< L1GtUtils::TriggerCategory > m_expTriggerCategory
trigger category for each L1 trigger in the logical expression
Definition: L1GtUtils.h:182
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:193
const int L1GtUtils::LogicalExpressionL1Results::logicalExpressionRunUpdate ( const edm::Run iRun,
const edm::EventSetup evSetup 
)

keep the logical expression given in the previous run

Definition at line 1887 of file L1GtUtils.cc.

References L1GtUtils::AlgorithmTrigger, L1GtUtils::availableL1Configuration(), L1TBPTX_cfi::bitNumber, dqmdumpme::first, L1GtUtils::l1AlgoTechTrigBitNumber(), L1GtUtils::l1TriggerNameFromBit(), m_decisionsAfterMask, m_decisionsBeforeMask, m_errorCodes, m_expBitsTechTrigger, m_expL1Triggers, m_expL1TriggersSize, m_expTriggerCategory, m_expTriggerInMenu, m_l1ConfCode, m_l1GtUtils, m_prescaleFactors, m_triggerMasks, m_validL1Configuration, AlCaHLTBitMon_QueryRunRegistry::string, and L1GtUtils::TechnicalTrigger.

1888  {
1889  // check first that a valid L1 configuration was retrieved,
1890  // to prevent also calls before the L1 configuration retrieval
1891 
1892  // initialize error code and L1 configuration code
1893  int errorCode = 0;
1894  int l1ConfCode = 0;
1895 
1896  if (!(m_l1GtUtils.availableL1Configuration(errorCode, l1ConfCode))) {
1897  m_validL1Configuration = false;
1898  return errorCode;
1899  } else {
1900  m_validL1Configuration = true;
1901  m_l1ConfCode = l1ConfCode;
1902  }
1903 
1904  // check if the trigger (name of alias) from the logical expression are in the menu,
1905  // if names are used, set tokenNumber to the corresponding bit number
1906  // if technical trigger bits, set tokenName to the corresponding technical trigger name, if
1907  // a technical trigger exists on that bit
1908  // for each trigger, set also the trigger category
1909 
1910  // initialization
1912  int bitNumber = -1;
1913 
1914  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
1915  trigCategory = L1GtUtils::AlgorithmTrigger;
1916  bitNumber = -1;
1917  const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
1918 
1919  if (!m_expBitsTechTrigger) {
1920  const bool triggerInMenu = m_l1GtUtils.l1AlgoTechTrigBitNumber(trigNameOrAlias, trigCategory, bitNumber);
1921 
1922  (m_expL1Triggers[iTrig]).tokenNumber = bitNumber;
1923  m_expTriggerCategory[iTrig] = trigCategory;
1924  m_expTriggerInMenu[iTrig] = triggerInMenu;
1925 
1926  } else {
1927  std::string aliasL1Trigger;
1928  std::string nameL1Trigger;
1929 
1930  trigCategory = L1GtUtils::TechnicalTrigger;
1931  bitNumber = (m_expL1Triggers[iTrig]).tokenNumber;
1932 
1933  const bool triggerInMenu =
1934  m_l1GtUtils.l1TriggerNameFromBit(bitNumber, trigCategory, aliasL1Trigger, nameL1Trigger);
1935 
1936  if (!triggerInMenu) {
1937  aliasL1Trigger = "Technical_trigger_bit_" + (m_expL1Triggers[iTrig]).tokenName + "_empty";
1938  }
1939 
1940  (m_expL1Triggers[iTrig]).tokenName = aliasL1Trigger;
1941  m_expTriggerCategory[iTrig] = trigCategory;
1942  m_expTriggerInMenu[iTrig] = triggerInMenu;
1943 
1944  // put the names of the technical triggers in the returned quantities
1945 
1946  (m_decisionsBeforeMask[iTrig]).first = aliasL1Trigger;
1947  (m_decisionsAfterMask[iTrig]).first = aliasL1Trigger;
1948  (m_prescaleFactors[iTrig]).first = aliasL1Trigger;
1949  (m_triggerMasks[iTrig]).first = aliasL1Trigger;
1950  (m_errorCodes[iTrig]).first = aliasL1Trigger;
1951  }
1952  }
1953 
1954  return errorCode;
1955 }
const bool l1TriggerNameFromBit(const int &bitNumber, const TriggerCategory &trigCategory, std::string &aliasL1Trigger, std::string &nameL1Trigger) const
Definition: L1GtUtils.cc:441
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:192
std::vector< L1GtLogicParser::OperandToken > m_expL1Triggers
Definition: L1GtUtils.h:178
int m_l1ConfCode
code for L1 trigger configuration
Definition: L1GtUtils.h:167
const bool l1AlgoTechTrigBitNumber(const std::string &nameAlgoTechTrig, TriggerCategory &trigCategory, int &bitNumber) const
Definition: L1GtUtils.cc:329
TriggerCategory
Definition: L1GtUtils.h:96
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:1637
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:196
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:195
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:194
std::vector< bool > m_expTriggerInMenu
Definition: L1GtUtils.h:189
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:185
std::vector< L1GtUtils::TriggerCategory > m_expTriggerCategory
trigger category for each L1 trigger in the logical expression
Definition: L1GtUtils.h:182
bool m_validL1Configuration
true if valid L1 configuration - if not, reset all quantities and return
Definition: L1GtUtils.h:170
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:193
const std::vector< std::pair< std::string, int > > & L1GtUtils::LogicalExpressionL1Results::prescaleFactors ( )

Definition at line 1981 of file L1GtUtils.cc.

References Exception, m_l1ResultsAlreadyCalled, and m_prescaleFactors.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), and expL1Triggers().

1981  {
1982  // throw an exception if the result is not computed once per event - user usage error
1983  if (!m_l1ResultsAlreadyCalled) {
1984  throw cms::Exception("FailModule")
1985  << "\nUsage error: "
1986  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
1987  << std::endl;
1988  }
1989 
1990  return m_prescaleFactors;
1991 }
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:194
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:176
void L1GtUtils::LogicalExpressionL1Results::reset ( const std::vector< std::pair< std::string, bool > > &  _pairVector) const
private

reset for each L1 trigger the value from pair.second

Definition at line 2028 of file L1GtUtils.cc.

References m_expL1TriggersSize, and edm::second().

Referenced by errorCodes(), expL1Triggers(), and l1Results().

2028  {
2029  std::vector<std::pair<std::string, bool> > pairVector = _pairVector;
2030  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2031  (pairVector[iTrig]).second = false;
2032  }
2033 }
U second(std::pair< T, U > const &p)
void L1GtUtils::LogicalExpressionL1Results::reset ( const std::vector< std::pair< std::string, int > > &  _pairVector) const
private

Definition at line 2035 of file L1GtUtils.cc.

References m_expL1TriggersSize, and edm::second().

2035  {
2036  std::vector<std::pair<std::string, int> > pairVector = _pairVector;
2037  for (size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2038  (pairVector[iTrig]).second = -1;
2039  }
2040 }
U second(std::pair< T, U > const &p)
const std::vector< std::pair< std::string, int > > & L1GtUtils::LogicalExpressionL1Results::triggerMasks ( )

Definition at line 1993 of file L1GtUtils.cc.

References Exception, m_l1ResultsAlreadyCalled, and m_triggerMasks.

Referenced by L1GtAnalyzer::analyzeL1GtUtilsCore(), and expL1Triggers().

1993  {
1994  // throw an exception if the result is not computed once per event - user usage error
1995  if (!m_l1ResultsAlreadyCalled) {
1996  throw cms::Exception("FailModule")
1997  << "\nUsage error: "
1998  << "\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
1999  << std::endl;
2000  }
2001 
2002  return m_triggerMasks;
2003 }
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:195
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:176

Member Data Documentation

std::vector<std::pair<std::string, bool> > L1GtUtils::LogicalExpressionL1Results::m_decisionsAfterMask
private
std::vector<std::pair<std::string, bool> > L1GtUtils::LogicalExpressionL1Results::m_decisionsBeforeMask
private
std::vector<std::pair<std::string, int> > L1GtUtils::LogicalExpressionL1Results::m_errorCodes
private

Definition at line 196 of file L1GtUtils.h.

Referenced by errorCodes(), initialize(), l1Results(), and logicalExpressionRunUpdate().

bool L1GtUtils::LogicalExpressionL1Results::m_expBitsTechTrigger
private

flag true, if the logical expression is built from technical trigger bits

Definition at line 185 of file L1GtUtils.h.

Referenced by initialize(), and logicalExpressionRunUpdate().

std::vector<L1GtLogicParser::OperandToken> L1GtUtils::LogicalExpressionL1Results::m_expL1Triggers
private

Definition at line 178 of file L1GtUtils.h.

Referenced by expL1Triggers(), initialize(), l1Results(), and logicalExpressionRunUpdate().

size_t L1GtUtils::LogicalExpressionL1Results::m_expL1TriggersSize
private

Definition at line 179 of file L1GtUtils.h.

Referenced by initialize(), l1Results(), logicalExpressionRunUpdate(), and reset().

std::vector<L1GtUtils::TriggerCategory> L1GtUtils::LogicalExpressionL1Results::m_expTriggerCategory
private

trigger category for each L1 trigger in the logical expression

Definition at line 182 of file L1GtUtils.h.

Referenced by initialize(), and logicalExpressionRunUpdate().

std::vector<bool> L1GtUtils::LogicalExpressionL1Results::m_expTriggerInMenu
private

for each L1 trigger in the logical expression, true if the trigger is found in the current L1 menu

Definition at line 189 of file L1GtUtils.h.

Referenced by initialize(), l1Results(), and logicalExpressionRunUpdate().

int L1GtUtils::LogicalExpressionL1Results::m_l1ConfCode
private

code for L1 trigger configuration

Definition at line 167 of file L1GtUtils.h.

Referenced by l1Results(), and logicalExpressionRunUpdate().

L1GtUtils& L1GtUtils::LogicalExpressionL1Results::m_l1GtUtils
private

Definition at line 161 of file L1GtUtils.h.

Referenced by l1Results(), and logicalExpressionRunUpdate().

bool L1GtUtils::LogicalExpressionL1Results::m_l1ResultsAlreadyCalled
private

set to true if the method l1Results was called once

Definition at line 176 of file L1GtUtils.h.

Referenced by decisionsAfterMask(), decisionsBeforeMask(), errorCodes(), logicalExpressionRunUpdate(), prescaleFactors(), and triggerMasks().

std::string L1GtUtils::LogicalExpressionL1Results::m_logicalExpression
private

private members as input parameters

logical expression

Definition at line 159 of file L1GtUtils.h.

Referenced by initialize(), l1Results(), and logicalExpressionRunUpdate().

std::vector<std::pair<std::string, int> > L1GtUtils::LogicalExpressionL1Results::m_prescaleFactors
private
std::vector<std::pair<std::string, int> > L1GtUtils::LogicalExpressionL1Results::m_triggerMasks
private
bool L1GtUtils::LogicalExpressionL1Results::m_validL1Configuration
private

true if valid L1 configuration - if not, reset all quantities and return

Definition at line 170 of file L1GtUtils.h.

Referenced by errorCodes(), and logicalExpressionRunUpdate().

bool L1GtUtils::LogicalExpressionL1Results::m_validLogicalExpression
private

true if the logical expression uses accepted L1GtLogicParser operators

Definition at line 173 of file L1GtUtils.h.

Referenced by initialize(), isValid(), and logicalExpressionRunUpdate().