44 ex <<
"algorithmBitNumber not found";
45 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::algorithmResult");
48 return i->algorithmResult();
52 int algorithmBitNumber, std::vector<L1GtLogicParser::OperandToken>& operandTokenVector)
const {
53 unsigned startIndex = 0;
54 unsigned endIndex = 0;
57 unsigned length = endIndex - startIndex;
58 if (length != operandTokenVector.size()) {
60 ex <<
"operand token vector size does not match number of conditions";
61 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::updateOperandTokenVector");
65 for (
unsigned i = 0;
i < length; ++
i) {
71 algorithmBitNumbers.clear();
75 algorithmBitNumbers.push_back(
i->algorithmBitNumber());
80 unsigned startIndex = 0;
81 unsigned endIndex = 0;
83 return endIndex - startIndex;
87 int algorithmBitNumber)
const {
88 unsigned startIndex = 0;
89 unsigned endIndex = 0;
95 int algorithmBitNumber,
unsigned conditionNumber)
const {
96 unsigned startIndex = 0;
97 unsigned endIndex = 0;
100 if (endIndex <= startIndex + conditionNumber) {
102 ex <<
"Condition number is out of range";
103 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::getCombinationsInCondition");
108 unsigned nextConditionIndex = startIndex + conditionNumber + 1
U;
112 unsigned beginObjectIndex =
m_conditionResults[startIndex + conditionNumber].startIndexOfCombinations();
113 unsigned short nObjectsPerCombination =
m_conditionResults[startIndex + conditionNumber].nObjectsPerCombination();
115 if (endObjectIndex == beginObjectIndex) {
118 if (endObjectIndex < beginObjectIndex ||
m_combinations.size() < endObjectIndex || nObjectsPerCombination == 0 ||
119 (endObjectIndex - beginObjectIndex) % nObjectsPerCombination != 0) {
121 ex <<
"Indexes to combinations are invalid";
122 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::getCombinationsInCondition");
126 (endObjectIndex - beginObjectIndex) / nObjectsPerCombination,
127 nObjectsPerCombination);
133 int algorithmBitNumber,
134 bool algorithmResult) {
144 std::vector<AlgorithmResult>::const_iterator
j =
i;
146 if (
j != iEnd && !(*
i < *
j)) {
148 ex <<
"AlgorithmResults should be sorted in increasing order of bit number with no duplicates. It is not.";
149 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::consistencyCheck");
154 if (endIndex < i->startIndexOfConditions()) {
156 ex <<
"startIndexOfConditions decreases or exceeds the size of m_conditionResults";
157 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::consistencyCheck");
164 std::vector<ConditionResult>::const_iterator
j =
i;
166 unsigned endIndex = (
j != iEnd) ?
j->startIndexOfCombinations() :
m_combinations.size();
168 if (endIndex < i->startIndexOfCombinations()) {
170 ex <<
"startIndexOfCombinations decreases or exceeds the size of m_conditionResults";
171 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::consistencyCheck");
174 unsigned length = endIndex -
i->startIndexOfCombinations();
176 if (
i->nObjectsPerCombination() != 0
U) {
178 ex <<
"Length is zero and nObjectsInCombination is not zero";
179 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::consistencyCheck");
183 if (
i->nObjectsPerCombination() == 0 || length %
i->nObjectsPerCombination() != 0) {
185 ex <<
"Size indicated by startIndexOfCombinations is not a multiple of nObjectsInCombination";
186 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::consistencyCheck");
196 unsigned short nObjectsPerCombination,
197 bool conditionResult) {
212 : m_startIndexOfConditions(0), m_algorithmBitNumber(0), m_algorithmResult(
false) {}
215 int algorithmBitNumber,
217 : m_startIndexOfConditions(startIndexOfConditions), m_algorithmResult(
algorithmResult) {
230 ex <<
"algorithmBitNumber out of range of a short int";
231 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::AlgorithmResult::AlgorithmResult");
238 : m_startIndexOfCombinations(0), m_nObjectsPerCombination(0), m_conditionResult(
false) {}
241 unsigned short nObjectsPerCombination,
242 bool conditionResult)
243 : m_startIndexOfCombinations(startIndexOfCombinations),
244 m_nObjectsPerCombination(nObjectsPerCombination),
245 m_conditionResult(conditionResult) {}
248 unsigned nConditions)
254 ex <<
"argument out of range";
255 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::ConditionsInAlgorithm::getConditionResult");
262 unsigned nCombinations,
263 unsigned short nObjectsPerCombination)
264 : m_startOfObjectIndexes(startOfObjectIndexes),
265 m_nCombinations(nCombinations),
266 m_nObjectsPerCombination(nObjectsPerCombination) {}
269 unsigned object)
const {
270 if (combination >= m_nCombinations ||
object >= m_nObjectsPerCombination) {
272 ex <<
"arguments out of range";
273 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::CombinationsInCondition::getObjectIndex");
276 return m_startOfObjectIndexes[combination * m_nObjectsPerCombination +
object];
280 unsigned& startIndex,
281 unsigned& endIndex)
const {
285 if (iAlgo ==
m_algorithmResults.end() || iAlgo->algorithmBitNumber() != algorithmBitNumber) {
287 ex <<
"algorithmBitNumber not found";
288 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::getStartEndIndex");
292 startIndex = iAlgo->startIndexOfConditions();
298 ex <<
"index out of order or out of range";
299 ex.
addContext(
"Calling L1GlobalTriggerObjectMaps::getStartEndIndex");