104{
105 msg(MSG::DEBUG) <<
" ALFA_RoDDecoder::fillCollection" <<
endmsg;
106
107 ALFA_RawDataCollection* collection = nullptr;
108
110
111 std::vector<uint32_t> VData;
112
113 VData.clear();
114
115
119
124
128
129 std::vector<bool> tmpLvl1Pattern;
130 std::vector<bool> tmpLvl2Pattern;
131 std::vector<bool> tmpEFPattern;
133
136
138
140
141
142
145 if (
sc.isFailure()) {
146 ATH_MSG_WARNING (
" cannot retrieve EventInfo, will not set ALFA bit information ");
147 }
148
149
150
151 try
152 {
153 robFrag->check();
154 }
155
156 catch (eformat::Issue &ex)
157 {
160 msg(MSG::WARNING) <<
"Cannot set ALFA error state"<<
endmsg;
161 return StatusCode::SUCCESS;
162 }
163
164
165
166 uint32_t nstat = robFrag->nstatus();
167
168 if (nstat)
169 {
171 robFrag->status (it);
172
173
174 if (*it)
175 {
176 msg(MSG::WARNING) <<
" Error in ROB status word: 0x" <<
endmsg;
178 msg(MSG::WARNING) <<
"Cannot set ALFA error state"<<
endmsg;
180 msg(MSG::WARNING) <<
"Cannot set event bit info for ALFA"<<
endmsg;
181
182 return StatusCode::SUCCESS;
183 }
184 }
185
186
187
189
190 robFrag->rod_data(vint);
191
192
193 uint32_t size = robFrag->rod_ndata();
194
195
196 uint32_t ROD_source_ID = robFrag->rod_source_id();
197
198
199 uint32_t ROD_LVL1_ID = robFrag->rod_lvl1_id();
200
201 msg(MSG::DEBUG) <<
"============================" << std::endl;
202 msg(MSG::DEBUG) <<
"Frag Size : " << robFrag->rod_fragment_size_word() <<
endmsg;
203 msg(MSG::DEBUG) <<
"Header Size: " << robFrag->rod_header_size_word() <<
endmsg;
204 msg(MSG::DEBUG) <<
"Source ID : " << ROD_source_ID <<
endmsg;
205 msg(MSG::DEBUG) <<
"Run num : " << robFrag->rod_run_no() <<
endmsg;
206 msg(MSG::DEBUG) <<
"Version : " << robFrag->rod_version() <<
endmsg;
207 msg(MSG::DEBUG) <<
" ROD_LVL1_ID " << ROD_LVL1_ID <<
endmsg;
208 msg(MSG::DEBUG) <<
"============================" << std::endl;
209
210
211
212
213 uint32_t evt_Id = ((robFrag->rod_lvl1_id()) & 0xFF000000) >> 24;
214 uint32_t lvl1_Id = ((robFrag->rod_lvl1_id()) & 0x00FFFFFF) ;
215
216
217 msg(MSG::DEBUG) <<
" evt_Id : " << evt_Id <<
" lvl1_Id : " << lvl1_Id <<
endmsg;
218
219
220
221
222
223
224
225
226
227
228
229
230
234
236
237 if(EcrId!=evt_Id)
238 {
241 }
242
243 if (n==0) Event_num = LvL1;
244 else Event_num = ((robFrag->rod_lvl1_id()) & 0x00FFFFFF) + Event_num;
245
246 LvL1 = ((robFrag->rod_lvl1_id()) & 0x00FFFFFF)+1 ;
247 EcrId = ((robFrag->rod_lvl1_id()) & 0xFF000000) >> 24;
248
249 if(l==1) Event_num_max=Event_num;
250
251 Event_num = ((robFrag->rod_lvl1_id()) & 0x00FFFFFF)+1 + Event_num_max;
252
253 Count_evt++;
254
255
256 msg(MSG::DEBUG) <<
" Event_num " << Event_num <<
" Count_evt " << Count_evt <<
endmsg;
257
258
259
260
262 {
263 msg(MSG::DEBUG) <<
" Found the beginning of buffer "<<
endmsg;
264
266 }
267 else
268 {
269 msg(MSG::DEBUG) <<
" Beginning of block not found BOB "<<
endmsg;
270 }
271
272
274 {
275
276
277
279 {
280 wordPos += 1;
281 if (wordPos >= size)
282 {
283 msg(MSG::WARNING)<<
" Error: data corrupted" <<
endmsg;
285 msg(MSG::WARNING) <<
"Cannot set ALFA error state"<<
endmsg;
287 msg(MSG::WARNING) <<
"Cannot set event bit info for ALFA"<<
endmsg;
288
289 return StatusCode::SUCCESS;
290 }
292 }
293
294
296 {
297 msg(MSG::DEBUG) <<
" Found the beginning of Link BOL"<<
endmsg;
299
300 }
301
303 {
304 msg(MSG::WARNING)<<
" Error: collection not found " <<
endmsg;
306 msg(MSG::WARNING) <<
"Cannot set ALFA error state"<<
endmsg;
308 msg(MSG::WARNING) <<
"Cannot set event bit info for ALFA"<<
endmsg;
309
310 return StatusCode::SUCCESS;
311 }
312
313
314 wordPos += 1;
315 if (wordPos >= size)
316 {
317 msg(MSG::WARNING)<<
" Error: data corrupted"<<
endmsg;
319 msg(MSG::WARNING) <<
"Cannot set ALFA error state"<<
endmsg;
321 msg(MSG::WARNING) <<
"Cannot set event bit info for ALFA"<<
endmsg;
322 return StatusCode::SUCCESS;
323 }
324
325
328
330 {
331
333
334 msg(MSG::DEBUG)<<
" Decoding data from Slot Id number : " << slotIdNum <<
endmsg;
335
336 ALFA_RawData* rawData;
337
338
339
341 {
342 wordPos += 1;
343 if (wordPos >= size)
344 {
345 msg(MSG::WARNING)<<
" Error: data corrupted" <<
endmsg;
347 msg(MSG::WARNING) <<
"Cannot set ALFA error state"<<
endmsg;
349 msg(MSG::WARNING) <<
"Cannot set event bit info for ALFA"<<
endmsg;
350
351 return StatusCode::SUCCESS;
352 }
353
355
359
361 {
362
363
364
365
367 {
368
369 msg(MSG::DEBUG) <<
" Creation of the new collection"<<
endmsg;
370
372
373
374 for (
unsigned int i=0;
i<8;
i++)
375 {
376
377 thisMB = (
char) tmpMB & 0x00000001;
378 tmpMB>>=1;
379
380 if(thisMB==1)
381 {
383
386
387 msg(MSG::DEBUG)<<
" DECODER : MBIdNum " << MBIdNum <<
endmsg;
388
389
390 }
391
392
393 }
394
395 }
396
397
398
399
401 {
402
403
405
408
409 rawData = new ALFA_RawData(PMFIdNum);
410
412
415
417
418 std::vector<uint16_t> hitId;
419
420 for (
unsigned int i=0;
i<16;
i++)
421 {
422
423 FiberNum=100;
424 fiber_hit = (
char) tmpFiber & 0x00000001;
425 tmpFiber>>=1;
426
427 if(fiber_hit==1)
428 {
430 hitId.push_back(FiberNum);
431
432 }
433 else hitId.push_back(100);
434
435 }
436
437
439
440 rawData->
addData(vint[wordPos]);
442 if(collection) collection->
push_back(rawData);
443 else delete rawData;
444
445 }
446
447
448
449
450
452 {
453
454
456 {
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473 }
474
475
476 else
478 {
481 }
482 else
484 {
487 if(collection)
msg(MSG::DEBUG) <<
" tmpADC1 = " << tmpADC1 <<
endmsg;
488 }
489 else
491 {
494 if(collection)
msg(MSG::DEBUG)<<
" tmpADC2 = " << tmpADC2 <<
endmsg;
495 }
496
498
499 }
500
501
502 }
503
504
505 }
506
507
509 {
511 }
512
513 wordPos += 1;
514 if (wordPos >= size)
515 {
516 msg(MSG::WARNING)<<
" Error: data corrupted" <<
endmsg;
518 msg(MSG::WARNING) <<
"Cannot set ALFA error state"<<
endmsg;
520 msg(MSG::WARNING) <<
"Cannot set event bit info for ALFA"<<
endmsg;
521
522 return StatusCode::SUCCESS;
523 }
524
525
528
529 }
530
531 wordPos += 1;
532 if (wordPos >= size)
533 {
534 msg(MSG::WARNING)<<
" Error: data corrupted" <<
endmsg;
536 msg(MSG::WARNING) <<
"Cannot set ALFA error state"<<
endmsg;
538 msg(MSG::WARNING) <<
"Cannot set event bit info for ALFA"<<
endmsg;
539
540 return StatusCode::SUCCESS;
541 }
542
544
545 }
546
547
548
549 const eformat::FullEventFragment<const uint32_t*> *
event =
m_robDataProvider->getEvent(Gaudi::Hive::currentContext());
550
551 msg(MSG::DEBUG) <<
"========FULL=============" << std::endl;
552 msg(MSG::DEBUG) <<
"Event time (sec): " << (
uint32_t)
event->bc_time_seconds() << std::endl;
553 msg(MSG::DEBUG) <<
"Event time (ns): " << (
uint32_t)
event->bc_time_nanoseconds() << std::endl;
554 msg(MSG::DEBUG) <<
"Global ID: " << (
uint32_t)
event->global_id() << std::endl;
555 msg(MSG::DEBUG) <<
"Run Type: " << (
uint32_t)
event->run_type() << std::endl;
556 msg(MSG::DEBUG) <<
"Run Number: " << (
uint32_t)
event->run_no() << std::endl;
557 msg(MSG::DEBUG) <<
"Lumi Block: " << (
uint32_t)
event->lumi_block() << std::endl;
558 msg(MSG::DEBUG) <<
"Level1 ID: " << (
uint32_t)
event->lvl1_id() << std::endl;
560 msg(MSG::DEBUG) <<
"Level1 trig type: " << (
uint32_t)
event->lvl1_trigger_type() << std::endl;
561 msg(MSG::DEBUG) <<
"Level1 Nwords: " << (
uint32_t)
event->nlvl1_trigger_info() << std::endl;
562 msg(MSG::DEBUG) <<
"Level2 Nwords: " << (
uint32_t)
event->nlvl2_trigger_info() << std::endl;
563 msg(MSG::DEBUG) <<
"EF Nwords: " << (
uint32_t)
event->nevent_filter_info() << std::endl;
564 msg(MSG::DEBUG) <<
"============================" << std::endl;
565
566 uint32_t Time_StampID =
event->bc_time_seconds();
567 uint32_t Time_StampnsID =
event->bc_time_nanoseconds();
569 uint32_t LumiBlock_ID =
event->lumi_block();
570
573 if(rdoCont) rdoCont->
SetBCId(BC_ID);
575
576
577
578
579
580
581
582 const uint32_t *point_lvl1 =
event->lvl1_trigger_info();
583 uint32_t point_lvl1_end =
event->nlvl1_trigger_info();
584 for(uint32_t i = 0;
i <= point_lvl1_end; ++
i)
585 {
586 wo = *(point_lvl1 +
i);
587 for(uint32_t j = 0; j < 32; ++j)
588 {
589 tmpLvl1Pattern.push_back((wo & 0x1));
590 wo >>= 1;
591 }
592 }
594
595 wo=0;
596
597
598 const uint32_t *point_lvl2 =
event->lvl2_trigger_info();
599 uint32_t point_lvl2_end =
event->nlvl2_trigger_info();
600 for(uint32_t i = 0;
i <= point_lvl2_end; ++
i)
601 {
602 wo = *(point_lvl2 +
i);
603 for(uint32_t j = 0; j < 32; ++j)
604 {
605 tmpLvl2Pattern.push_back((wo & 0x1));
606 wo >>= 1;
607 }
608 }
609
611
612 wo=0;
613
614
615
616 const uint32_t *point_ef =
event->event_filter_info();
617 uint32_t point_ef_end =
event->nevent_filter_info();
618 for(uint32_t i = 0;
i <= point_ef_end; ++
i)
619 {
620 wo = *(point_ef +
i);
621
622
623 for(uint32_t j = 0; j < 32; ++j)
624 {
625 tmpEFPattern.push_back((wo & 0x1));
626 wo >>= 1;
627 }
628 }
629
631
632
633
635 {
636 msg(MSG::DEBUG) <<
" Found the end of block EOB ---------------------- "<<
endmsg;
637 }
638
639 wordPos += 1;
641
642 return StatusCode::SUCCESS;
643
644}
#define ATH_MSG_WARNING(x)
ALFA_RawDataCollection * getCollection(unsigned int MotherBoardId, ALFA_RawDataContainer *cont)
ALFA_RawDataCollectionReadOut * m_ALFA_RawDataCollectionReadOut
ALFA_RawDataContainerReadOut * m_ALFA_RawDataContainerReadOut
ALFA_RawDataReadOut * m_ALFA_RawDataReadOut
void Set_ADC1_POT(uint16_t ADC1_number)
void Set_ADC2_POT(uint16_t ADC2_number)
void Set_pattern_POT(const std::vector< bool > &pattern_number)
void Set_scaler_POT(uint16_t scaler_number)
void SetMBId_POT(uint16_t MB_number)
void SetTrigSyncErr(bool bit)
void SetTimeStampns(uint32_t tmpTimeStampns)
void SetTimeStamp(uint32_t tmpTimeStamp)
void SetLvl2Pattern(const std::vector< bool > &tmplvl2_pattern)
void SetBCId(uint32_t tmpBCId)
void SetLvl1Pattern(const std::vector< bool > &tmplvl1_pattern)
void SetLumiBlock(uint32_t tmpLumiBlock)
void SetEFPattern(const std::vector< bool > &tmpef_pattern)
void SetPMFId_PMF(uint16_t PMF_number)
void SetMarocChan_PMF(const std::vector< uint16_t > &MarocChan)
void Set_error_bit17(bool bit)
void addData(uint32_t dataWord)
void SetWordId_PMF(uint16_t Word_number)
void PushBack_PMF(uint16_t fiber_hit)
void SetMBId_PMF(uint16_t MB_number)
ServiceHandle< StoreGateSvc > & evtStore()
value_type push_back(value_type pElem)
Add an element to the end of the collection.
@ ForwardDet
The forward detectors.
@ Error
The sub-detector issued an error.
@ COLL_NOT_FOUND
collection not found
@ CORRUPTION
data corrupted
@ ROB_ERROR
ROB status error.
::StatusCode StatusCode
StatusCode definition for legacy code.
const DataType * PointerType
l
Printing final latex table to .tex output file.
EventInfo_v1 EventInfo
Definition of the latest event info version.