ATLAS Offline Software
Loading...
Searching...
No Matches
ComboIterator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGNAVSTRUCTURE_ComboIterator_H
6#define TRIGNAVSTRUCTURE_ComboIterator_H
7
8#include <vector>
9#include <set>
11
12namespace HLT {
13 class TriggerElement;
14 typedef std::vector<HLT::TriggerElement*> TEVec;
15
16 class TrigNavStructure;
17
18
27
29
30 public:
31
34
36 virtual ~ComboIteratorBase() {}
37
39 virtual bool rewind() = 0;
40
42 virtual TEVec& operator*() = 0;
43
47 virtual bool isValid() const = 0;
48
50 virtual TEVec& combination() = 0;
51
53 virtual ComboIteratorBase& operator++(int) = 0;
54
57
58 };
59
60
73
75
76 public:
84 ComboIterator(const std::vector<TEVec>& tes, const TrigNavStructure* nav);
85
87 bool rewind();
88
90 TEVec& operator*() { return combination(); }
91
95 bool isValid() const { return m_valid; }
96
98 TEVec& combination() { return m_comb; }
99
102
105
106 protected:
107
113 virtual bool overlaps(const TriggerElement* t1, const TriggerElement* t2) const;
114
121 bool overlaps(const TriggerElement* t1,
122 const TEVec& teVec, int idx = -1) const;
123
125 bool incrementByOne(int pos, bool& ok);
126
128 bool increment (int pos);
129
131 bool reset (int pos);
132
134 void invalidate();
135
137 void print() const;
138
141
143 std::vector<int> m_idx;
144
146 std::vector<TEVec> m_tes;
147
150
153 };
154
155
156
157
172
174 public:
175 ComboIteratorTopo(const std::vector<TEVec>& tes, const TrigNavStructure* nav, HLT::te_id_type topoSpan);
176
177 protected:
178 // on top of same RoI adds check if TEs are span by the topological TE of give id
179 // think ... is not combination which was ever (sucesfullly) considered by topo algorithm
180 virtual bool overlaps(const TriggerElement* t1, const TriggerElement* t2) const;
181 private:
182 void traverseUntilSeedsTopo(const TriggerElement* start, std::set<const TriggerElement*>& topos) const;
184
185 };
186
187} // eof namespace
188
189#endif //#ifndef
190
191
virtual ~ComboIteratorBase()
Destructor.
virtual bool rewind()=0
Rewind method, resetting the iterator to the first element.
virtual bool isValid() const =0
Validity check for the iterator.
virtual ComboIteratorBase & operator++(int)=0
Post increment operator.
virtual ComboIteratorBase & operator++()=0
Pre increment operator.
virtual TEVec & operator*()=0
Unary * operator, used to recover the current combination.
ComboIteratorBase()
Constructor.
virtual TEVec & combination()=0
Accessor method for the current combination.
HLT::te_id_type m_spanId
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 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 isValid() const
Validity check for the iterator.
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.
TEVec & combination()
Accessor method for the current combination.
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.
ComboIterator & operator++(int)
Post increment operator.
TEVec & operator*()
Unary * operator, used to recover the current combination.
bool increment(int pos)
Private increment method.
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
const std::string reset
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
std::vector< HLT::TriggerElement * > TEVec