10 #include <TClonesArray.h>
21 :
FairUnpack(type, subType, procId, subCrate, control)
22 , fRawData(new TClonesArray(
"FairMBSRawItem"))
29 LOG(info) <<
"FairMBSUnpack: Delete instance";
42 LOG(info) <<
"FairMBSUnpack : Registering...";
47 fMan->
Register(
"MBSRawItem",
"MBS", fRawData, kTRUE);
53 LOG(debug) <<
"FairMBSUnpack : Unpacking... size = " << size;
62 UInt_t* p1 =
reinterpret_cast<UInt_t*
>(data + l_i);
63 UInt_t l_sam_id = (p1[0] & 0xf0000000) >> 28;
64 UInt_t l_gtb_id = (p1[0] & 0x0f000000) >> 24;
65 UInt_t l_lec = (p1[0] & 0x00f00000) >> 20;
66 UInt_t l_da_siz = (p1[0] & 0x000001ff);
68 LOG(debug) <<
"FairMBSUnpack : SAM:" << l_sam_id <<
", GTB:" << l_gtb_id <<
", lec:" << l_lec
69 <<
", size:" << l_da_siz;
73 p1 =
reinterpret_cast<UInt_t*
>((data + l_i));
75 for (UInt_t i1 = 0; i1 < l_da_siz; i1 += 2) {
82 tac_addr = (p1[i1] & 0xf8000000) >> 27;
83 tac_ch = (p1[i1] & 0x07c00000) >> 22;
84 cal = (p1[i1] & 0x003C0000) >> 18;
85 clock = 63 - ((p1[i1] & 0x0003f000) >> 12);
86 tac_data = 4095 - ((p1[i1] & 0x00000fff));
87 qdc_data = (p1[i1 + 1] & 0x00000fff);
93 LOG(debug) <<
"FairMBSUnpack : TAC ADDR IS " << tac_addr <<
", TAC CH IS " << tac_ch <<
", TAC Data IS "
94 << tac_data <<
", QDC Data IS " << qdc_data;
95 new ((*fRawData)[fNHits])
96 FairMBSRawItem(l_sam_id, l_gtb_id, tac_addr, tac_ch, cal, clock, tac_data, qdc_data);
100 LOG(debug) <<
"FairMBSUnpack : n17=" << n17;
103 LOG(debug) <<
"FairMBSUnpack : Number of hits in LAND: " << fNHits;
105 fNHitsTotal += fNHits;
113 LOG(debug) <<
"FairMBSUnpack : Clearing Data Structure";
virtual Bool_t DoUnpack(Int_t *data, Int_t size)
FairMBSUnpack(Short_t type=94, Short_t subType=9400, Short_t procId=10, Short_t subCrate=1, Short_t control=3)
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
void Register(const char *name, const char *Foldername, TNamed *obj, Bool_t toFile)