10 #include <TClonesArray.h>
13 #include <FairMQLogger.h>
21 :
FairUnpack(type, subType, procId, subCrate, control)
22 , fRawData(new TClonesArray(
"FairMBSRawItem"))
30 LOG(info) <<
"FairMBSUnpacker: Delete instance";
40 LOG(debug) <<
"FairMBSUnpacker: Unpacking... size = " << size;
49 UInt_t* p1 =
reinterpret_cast<UInt_t*
>(data + l_i);
50 UInt_t l_sam_id = (p1[0] & 0xf0000000) >> 28;
51 UInt_t l_gtb_id = (p1[0] & 0x0f000000) >> 24;
52 UInt_t l_lec = (p1[0] & 0x00f00000) >> 20;
53 UInt_t l_da_siz = (p1[0] & 0x000001ff);
55 LOG(debug) <<
"FairMBSUnpacker: SAM: " << l_sam_id <<
", GTB: " << l_gtb_id <<
", lec: " << l_lec
56 <<
", size: " << l_da_siz;
60 p1 =
reinterpret_cast<UInt_t*
>(data + l_i);
62 for (UInt_t i1 = 0; i1 < l_da_siz; i1 += 2) {
69 tac_addr = (p1[i1] & 0xf8000000) >> 27;
70 tac_ch = (p1[i1] & 0x07c00000) >> 22;
71 cal = (p1[i1] & 0x003C0000) >> 18;
72 clock = 63 - ((p1[i1] & 0x0003f000) >> 12);
73 tac_data = 4095 - ((p1[i1] & 0x00000fff));
74 qdc_data = (p1[i1 + 1] & 0x00000fff);
80 LOG(debug) <<
"FairMBSUnpacker: TAC ADDR: " << tac_addr <<
", TAC CH: " << tac_ch
81 <<
", TAC Data: " << tac_data <<
", QDC Data: " << qdc_data;
82 new ((*fRawData)[fNHits])
83 FairMBSRawItem(l_sam_id, l_gtb_id, tac_addr, tac_ch, cal, clock, tac_data, qdc_data);
87 LOG(debug) <<
"FairMBSUnpacker: n17=" << n17;
90 LOG(debug) <<
"FairMBSUnpacker: Number of hits in LAND: " << fNHits;
92 fNHitsTotal += fNHits;
100 LOG(debug) <<
"FairMBSUnpacker: Clearing Data Structure";
virtual Bool_t DoUnpack(Int_t *data, Int_t size)
FairMBSUnpacker(Short_t type=94, Short_t subType=9400, Short_t procId=10, Short_t subCrate=1, Short_t control=3)
ClassImp(FairEventBuilder)
virtual ~FairMBSUnpacker()