ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypo
src
ProductGen.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#include "
./ProductGen.h
"
7
8
9
ProductGen::ProductGen
() {}
10
11
ProductGen::ProductGen
(
const
std::vector<std::size_t>& ends):
12
m_ends
(ends),
m_counters
(ends.size(), 0),
m_ncounters
(ends.size()){
13
14
if
(!
m_ends
.empty()){
15
m_done = false;
16
for(auto& i : m_ends){
17
if(i < 1) {
18
m_done = true;
19
break;
20
} else {
21
i -= 1;
22
}
23
}
24
}
25
26
}
27
28
29
std::vector<std::size_t>
ProductGen::next
() {
30
31
if
(
m_done
){
return
std::vector<std::size_t>();}
32
33
auto
result
= std::vector<std::size_t>(
m_counters
);
34
m_done
=
atEnd
();
35
for
(std::size_t i = 0; i <
m_ncounters
; ++i){
36
37
if
(
m_counters
[i] ==
m_ends
[i]){
38
m_counters
[i] = 0;
39
}
else
{
40
m_counters
[i] += 1;
41
break
;
42
}
43
}
44
return
result
;
45
}
ProductGen.h
ProductGen::ProductGen
ProductGen()
Definition
ProductGen.cxx:9
ProductGen::m_done
bool m_done
Definition
ProductGen.h:25
ProductGen::m_ncounters
std::size_t m_ncounters
Definition
ProductGen.h:24
ProductGen::next
std::vector< std::size_t > next()
Definition
ProductGen.cxx:29
ProductGen::m_counters
std::vector< std::size_t > m_counters
Definition
ProductGen.h:23
ProductGen::m_ends
std::vector< std::size_t > m_ends
Definition
ProductGen.h:22
ProductGen::atEnd
bool atEnd()
Definition
ProductGen.h:26
result
Generated on
for ATLAS Offline Software by
1.14.0