ATLAS Offline Software
TileRawRoISelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 
9 // Implementation of const_iterator
10 
11 // constructor
13 (const VEC_ITPAIR* v)
14  : m_vec_itpair(v),
15  m_pair_it (v->begin())
16 {
17  if(m_pair_it != v->end()){
18  m_obj_it = (*m_pair_it).first ;
19  m_obj_it_end = (*m_pair_it).second ;
20  }
21 }
22 
23 // constructor for end iterator
25 (const VEC_ITPAIR* v, const ITPAIR_IT& it)
26  : m_vec_itpair(v),
27  m_pair_it (it)
28 {
29 }
30 
32 ()
33 {
34  m_vec_itpair = NULL ;
35  return;
36 }
37 
38 
39 // ++ operator
42 {
43  ++m_obj_it;
44  if(m_obj_it == m_obj_it_end) {
45  // end of this RoI, get next RoI
46  ++m_pair_it;
47  if(m_pair_it != m_vec_itpair->end() )
48  {
49  m_obj_it = (*m_pair_it).first;
50  m_obj_it_end = (*m_pair_it).second;
51  }
52  }
53 
54  return *this;
55 }
56 
57 
58 // ++ operator
61 {
62  const_iterator tmp = *this;
63  ++tmp;
64  return tmp;
65 }
66 
67 
68 // != operator
69 bool
70 TileRawRoISelector::const_iterator:: operator !=
71  ( const TileRawRoISelector::const_iterator & it ) const
72 {
73  // compare m_pair_it first because for end, m_pair_it is end.
74  if(it.m_pair_it == it.m_vec_itpair->end() )
75  { return m_pair_it != it.m_pair_it ;
76  } else
77  return
78  m_pair_it != it.m_pair_it ||
79  m_obj_it != it.m_obj_it ||
80  m_obj_it_end != it.m_obj_it_end ||
81  m_vec_itpair != it.m_vec_itpair ;
82 
83 }
84 
85 // == operator
86 bool
87 TileRawRoISelector::const_iterator:: operator ==
88  ( const TileRawRoISelector::const_iterator & it ) const
89 {
90  // compare m_map_it first because for end, m_map_it is end.
91 
92  // if m_pair_it is end, only compare the pair iterator
93  if(m_pair_it == m_vec_itpair->end() )
94  return m_pair_it == it.m_pair_it ;
95 
96  return
97  m_pair_it == it.m_pair_it &&
98  m_obj_it == it.m_obj_it &&
99  m_obj_it_end == it.m_obj_it_end &&
100  m_vec_itpair == it.m_vec_itpair ;
101 }
102 
103 
104 // == operator
107 {
108  return *m_obj_it;
109 }
110 /*************** Implementation of TileRawRoISelector
111 *
112 */
113 
114 // Constructor
117 m_roiMap(m),
118 m_container(c)
119 {
120 
121 }
122 
123 
124 // set methods
126  m_roiMap = m;
127 }
128 
129 
131  m_container = c;
132 }
133 
134 /*
135 void TileRawRoISelector :: setRoIs( const VEC_TT_ID& ids)
136 {
137 
138  // clean it up.
139  if(m_vecItPair.size() > 0 ) {
140  m_vecItPair.erase(m_vecItPair.begin(), m_vecItPair.end());
141  }
142 
143  TT_ID_IT it = ids.begin();
144  TT_ID_IT it_end = ids.end() ;
145 
146  for(; it!=it_end; ++it){
147  //
148  const TT_ID& rId = (*it);
149  std::vector<COLL_ID> cIDs = m_roiMap->CollectionID(rId);
150  std::vector<COLL_ID>::const_iterator cId_it = cIDs.begin();
151  std::vector<COLL_ID>::const_iterator cId_it_end = cIDs.end();
152  for(; cId_it!=cId_it_end;++cId_it){
153  const COLL_ID& cId = (*cId_it);
154  CONTAINER::const_iterator coll_it = m_container->find(cId);
155  if(coll_it!=m_container->end()){
156  // Collection exist
157  const COLLECTION* coll = (*coll_it);
158  OBJ_IT b;
159  OBJ_IT e;
160  coll->getTT(rId,b,e);
161  if(b!=e){
162  m_vecItPair.push_back(ITPAIR(b,e) ) ;
163  }
164  }
165  }
166  }
167 
168 
169 }
170 */
171 
174 {
175  return const_iterator(&m_vecItPair);
176 }
177 
180 {
181  return const_iterator(&m_vecItPair, m_vecItPair.end() );
182 }
TileRawChannelContainer
Definition: TileRawChannelContainer.h:13
TileRawRoISelector::setContainer
void setContainer(TileRawChannelContainer *c)
Definition: TileRawRoISelector.cxx:130
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TileRawRoISelector::const_iterator::operator*
const OBJECT * operator*()
Definition: TileRawRoISelector.cxx:106
TileRawRoISelector::TileRawRoISelector
TileRawRoISelector(TileRoI_Map *map=NULL, TileRawChannelContainer *c=NULL)
Definition: TileRawRoISelector.cxx:115
TileRawRoISelector::const_iterator::m_obj_it_end
OBJ_IT m_obj_it_end
Definition: TileRawRoISelector.h:78
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TileRawRoISelector::const_iterator::m_obj_it
OBJ_IT m_obj_it
Definition: TileRawRoISelector.h:77
TileRawRoISelector::const_iterator::const_iterator
const_iterator()
Definition: TileRawRoISelector.cxx:32
TileRawRoISelector::begin
const_iterator begin() const
Definition: TileRawRoISelector.cxx:173
TileRawRoISelector::const_iterator
friend class const_iterator
Definition: TileRawRoISelector.h:82
TileRawChannel
Definition: TileRawChannel.h:35
TileRawRoISelector.h
TileRawRoISelector::ITPAIR_IT
VEC_ITPAIR::const_iterator ITPAIR_IT
Definition: TileRawRoISelector.h:47
TileRawRoISelector::m_container
TileRawChannelContainer * m_container
Definition: TileRawRoISelector.h:100
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
TileRawRoISelector::VEC_ITPAIR
std::vector< ITPAIR > VEC_ITPAIR
Definition: TileRawRoISelector.h:46
TileRawRoISelector::m_vecItPair
VEC_ITPAIR m_vecItPair
Definition: TileRawRoISelector.h:102
TileRawRoISelector::setMap
void setMap(TileRoI_Map *map)
Definition: TileRawRoISelector.cxx:125
python.PyAthena.v
v
Definition: PyAthena.py:154
TileRoI_Map.h
TileRawRoISelector::end
const_iterator end() const
Definition: TileRawRoISelector.cxx:179
TileRawRoISelector::const_iterator::m_pair_it
ITPAIR_IT m_pair_it
Definition: TileRawRoISelector.h:76
TileRawRoISelector::const_iterator::operator++
const_iterator & operator++()
Definition: TileRawRoISelector.cxx:41
TileRawRoISelector::m_roiMap
TileRoI_Map * m_roiMap
Definition: TileRawRoISelector.h:99
python.compressB64.c
def c
Definition: compressB64.py:93
TileRoI_Map
TileCal RoI map to offline Identifier.
Definition: TileRoI_Map.h:32
TileRawRoISelector::const_iterator
Definition: TileRawRoISelector.h:55