13 #include "hcategory.h"
17 #include "hldsource.h"
18 #include "hldsubevt.h"
29 #define PR(x) std::cout << "++DEBUG: " << #x << " = |" << x << "| (" << __FILE__ << ", " << __LINE__ << ")\n";
30 #define PRh(x) std::cout << "++DEBUG: " << #x << " = hex |" << std::hex << x << std::dec << "| (" << __FILE__ << ", " << __LINE__ << ")\n";
43 reportCritical = kFALSE;
58 Error (
"init",
"No PionTracker found.");
70 Error (
"init",
"No Pointer to parameter container PionTrackerTrb3Lookup.");
97 Warning (
"execute",
"EvtId: 0x%x, Unpacker 0x%x ==> no data",
109 UInt_t * databeg = pSubEvt->getData();
110 UInt_t * dataend = pSubEvt->getEnd();
114 size_t data_size = dataend - databeg;
116 if (data_size == 0)
return 0;
121 ptstate sm = sm_wait_for_board;
126 for (
size_t cnt = 0; cnt < data_size; ++cnt)
128 UInt_t d = * (databeg + cnt);
132 case sm_wait_for_board:
133 datanum = (d >> 16) & 0xFFFF;
134 uTrbNetAddress = d & 0xFFFF;
144 if (uTrbNetAddress == 0x5555)
150 pTrbBoard = pLookup->getBoard (uTrbNetAddress);
154 Warning (
"HPionTrackerTrb3Unpacker::execute",
155 "Evt Nr : %i TrbNetAdress: %x (%i) unpacked but TRB Board not in lookup table",
156 nEvt, uTrbNetAddress, uTrbNetAddress);
169 pths = decodeSubevent(d);
182 if (datacnt != datanum)
184 Error (
"execute()",
"Event %d --> datanum and datacnt differs. datanum=%lu, datacnt=%lu", nEvt, datanum, datacnt);
187 sm = sm_wait_for_board;
196 ptds = decodeData_Cosy13(d, pths);
199 ptds = decodeData_140115(d, pths);
211 sm = sm_wait_for_board;
229 bool olddesign = ((h >> 30) & 0x03) == 0x00;
234 pths.
tsref = h & 0xfff;
235 pths.
evcnt = (h >> 12) & 0x3ff;
236 pths.
romode = (h >> 22) & 0x3;
238 pths.
boardid = (h >> 24) & 0xff;
244 pths.
tsref = h & 0xfff;
245 pths.
evcnt = (h >> 12) & 0x3ff;
246 pths.
romode = (h >> 22) & 0x3;
247 pths.
version = (h >> 26) & 0xf;
248 pths.
boardid = (h >> 30) & 0x3;
257 ptds.
ts = (d >> 0) & 0xfff;
258 ptds.
adc = (d >> 12) & 0xfff;
259 ptds.
strip = (d >> 24) & 0x7f;
260 ptds.
pileup = (d >> 31) & 0x01;
273 ptds.
adc = (d >> 11) & 0xfff;
275 ptds.
pileup = (d >> 24) & 0x01;
276 ptds.
strip = (d >> 25) & 0x7f;
280 ptds.
adc = (d >> 11) & 0xffe;
282 ptds.
pileup = (d >> 24) & 0x01;
283 ptds.
strip = (d >> 25) & 0x7f;
286 ptds.
ts = d & 0x3fff;
287 ptds.
adc = (d >> 11) & 0xff8;
289 ptds.
pileup = (d >> 24) & 0x01;
290 ptds.
strip = (d >> 25) & 0x7f;
293 ptds.
ts = d & 0x3fff;
294 ptds.
adc = (d >> 13) & 0xffe;
297 ptds.
strip = (d >> 25) & 0x7f;
345 Warning (
"HPionTrackerTrb3Unpacker::execute()",
346 "Can't get slot mod=%i, chan=%i", loc[0], loc[1]);
353 pRaw->
setData (time, charge, pileup, overflow);
357 Warning (
"HPionTrackerTrb3Unpacker::execute()",
358 "Not found in lookup table: TrbNetAddress=%i, channel=%i", uTrbNetAddress, channel);
Bool_t fillRaw(const ptdataset &ptds)
ptdataset decodeData_140115(UInt_t d, const ptheaderset &hs)
const Cat_t catPionTrackerRaw
ClassImp(HPionTrackerTrb3Unpacker) HPionTrackerTrb3Unpacker
HRuntimeDb * getRuntimeDb(void)
HEvent *& getCurrentEvent(void)
virtual HEventHeader * getHeader(void) const
Bool_t setData(const Float_t time, const Float_t charge, const Char_t pileup=0, const Char_t overflow=0)
void getAddress(Int_t &m, Int_t &c)
HSpectrometer * getSetup(void)
HDetector * getDetector(const Char_t *name)
ptdataset decodeData_Cosy13(UInt_t d, const ptheaderset &hs)
ptheaderset decodeSubevent(UInt_t h)
HParSet * getContainer(const Text_t *)
HCategory * buildCategory(Cat_t)
void setAddress(const Int_t m, const Int_t s)