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