ATLAS Offline Software
Loading...
Searching...
No Matches
ALFA_Decoder.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#include "eformat/Issue.h"
9#include <algorithm>
10
11using xAOD::EventInfo;
12
13static const InterfaceID IID_IALFA_Decoder ("ALFA_Decoder", 1, 0);
14const InterfaceID& ALFA_Decoder::interfaceID()
15{
16 return IID_IALFA_Decoder;
17}
18
20// constructor
22
23ALFA_Decoder::ALFA_Decoder ( const std::string& type, const std::string& name,const IInterface* parent)
24 : AthAlgTool(type,name,parent),
25 m_robDataProvider ("ROBDataProviderSvc",name)
26 //, m_ALFA_RawDataContainerReadOut(0), m_ALFA_RawDataCollectionReadOut(0), m_ALFA_RawDataReadOut(0)
27{
28 declareInterface<ALFA_Decoder>(this);
29
30}
31
32
33
35// destructor
40
41
43// initialize() -
46{
47
48
49 StatusCode sc;
50 sc = AthAlgTool::initialize();
51 msg(MSG::DEBUG) << " ALFA_RoDDecoder::initialize" << endmsg;
52 if (sc.isFailure()) return sc;
53
54 // Get ROBDataProviderSvc
55 if (m_robDataProvider.retrieve().isFailure())
56 {
57 msg(MSG::FATAL) << "Failed to retrieve service " << m_robDataProvider << endmsg;
58 return StatusCode::FAILURE;
59 } else
60 msg(MSG::DEBUG) << "Retrieved service " << m_robDataProvider << endmsg;
61
62
64
65
66 // Initialize decoding classes
70
71
72 return StatusCode::SUCCESS;
73}
74
75
76
77
78
79
81// finalize() -
84{
85
86 msg(MSG::DEBUG) << " ALFA_RoDDecoder::FINALIZE" << endmsg;
87
88 msg(MSG::DEBUG) << " Bytestream summary:" << m_fragment_number << " fragments found" << endmsg;
89
90
94
95 return StatusCode::SUCCESS;
96}
97
98
99
101// fillCollection() -
103StatusCode ALFA_Decoder::fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *robFrag, ALFA_RawDataContainer* rdoCont, std::vector<unsigned int>* )
104{
105 msg(MSG::DEBUG) << " ALFA_RoDDecoder::fillCollection" << endmsg;
106
107 ALFA_RawDataCollection* collection = nullptr;
108
109 uint32_t wordPos = 0;
110
111 std::vector<uint32_t> VData;
112
113 VData.clear();
114
115
116 uint32_t Event_num=0;
117 uint32_t Event_num_max=0;
118 uint16_t fiber_hit;
119
120 uint16_t tmpFiber;
121 uint16_t thisMB;
122 uint16_t tmpMB;
123 uint16_t MBIdNum=0;
124
125 uint16_t tmpADC1=10000;
126 uint16_t tmpADC2=10000;
127 uint16_t tmpScaler=100;
128
129 std::vector<bool> tmpLvl1Pattern;
130 std::vector<bool> tmpLvl2Pattern;
131 std::vector<bool> tmpEFPattern;
132 uint32_t wo=0;
133
134 uint32_t EcrId=1;
135 uint32_t LvL1 =0;
136
137 uint32_t Count_evt=0;
138
139 int n=0;
140
141
142 // retrieve EventInfo
143 const EventInfo* eventInfo=nullptr;
144 StatusCode sc = evtStore()->retrieve(eventInfo);
145 if (sc.isFailure()) {
146 ATH_MSG_WARNING (" cannot retrieve EventInfo, will not set ALFA bit information ");
147 }
148
149 // Check the ROB and ROD fragment for lenght and version consistency
150
151 try
152 {
153 robFrag->check();
154 }
155
156 catch (eformat::Issue &ex)
157 {
158 msg(MSG::WARNING) <<ex.what ()<< endmsg;
159 if (!eventInfo->updateErrorState(EventInfo::ForwardDet, EventInfo::Error))
160 msg(MSG::WARNING) <<"Cannot set ALFA error state"<< endmsg;
161 return StatusCode::SUCCESS; // error in fragment - we search for no collection
162 }
163
164 // Check the ROB status word for truncation or corruption.
165
166 uint32_t nstat = robFrag->nstatus();
167
168 if (nstat)
169 {
170 const uint32_t *it;
171 robFrag->status (it);
172
173
174 if (*it)
175 {
176 msg(MSG::WARNING) << " Error in ROB status word: 0x" << endmsg;
177 if (!eventInfo->updateErrorState(EventInfo::ForwardDet, EventInfo::Error))
178 msg(MSG::WARNING) <<"Cannot set ALFA error state"<< endmsg;
179 if (!eventInfo->updateEventFlagBit(EventInfo::ForwardDet, ALFAEventBitInfo::ROB_ERROR))
180 msg(MSG::WARNING) <<"Cannot set event bit info for ALFA"<< endmsg;
181
182 return StatusCode::SUCCESS;
183 }
184 }
185
186 // set the data pointer type
187
189
190 robFrag->rod_data(vint);
191
192 // get number of data words in the fragment
193 uint32_t size = robFrag->rod_ndata();
194
195 // get source ID
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 // msg(MSG::INFO) << "ROD Time_StampID " <<robFrag->bc_time_seconds() << endmsg;
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 /*msg(MSG::DEBUG) << " **********Decoder dumping the words******** "<< endmsg;
220
221 if (size > 0) {
222 msg(MSG::DEBUG) << " The size of this ROD-read is "<< endmsg;
223 for (unsigned int i=0; i < size; i++)
224 msg(MSG::DEBUG) << " word " << i << " = " << MSG::hex << vint[i] << MSG::dec<< endmsg;
225 } else {
226 msg(MSG::DEBUG) << " Buffer size 0 ! "<< endmsg;
227 return StatusCode::FAILURE;
228 }*/
229
230
231 m_ALFA_RawDataCollectionReadOut->decodeWord(vint[wordPos]);
232 m_ALFA_RawDataReadOut->decodeWord(vint[wordPos]);
233 m_ALFA_RawDataContainerReadOut->decodeWord(vint[wordPos]);
234
235 int l=0;
236
237 if(EcrId!=evt_Id)
238 {
239 n++;
240 l=1;
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 //if (Count_evt == maxEvt) break;
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 // Check that Lvl1d matches the one from the ROD header. this is the number of event.it corresponds to m_ALFA_RawDataReadOut->ecnt_BOT() and m_ALFA_RawDataReadOut->ecnt_EOT()
265 msg(MSG::DEBUG) << " Level 1 Id : " << m_ALFA_RawDataCollectionReadOut->lvl1Id()<< endmsg;
266 }
267 else
268 {
269 msg(MSG::DEBUG) << " Beginning of block not found BOB "<< endmsg;
270 } // BOB
271
272
273 while (!m_ALFA_RawDataCollectionReadOut->is_EOB())
274 {
275
276 //Check for corrupted data
277
278 while ((!m_ALFA_RawDataCollectionReadOut->is_BOL()) && (!m_ALFA_RawDataCollectionReadOut->is_EOB()))
279 {
280 wordPos += 1;
281 if (wordPos >= size)
282 {
283 msg(MSG::WARNING)<<" Error: data corrupted" << endmsg;
284 if (!eventInfo->updateErrorState(EventInfo::ForwardDet, EventInfo::Error))
285 msg(MSG::WARNING) <<"Cannot set ALFA error state"<< endmsg;
286 if (!eventInfo->updateEventFlagBit(EventInfo::ForwardDet, ALFAEventBitInfo::CORRUPTION))
287 msg(MSG::WARNING) <<"Cannot set event bit info for ALFA"<< endmsg;
288
289 return StatusCode::SUCCESS;
290 }
291 m_ALFA_RawDataCollectionReadOut->decodeWord(vint[wordPos]);
292 }
293
294
296 {
297 msg(MSG::DEBUG) << " Found the beginning of Link BOL"<< endmsg;
298 msg(MSG::DEBUG) << " MrodNum BOL : " << m_ALFA_RawDataCollectionReadOut->MrodNum()<< " RODinput BOL : " <<m_ALFA_RawDataCollectionReadOut->RODinput()<< endmsg;
299
300 } // is_BOL()
301
302 else if (m_ALFA_RawDataCollectionReadOut->is_EOB())
303 {
304 msg(MSG::WARNING)<<" Error: collection not found " << endmsg;
305 if (!eventInfo->updateErrorState(EventInfo::ForwardDet, EventInfo::Error))
306 msg(MSG::WARNING) <<"Cannot set ALFA error state"<< endmsg;
307 if (!eventInfo->updateEventFlagBit(EventInfo::ForwardDet, ALFAEventBitInfo::COLL_NOT_FOUND))
308 msg(MSG::WARNING) <<"Cannot set event bit info for ALFA"<< endmsg;
309
310 return StatusCode::SUCCESS;
311 } // is_EOB()
312
313
314 wordPos += 1;
315 if (wordPos >= size)
316 {
317 msg(MSG::WARNING)<<" Error: data corrupted"<< endmsg;
318 if (!eventInfo->updateErrorState(EventInfo::ForwardDet, EventInfo::Error))
319 msg(MSG::WARNING) <<"Cannot set ALFA error state"<< endmsg;
320 if (!eventInfo->updateEventFlagBit(EventInfo::ForwardDet, ALFAEventBitInfo::CORRUPTION))
321 msg(MSG::WARNING) <<"Cannot set event bit info for ALFA"<< endmsg;
322 return StatusCode::SUCCESS;
323 }
324
325
326 m_ALFA_RawDataCollectionReadOut->decodeWord(vint[wordPos]);
327 m_ALFA_RawDataReadOut->decodeWord(vint[wordPos]);
328
329 while (!m_ALFA_RawDataCollectionReadOut->is_TWC())
330 {
331
332 uint16_t slotIdNum = m_ALFA_RawDataReadOut->SlotId();
333
334 msg(MSG::DEBUG)<<" Decoding data from Slot Id number : " << slotIdNum << endmsg;
335
336 ALFA_RawData* rawData;
337
338 // Loop on the TDC data words and create the corresponding RDO's
339
340 while (!m_ALFA_RawDataReadOut->is_EOT())
341 {
342 wordPos += 1;
343 if (wordPos >= size)
344 {
345 msg(MSG::WARNING)<<" Error: data corrupted" << endmsg;
346 if (!eventInfo->updateErrorState(EventInfo::ForwardDet, EventInfo::Error))
347 msg(MSG::WARNING) <<"Cannot set ALFA error state"<< endmsg;
348 if (!eventInfo->updateEventFlagBit(EventInfo::ForwardDet, ALFAEventBitInfo::CORRUPTION))
349 msg(MSG::WARNING) <<"Cannot set event bit info for ALFA"<< endmsg;
350
351 return StatusCode::SUCCESS;
352 }
353
354 m_ALFA_RawDataReadOut->decodeWord(vint[wordPos]);
355
356 uint16_t PMFIdNum;
357 uint16_t WordIdNum;
358 uint16_t FiberNum;
359
360 if (m_ALFA_RawDataReadOut->is_TDCt() && m_ALFA_RawDataReadOut->bit26_27()==0 && !m_ALFA_RawDataReadOut->bit16() && !m_ALFA_RawDataReadOut->bit18() )
361 {
362
363 //msg(MSG::DEBUG)<<" DECODER : PMFId " << m_ALFA_RawDataReadOut->PMFId() << " MBId " << m_ALFA_RawDataReadOut->MBId() << endmsg;
364
365
366 if(m_ALFA_RawDataReadOut->PMFId() ==0 && m_ALFA_RawDataReadOut->WordId() ==0) //PMF0 contains the information on wich MB is readen
367 {
368
369 msg(MSG::DEBUG) << " Creation of the new collection"<< endmsg;
370
371 tmpMB = m_ALFA_RawDataReadOut->fiber();
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 {
382 MBIdNum=i+1;
383
384 collection = getCollection(MBIdNum,rdoCont );
385 if(collection) collection->SetMBId_POT(MBIdNum);
386
387 msg(MSG::DEBUG)<<" DECODER : MBIdNum " << MBIdNum << endmsg;
388
389
390 }
391
392
393 } // loop over 8 Mother Boards
394
395 } // PMFId() ==0 & WordId() ==0
396
397
398
399
400 if(m_ALFA_RawDataReadOut->PMFId() >0 && m_ALFA_RawDataReadOut->PMFId() <24)
401 {
402
403
404 tmpFiber = m_ALFA_RawDataReadOut->fiber();
405
406 WordIdNum = m_ALFA_RawDataReadOut->WordId();
407 PMFIdNum = m_ALFA_RawDataReadOut->PMFId();
408
409 rawData = new ALFA_RawData(PMFIdNum);
410
411 rawData->SetWordId_PMF(WordIdNum);
412
413 rawData->SetPMFId_PMF(PMFIdNum);
414 rawData->SetMBId_PMF(MBIdNum);
415
416 rawData->Set_error_bit17(m_ALFA_RawDataReadOut->error_bit17());
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 {
429 FiberNum=m_ALFA_RawDataReadOut->WordId()*16+i;
430 hitId.push_back(FiberNum);
431 //msg(MSG::DEBUG)<<" fiberNum = " << FiberNum <<", fiber_hit = " << fiber_hit << " PMFIdNum = " << PMFIdNum <<" WordIdNum = " << WordIdNum <<endmsg;
432 }
433 else hitId.push_back(100);
434
435 } // loop over 16 fibers
436
437
438 rawData->SetMarocChan_PMF(hitId);
439
440 rawData->addData(vint[wordPos]);
441 rawData->PushBack_PMF(FiberNum);
442 if(collection) collection->push_back(rawData);
443 else delete rawData;
444
445 } // PMFIdNum >0 && <24
446
447
448
449
450
451 if(m_ALFA_RawDataReadOut->PMFId()==24) // PMF 24 contains trigger and charge infos
452 {
453
454
455 if(m_ALFA_RawDataReadOut->WordId()==0)
456 {
457 const auto& tmpPattern=m_ALFA_RawDataReadOut->pattern();
458 if(collection) collection->Set_pattern_POT(tmpPattern);
459
460 // // TEST of the readed trigger pattern
461 // std::vector<bool> testpattern = m_ALFA_RawDataReadOut->pattern();
462 // //uint16_t testMBid = m_ALFA_RawDataReadOut->MBId();
463 // uint16_t testPMFid = m_ALFA_RawDataReadOut->PMFId();
464 // msg() << MSG::DEBUG << "MB : " << MBIdNum << endmsg;
465 // msg(MSG::DEBUG) << "PMF : " << testPMFid << endmsg;
466 // for (unsigned int i = 0; i < (unsigned int) testpattern.size(); i++)
467 // {
468 // msg(MSG::DEBUG) << "Trig pattern " << i << " : " << testpattern[i] << endmsg;
469 // }
470 // // end of TEST of the readed trigger pattern
471
472
473 } // m_ALFA_RawDataReadOut->WordId()==0
474
475
476 else
477 if(m_ALFA_RawDataReadOut->WordId()==1)
478 {
479 tmpScaler=m_ALFA_RawDataReadOut->scaler();
480 if(collection) collection->Set_scaler_POT(tmpScaler);
481 }
482 else
483 if(m_ALFA_RawDataReadOut->WordId()==2)
484 {
485 tmpADC1=m_ALFA_RawDataReadOut->ADC();
486 if(collection) collection->Set_ADC1_POT(tmpADC1);
487 if(collection) msg(MSG::DEBUG) <<" tmpADC1 = " << tmpADC1 << endmsg;
488 }
489 else
490 if(m_ALFA_RawDataReadOut->WordId()==3)
491 {
492 tmpADC2=m_ALFA_RawDataReadOut->ADC();
493 if(collection) collection->Set_ADC2_POT(tmpADC2);
494 if(collection) msg(MSG::DEBUG)<<" tmpADC2 = " << tmpADC2 << endmsg;
495 }
496
497 if(collection) collection->SetTrigSyncErr(m_ALFA_RawDataReadOut->error_bit17());
498
499 } //TSM PMF24
500
501
502 } // TSM
503
504
505 } // End of loop on AMTs (EOT)
506
507
508 if (m_ALFA_RawDataReadOut->is_EOT() && m_ALFA_RawDataReadOut->bit24_27()!=0)
509 {
510 msg(MSG::DEBUG) << " Event Counter EOT : " << m_ALFA_RawDataReadOut->ecnt_EOT()<< endmsg;
511 }
512
513 wordPos += 1;
514 if (wordPos >= size)
515 {
516 msg(MSG::WARNING)<<" Error: data corrupted" << endmsg;
517 if (!eventInfo->updateErrorState(EventInfo::ForwardDet, EventInfo::Error))
518 msg(MSG::WARNING) <<"Cannot set ALFA error state"<< endmsg;
519 if (!eventInfo->updateEventFlagBit(EventInfo::ForwardDet, ALFAEventBitInfo::CORRUPTION))
520 msg(MSG::WARNING) <<"Cannot set event bit info for ALFA"<< endmsg;
521
522 return StatusCode::SUCCESS;
523 }
524
525
526 m_ALFA_RawDataCollectionReadOut->decodeWord(vint[wordPos]);
527 m_ALFA_RawDataReadOut->decodeWord(vint[wordPos]);
528
529 } // End of loop on TDCs (TWC)
530
531 wordPos += 1;
532 if (wordPos >= size)
533 {
534 msg(MSG::WARNING)<<" Error: data corrupted" << endmsg;
535 if (!eventInfo->updateErrorState(EventInfo::ForwardDet, EventInfo::Error))
536 msg(MSG::WARNING) <<"Cannot set ALFA error state"<< endmsg;
537 if (!eventInfo->updateEventFlagBit(EventInfo::ForwardDet, ALFAEventBitInfo::CORRUPTION))
538 msg(MSG::WARNING) <<"Cannot set event bit info for ALFA"<< endmsg;
539
540 return StatusCode::SUCCESS;
541 }
542
543 m_ALFA_RawDataCollectionReadOut->decodeWord(vint[wordPos]);
544
545 } //EOB
546
547
548 // take full event
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;
559 msg(MSG::DEBUG) << "BCID: " << (uint32_t)event->bc_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();
568 uint32_t BC_ID = event->bc_id();
569 uint32_t LumiBlock_ID = event->lumi_block();
570
571 if(rdoCont) rdoCont->SetTimeStamp(Time_StampID);
572 if(rdoCont) rdoCont->SetTimeStampns(Time_StampnsID);
573 if(rdoCont) rdoCont->SetBCId(BC_ID);
574 if(rdoCont) rdoCont->SetLumiBlock(LumiBlock_ID);
575
576 /*
577 For the LVL1 trigger there are three consecutive blocks of 256 bits (8 ints):
578 256 bits for the TBP (trigger before prescale)
579 256 bits for the TAP (trigger after prescale
580 256 bits for the TAV (trigger after veto)
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 }
593 if(rdoCont) rdoCont->SetLvl1Pattern(tmpLvl1Pattern);
594
595 wo=0;
596
597 //It's not defined how many LVL2 and EF words are there
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 //std::cout << std::dec << std::endl;
610 if(rdoCont) rdoCont->SetLvl2Pattern(tmpLvl2Pattern);
611
612 wo=0;
613
614 //std::cout << "Event num " << event->global_id() << std::endl;
615 //std::cout << "EF pat:" << std::endl;
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 //std::cout << std::dec << i << ": ";
622 //std::cout << std::hex << wo << " ";
623 for(uint32_t j = 0; j < 32; ++j)
624 {
625 tmpEFPattern.push_back((wo & 0x1));
626 wo >>= 1;
627 }
628 }
629 //std::cout << std::dec << std::endl;
630 if(rdoCont) rdoCont->SetEFPattern(tmpEFPattern);
631
632
633
635 {
636 msg(MSG::DEBUG) << " Found the end of block EOB ---------------------- "<< endmsg;
637 }
638
639 wordPos += 1;
640 m_ALFA_RawDataCollectionReadOut->decodeWord(vint[wordPos]);
641
642 return StatusCode::SUCCESS;
643
644}
645
646
648// getCollection() - return collection corresponding to a particular channel
649// if it exists in container, or create it if it doesn't
651
653{
654
655 msg(MSG::DEBUG) << " ALFA_RoDDecoder::getCollection" << endmsg;
656
658
660 bool collExists = false;
663
664
665 for (; it!=itE; ++it)
666 {
667 if ((*it)->GetMBId_POT() == MBIdNum)
668 {
669 collExists = true;
670 cont_it = it;
671 }
672 }
673 if (collExists)
674 {
675 msg(MSG::DEBUG) << " Collection exists " << endmsg;
676 return nullptr;
677
678 }
679 else // if collection does not exist create it
680 {
681 coll = new ALFA_RawDataCollection(MBIdNum);
682 msg(MSG::DEBUG) << " create collection; MBId " << MBIdNum <<endmsg;
683 cont->push_back(coll); // add collection to container
684
685
686 }
687
688
689 return coll;
690}
static const InterfaceID IID_IALFA_Decoder("ALFA_Decoder", 1, 0)
#define endmsg
#define ATH_MSG_WARNING(x)
static Double_t sc
ALFA_RawDataCollection * getCollection(unsigned int MotherBoardId, ALFA_RawDataContainer *cont)
ALFA_RawDataCollectionReadOut * m_ALFA_RawDataCollectionReadOut
ALFA_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
ALFA_RawDataContainerReadOut * m_ALFA_RawDataContainerReadOut
virtual ~ALFA_Decoder()
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Service for reading bytestream.
virtual StatusCode initialize()
static const InterfaceID & interfaceID()
ALFA_RawDataReadOut * m_ALFA_RawDataReadOut
virtual StatusCode finalize()
StatusCode fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *robFrag, ALFA_RawDataContainer *rdoCont, std::vector< unsigned int > *vecHash=NULL)
unsigned int m_fragment_number
RDOs : Chamber Service Module, collection of RawData.
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)
This container provides acces to the PMF RDOs.
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)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore()
MsgStream & msg() const
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning 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.
const DataType * PointerType
Definition RawEvent.h:25
eformat::ROBFragment< PointerType > ROBFragment
Definition RawEvent.h:27
EventInfo_v1 EventInfo
Definition of the latest event info version.