File indexing completed on 2023-03-17 10:50:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h"
0017
0018
0019
0020 #include <algorithm>
0021
0022
0023
0024 #include "DataFormats/L1GlobalTrigger/interface/L1GtLogicParser.h"
0025
0026 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0027
0028
0029
0030
0031
0032
0033 const L1GlobalTriggerObjectMap* L1GlobalTriggerObjectMapRecord::getObjectMap(const std::string& algoNameVal) const {
0034 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itObj = m_gtObjectMap.begin();
0035 itObj != m_gtObjectMap.end();
0036 ++itObj) {
0037 if (itObj->algoName() == algoNameVal) {
0038 return &((*itObj));
0039 }
0040 }
0041
0042
0043 edm::LogError("L1GlobalTriggerObjectMapRecord")
0044 << " ERROR: The requested algorithm name = " << algoNameVal << " does not exist in the trigger menu."
0045 << " Returning zero pointer for getObjectMap." << std::endl;
0046
0047 return nullptr;
0048 }
0049
0050
0051 const L1GlobalTriggerObjectMap* L1GlobalTriggerObjectMapRecord::getObjectMap(const int algoBitNumberVal) const {
0052 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itObj = m_gtObjectMap.begin();
0053 itObj != m_gtObjectMap.end();
0054 ++itObj) {
0055 if (itObj->algoBitNumber() == algoBitNumberVal) {
0056 return &((*itObj));
0057 }
0058 }
0059
0060
0061 edm::LogError("L1GlobalTriggerObjectMapRecord")
0062 << " ERROR: The requested algorithm with bit number = " << algoBitNumberVal
0063 << " does not exist in the trigger menu."
0064 << " Returning zero pointer for getObjectMap." << std::endl;
0065
0066 return nullptr;
0067 }
0068
0069
0070
0071 const CombinationsInCond* L1GlobalTriggerObjectMapRecord::getCombinationsInCond(const std::string& algoNameVal,
0072 const std::string& condNameVal) const {
0073 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itObj = m_gtObjectMap.begin();
0074 itObj != m_gtObjectMap.end();
0075 ++itObj) {
0076 if (itObj->algoName() == algoNameVal) {
0077 return itObj->getCombinationsInCond(condNameVal);
0078 }
0079 }
0080
0081
0082 edm::LogError("L1GlobalTriggerObjectMapRecord")
0083 << " ERROR: The requested (algorithm name, condition name) = (" << algoNameVal << ", " << condNameVal
0084 << ") does not exist in the trigger menu."
0085 << " Returning zero pointer for getCombinationsInCond." << std::endl;
0086
0087 return nullptr;
0088 }
0089
0090
0091
0092 const CombinationsInCond* L1GlobalTriggerObjectMapRecord::getCombinationsInCond(const int algoBitNumberVal,
0093 const std::string& condNameVal) const {
0094 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itObj = m_gtObjectMap.begin();
0095 itObj != m_gtObjectMap.end();
0096 ++itObj) {
0097 if (itObj->algoBitNumber() == algoBitNumberVal) {
0098 return itObj->getCombinationsInCond(condNameVal);
0099 }
0100 }
0101
0102
0103 edm::LogError("L1GlobalTriggerObjectMapRecord")
0104 << " ERROR: The requested (algorithm bit number, condition name) = (" << algoBitNumberVal << ", " << condNameVal
0105 << ") does not exist in the trigger menu."
0106 << " Returning zero pointer for getCombinationsInCond." << std::endl;
0107
0108 return nullptr;
0109 }
0110
0111
0112
0113 bool L1GlobalTriggerObjectMapRecord::getConditionResult(const std::string& algoNameVal,
0114 const std::string& condNameVal) const {
0115 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itObj = m_gtObjectMap.begin();
0116 itObj != m_gtObjectMap.end();
0117 ++itObj) {
0118 if (itObj->algoName() == algoNameVal) {
0119 return itObj->getConditionResult(condNameVal);
0120 }
0121 }
0122
0123
0124 edm::LogError("L1GlobalTriggerObjectMapRecord")
0125 << " ERROR: The requested (algorithm name, condition name) = (" << algoNameVal << ", " << condNameVal
0126 << ") does not exist in the trigger menu."
0127 << " Returning false for condition result! Unknown result, in fact!" << std::endl;
0128
0129 return false;
0130 }
0131
0132
0133
0134 bool L1GlobalTriggerObjectMapRecord::getConditionResult(const int algoBitNumberVal,
0135 const std::string& condNameVal) const {
0136 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator itObj = m_gtObjectMap.begin();
0137 itObj != m_gtObjectMap.end();
0138 ++itObj) {
0139 if (itObj->algoBitNumber() == algoBitNumberVal) {
0140 return itObj->getConditionResult(condNameVal);
0141 }
0142 }
0143
0144
0145 edm::LogError("L1GlobalTriggerObjectMapRecord")
0146 << " ERROR: The requested (algorithm bit number, condition name) = (" << algoBitNumberVal << ", " << condNameVal
0147 << ") does not exist in the trigger menu."
0148 << " Returning false for condition result! Unknown result, in fact!" << std::endl;
0149
0150 return false;
0151 }