50 m_l1GtStableParCacheID(0ULL), m_numberAlgorithmTriggers(0),
52 m_numberTechnicalTriggers(0),
54 m_l1GtPfAlgoCacheID(0ULL), m_l1GtPfTechCacheID(0ULL),
56 m_l1GtTmAlgoCacheID(0ULL), m_l1GtTmTechCacheID(0ULL),
58 m_l1GtTmVetoAlgoCacheID(0ULL), m_l1GtTmVetoTechCacheID(0ULL),
60 m_l1GtMenuCacheID(0ULL),
62 m_l1EventSetupValid(
false),
64 m_l1GtMenuLiteValid(
false),
66 m_beginRunCache(
false),
70 m_physicsDaqPartition(0),
72 m_retrieveL1EventSetup(
false),
74 m_retrieveL1GtTriggerMenuLite(
false)
84 L1GtUtils(pset, iC, useL1GtTriggerMenuLite) { }
103 switch (trigCategory) {
105 return "Algorithm Trigger";
109 return "Technical Trigger";
132 unsigned long long l1GtStableParCacheID =
162 unsigned long long l1GtPfAlgoCacheID =
177 unsigned long long l1GtPfTechCacheID = evSetup.
get<
195 unsigned long long l1GtTmAlgoCacheID =
210 unsigned long long l1GtTmTechCacheID =
225 unsigned long long l1GtTmVetoAlgoCacheID =
240 unsigned long long l1GtTmVetoTechCacheID =
258 unsigned long long l1GtMenuCacheID =
291 LogDebug(
"L1GtUtils") <<
"\nL1GtTriggerMenuLite with \n "
293 <<
"\nrequested, but not found in the run."
301 LogDebug(
"L1GtUtils") <<
"\nL1GtTriggerMenuLite with \n "
329 if (useL1EventSetup) {
338 if (useL1GtTriggerMenuLite) {
352 if (useL1EventSetup) {
368 if (useL1GtTriggerMenuLite) {
378 int& bitNumber)
const {
391 if (itTrig->second == nameAlgoTechTrig) {
394 bitNumber = itTrig->first;
405 if (itTrig->second == nameAlgoTechTrig) {
408 bitNumber = itTrig->first;
419 if (itTrig->second == nameAlgoTechTrig) {
422 bitNumber = itTrig->first;
434 bitNumber = (itAlgo->second).algoBitNumber();
443 bitNumber = (itAlgo->second).algoBitNumber();
452 bitNumber = (itAlgo->second).algoBitNumber();
468 bitNumber = (itAlgo->second).algoBitNumber();
477 bitNumber = (itAlgo->second).algoBitNumber();
486 bitNumber = (itAlgo->second).algoBitNumber();
507 aliasL1Trigger.clear();
508 nameL1Trigger.clear();
516 bool trigAliasFound =
false;
517 bool trigNameFound =
false;
523 if (static_cast<int>(itTrig->first) == bitNumber) {
524 aliasL1Trigger = itTrig->second;
525 trigAliasFound =
true;
534 if (static_cast<int>(itTrig->first) == bitNumber) {
535 nameL1Trigger = itTrig->second;
536 trigNameFound =
true;
541 if (!(trigAliasFound && trigNameFound)) {
551 bool trigNameFound =
false;
557 if (static_cast<int>(itTrig->first) == bitNumber) {
558 nameL1Trigger = itTrig->second;
562 aliasL1Trigger = itTrig->second;
564 trigNameFound =
true;
569 if (!(trigNameFound)) {
586 bool trigAliasFound =
false;
591 if ((itTrig->second).algoBitNumber() == bitNumber) {
592 aliasL1Trigger = itTrig->first;
594 nameL1Trigger = (itTrig->second).algoName();
596 trigAliasFound =
true;
601 if (!(trigAliasFound)) {
611 bool trigNameFound =
false;
616 if ((itTrig->second).algoBitNumber() == bitNumber) {
617 nameL1Trigger = (itTrig->second).algoName();
620 aliasL1Trigger = nameL1Trigger;
622 trigNameFound =
true;
627 if (!(trigNameFound)) {
649 bool trigAliasFound =
false;
654 if ((itTrig->second).algoBitNumber() == bitNumber) {
655 aliasL1Trigger = itTrig->first;
657 nameL1Trigger = (itTrig->second).algoName();
659 trigAliasFound =
true;
664 if (!(trigAliasFound)) {
674 bool trigNameFound =
false;
679 if ((itTrig->second).algoBitNumber() == bitNumber) {
680 nameL1Trigger = (itTrig->second).algoName();
683 aliasL1Trigger = itTrig->first;
685 trigNameFound =
true;
690 if (!(trigNameFound)) {
714 const std::string& nameAlgoTechTrig,
bool& decisionBeforeMask,
715 bool& decisionAfterMask,
int&
prescaleFactor,
int& triggerMask)
const {
718 decisionBeforeMask =
false;
719 decisionAfterMask =
false;
745 iError = l1ConfCode + 1;
750 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n "
752 <<
"\not found in the trigger menu \n "
754 <<
"\nretrieved from L1GtTriggerMenuLite" << std::endl;
759 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n "
761 <<
"\not found in the trigger menu \n "
763 <<
"\nretrieved from Event Setup" << std::endl;
769 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n "
771 <<
"\not found in the trigger menu \n "
773 <<
"\nretrieved from Event Setup" << std::endl;
786 iError = l1ConfCode + 2;
790 LogDebug(
"L1GtUtils") <<
"\nNegative bit number for "
792 << nameAlgoTechTrig <<
"\nfrom menu \n "
794 <<
"\nretrieved from L1GtTriggerMenuLite" << std::endl;
798 LogDebug(
"L1GtUtils") <<
"\nNegative bit number for "
800 << nameAlgoTechTrig <<
"\nfrom menu \n "
802 <<
"\nretrieved from Event Setup" << std::endl;
808 LogDebug(
"L1GtUtils") <<
"\nNegative bit number for "
810 << nameAlgoTechTrig <<
"\nfrom menu \n "
812 <<
"\nretrieved from Event Setup" << std::endl;
824 int iErrorRecord = 0;
826 bool validRecord =
false;
827 bool gtReadoutRecordValid =
false;
840 LogDebug(
"L1GtUtils") <<
"\nL1GlobalTriggerRecord with \n "
849 if (gtReadoutRecord.
isValid()) {
851 gtReadoutRecordValid =
true;
856 iErrorRecord = iErrorRecord + 100;
857 LogDebug(
"L1GtUtils") <<
"\nL1GlobalTriggerReadoutRecord with \n "
869 int pfIndexTechTrig = -1;
870 int pfIndexAlgoTrig = -1;
873 if (gtReadoutRecordValid) {
876 = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexTech();
878 = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo();
883 =
static_cast<int> (gtRecord->gtPrescaleFactorIndexTech());
885 =
static_cast<int> (gtRecord->gtPrescaleFactorIndexAlgo());
891 LogDebug(
"L1GtUtils") <<
"\nError: "
892 <<
"\nNo valid L1GlobalTriggerRecord with \n "
894 <<
"\nNo valid L1GlobalTriggerReadoutRecord with \n "
898 iError = l1ConfCode + iErrorRecord;
911 size_t pfSetsSize = 0;
913 const std::vector<int>* prescaleFactorsSubset = 0;
914 const std::vector<unsigned int>* triggerMasksSet = 0;
916 switch (trigCategory) {
937 pfIndex = pfIndexAlgoTrig;
961 pfIndex = pfIndexTechTrig;
967 iError = l1ConfCode + iErrorRecord + 3;
979 iError = l1ConfCode + iErrorRecord + 1000;
981 <<
"\nError: index of prescale factor set retrieved from the data \n"
983 <<
"\n Value of index retrieved from data = " << pfIndex
988 }
else if (pfIndex >= (static_cast<int>(pfSetsSize))) {
989 iError = l1ConfCode + iErrorRecord + 2000;
991 <<
"\nError: index of prescale factor set retrieved from the data \n"
992 <<
"greater than the size of the vector of prescale factor sets."
993 <<
"\n Value of index retrieved from data = " << pfIndex
994 <<
"\n Vector size = " << pfSetsSize << std::endl;
999 switch (trigCategory) {
1003 prescaleFactorsSubset
1004 = &((*m_prescaleFactorsAlgoTrigLite).at(pfIndex));
1008 prescaleFactorsSubset
1009 = &((*m_prescaleFactorsAlgoTrig).at(pfIndex));
1015 prescaleFactorsSubset
1016 = &((*m_prescaleFactorsAlgoTrig).at(pfIndex));
1025 prescaleFactorsSubset
1026 = &((*m_prescaleFactorsTechTrigLite).at(pfIndex));
1030 prescaleFactorsSubset
1031 = &((*m_prescaleFactorsTechTrig).at(pfIndex));
1037 prescaleFactorsSubset
1038 = &((*m_prescaleFactorsTechTrig).at(pfIndex));
1057 switch (trigCategory) {
1059 if (gtReadoutRecordValid) {
1060 const DecisionWord& decWord = gtReadoutRecord->decisionWord();
1061 decisionBeforeMask =
trigResult(decWord, bitNumber,
1062 nameAlgoTechTrig, trigCategory, iError);
1064 return (iError + l1ConfCode + iErrorRecord);
1070 gtRecord->decisionWordBeforeMask();
1071 decisionBeforeMask =
trigResult(decWord, bitNumber,
1072 nameAlgoTechTrig, trigCategory, iError);
1074 return (iError + l1ConfCode + iErrorRecord);
1082 if (gtReadoutRecordValid) {
1084 gtReadoutRecord->technicalTriggerWord();
1085 decisionBeforeMask =
trigResult(decWord, bitNumber,
1086 nameAlgoTechTrig, trigCategory, iError);
1088 return (iError + l1ConfCode + iErrorRecord);
1094 gtRecord->technicalTriggerWordBeforeMask();
1095 decisionBeforeMask =
trigResult(decWord, bitNumber,
1096 nameAlgoTechTrig, trigCategory, iError);
1098 return (iError + l1ConfCode + iErrorRecord);
1115 if (bitNumber < (static_cast<int> (prescaleFactorsSubset->size()))) {
1116 prescaleFactor = (*prescaleFactorsSubset)[bitNumber];
1118 iError = l1ConfCode + iErrorRecord + 4000;
1119 LogDebug(
"L1GtUtils") <<
"\nError: bit number " << bitNumber
1122 <<
"\ngreater than size of actual L1 GT prescale factor set: "
1123 << prescaleFactorsSubset->size()
1124 <<
"\nError: Inconsistent L1 trigger configuration!"
1132 if (bitNumber < (static_cast<int> ((*triggerMasksSet).size()))) {
1136 triggerMask = (*triggerMasksSet)[bitNumber];
1141 triggerMask = ((*triggerMasksSet)[bitNumber]) & (1
1149 triggerMask = ((*triggerMasksSet)[bitNumber]) & (1
1156 iError = l1ConfCode + iErrorRecord + 5000;
1157 LogDebug(
"L1GtUtils") <<
"\nError: bit number " << bitNumber
1160 <<
"\ngreater than size of L1 GT trigger mask set: "
1161 << (*triggerMasksSet).size()
1162 <<
"\nError: Inconsistent L1 trigger configuration!"
1172 decisionAfterMask =
false;
1179 const std::string& nameAlgoTechTrig,
int& errorCode)
const {
1187 errorCode =
l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1188 decisionAfterMask, prescaleFactor, triggerMask);
1194 const std::string& nameAlgoTechTrig,
int& errorCode)
const {
1202 errorCode =
l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1203 decisionAfterMask, prescaleFactor, triggerMask);
1209 const std::string& nameAlgoTechTrig,
int& errorCode)
const {
1217 errorCode =
l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1218 decisionAfterMask, prescaleFactor, triggerMask);
1224 const std::string& nameAlgoTechTrig,
int& errorCode)
const {
1232 errorCode =
l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1233 decisionAfterMask, prescaleFactor, triggerMask);
1239 const std::string& nameAlgoTechTrig,
int& errorCode)
const {
1247 errorCode =
l1Results(iEvent, nameAlgoTechTrig, decisionBeforeMask,
1248 decisionAfterMask, prescaleFactor, triggerMask);
1254 int& errorCode)
const {
1257 int triggerMaskValue = -1;
1267 return triggerMaskValue;
1281 iError = l1ConfCode + 1;
1286 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n "
1288 <<
"\not found in the trigger menu \n "
1290 <<
"\nretrieved from L1GtTriggerMenuLite" << std::endl;
1295 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n "
1297 <<
"\not found in the trigger menu \n "
1299 <<
"\nretrieved from Event Setup" << std::endl;
1305 LogDebug(
"L1GtUtils") <<
"\nAlgorithm/technical trigger \n "
1307 <<
"\not found in the trigger menu \n "
1309 <<
"\nretrieved from Event Setup" << std::endl;
1314 return triggerMaskValue;
1321 if (bitNumber < 0) {
1323 iError = l1ConfCode + 2;
1327 LogDebug(
"L1GtUtils") <<
"\nNegative bit number for "
1329 << nameAlgoTechTrig <<
"\nfrom menu \n "
1331 <<
"\nretrieved from L1GtTriggerMenuLite" << std::endl;
1335 LogDebug(
"L1GtUtils") <<
"\nNegative bit number for "
1337 << nameAlgoTechTrig <<
"\nfrom menu \n "
1339 <<
"\nretrieved from Event Setup" << std::endl;
1345 LogDebug(
"L1GtUtils") <<
"\nNegative bit number for "
1347 << nameAlgoTechTrig <<
"\nfrom menu \n "
1349 <<
"\nretrieved from Event Setup" << std::endl;
1354 return triggerMaskValue;
1362 const std::vector<unsigned int>* triggerMasksSet = 0;
1364 switch (trigCategory) {
1405 iError = l1ConfCode + 3;
1408 return triggerMaskValue;
1416 if (bitNumber < (static_cast<int> ((*triggerMasksSet).size()))) {
1420 triggerMaskValue = (*triggerMasksSet)[bitNumber];
1425 triggerMaskValue = ((*triggerMasksSet)[bitNumber]) & (1
1433 triggerMaskValue = ((*triggerMasksSet)[bitNumber]) & (1
1439 iError = l1ConfCode + 5000;
1440 LogDebug(
"L1GtUtils") <<
"\nError: bit number " << bitNumber
1443 <<
"\ngreater than size of L1 GT trigger mask set: "
1444 << (*triggerMasksSet).size()
1445 <<
"\nError: Inconsistent L1 trigger configuration!"
1449 return triggerMaskValue;
1454 return triggerMaskValue;
1482 int iErrorRecord = 0;
1484 bool validRecord =
false;
1485 bool gtReadoutRecordValid =
false;
1498 LogDebug(
"L1GtUtils") <<
"\nL1GlobalTriggerRecord with \n "
1507 if (gtReadoutRecord.
isValid()) {
1509 gtReadoutRecordValid =
true;
1514 iErrorRecord = iErrorRecord + 100;
1515 LogDebug(
"L1GtUtils") <<
"\nL1GlobalTriggerReadoutRecord with \n "
1516 <<
m_l1GtUtilsHelper->l1GtReadoutRecordInputTag() <<
"\nnot found in the event."
1527 int pfIndexTechTrig = -1;
1528 int pfIndexAlgoTrig = -1;
1531 if (gtReadoutRecordValid) {
1534 = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexTech();
1536 = (gtReadoutRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo();
1541 =
static_cast<int> (gtRecord->gtPrescaleFactorIndexTech());
1543 =
static_cast<int> (gtRecord->gtPrescaleFactorIndexAlgo());
1549 LogDebug(
"L1GtUtils") <<
"\nError: "
1550 <<
"\nNo valid L1GlobalTriggerRecord with \n "
1552 <<
"\nNo valid L1GlobalTriggerReadoutRecord with \n "
1556 iError = l1ConfCode + iErrorRecord;
1571 size_t pfSetsSize = 0;
1573 switch (trigCategory) {
1591 pfIndex = pfIndexAlgoTrig;
1612 pfIndex = pfIndexTechTrig;
1618 iError = l1ConfCode + iErrorRecord + 3;
1630 iError = l1ConfCode + iErrorRecord + 1000;
1632 <<
"\nError: index of prescale factor set retrieved from the data \n"
1633 <<
"less than zero."
1634 <<
"\n Value of index retrieved from data = " << pfIndex
1640 }
else if (pfIndex >= (static_cast<int>(pfSetsSize))) {
1641 iError = l1ConfCode + iErrorRecord + 2000;
1643 <<
"\nError: index of prescale factor set retrieved from the data \n"
1644 <<
"greater than the size of the vector of prescale factor sets."
1645 <<
"\n Value of index retrieved from data = " << pfIndex
1646 <<
"\n Vector size = " << pfSetsSize << std::endl;
1675 switch (trigCategory) {
1680 = (*m_prescaleFactorsAlgoTrigLite).at(pfIndex);
1702 = (*m_prescaleFactorsTechTrigLite).at(pfIndex);
1760 switch (trigCategory) {
1817 iError = l1ConfCode + 3;
1900 iError = l1ConfCode;
1931 iError = l1ConfCode;
1937 iError = l1ConfCode;
1953 <<
"\nRetrieve L1 trigger configuration from L1GtTriggerMenuLite only.\n"
1958 <<
"\nFall through: retrieve L1 trigger configuration from L1GtTriggerMenuLite."
1959 <<
"\nIf L1GtTriggerMenuLite not valid, try to retrieve from event setup.\n"
1961 l1ConfCode = 100000;
1966 <<
"\nRetrieve L1 trigger configuration from L1GtTriggerMenuLite, valid product.\n"
1968 l1ConfCode = l1ConfCode + 10000;
1976 <<
"\nFall through: retrieve L1 trigger configuration from event setup."
1977 <<
"\nFirst option was L1GtTriggerMenuLite - but product is not valid.\n"
1979 l1ConfCode = l1ConfCode + 20000;
1986 <<
"\nFall through: L1GtTriggerMenuLite not valid, event setup not valid.\n"
1989 errorCode = l1ConfCode;
1998 <<
"\nError: L1 trigger configuration requested from L1GtTriggerMenuLite only"
1999 <<
"\nbut L1GtTriggerMenuLite is not valid.\n" << std::endl;
2001 errorCode = l1ConfCode;
2009 <<
"\nRetrieve L1 trigger configuration from event setup."
2010 <<
"\nL1GtTriggerMenuLite product was not requested.\n"
2012 l1ConfCode = 200000;
2016 <<
"\nRetrieve L1 trigger configuration from event setup only."
2017 <<
"\nValid L1 trigger event setup.\n"
2019 l1ConfCode = l1ConfCode + 10000;
2026 <<
"\nRetrieve L1 trigger configuration from event setup only."
2027 <<
"\nNo valid L1 trigger event setup.\n"
2030 errorCode = l1ConfCode;
2039 <<
"\nError: no L1 trigger configuration requested to be retrieved."
2040 <<
"\nMust call before getL1GtRunCache in beginRun and analyze.\n"
2042 l1ConfCode = 300000;
2043 errorCode = l1ConfCode;
2053 const int bitNumber,
const std::string& nameAlgoTechTrig,
2056 bool trigRes =
false;
2059 if (bitNumber < (static_cast<int> (decWord.size()))) {
2060 trigRes = decWord[bitNumber];
2063 LogDebug(
"L1GtUtils") <<
"\nError: bit number " << bitNumber
2066 <<
"\ngreater than size of L1 GT decision word: "
2068 <<
"\nError: Inconsistent L1 trigger configuration!"
2078 m_logicalExpression(expression),
2080 m_l1GtUtils(l1GtUtils),
2084 m_validL1Configuration(
false),
2086 m_validLogicalExpression(
false),
2088 m_l1ResultsAlreadyCalled(
false),
2090 m_expL1TriggersSize(0),
2092 m_expBitsTechTrigger(
false) {
2112 m_logicalExpression);
2116 m_expL1TriggersSize = m_expL1Triggers.size();
2118 m_validLogicalExpression =
true;
2121 m_validLogicalExpression =
false;
2135 m_expBitsTechTrigger =
true;
2137 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2138 const std::string& bitString = (m_expL1Triggers[iTrig]).tokenName;
2139 std::istringstream bitStream(bitString);
2142 if ((bitStream >> bitInt).
fail()) {
2144 m_expBitsTechTrigger =
false;
2149 (m_expL1Triggers[iTrig]).tokenNumber = bitInt;
2154 m_decisionsBeforeMask.resize(m_expL1TriggersSize);
2155 m_decisionsAfterMask.resize(m_expL1TriggersSize);
2156 m_prescaleFactors.resize(m_expL1TriggersSize);
2157 m_triggerMasks.resize(m_expL1TriggersSize);
2158 m_errorCodes.resize(m_expL1TriggersSize);
2159 m_expTriggerCategory.resize(m_expL1TriggersSize);
2160 m_expTriggerInMenu.resize(m_expL1TriggersSize);
2162 LogDebug(
"L1GtUtils") << std::endl;
2163 LogTrace(
"L1GtUtils") <<
"\nLogical expression\n " << m_logicalExpression
2164 <<
"\n has " << m_expL1TriggersSize <<
" L1 triggers" << std::endl;
2165 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2167 const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2168 LogTrace(
"L1GtUtils") <<
" " << trigNameOrAlias << std::endl;
2170 (m_decisionsBeforeMask[iTrig]).
first = trigNameOrAlias;
2171 (m_decisionsBeforeMask[iTrig]).
second =
false;
2173 (m_decisionsAfterMask[iTrig]).
first = trigNameOrAlias;
2174 (m_decisionsAfterMask[iTrig]).
second =
false;
2176 (m_prescaleFactors[iTrig]).
first = trigNameOrAlias;
2177 (m_prescaleFactors[iTrig]).
second = -1;
2179 (m_triggerMasks[iTrig]).
first = trigNameOrAlias;
2180 (m_triggerMasks[iTrig]).
second = -1;
2182 (m_errorCodes[iTrig]).
first = trigNameOrAlias;
2183 (m_errorCodes[iTrig]).
second = -1;
2187 m_expTriggerInMenu[iTrig] =
false;
2190 LogTrace(
"L1GtUtils") << std::endl;
2207 m_logicalExpression = logicExpression;
2208 m_validLogicalExpression =
false;
2210 m_l1ResultsAlreadyCalled =
false;
2212 m_expL1TriggersSize = 0;
2213 m_expBitsTechTrigger =
false;
2216 m_decisionsBeforeMask.clear();
2217 m_decisionsAfterMask.clear();
2218 m_prescaleFactors.clear();
2219 m_triggerMasks.clear();
2220 m_errorCodes.clear();
2221 m_expTriggerCategory.clear();
2222 m_expTriggerInMenu.clear();
2228 errorCode = logicalExpressionRunUpdate(iRun, evSetup);
2245 if (!(m_l1GtUtils.availableL1Configuration(errorCode, l1ConfCode))) {
2247 m_validL1Configuration =
false;
2251 m_validL1Configuration =
true;
2252 m_l1ConfCode = l1ConfCode;
2265 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2269 const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2271 if (!m_expBitsTechTrigger) {
2272 const bool triggerInMenu = m_l1GtUtils.l1AlgoTechTrigBitNumber(
2273 trigNameOrAlias, trigCategory, bitNumber);
2275 (m_expL1Triggers[iTrig]).tokenNumber = bitNumber;
2276 m_expTriggerCategory[iTrig] = trigCategory;
2277 m_expTriggerInMenu[iTrig] = triggerInMenu;
2285 bitNumber = (m_expL1Triggers[iTrig]).tokenNumber;
2287 const bool triggerInMenu = m_l1GtUtils.l1TriggerNameFromBit(
2288 bitNumber, trigCategory, aliasL1Trigger, nameL1Trigger);
2290 if (!triggerInMenu) {
2291 aliasL1Trigger =
"Technical_trigger_bit_"
2292 + (m_expL1Triggers[iTrig]).tokenName +
"_empty";
2295 (m_expL1Triggers[iTrig]).tokenName = aliasL1Trigger;
2296 m_expTriggerCategory[iTrig] = trigCategory;
2297 m_expTriggerInMenu[iTrig] = triggerInMenu;
2301 (m_decisionsBeforeMask[iTrig]).
first = aliasL1Trigger;
2302 (m_decisionsAfterMask[iTrig]).
first = aliasL1Trigger;
2303 (m_prescaleFactors[iTrig]).
first = aliasL1Trigger;
2304 (m_triggerMasks[iTrig]).
first = aliasL1Trigger;
2305 (m_errorCodes[iTrig]).
first = aliasL1Trigger;
2317 if (!m_l1ResultsAlreadyCalled) {
2319 <<
"\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2323 return m_decisionsBeforeMask;
2330 if (!m_l1ResultsAlreadyCalled) {
2332 <<
"\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2336 return m_decisionsAfterMask;
2343 if (!m_l1ResultsAlreadyCalled) {
2345 <<
"\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2349 return m_prescaleFactors;
2356 if (!m_l1ResultsAlreadyCalled) {
2358 <<
"\n Method 'errorCodes' must be called in the event loop before attempting to use this method.\n"
2362 return m_triggerMasks;
2369 m_l1ResultsAlreadyCalled =
false;
2372 if (!m_validL1Configuration) {
2373 reset(m_decisionsBeforeMask);
2374 reset(m_decisionsAfterMask);
2375 reset(m_prescaleFactors);
2376 reset(m_triggerMasks);
2377 reset(m_errorCodes);
2379 m_l1ResultsAlreadyCalled =
true;
2380 return m_errorCodes;
2386 m_l1ResultsAlreadyCalled =
true;
2388 return m_errorCodes;
2393 const std::vector<std::pair<std::string, bool> >& _pairVector)
const {
2394 std::vector<std::pair<std::string, bool> > pairVector = _pairVector;
2395 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2396 (pairVector[iTrig]).
second =
false;
2401 const std::vector<std::pair<std::string, int> >& _pairVector)
const {
2402 std::vector<std::pair<std::string, int> > pairVector = _pairVector;
2403 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2404 (pairVector[iTrig]).
second = -1;
2411 reset(m_decisionsBeforeMask);
2412 reset(m_decisionsAfterMask);
2413 reset(m_prescaleFactors);
2414 reset(m_triggerMasks);
2415 reset(m_errorCodes);
2418 bool decisionBeforeMaskValue =
false;
2419 bool decisionAfterMaskValue =
false;
2420 int prescaleFactorValue = -1;
2421 int triggerMaskValue = -1;
2424 LogDebug(
"L1GtUtils") << std::endl;
2425 LogTrace(
"L1GtUtils") <<
"\nLogical expression\n " << m_logicalExpression
2430 for (
size_t iTrig = 0; iTrig < m_expL1TriggersSize; ++iTrig) {
2432 const std::string& trigNameOrAlias = (m_expL1Triggers[iTrig]).tokenName;
2434 if (m_expTriggerInMenu[iTrig]) {
2435 errorCode = m_l1GtUtils.l1Results(iEvent, trigNameOrAlias,
2436 decisionBeforeMaskValue, decisionAfterMaskValue,
2437 prescaleFactorValue, triggerMaskValue);
2439 if (errorCode != 0) {
2444 decisionBeforeMaskValue =
false;
2445 decisionAfterMaskValue =
false;
2446 prescaleFactorValue = -1;
2447 triggerMaskValue = -1;
2455 decisionBeforeMaskValue =
false;
2456 decisionAfterMaskValue =
false;
2457 prescaleFactorValue = -1;
2458 triggerMaskValue = -1;
2459 errorCode = m_l1ConfCode + 1;
2463 LogTrace(
"L1GtUtils") <<
"\n" << trigNameOrAlias <<
":" << std::endl;
2465 (m_decisionsBeforeMask[iTrig]).
second = decisionBeforeMaskValue;
2466 LogTrace(
"L1GtUtils") <<
" decision before mask = "
2467 << decisionBeforeMaskValue << std::endl;
2469 (m_decisionsAfterMask[iTrig]).
second = decisionAfterMaskValue;
2470 LogTrace(
"L1GtUtils") <<
" decision after mask = "
2471 << decisionAfterMaskValue << std::endl;
2473 (m_prescaleFactors[iTrig]).
second = prescaleFactorValue;
2474 LogTrace(
"L1GtUtils") <<
" prescale factor = "
2475 << prescaleFactorValue << std::endl;
2477 (m_triggerMasks[iTrig]).
second = triggerMaskValue;
2478 LogTrace(
"L1GtUtils") <<
" trigger mask = "
2479 << triggerMaskValue << std::endl;
2481 (m_errorCodes[iTrig]).
second = errorCode;
2482 LogTrace(
"L1GtUtils") <<
" error code = " << errorCode
2487 LogDebug(
"L1GtUtils") << std::endl;
bool m_retrieveL1GtTriggerMenuLite
virtual char const * what() const
edm::RunID m_runIDCache
run cache ID
static AlgebraicMatrix initialize()
const bool l1TriggerNameFromBit(const int &bitNumber, const TriggerCategory &trigCategory, std::string &aliasL1Trigger, std::string &nameL1Trigger) const
void l1Results(const edm::Event &iEvent)
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 &)
const L1GtTriggerMenuLite * ptrL1GtTriggerMenuLite(int &errorCode)
return a pointer to the L1GtTriggerMenuLite product
const std::vector< unsigned int > * m_triggerMaskTechTrig
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual std::string explainSelf() const
const L1GtTriggerMask * m_l1GtTmVetoTech
const bool l1AlgoTechTrigBitNumber(const std::string &nameAlgoTechTrig, TriggerCategory &trigCategory, int &bitNumber) const
const int prescaleFactorSetIndex(const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode) const
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrigLite
virtual ~L1GtUtils()
destructor
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks & veto masks
const AlgorithmMap * m_algorithmMap
const std::vector< std::pair< std::string, int > > & prescaleFactors()
const bool decision(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
Run const & getRun() const
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::string & l1TriggerMenu() const
return the L1 trigger menu name
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmAliasMapLite
U second(std::pair< T, U > const &p)
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmMapLite
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
unsigned long long m_l1GtTmVetoTechCacheID
const std::vector< std::pair< std::string, bool > > & decisionsAfterMask()
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
const std::vector< std::pair< std::string, bool > > & decisionsBeforeMask()
const std::string & l1TriggerMenuImplementation() const
return the L1 trigger menu implementation
const AlgorithmMap * m_algorithmAliasMap
std::vector< OperandToken > & operandTokenVector()
return the vector of operand tokens
unsigned long long m_l1GtTmTechCacheID
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrigLite
const L1GtTriggerMask * m_l1GtTmVetoAlgo
std::vector< bool > DecisionWord
typedefs
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static const std::string EmptyString
const std::string triggerCategory(const TriggerCategory &) const
public methods
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
unsigned long long m_l1GtTmAlgoCacheID
unsigned int m_numberTechnicalTriggers
number of technical triggers
const int l1Results(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
unsigned int m_physicsDaqPartition
index of physics DAQ partition
unsigned int m_numberAlgorithmTriggers
number of algorithm triggers
const int triggerMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
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 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 std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
void reset(const std::vector< std::pair< std::string, bool > > &) const
reset for each L1 trigger the value from pair.second
T const * product() const
const L1GtPrescaleFactors * m_l1GtPfTech
const AlgorithmMap * m_technicalTriggerMap
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
T const * product() const
std::unique_ptr< L1GtUtilsHelper > m_l1GtUtilsHelper
const std::vector< unsigned int > * m_triggerMaskTechTrigLite
static const bool useL1GtTriggerMenuLite(true)
RunAuxiliary const & runAuxiliary() const
const std::vector< unsigned int > * m_triggerMaskAlgoTrigLite
bool m_beginRunCache
flag for call of getL1GtRunCache in beginRun
const bool trigResult(const DecisionWord &decWord, const int bitNumber, const std::string &nameAlgoTechTrig, const TriggerCategory &trigCategory, 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
const L1GtTriggerMenu * m_l1GtMenu
~LogicalExpressionL1Results()
destructor
unsigned long long m_l1GtPfTechCacheID
static const int L1GtNotValidError
volatile std::atomic< bool > shutdown_flag false
unsigned long long m_l1GtTmVetoAlgoCacheID
std::vector< int > m_prescaleFactorSet
const L1GtTriggerMenu * ptrL1TriggerMenuEventSetup(int &errorCode)
return a pointer to the L1 trigger menu from event setup
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
void reset(double vett[256])
unsigned long long m_l1GtStableParCacheID
const L1GtTriggerMenuLite::L1TriggerMap * m_technicalTriggerMapLite
static const bool useL1EventSetup(true)
const std::vector< unsigned int > * m_triggerMaskVetoTechTrig
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 &)
const int prescaleFactor(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger