ATLAS Offline Software
ROBData.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 XAOD_ANALYSIS
6 
7 #ifndef BYTESTREAMDATA_ROBDATA_H
8 #define BYTESTREAMDATA_ROBDATA_H
9 
28 #include "eformat/SourceIdentifier.h"
30 
45 template <typename ROBFragment, typename PointerType>
46 class ROBData_T {
47 
48 public:
50  class iterator;
51 
52 
54  ROBData_T(const ROBFragment* rob);
55 
57  ROBData_T(const ROBData_T& other);
58 
60  ROBData_T();
61 
63  iterator begin(void) const;
64 
66  iterator end(void) const;
67 
70 
72  eformat::SubDetector sub_detector() const;
73 
76 
78  uint32_t no_of_elements() const;
79 
81  const ROBFragment* getROBFragment() const;
82 
83 public:
88  class iterator {
89  private:
96  iterator(const PointerType& it);
97 
98  public:
101 
103  iterator& operator=(const iterator& other);
104 
106  uint32_t operator*(void);
107 
116  iterator& operator+=(const unsigned int& pos);
117 
119  iterator& operator++(void);
120 
122  bool operator!=(const iterator& other) const;
123 
124  private: //Representation
125  friend class ROBData_T<ROBFragment, PointerType>;
127  };
128 
129 private: //Representation
132 };
133 
134 template <class ROBFragment, typename PointerType>
136  m_rob->rod_data(m_data);
137 }
138 
139 template <class ROBFragment, typename PointerType>
141 }
142 
143 template <class ROBFragment, typename PointerType>
146 }
147 
148 template <class ROBFragment, typename PointerType>
150  m_rob = other.m_rob;
151  m_data = other.m_data;
152  return *this;
153 }
154 
155 template <class ROBFragment, typename PointerType>
157  return iterator(m_data);
158 }
159 
160 template <class ROBFragment, typename PointerType>
162  return iterator(m_data + m_rob->rod_ndata());
163 }
164 
165 template <class ROBFragment, typename PointerType>
167  eformat::helper::SourceIdentifier sid(m_rob->rod_source_id());
168  return sid.subdetector_id();
169 }
170 
171 template <class ROBFragment, typename PointerType>
173  // m_data->header()->source_id(); //FIXME: WHY AM I NEEDED?
174  eformat::helper::SourceIdentifier sid(m_rob->rod_source_id());
175  return sid.module_id();
176 }
177 
178 template <class ROBFragment, typename PointerType>
180  return m_rob->rod_ndata();
181 }
182 
183 template <class ROBFragment, typename PointerType>
185  return m_rob;
186 }
187 
188 template <class ROBFragment, typename PointerType>
190 }
191 
192 template <class ROBFragment, typename PointerType>
194  m_it(other.m_it) {
195 }
196 
197 template <class ROBFragment, typename PointerType>
199  m_it = other.m_it;
200  return *this;
201 }
202 
203 template <class ROBFragment, typename PointerType>
205  return *m_it;
206 }
207 
208 template <class ROBFragment, typename PointerType>
210  m_it += pos;
211  return *this;
212 }
213 
214 template <class ROBFragment, typename PointerType>
216  ++m_it;
217  return *this;
218 }
219 
220 template <class ROBFragment, typename PointerType>
222  return m_it != other.m_it;
223 }
224 
226 
227 #endif //BYTESTREAMDATA_ROBDATA_H
228 
229 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ROBData_T::iterator::iterator
iterator(const PointerType &it)
The sole constructor was made private.
Definition: ROBData.h:189
ROBData_T::getROBFragment
const ROBFragment * getROBFragment() const
Return the ROBFragment.
Definition: ROBData.h:184
ROBData_T::iterator::operator*
uint32_t operator*(void)
Dereferencing.
Definition: ROBData.h:204
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ROBData
ROBData_T< OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment, OFFLINE_FRAGMENTS_NAMESPACE::PointerType > ROBData
Definition: ROBData.h:225
m_data
std::vector< T > m_data
Definition: TrackTruthMatchingBaseAlg.cxx:660
ROBData_T::iterator::iterator
iterator(const iterator &other)
Copy Constructor.
ROBData_T
templete data class to wrap ROB fragment for accessing ROD data
Definition: ROBData.h:46
skel.it
it
Definition: skel.GENtoEVGEN.py:396
ROBData_T::module_identifier
uint16_t module_identifier() const
Return the current module identifier.
Definition: ROBData.h:172
ROBData_T::iterator::operator+=
iterator & operator+=(const unsigned int &pos)
winding.
Definition: ROBData.h:209
ROBData_T::iterator::operator!=
bool operator!=(const iterator &other) const
Is not equal.
Definition: ROBData.h:221
ROBData_T::end
iterator end(void) const
Instantiates an iterator over 32-bit integers to the last+1 element.
Definition: ROBData.h:161
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
ROBData_T::begin
iterator begin(void) const
Instantiates an iterator over 32-bit integers to the first element.
Definition: ROBData.h:156
ROBData_T::iterator::operator++
iterator & operator++(void)
Increment.
Definition: ROBData.h:215
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
ROBData_T::m_rob
const ROBFragment * m_rob
daddy
Definition: ROBData.h:130
ROBData_T::ROBData_T
ROBData_T()
Default Constructor.
Definition: ROBData.h:140
RawEvent.h
ROBData_T::iterator::m_it
PointerType m_it
iterator
Definition: ROBData.h:126
ROBData_T::iterator
This class defines how to iterate over the ROBData_T, in different formats.
Definition: ROBData.h:88
ROBData_T::sub_detector
eformat::SubDetector sub_detector() const
Return the current subdetector type.
Definition: ROBData.h:166
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment
eformat::ROBFragment< PointerType > ROBFragment
Definition: RawEvent.h:27
ROBData_T::m_data
PointerType m_data
data
Definition: ROBData.h:131
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ROBData_T::no_of_elements
uint32_t no_of_elements() const
Return the number of 32-bit words inside the ROD.
Definition: ROBData.h:179
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
ROBData_T::operator=
ROBData_T & operator=(const ROBData_T &other)
Assignment Operator.
Definition: ROBData.h:149
ROBData_T::iterator::operator=
iterator & operator=(const iterator &other)
Assignment Operator.
Definition: ROBData.h:198