ATLAS Offline Software
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>
10 #include "TrigNavStructure/Types.h"
11 
12 namespace HLT {
13  class TriggerElement;
14  typedef std::vector<HLT::TriggerElement*> TEVec;
15 
16  class TrigNavStructure;
17 
18 
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 
56  virtual ComboIteratorBase& operator++() = 0;
57 
58  };
59 
60 
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 
101  ComboIterator& operator++(int) { return operator++(); }
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 
149  bool m_valid;
150 
153  };
154 
155 
156 
157 
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 
HLT::ComboIterator::operator++
ComboIterator & operator++()
Pre increment operator.
Definition: ComboIterator.cxx:58
HLT::ComboIterator::print
void print() const
Debug dump to std::cout.
Definition: ComboIterator.cxx:170
HLT::ComboIterator::invalidate
void invalidate()
Method used to invalidate the current combination.
Definition: ComboIterator.cxx:189
HLT::ComboIterator::m_nav
const TrigNavStructure * m_nav
Pointer to the navigation service.
Definition: ComboIterator.h:152
HLT::ComboIteratorTopo
Definition: ComboIterator.h:173
HLT::ComboIterator::combination
TEVec & combination()
Accessor method for the current combination.
Definition: ComboIterator.h:98
HLT::ComboIterator::m_comb
TEVec m_comb
Current combination of TEs.
Definition: ComboIterator.h:140
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
HLT::ComboIterator::incrementByOne
bool incrementByOne(int pos, bool &ok)
Private increment method.
Definition: ComboIterator.cxx:80
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
HLT::ComboIterator::reset
bool reset(int pos)
Private reset method.
Definition: ComboIterator.cxx:117
HLT::ComboIteratorTopo::ComboIteratorTopo
ComboIteratorTopo(const std::vector< TEVec > &tes, const TrigNavStructure *nav, HLT::te_id_type topoSpan)
Definition: ComboIterator.cxx:199
HLT::ComboIteratorBase::operator*
virtual TEVec & operator*()=0
Unary * operator, used to recover the current combination.
HLT::ComboIteratorBase::~ComboIteratorBase
virtual ~ComboIteratorBase()
Destructor.
Definition: ComboIterator.h:36
HLT::TrigNavStructure
Definition: TrigNavStructure.h:40
HLT::ComboIterator::increment
bool increment(int pos)
Private increment method.
Definition: ComboIterator.cxx:69
HLT::ComboIteratorBase::isValid
virtual bool isValid() const =0
Validity check for the iterator.
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
HLT::ComboIteratorTopo::traverseUntilSeedsTopo
void traverseUntilSeedsTopo(const TriggerElement *start, std::set< const TriggerElement * > &topos) const
Definition: ComboIterator.cxx:206
HLT::TriggerElement
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:27
Types.h
HLT::ComboIteratorBase::ComboIteratorBase
ComboIteratorBase()
Constructor.
Definition: ComboIterator.h:33
HLT::ComboIteratorTopo::overlaps
virtual bool overlaps(const TriggerElement *t1, const TriggerElement *t2) const
Method used to test overlaps between two TEs.
Definition: ComboIterator.cxx:228
HLT::ComboIterator
Iterator used to loop over multi-particle combinations.
Definition: ComboIterator.h:74
HLT::ComboIteratorBase::operator++
virtual ComboIteratorBase & operator++(int)=0
Post increment operator.
HLT::TEVec
std::vector< HLT::TriggerElement * > TEVec
Definition: ComboIterator.h:13
HLT::ComboIterator::operator*
TEVec & operator*()
Unary * operator, used to recover the current combination.
Definition: ComboIterator.h:90
HLT::ComboIterator::overlaps
virtual bool overlaps(const TriggerElement *t1, const TriggerElement *t2) const
Method used to test overlaps between two TEs.
Definition: ComboIterator.cxx:160
HLT::ComboIteratorBase::operator++
virtual ComboIteratorBase & operator++()=0
Pre increment operator.
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
HLT::ComboIterator::m_tes
std::vector< TEVec > m_tes
Vector of vectors of TEs to be combined.
Definition: ComboIterator.h:146
HLT::ComboIterator::m_valid
bool m_valid
Validity status variable.
Definition: ComboIterator.h:149
HLT::ComboIterator::ComboIterator
ComboIterator(const std::vector< TEVec > &tes, const TrigNavStructure *nav)
Constructor; gets a vector of TE vectors and a pointer to Navigation as arguments.
Definition: ComboIterator.cxx:15
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
HLT::ComboIterator::m_idx
std::vector< int > m_idx
Vector of indexes keeping track of the loop over combinations.
Definition: ComboIterator.h:143
HLT::ComboIteratorBase::rewind
virtual bool rewind()=0
Rewind method, resetting the iterator to the first element.
HLT::ComboIterator::operator++
ComboIterator & operator++(int)
Post increment operator.
Definition: ComboIterator.h:101
HLT::ComboIteratorBase::combination
virtual TEVec & combination()=0
Accessor method for the current combination.
HLT::ComboIteratorTopo::m_spanId
HLT::te_id_type m_spanId
Definition: ComboIterator.h:183
HLT::ComboIterator::rewind
bool rewind()
Rewind method, resetting the iterator to the first element.
Definition: ComboIterator.cxx:27
HLT::ComboIterator::isValid
bool isValid() const
Validity check for the iterator.
Definition: ComboIterator.h:95
HLT::ComboIteratorBase
Base class for iterator used to loop over multi-particle combinations.
Definition: ComboIterator.h:28
HLT::te_id_type
uint32_t te_id_type
Definition: Trigger/TrigEvent/TrigNavStructure/TrigNavStructure/Types.h:11