21 DoRegister( ModuleType(
"Decoder::TIBlobModule" , 4 ));
46#if defined DEBUG && defined WITH_DEBUG
74 UInt_t debug = 0, word4 = 0;
75 vector<ConfigStrReq> req = { {
"debug", debug },
89 return LoadSlot(sldat, evbuffer, 0, pstop + 1 - evbuffer);
96 os <<
"TIBlobModule::" <<
function <<
": slot/crate "
104 return (word & 0xFFFF0000) == 0xDA560000;
112 <<
"Unexpected data in event with " << nopt <<
" optional "
113 <<
"words. Expected trigger bits 0xDA5600XX, but found."
114 << hex <<
"0x" << word << dec << endl;
128 const char*
const here =
"LoadSlot";
147 const auto*
p = evbuffer +
pos;
148 UInt_t nwords = (*
p & 0xFFFF) + 1;
150 cerr <<
Here(here) <<
"Reported event length too long: hdr = "
151 << nwords <<
", buf = " <<
len <<
", need <= " <<
kNTICHAN
152 <<
" and <= " <<
len << endl;
156 cerr <<
Here(here) <<
"Reported event length too short. Got "
157 << nwords <<
", need >= 2" << endl;
161 cerr <<
Here(here) <<
"Inconsistent event length = " << nwords
162 <<
" but timestamp present requires >= 3" << endl;
166 cerr <<
Here(here) <<
"Warning: TI event data unexpectedly "
167 <<
" followed by " <<
len-nwords <<
" extra words" << endl;
189 const auto*
q = evbuffer +
pos + nwords;
191 auto noptional =
q-
p;
192 if( noptional == 2 ) {
204 else if( noptional == 1 ) {
224 cerr <<
Here(here) <<
"Unexpected decoding error, read "
225 <<
p - evbuffer -
pos
226 <<
" words out of " << nwords <<
". Call expert." << endl;
248 const uint32_t ID =
BIT(31) | (slot & 0x1F) << 22;
249 const auto*
p = buf +
start;
250 const auto*
q =
p +
len;
251 while(
p !=
q && (*
p & 0xFFFC0000) != ID )
253 return (
p !=
q) ?
p - buf : -1;
264 const char*
const here =
"LoadBank";
269 cerr << here <<
"Bank too short. Expected >= 5, got " <<
len <<
" words."
282 <<
"No block header found in bank. Call expert." << endl;
287 <<
"Warning: " << ibeg-
pos <<
" words of leading garbage" << endl;
289 const UInt_t*
p = evbuffer+ibeg;
296 UInt_t hdr2id = (*++
p & 0xFFFEFF00);
297 if( hdr2id != 0xFF102000 ) {
298 cerr <<
Here(here) <<
"Invalid block header #2 signature = " << hex
299 <<
"0x" << *
p << dec <<
", expected 0xFF1020xx or 0xFF1120xx" << endl;
303 UInt_t block_size2 = (*
p & 0x000000FF);
305 cerr <<
Here(here) <<
"Warning: block sizes in block headers #1 and #2 "
306 <<
"disagree: " <<
block_size <<
", " << block_size2 << endl;
316 while( blksz > 0 &&
p-evbuffer <
pos+
len) {
317 UInt_t sig = (*
p & 0x00FF0000) >> 16;
319 cerr <<
Here(here) <<
"Invalid event header signature for iblock "
320 <<
block_size-blksz <<
". Expected xx01xxxx, got "
321 << hex <<
"0x" << *
p << dec << endl;
324 UInt_t nwords = (*
p & 0xFFFF) + 1;
326 cerr <<
Here(here) <<
"Event data too short, expected >= 2, got "
330 evtblk.push_back(
p - evbuffer);
336 cerr <<
Here(here) <<
"Incorrect number of events found, expected "
345 cerr <<
Here(here) <<
"Warning: Missing block trailer" << endl;
349 size_t blklen = iend + 1 - ibeg;
351 cerr <<
Here(here) <<
"Warning: block trailer word count mismatch, "
354 assert( ibeg >=
pos && iend > ibeg && iend <
pos+
len );
358 && (*
p & 0xF7C00000) == (0xF0000000 | (
fSlot & 0x1F) << 22) ) {
363 <<
" trailing garbage words" << endl;
380 return LoadSlot(sldat, evbuffer, ibeg, iend-ibeg)
393 assert( ii+1 <
evtblk.size() );
398 assert(ibeg > 0 && iend > ibeg);
441 Warning(
"TIBlobModule::SetWord4Type",
442 "Unsupported type for 3rd/4th data word: %u. "
443 "Check configuration string in crate map.",
type);
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
ClassImp(VDC::AnalyticTTDConv) using namespace std
std::ofstream * fDebugFile
static void ParseConfigStr(const char *configstr, const std::vector< ConfigStrReq > &req)
std::vector< UInt_t > fData
std::vector< Long64_t > evtblk
virtual void Clear(Option_t *opt="")
Int_t loadData(const char *type, UInt_t chan, UInt_t dat, UInt_t raw)
virtual UInt_t LoadNextEvBuffer(THaSlotData *sldat)
virtual UInt_t LoadSlot(THaSlotData *sldat, const UInt_t *evbuffer, const UInt_t *pstop)
std::string Here(const char *function)
virtual void Clear(const Option_t *opt="")
virtual UInt_t GetData(UInt_t chan) const
void SetWord4Type(UInt_t type)
void CheckWarnTrigBits(UInt_t word, UInt_t nopt, const char *here)
static TypeIter_t fgThisType
virtual UInt_t LoadBank(THaSlotData *sldat, const UInt_t *evbuffer, UInt_t pos, UInt_t len)
virtual void Warning(const char *method, const char *msgfmt,...) const
static bool IsTrigBits(UInt_t word)
static Long64_t FindBlockHeaderForSlot(const UInt_t *buf, UInt_t start, UInt_t len, UInt_t slot)
void function(const Char_t *name_, T fun, const Char_t *docstring=0)