33 m_l1GtStableParCacheID(0ULL),
34 m_numberAlgorithmTriggers(0),
36 m_numberTechnicalTriggers(0),
38 m_l1GtPfAlgoCacheID(0ULL),
39 m_l1GtPfTechCacheID(0ULL),
41 m_l1GtTmAlgoCacheID(0ULL),
42 m_l1GtTmTechCacheID(0ULL),
44 m_l1GtTmVetoAlgoCacheID(0ULL),
45 m_l1GtTmVetoTechCacheID(0ULL),
47 m_l1GtMenuCacheID(0ULL),
49 m_l1EventSetupValid(
false),
51 m_l1GtMenuLiteValid(
false),
53 m_beginRunCache(
false),
57 m_physicsDaqPartition(0),
59 m_retrieveL1EventSetup(
false),
61 m_retrieveL1GtTriggerMenuLite(
false)
113 switch (trigCategory) {
115 return "Algorithm Trigger";
118 return "Technical Trigger";
139 unsigned long long l1GtStableParCacheID = l1GtStableParametersRcd.
cacheIdentifier();
167 unsigned long long l1GtPfAlgoCacheID = l1GtPrescaleFactorsAlgoTrigRcd.
cacheIdentifier();
182 unsigned long long l1GtPfTechCacheID = l1GtPrescaleFactorsTechTrigRcd.
cacheIdentifier();
200 unsigned long long l1GtTmAlgoCacheID = l1GtTriggerMaskAlgoTrigRcd.
cacheIdentifier();
215 unsigned long long l1GtTmTechCacheID = l1GtTriggerMaskTechTrigRcd.
cacheIdentifier();
230 unsigned long long l1GtTmVetoAlgoCacheID = l1GtTriggerMaskVetoAlgoTrigRcd.
cacheIdentifier();
245 unsigned long long l1GtTmVetoTechCacheID = l1GtTriggerMaskVetoTechTrigRcd.
cacheIdentifier();
263 unsigned long long l1GtMenuCacheID = l1GtTriggerMenuRcd.
cacheIdentifier();
292 <<
"\nrequested, but not found in the run." << std::endl;
383 if (itTrig->second == nameAlgoTechTrig) {
394 if (itTrig->second == nameAlgoTechTrig) {
406 if (itTrig->second == nameAlgoTechTrig) {
419 bitNumber = (itAlgo->second).algoBitNumber();
428 bitNumber = (itAlgo->second).algoBitNumber();
437 bitNumber = (itAlgo->second).algoBitNumber();
451 bitNumber = (itAlgo->second).algoBitNumber();
460 bitNumber = (itAlgo->second).algoBitNumber();
469 bitNumber = (itAlgo->second).algoBitNumber();
487 aliasL1Trigger.clear();
488 nameL1Trigger.clear();
494 bool trigAliasFound =
false;
495 bool trigNameFound =
false;
500 if (static_cast<int>(itTrig->first) ==
bitNumber) {
501 aliasL1Trigger = itTrig->second;
502 trigAliasFound =
true;
509 if (static_cast<int>(itTrig->first) ==
bitNumber) {
510 nameL1Trigger = itTrig->second;
511 trigNameFound =
true;
516 if (!(trigAliasFound && trigNameFound)) {
525 bool trigNameFound =
false;
530 if (static_cast<int>(itTrig->first) ==
bitNumber) {
531 nameL1Trigger = itTrig->second;
535 aliasL1Trigger = itTrig->second;
537 trigNameFound =
true;
542 if (!(trigNameFound)) {
556 bool trigAliasFound =
false;
559 if ((itTrig->second).algoBitNumber() ==
bitNumber) {
560 aliasL1Trigger = itTrig->first;
562 nameL1Trigger = (itTrig->second).
algoName();
564 trigAliasFound =
true;
569 if (!(trigAliasFound)) {
578 bool trigNameFound =
false;
581 if ((itTrig->second).algoBitNumber() ==
bitNumber) {
582 nameL1Trigger = (itTrig->second).
algoName();
585 aliasL1Trigger = nameL1Trigger;
587 trigNameFound =
true;
592 if (!(trigNameFound)) {
610 bool trigAliasFound =
false;
613 if ((itTrig->second).algoBitNumber() ==
bitNumber) {
614 aliasL1Trigger = itTrig->first;
616 nameL1Trigger = (itTrig->second).
algoName();
618 trigAliasFound =
true;
623 if (!(trigAliasFound)) {
632 bool trigNameFound =
false;
635 if ((itTrig->second).algoBitNumber() ==
bitNumber) {
636 nameL1Trigger = (itTrig->second).
algoName();
639 aliasL1Trigger = itTrig->first;
641 trigNameFound =
true;
646 if (!(trigNameFound)) {
668 bool& decisionBeforeMask,
669 bool& decisionAfterMask,
671 int& triggerMask)
const {
698 iError = l1ConfCode + 1;
702 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n " << nameAlgoTechTrig
704 <<
"\nretrieved from L1GtTriggerMenuLite" << std::endl;
708 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n " << nameAlgoTechTrig
710 <<
"\nretrieved from Event Setup" << std::endl;
715 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n " << nameAlgoTechTrig
717 <<
"\nretrieved from Event Setup" << std::endl;
727 iError = l1ConfCode + 2;
733 <<
"\nretrieved from L1GtTriggerMenuLite" << std::endl;
739 <<
"\nretrieved from Event Setup" << std::endl;
746 <<
"\nretrieved from Event Setup" << std::endl;
756 int iErrorRecord = 0;
758 bool validRecord =
false;
759 bool gtReadoutRecordValid =
false;
771 <<
"\nnot found in the event." << std::endl;
778 if (gtReadoutRecord.
isValid()) {
779 gtReadoutRecordValid =
true;
783 iErrorRecord = iErrorRecord + 100;
784 LogDebug(
"L1GtUtils") <<
"\nL1GlobalTriggerReadoutRecord with \n " 785 <<
m_l1GtUtilsHelper->l1GtReadoutRecordInputTag() <<
"\nnot found in the event." << std::endl;
793 int pfIndexTechTrig = -1;
794 int pfIndexAlgoTrig = -1;
797 if (gtReadoutRecordValid) {
798 pfIndexTechTrig = (gtReadoutRecord->
gtFdlWord()).gtPrescaleFactorIndexTech();
799 pfIndexAlgoTrig = (gtReadoutRecord->
gtFdlWord()).gtPrescaleFactorIndexAlgo();
807 LogDebug(
"L1GtUtils") <<
"\nError: " 808 <<
"\nNo valid L1GlobalTriggerRecord with \n " <<
m_l1GtUtilsHelper->l1GtRecordInputTag()
809 <<
"\nfound in the event." 810 <<
"\nNo valid L1GlobalTriggerReadoutRecord with \n " 811 <<
m_l1GtUtilsHelper->l1GtReadoutRecordInputTag() <<
"\nfound in the event." << std::endl;
813 iError = l1ConfCode + iErrorRecord;
825 size_t pfSetsSize = 0;
827 const std::vector<int>* prescaleFactorsSubset =
nullptr;
828 const std::vector<unsigned int>* triggerMasksSet =
nullptr;
830 switch (trigCategory) {
849 pfIndex = pfIndexAlgoTrig;
870 pfIndex = pfIndexTechTrig;
875 iError = l1ConfCode + iErrorRecord + 3;
884 iError = l1ConfCode + iErrorRecord + 1000;
885 LogDebug(
"L1GtUtils") <<
"\nError: index of prescale factor set retrieved from the data \n" 887 <<
"\n Value of index retrieved from data = " << pfIndex << std::endl;
891 }
else if (pfIndex >= (static_cast<int>(pfSetsSize))) {
892 iError = l1ConfCode + iErrorRecord + 2000;
893 LogDebug(
"L1GtUtils") <<
"\nError: index of prescale factor set retrieved from the data \n" 894 <<
"greater than the size of the vector of prescale factor sets." 895 <<
"\n Value of index retrieved from data = " << pfIndex
896 <<
"\n Vector size = " << pfSetsSize << std::endl;
901 switch (trigCategory) {
905 prescaleFactorsSubset = &((*m_prescaleFactorsAlgoTrigLite).at(pfIndex));
909 prescaleFactorsSubset = &((*m_prescaleFactorsAlgoTrig).at(pfIndex));
914 prescaleFactorsSubset = &((*m_prescaleFactorsAlgoTrig).at(pfIndex));
921 prescaleFactorsSubset = &((*m_prescaleFactorsTechTrigLite).at(pfIndex));
925 prescaleFactorsSubset = &((*m_prescaleFactorsTechTrig).at(pfIndex));
930 prescaleFactorsSubset = &((*m_prescaleFactorsTechTrig).at(pfIndex));
944 switch (trigCategory) {
946 if (gtReadoutRecordValid) {
950 return (iError + l1ConfCode + iErrorRecord);
957 return (iError + l1ConfCode + iErrorRecord);
963 if (gtReadoutRecordValid) {
967 return (iError + l1ConfCode + iErrorRecord);
974 return (iError + l1ConfCode + iErrorRecord);
988 if (
bitNumber < (static_cast<int>(prescaleFactorsSubset->size()))) {
991 iError = l1ConfCode + iErrorRecord + 4000;
993 <<
"\n " << nameAlgoTechTrig <<
"\ngreater than size of actual L1 GT prescale factor set: " 994 << prescaleFactorsSubset->size() <<
"\nError: Inconsistent L1 trigger configuration!" 1002 if (
bitNumber < (static_cast<int>((*triggerMasksSet).size()))) {
1020 iError = l1ConfCode + iErrorRecord + 5000;
1022 <<
"\n " << nameAlgoTechTrig
1023 <<
"\ngreater than size of L1 GT trigger mask set: " << (*triggerMasksSet).size()
1024 <<
"\nError: Inconsistent L1 trigger configuration!" << std::endl;
1040 int& errorCode)
const {
1054 int& errorCode)
const {
1080 int& errorCode)
const {
1106 int triggerMaskValue = -1;
1116 return triggerMaskValue;
1129 iError = l1ConfCode + 1;
1133 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n " << nameAlgoTechTrig
1135 <<
"\nretrieved from L1GtTriggerMenuLite" << std::endl;
1139 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n " << nameAlgoTechTrig
1141 <<
"\nretrieved from Event Setup" << std::endl;
1146 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n " << nameAlgoTechTrig
1148 <<
"\nretrieved from Event Setup" << std::endl;
1152 return triggerMaskValue;
1159 iError = l1ConfCode + 2;
1165 <<
"\nretrieved from L1GtTriggerMenuLite" << std::endl;
1171 <<
"\nretrieved from Event Setup" << std::endl;
1178 <<
"\nretrieved from Event Setup" << std::endl;
1182 return triggerMaskValue;
1190 const std::vector<unsigned int>* triggerMasksSet =
nullptr;
1192 switch (trigCategory) {
1227 iError = l1ConfCode + 3;
1230 return triggerMaskValue;
1237 if (
bitNumber < (static_cast<int>((*triggerMasksSet).size()))) {
1240 triggerMaskValue = (*triggerMasksSet)[
bitNumber];
1255 iError = l1ConfCode + 5000;
1257 <<
"\n " << nameAlgoTechTrig
1258 <<
"\ngreater than size of L1 GT trigger mask set: " << (*triggerMasksSet).size()
1259 <<
"\nError: Inconsistent L1 trigger configuration!" << std::endl;
1262 return triggerMaskValue;
1266 return triggerMaskValue;
1271 int& errorCode)
const {
1293 int iErrorRecord = 0;
1295 bool validRecord =
false;
1296 bool gtReadoutRecordValid =
false;
1308 <<
"\nnot found in the event." << std::endl;
1315 if (gtReadoutRecord.
isValid()) {
1316 gtReadoutRecordValid =
true;
1320 iErrorRecord = iErrorRecord + 100;
1321 LogDebug(
"L1GtUtils") <<
"\nL1GlobalTriggerReadoutRecord with \n " 1322 <<
m_l1GtUtilsHelper->l1GtReadoutRecordInputTag() <<
"\nnot found in the event." << std::endl;
1330 int pfIndexTechTrig = -1;
1331 int pfIndexAlgoTrig = -1;
1334 if (gtReadoutRecordValid) {
1335 pfIndexTechTrig = (gtReadoutRecord->
gtFdlWord()).gtPrescaleFactorIndexTech();
1336 pfIndexAlgoTrig = (gtReadoutRecord->
gtFdlWord()).gtPrescaleFactorIndexAlgo();
1344 LogDebug(
"L1GtUtils") <<
"\nError: " 1345 <<
"\nNo valid L1GlobalTriggerRecord with \n " <<
m_l1GtUtilsHelper->l1GtRecordInputTag()
1346 <<
"\nfound in the event." 1347 <<
"\nNo valid L1GlobalTriggerReadoutRecord with \n " 1348 <<
m_l1GtUtilsHelper->l1GtReadoutRecordInputTag() <<
"\nfound in the event." << std::endl;
1350 iError = l1ConfCode + iErrorRecord;
1364 size_t pfSetsSize = 0;
1366 switch (trigCategory) {
1382 pfIndex = pfIndexAlgoTrig;
1400 pfIndex = pfIndexTechTrig;
1405 iError = l1ConfCode + iErrorRecord + 3;
1414 iError = l1ConfCode + iErrorRecord + 1000;
1415 LogDebug(
"L1GtUtils") <<
"\nError: index of prescale factor set retrieved from the data \n" 1416 <<
"less than zero." 1417 <<
"\n Value of index retrieved from data = " << pfIndex << std::endl;
1422 }
else if (pfIndex >= (static_cast<int>(pfSetsSize))) {
1423 iError = l1ConfCode + iErrorRecord + 2000;
1424 LogDebug(
"L1GtUtils") <<
"\nError: index of prescale factor set retrieved from the data \n" 1425 <<
"greater than the size of the vector of prescale factor sets." 1426 <<
"\n Value of index retrieved from data = " << pfIndex
1427 <<
"\n Vector size = " << pfSetsSize << std::endl;
1453 switch (trigCategory) {
1520 switch (trigCategory) {
1565 iError = l1ConfCode + 3;
1635 iError = l1ConfCode;
1663 iError = l1ConfCode;
1669 iError = l1ConfCode;
1682 LogDebug(
"L1GtUtils") <<
"\nRetrieve L1 trigger configuration from L1GtTriggerMenuLite only.\n" << std::endl;
1685 LogDebug(
"L1GtUtils") <<
"\nFall through: retrieve L1 trigger configuration from L1GtTriggerMenuLite." 1686 <<
"\nIf L1GtTriggerMenuLite not valid, try to retrieve from event setup.\n" 1688 l1ConfCode = 100000;
1692 LogDebug(
"L1GtUtils") <<
"\nRetrieve L1 trigger configuration from L1GtTriggerMenuLite, valid product.\n" 1694 l1ConfCode = l1ConfCode + 10000;
1701 LogDebug(
"L1GtUtils") <<
"\nFall through: retrieve L1 trigger configuration from event setup." 1702 <<
"\nFirst option was L1GtTriggerMenuLite - but product is not valid.\n" 1704 l1ConfCode = l1ConfCode + 20000;
1710 LogDebug(
"L1GtUtils") <<
"\nFall through: L1GtTriggerMenuLite not valid, event setup not valid.\n" << std::endl;
1712 errorCode = l1ConfCode;
1718 LogDebug(
"L1GtUtils") <<
"\nError: L1 trigger configuration requested from L1GtTriggerMenuLite only" 1719 <<
"\nbut L1GtTriggerMenuLite is not valid.\n" 1722 errorCode = l1ConfCode;
1727 LogDebug(
"L1GtUtils") <<
"\nRetrieve L1 trigger configuration from event setup." 1728 <<
"\nL1GtTriggerMenuLite product was not requested.\n" 1730 l1ConfCode = 200000;
1733 LogDebug(
"L1GtUtils") <<
"\nRetrieve L1 trigger configuration from event setup only." 1734 <<
"\nValid L1 trigger event setup.\n" 1736 l1ConfCode = l1ConfCode + 10000;
1742 LogDebug(
"L1GtUtils") <<
"\nRetrieve L1 trigger configuration from event setup only." 1743 <<
"\nNo valid L1 trigger event setup.\n" 1746 errorCode = l1ConfCode;
1752 LogDebug(
"L1GtUtils") <<
"\nError: no L1 trigger configuration requested to be retrieved." 1753 <<
"\nMust call before getL1GtRunCache in beginRun and analyze.\n" 1755 l1ConfCode = 300000;
1756 errorCode = l1ConfCode;
1768 int& errorCode)
const {
1769 bool trigRes =
false;
1772 if (
bitNumber < (static_cast<int>(decWord.size()))) {
1777 <<
"\n " << nameAlgoTechTrig
1778 <<
"\ngreater than size of L1 GT decision word: " << decWord.size()
1779 <<
"\nError: Inconsistent L1 trigger configuration!" << std::endl;
1788 m_logicalExpression(expression),
1790 m_l1GtUtils(l1GtUtils),
1794 m_validL1Configuration(
false),
1796 m_validLogicalExpression(
false),
1798 m_l1ResultsAlreadyCalled(
false),
1800 m_expL1TriggersSize(0),
1802 m_expBitsTechTrigger(
false) {
1820 m_expL1TriggersSize = m_expL1Triggers.size();
1822 m_validLogicalExpression =
true;
1825 m_validLogicalExpression =
false;
1839 m_expBitsTechTrigger =
true;
1841 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
1842 const std::string& bitString = (m_expL1Triggers[iTrig]).tokenName;
1843 std::istringstream bitStream(bitString);
1846 if ((bitStream >> bitInt).fail()) {
1847 m_expBitsTechTrigger =
false;
1852 (m_expL1Triggers[iTrig]).tokenNumber = bitInt;
1856 m_decisionsBeforeMask.resize(m_expL1TriggersSize);
1857 m_decisionsAfterMask.resize(m_expL1TriggersSize);
1858 m_prescaleFactors.resize(m_expL1TriggersSize);
1859 m_triggerMasks.resize(m_expL1TriggersSize);
1860 m_errorCodes.resize(m_expL1TriggersSize);
1861 m_expTriggerCategory.resize(m_expL1TriggersSize);
1862 m_expTriggerInMenu.resize(m_expL1TriggersSize);
1864 LogDebug(
"L1GtUtils") << std::endl;
1865 LogTrace(
"L1GtUtils") <<
"\nLogical expression\n " << m_logicalExpression <<
"\n has " << m_expL1TriggersSize
1866 <<
" L1 triggers" << std::endl;
1867 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
1868 const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
1869 LogTrace(
"L1GtUtils") <<
" " << trigNameOrAlias << std::endl;
1871 (m_decisionsBeforeMask[iTrig]).
first = trigNameOrAlias;
1872 (m_decisionsBeforeMask[iTrig]).
second =
false;
1874 (m_decisionsAfterMask[iTrig]).
first = trigNameOrAlias;
1875 (m_decisionsAfterMask[iTrig]).
second =
false;
1877 (m_prescaleFactors[iTrig]).
first = trigNameOrAlias;
1878 (m_prescaleFactors[iTrig]).
second = -1;
1880 (m_triggerMasks[iTrig]).
first = trigNameOrAlias;
1881 (m_triggerMasks[iTrig]).
second = -1;
1883 (m_errorCodes[iTrig]).
first = trigNameOrAlias;
1884 (m_errorCodes[iTrig]).
second = -1;
1888 m_expTriggerInMenu[iTrig] =
false;
1890 LogTrace(
"L1GtUtils") << std::endl;
1904 m_logicalExpression = logicExpression;
1905 m_validLogicalExpression =
false;
1907 m_l1ResultsAlreadyCalled =
false;
1909 m_expL1TriggersSize = 0;
1910 m_expBitsTechTrigger =
false;
1913 m_decisionsBeforeMask.clear();
1914 m_decisionsAfterMask.clear();
1915 m_prescaleFactors.clear();
1916 m_triggerMasks.clear();
1917 m_errorCodes.clear();
1918 m_expTriggerCategory.clear();
1919 m_expTriggerInMenu.clear();
1924 errorCode = logicalExpressionRunUpdate(iRun, evSetup);
1938 if (!(m_l1GtUtils.availableL1Configuration(errorCode, l1ConfCode))) {
1939 m_validL1Configuration =
false;
1942 m_validL1Configuration =
true;
1943 m_l1ConfCode = l1ConfCode;
1956 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
1959 const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
1961 if (!m_expBitsTechTrigger) {
1962 const bool triggerInMenu = m_l1GtUtils.l1AlgoTechTrigBitNumber(trigNameOrAlias, trigCategory,
bitNumber);
1964 (m_expL1Triggers[iTrig]).tokenNumber =
bitNumber;
1965 m_expTriggerCategory[iTrig] = trigCategory;
1966 m_expTriggerInMenu[iTrig] = triggerInMenu;
1973 bitNumber = (m_expL1Triggers[iTrig]).tokenNumber;
1975 const bool triggerInMenu =
1976 m_l1GtUtils.l1TriggerNameFromBit(
bitNumber, trigCategory, aliasL1Trigger, nameL1Trigger);
1978 if (!triggerInMenu) {
1979 aliasL1Trigger =
"Technical_trigger_bit_" + (m_expL1Triggers[iTrig]).tokenName +
"_empty";
1982 (m_expL1Triggers[iTrig]).tokenName = aliasL1Trigger;
1983 m_expTriggerCategory[iTrig] = trigCategory;
1984 m_expTriggerInMenu[iTrig] = triggerInMenu;
1988 (m_decisionsBeforeMask[iTrig]).
first = aliasL1Trigger;
1989 (m_decisionsAfterMask[iTrig]).
first = aliasL1Trigger;
1990 (m_prescaleFactors[iTrig]).
first = aliasL1Trigger;
1991 (m_triggerMasks[iTrig]).
first = aliasL1Trigger;
1992 (m_errorCodes[iTrig]).
first = aliasL1Trigger;
2001 if (!m_l1ResultsAlreadyCalled) {
2003 <<
"\nUsage error: " 2004 <<
"\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n" 2008 return m_decisionsBeforeMask;
2013 if (!m_l1ResultsAlreadyCalled) {
2015 <<
"\nUsage error: " 2016 <<
"\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n" 2020 return m_decisionsAfterMask;
2025 if (!m_l1ResultsAlreadyCalled) {
2027 <<
"\nUsage error: " 2028 <<
"\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n" 2032 return m_prescaleFactors;
2037 if (!m_l1ResultsAlreadyCalled) {
2039 <<
"\nUsage error: " 2040 <<
"\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n" 2044 return m_triggerMasks;
2049 m_l1ResultsAlreadyCalled =
false;
2052 if (!m_validL1Configuration) {
2053 reset(m_decisionsBeforeMask);
2054 reset(m_decisionsAfterMask);
2055 reset(m_prescaleFactors);
2056 reset(m_triggerMasks);
2057 reset(m_errorCodes);
2059 m_l1ResultsAlreadyCalled =
true;
2060 return m_errorCodes;
2065 m_l1ResultsAlreadyCalled =
true;
2067 return m_errorCodes;
2071 std::vector<std::pair<std::string, bool> > pairVector = _pairVector;
2072 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2073 (pairVector[iTrig]).
second =
false;
2078 std::vector<std::pair<std::string, int> > pairVector = _pairVector;
2079 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2080 (pairVector[iTrig]).
second = -1;
2086 reset(m_decisionsBeforeMask);
2087 reset(m_decisionsAfterMask);
2088 reset(m_prescaleFactors);
2089 reset(m_triggerMasks);
2090 reset(m_errorCodes);
2093 bool decisionBeforeMaskValue =
false;
2094 bool decisionAfterMaskValue =
false;
2095 int prescaleFactorValue = -1;
2096 int triggerMaskValue = -1;
2099 LogDebug(
"L1GtUtils") << std::endl;
2100 LogTrace(
"L1GtUtils") <<
"\nLogical expression\n " << m_logicalExpression << std::endl;
2104 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2105 const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2107 if (m_expTriggerInMenu[iTrig]) {
2108 errorCode = m_l1GtUtils.l1Results(
iEvent,
2110 decisionBeforeMaskValue,
2111 decisionAfterMaskValue,
2112 prescaleFactorValue,
2115 if (errorCode != 0) {
2119 decisionBeforeMaskValue =
false;
2120 decisionAfterMaskValue =
false;
2121 prescaleFactorValue = -1;
2122 triggerMaskValue = -1;
2129 decisionBeforeMaskValue =
false;
2130 decisionAfterMaskValue =
false;
2131 prescaleFactorValue = -1;
2132 triggerMaskValue = -1;
2133 errorCode = m_l1ConfCode + 1;
2136 LogTrace(
"L1GtUtils") <<
"\n" << trigNameOrAlias <<
":" << std::endl;
2138 (m_decisionsBeforeMask[iTrig]).
second = decisionBeforeMaskValue;
2139 LogTrace(
"L1GtUtils") <<
" decision before mask = " << decisionBeforeMaskValue << std::endl;
2141 (m_decisionsAfterMask[iTrig]).
second = decisionAfterMaskValue;
2142 LogTrace(
"L1GtUtils") <<
" decision after mask = " << decisionAfterMaskValue << std::endl;
2144 (m_prescaleFactors[iTrig]).
second = prescaleFactorValue;
2145 LogTrace(
"L1GtUtils") <<
" prescale factor = " << prescaleFactorValue << std::endl;
2147 (m_triggerMasks[iTrig]).
second = triggerMaskValue;
2148 LogTrace(
"L1GtUtils") <<
" trigger mask = " << triggerMaskValue << std::endl;
2150 (m_errorCodes[iTrig]).
second = errorCode;
2151 LogTrace(
"L1GtUtils") <<
" error code = " << errorCode << std::endl;
2154 LogDebug(
"L1GtUtils") << std::endl;
const int prescaleFactorSetIndex(const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode) const
bool m_retrieveL1GtTriggerMenuLite
edm::RunID m_runIDCache
run cache ID
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
static AlgebraicMatrix initialize()
void l1Results(const edm::Event &iEvent)
void retrieveL1EventSetup(const edm::EventSetup &, bool isRun=true)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
LogicalExpressionL1Results(const std::string &, L1GtUtils &)
constructor(s)
std::vector< unsigned int > m_triggerMaskSet
unsigned long long m_l1GtMenuCacheID
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
const int logicalExpressionRunUpdate(const edm::Run &, const edm::EventSetup &, const std::string &)
virtual std::string explainSelf() const
const L1GtTriggerMenuLite * ptrL1GtTriggerMenuLite(int &errorCode)
return a pointer to the L1GtTriggerMenuLite product
const std::vector< unsigned int > * m_triggerMaskTechTrig
const L1GtTriggerMask * m_l1GtTmVetoTech
const int prescaleFactor(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
RunAuxiliary const & runAuxiliary() const final
T const * product() const
const bool l1AlgoTechTrigBitNumber(const std::string &nameAlgoTechTrig, TriggerCategory &trigCategory, int &bitNumber) const
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrigLite
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_L1GtTriggerMenuRunToken
virtual ~L1GtUtils()
destructor
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks & veto masks
const AlgorithmMap * m_algorithmMap
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd > m_L1GtTriggerMaskAlgoTrigRunToken
const std::vector< std::pair< std::string, int > > & prescaleFactors()
const DecisionWord & decisionWord(int bxInEventValue) const
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
const L1GtStableParameters * m_l1GtStablePar
event setup cached stuff
unsigned long long m_l1GtPfAlgoCacheID
const std::vector< unsigned int > & triggerMaskSet(const TriggerCategory &trigCategory, int &errorCode)
const std::vector< std::pair< std::string, int > > & triggerMasks()
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmAliasMapLite
unsigned long long cacheIdentifier() const
const std::string & l1TriggerMenuImplementation() const
return the L1 trigger menu implementation
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_L1GtTriggerMenuEventToken
U second(std::pair< T, U > const &p)
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmMapLite
unsigned long long m_l1GtTmVetoTechCacheID
const int l1Results(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
const std::vector< std::pair< std::string, bool > > & decisionsAfterMask()
const bool trigResult(const DecisionWord &decWord, const int bitNumber, const std::string &nameAlgoTechTrig, const TriggerCategory &trigCategory, int &errorCode) const
edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsTechTrigRcd > m_L1GtPrescaleFactorsTechTrigRunToken
const std::vector< std::pair< std::string, bool > > & decisionsBeforeMask()
edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > m_L1GtPrescaleFactorsAlgoTrigRunToken
const bool l1TriggerNameFromBit(const int &bitNumber, const TriggerCategory &trigCategory, std::string &aliasL1Trigger, std::string &nameL1Trigger) const
const AlgorithmMap * m_algorithmAliasMap
std::vector< OperandToken > & operandTokenVector()
return the vector of operand tokens
unsigned long long m_l1GtTmTechCacheID
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrigLite
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd > m_L1GtTriggerMaskTechTrigRunToken
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
const L1GtTriggerMask * m_l1GtTmVetoAlgo
std::vector< bool > DecisionWord
typedefs
const unsigned int gtPrescaleFactorIndexTech() const
get/set index of the set of prescale factors
static const std::string EmptyString
edm::ESGetToken< L1GtStableParameters, L1GtStableParametersRcd > m_L1GtStableParametersEventToken
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
unsigned long long m_l1GtTmAlgoCacheID
const std::string & l1TriggerMenu() const
return the L1 trigger menu name
void reset(const std::vector< std::pair< std::string, bool > > &) const
reset for each L1 trigger the value from pair.second
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd > m_L1GtTriggerMaskAlgoTrigEventToken
unsigned int m_numberTechnicalTriggers
number of technical triggers
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsTechTrigRcd > m_L1GtPrescaleFactorsTechTrigEventToken
unsigned int m_physicsDaqPartition
index of physics DAQ partition
unsigned int m_numberAlgorithmTriggers
number of algorithm triggers
const std::vector< int > & prescaleFactorSet(const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode)
const L1GtTriggerMask * m_l1GtTmTech
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
const L1GtPrescaleFactors * m_l1GtPfTech
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskVetoTechTrigRcd > m_L1GtTriggerMaskVetoTechTrigEventToken
const AlgorithmMap * m_technicalTriggerMap
const std::string triggerCategory(const TriggerCategory &) const
public methods
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::unique_ptr< L1GtUtilsHelper > m_l1GtUtilsHelper
const std::vector< unsigned int > * m_triggerMaskTechTrigLite
static const bool useL1GtTriggerMenuLite(true)
const int triggerMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd > m_L1GtTriggerMaskTechTrigEventToken
L1GtUtils(edm::ParameterSet const &pset, edm::ConsumesCollector &&iC, bool useL1GtTriggerMenuLite, UseEventSetupIn use=UseEventSetupIn::Run)
const std::vector< unsigned int > * m_triggerMaskAlgoTrigLite
bool m_beginRunCache
flag for call of getL1GtRunCache in beginRun
const bool decision(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
void getL1GtRunCache(const edm::Run &, const edm::EventSetup &, const bool, const bool)
get all the run-constant quantities for L1 trigger and cache them
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskVetoAlgoTrigRcd > m_L1GtTriggerMaskVetoAlgoTrigEventToken
const L1GtTriggerMenu * m_l1GtMenu
~LogicalExpressionL1Results()
destructor
const DecisionWord decisionWordBeforeMask() const
unsigned long long m_l1GtPfTechCacheID
const bool decisionAfterMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
static const int L1GtNotValidError
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
const unsigned int gtPrescaleFactorIndexAlgo() const
unsigned long long m_l1GtTmVetoAlgoCacheID
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskVetoAlgoTrigRcd > m_L1GtTriggerMaskVetoAlgoTrigRunToken
std::vector< int > m_prescaleFactorSet
Log< level::Warning, false > LogWarning
char const * what() const noexcept override
const TechnicalTriggerWord technicalTriggerWordBeforeMask() const
const L1GtTriggerMenu * ptrL1TriggerMenuEventSetup(int &errorCode)
return a pointer to the L1 trigger menu from event setup
edm::ESGetToken< L1GtStableParameters, L1GtStableParametersRcd > m_L1GtStableParametersRunToken
void reset(double vett[256])
unsigned long long m_l1GtStableParCacheID
const bool decisionBeforeMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
const L1GtTriggerMenuLite::L1TriggerMap * m_technicalTriggerMapLite
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskVetoTechTrigRcd > m_L1GtTriggerMaskVetoTechTrigRunToken
edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > m_L1GtPrescaleFactorsAlgoTrigEventToken
static const bool useL1EventSetup(true)
const std::vector< unsigned int > * m_triggerMaskVetoTechTrig
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
void retrieveL1GtTriggerMenuLite(const edm::Run &)
retrieve L1GtTriggerMenuLite (per run product) and cache it to improve the speed
const std::vector< std::pair< std::string, int > > & errorCodes(const edm::Event &)