18 const std::vector<unsigned int>& tobWords) :
38 std::vector<unsigned int> allTOBs(8,0);
41 for ( ; itRoI != tobs->
end(); ++itRoI) {
42 if ( (*itRoI)->crate() !=
crate || (*itRoI)->jem() !=
module )
continue;
44 int frame = (*itRoI)->frame();
45 int lc = (*itRoI)->location();
46 int etL = (*itRoI)->energyLarge();
47 int etS = (*itRoI)->energySmall();
53 unsigned int tobdata = etL + (etS<<10) + (
lc<<19);
54 allTOBs[frame] = tobdata;
59 for (
int i = 0;
i < 8; ++
i) {
60 if (allTOBs[
i] == 0 )
continue;
62 unsigned int etL = allTOBs[
i] & 0x3ff;
63 unsigned int etS = (allTOBs[
i] >> 10) & 0x1ff;
64 unsigned int lc = (allTOBs[
i] >> 19) & 3;
96 for (
unsigned int word = 0; word < 4; ++word) {
97 unsigned int parity = 1;
98 for (
unsigned int bit = 0; bit < 24; ++bit)
if ( ( (
m_DataWords[word]>>bit) & 1) > 0 ) parity++;
126 unsigned int value = (m_DataWords[0] & 0xff);
133 bool overflow =
false;
136 if ( (m_DataWords[0] & 0xff) == 0 )
return overflow;
140 for (
unsigned int i = 0;
i < 8; ++
i) {
142 if ( (m_DataWords[0] & (1<<
i)) > 0 ) ntob++;
147 if (ntob > 4) overflow =
true;
160 std::vector<unsigned int> bits;
163 for (
unsigned int i = 0;
i < 8; ++
i) {
165 if ( (m_DataWords[0] & (1<<
i)) > 0 ) {
167 if (ntob < 4) bits.push_back(
i);
181 std::vector<unsigned int>
data;
184 if ( (m_DataWords[0] & 0xff) == 0 )
return data;
187 unsigned int ntob = 0;
188 for (
unsigned int i = 0;
i < 8; ++
i) {
190 if ( (m_DataWords[0] & (1<<
i)) > 0 ) {
194 unsigned int word = 0;
195 unsigned int coord = 0;
196 unsigned int etSmall = 0;
197 unsigned int etLarge = 0;
201 coord = (m_DataWords[0] >> 11) & 0x3;
202 etSmall = ((m_DataWords[0] >> 8) & 0x7) + ((m_DataWords[1] & 0x3f) << 3);
203 etLarge = (m_DataWords[0] >> 13) & 0x3ff;
206 coord = (m_DataWords[1] >> 11) & 0x3;
207 etSmall = ((m_DataWords[1] >> 6) & 0x1f) + ((m_DataWords[2] & 0xf) << 5);
208 etLarge = (m_DataWords[1] >> 13) & 0x3ff;
211 coord = (m_DataWords[2] >> 11) & 0x3;
212 etSmall = ((m_DataWords[2] >> 4) & 0x7f) + ((m_DataWords[3] & 0x3) << 7);
213 etLarge = (m_DataWords[2] >> 13) & 0x3ff;
216 coord = (m_DataWords[3] >> 11) & 0x3;
217 etSmall = (m_DataWords[3] >> 2) & 0x1ff;
218 etLarge = (m_DataWords[3] >> 13) & 0x3ff;
222 word = etLarge + (etSmall<<10) + (
coord<<19);
223 data.push_back(word);
238 std::vector<unsigned int>
data;
241 if ( (m_DataWords[0] & 0xff) == 0 )
return data;
244 unsigned int ntob = 0;
245 for (
unsigned int i = 0;
i < 8; ++
i) {
247 if ( (m_DataWords[0] & (1<<
i)) > 0 ) {
251 unsigned int frame =
i;
255 unsigned int coord = 0;
256 unsigned int etSmall = 0;
257 unsigned int etLarge = 0;
261 coord = (m_DataWords[0] >> 11) & 0x3;
262 etSmall = ((m_DataWords[0] >> 8) & 0x7) + ((m_DataWords[1] & 0x3f) << 3);
263 etLarge = (m_DataWords[0] >> 13) & 0x3ff;
266 coord = (m_DataWords[1] >> 11) & 0x3;
267 etSmall = ((m_DataWords[1] >> 6) & 0x1f) + ((m_DataWords[2] & 0xf) << 5);
268 etLarge = (m_DataWords[1] >> 13) & 0x3ff;
271 coord = (m_DataWords[2] >> 11) & 0x3;
272 etSmall = ((m_DataWords[2] >> 4) & 0x7f) + ((m_DataWords[3] & 0x3) << 7);
273 etLarge = (m_DataWords[2] >> 13) & 0x3ff;
276 coord = (m_DataWords[3] >> 11) & 0x3;
277 etSmall = (m_DataWords[3] >> 2) & 0x1ff;
278 etLarge = (m_DataWords[3] >> 13) & 0x3ff;
282 word = etLarge + (etSmall<<10) + (
coord<<19) + (frame<<21) + (m_module<<24);
283 data.push_back(word);