202{
203
204
205 bool p_debug = (
log.level() <= MSG::DEBUG);
206
207 TGC_BYTESTREAM_SOURCEID sid;
209
211 {
212 if(p_debug) {
213 log << MSG::DEBUG <<
"Error: input TgcRdo id does not match bytestream id" <<
endmsg;
214 }
215 return;
216 }
217
219
220 TGC_BYTESTREAM_FRAGMENTCOUNT counters[7] = {
221 {0, 1}, {0, 2}, {0, 3}, {0, 4}, {0, 5}, {0, 8}, {0, 9}
222 };
223 TGC_BYTESTREAM_FRAGMENTCOUNT
counter{};
224
225
226 int iBs = 0;
227 for(int iCnt = 0; iCnt < 7; iCnt++)
228 {
230 if(
counter.id == counters[iCnt].id)
231 {
233 iBs++;
234 }
235 }
236
237 for(int iCnt = 0; iCnt < 7; iCnt++)
238 {
239 if(counters[iCnt].
count == 0)
continue;
240 switch(counters[iCnt].id)
241 {
242 case 1:
243 {
244 if(p_debug) {
246 <<
"fragment" << counters[iCnt].
id <<
" "
248 }
249 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
250 {
251 if(p_debug) {
253 <<
"WORD" << iFrag <<
":" << MSG::hex << bs[iBs] <<
endmsg;
254 }
255 iBs++;
256 }
257 break;
258 }
259
260 case 2:
261 {
262 if(p_debug) {
263 log << MSG::DEBUG <<
"fragment"
264 << counters[iCnt].
id <<
" " << counters[iCnt].
count
266 }
267 TGC_BYTESTREAM_READOUTHIT roh;
268 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
269 {
270 if(p_debug) {
271 log << MSG::DEBUG <<
"WORD" << iFrag <<
":" << MSG::hex << bs[iBs] <<
endmsg;
272 }
274
275
276 if(p_debug) {
279 <<
" rdo.rodId():" <<rdo.
rodId()
280 <<
" roh.ldbId:" <<roh.
ldbId
281 <<
" roh.sbId:" <<roh.
sbId
282 <<
" rdo.l1Id():"<<rdo.
l1Id()
284 }
285
287
288
289
290
291
292
296 else slbId = (roh.
sbId-8)*2+1;
297 }
298
303 slbId,
306
307
308
309
310
311
312
313
314
315
316
317
318
319
325 }
326 break;
327 }
328 case 3:
329 {
330 if(p_debug) {
331 log << MSG::DEBUG <<
"fragment"
332 << counters[iCnt].
id <<
" " << counters[iCnt].
count
334 }
335 TGC_BYTESTREAM_READOUTTRIPLETSTRIP rostrip;
336 TGC_BYTESTREAM_READOUTTRACKLET rotrk;
337 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
338 {
339 if(p_debug) {
340 log<< MSG::DEBUG <<
"WORD"
341 << iFrag <<
":" << MSG::hex << bs[iBs] <<
endmsg;
342 }
344
346 {
355 0,
360 }
361 else
362 {
371
372
373
374
375
376
377
378
379
380
381
382
383
384
388 0,
391 }
392 iBs++;
393 }
394 break;
395 }
396 case 8:
397 {
398 if(p_debug) {
399 log << MSG::DEBUG <<
"fragment"
400 << counters[iCnt].
id <<
" " << counters[iCnt].
count
402 }
403 TGC_BYTESTREAM_HIPT hpt;
404 TGC_BYTESTREAM_HIPT_INNER hptinner;
405 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
406 {
407 if(p_debug) {
408 log << MSG::DEBUG <<
"WORD"
409 << iFrag <<
":" << MSG::hex << bs[iBs] <<
endmsg;
410 }
419 0,
421 0,
422 0,
423 0,
424 0,
425 0,
426 0,
429 }else{
445 0);
447 }
448 iBs++;
449 }
450 break;
451 }
452 case 9:
453 {
454 if(p_debug) {
455 log << MSG::DEBUG <<
"fragment"
456 << counters[iCnt].
id <<
" " << counters[iCnt].
count
458 }
459 TGC_BYTESTREAM_SL sl;
460 for(
unsigned iFrag = 0; iFrag < counters[iCnt].
count; iFrag++)
461 {
462 if(p_debug) {
463 log << MSG::DEBUG <<
"WORD"
464 << iFrag <<
":" << MSG::hex << bs[iBs] <<
endmsg;
465 }
467
474 static_cast<bool>(sl.
fwd),
483 }
484 break;
485 }
486 default:
487 if(p_debug) {
489 << "Error: TgcByteStream::byteStream2Rdo Unsupported fragment type "
491 }
492 break;
493 }
494 }
495
496 if(p_debug) {
497 log << MSG::DEBUG <<
"Decoded " << MSG::dec << rdo.
size()
499 log << MSG::DEBUG <<
"TgcByteStream::byteStream2Rdo done" <<
endmsg;
500 }
501}
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current TgcRawData
void fromBS32(uint32_t data, T &s)
unsigned bcTag(unsigned bcBitMap)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
void setOnlineId(uint16_t subDetectorId, uint16_t rodId)
uint16_t subDetectorId() const
static uint16_t calculateOnlineId(uint16_t subDetectorId, uint16_t rodId)
uint16_t identify() const
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string