20 for (
unsigned int i = 0; i < tes.size(); i++)
21 m_tes.push_back(tes[i]);
34 for (
unsigned int i = 0; i <
m_tes.size(); i++) {
36 if (
m_tes[i].size() == 0) {
84 if (pos >= (
int)
m_comb.size() || pos < 0)
return false;
89 if (
m_idx[pos] == (
int)
m_tes[pos].size() - 1) {
92 if (pos == 0)
return false;
98 if (!
reset(pos))
return false;
121 if (pos >= (
int)
m_comb.size() || pos < 0)
return false;
130 for (
unsigned int j = pos; j > 0; j--) {
132 if (!
m_comb[j - 1])
continue;
135 if (
m_comb[j - 1]->getId() ==
m_tes[pos][0]->getId()) {
147 const TEVec& teVec,
int idx)
const
149 if (idx < 0) idx = teVec.size();
151 for (
int i = 0; i < idx; i++) {
152 if (!teVec[i])
return false;
153 if (
overlaps(te1, teVec[i]))
return true;
163 if (te1 == te2)
return true;
164 if (
m_nav &&
m_nav->haveCommonRoI(te1, te2))
return true;
173 cout <<
"TEs:" << endl;
175 for (
unsigned int i = 0; i <
m_tes.size(); i++) {
177 for (
unsigned int j = 0; j <
m_tes[i].size(); j++) cout <<
m_tes[i][j] <<
" ";
180 cout <<
"}" << endl << endl <<
"Comb = [ ";
181 for (
unsigned int i = 0; i <
m_comb.size(); i++) cout <<
m_comb[i] <<
" ";
182 cout <<
"]" << endl <<
"Idxs = [ ";
183 for (
unsigned int i = 0; i <
m_idx.size(); i++) cout <<
m_idx[i] <<
" ";
185 cout << (
isValid() ?
"Valid" :
"Invalid") << endl << endl;
209 for (
auto successor : successors ) {
210 if ( successor->getActiveState() ==
true and successor->getId() ==
m_spanId ) {
211 topos.insert(successor);
214 if ( not topos.empty() )
219 for (
auto predecessor : predecessors ) {
223 if ( not topos.empty() )
234 std::set<const TriggerElement*> te1span;
236 if ( te1span.empty() )
239 std::set<const TriggerElement*> te2span;
241 if ( te2span.empty() )
251 std::set_intersection(te1span.begin(), te1span.end(), te2span.begin(), te2span.end(),
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
virtual bool overlaps(const TriggerElement *t1, const TriggerElement *t2) const
Method used to test overlaps between two TEs.
ComboIteratorTopo(const std::vector< TEVec > &tes, const TrigNavStructure *nav, HLT::te_id_type topoSpan)
void traverseUntilSeedsTopo(const TriggerElement *start, std::set< const TriggerElement * > &topos) const
Iterator used to loop over multi-particle combinations.
std::vector< TEVec > m_tes
Vector of vectors of TEs to be combined.
const TrigNavStructure * m_nav
Pointer to the navigation service.
void invalidate()
Method used to invalidate the current combination.
bool reset(int pos)
Private reset method.
bool m_valid
Validity status variable.
bool incrementByOne(int pos, bool &ok)
Private increment method.
ComboIterator(const std::vector< TEVec > &tes, const TrigNavStructure *nav)
Constructor; gets a vector of TE vectors and a pointer to Navigation as arguments.
bool rewind()
Rewind method, resetting the iterator to the first element.
TEVec m_comb
Current combination of TEs.
std::vector< int > m_idx
Vector of indexes keeping track of the loop over combinations.
virtual bool overlaps(const TriggerElement *t1, const TriggerElement *t2) const
Method used to test overlaps between two TEs.
ComboIterator & operator++()
Pre increment operator.
void print() const
Debug dump to std::cout.
bool increment(int pos)
Private increment method.
static const std::vector< TriggerElement * > & getDirectPredecessors(const TriggerElement *te)
returns list of direct predecessors (nodes seeding me)
static const std::vector< TriggerElement * > & getDirectSuccessors(const TriggerElement *te)
returns list of direct predecessors (nodes I seed)
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
std::vector< HLT::TriggerElement * > TEVec