35using vsiz_t = vector<int>::size_type;
38 DoRegister( ModuleType(
"Decoder::VLDModule" , 493 ));
43 vld_header_data{}, vld_data{},
44 block_header_found(false), block_trailer_found(false), slot_header_found(false)
58 vld_header_data.clear();
71#if defined DEBUG && defined WITH_DEBUG
90 vld_header_data.num_vld = (pdat >> 16) & 0x1F;
91 vld_header_data.read_count = (pdat >> 8) & 0xFF;
92 vld_header_data.write_count = (pdat >> 0) & 0xFF;
96 *
fDebugFile <<
"VLDModule::Decode:: VLD BLOCK HEADER"
97 <<
" >> data = " << hex << pdat << dec
98 <<
" >> num_vld = " << vld_header_data.num_vld
99 <<
" >> read count = " << vld_header_data.read_count
100 <<
" >> write count = " << vld_header_data.write_count
110 vld_header_data.nwords_inblock = (pdat >> 0) & 0xFFFF;
114 *
fDebugFile <<
"VLDModule::Decode:: VLD BLOCK TRAILER"
115 <<
" >> data = " << hex << pdat << dec
116 <<
" >> nwords in block = " << vld_header_data.nwords_inblock
126 vld_header_data.slotid = (pdat >> 16) & 0x1F;
127 vld_header_data.nconnect = (pdat >> 8) & 0xFF;
130 *
fDebugFile <<
"VLDModule::Decode:: VLD SLOT HEADER"
131 <<
" >> data = " << hex << pdat << dec
132 <<
" >> slot ID = " << vld_header_data.slotid
133 <<
" >> num connector words = " << vld_header_data.nconnect
139 uint32_t
lohi = (pdat >> 24) & 0x1;
140 uint32_t
chnmask = (pdat >> 0) & 0x3FFFF;
142 vld_data.connectid.push_back(
connectid );
143 vld_data.lohi.push_back(
lohi );
144 vld_data.chnmask.push_back(
chnmask );
147 *
fDebugFile <<
"VLDModule::Decode:: VLD SLOT DATA"
148 <<
" >> data = " << hex << pdat << dec
149 <<
" >> slot ID = " << vld_header_data.slotid
150 <<
" >> num connector words = " << vld_header_data.nconnect
151 <<
" >> num connector id = " <<
connectid
152 <<
" >> num lo/hi bit = " <<
lohi
153 <<
" >> channel mask = " <<
chnmask
167 str <<
"VLDModule::Decode:: UNDEFINED TYPE"
168 <<
" >> data = " << hex << pdat << dec
169 <<
" >> data type id = " << data_type_id
174 cerr << str.str() << endl;
182 uint32_t
data = *pdat;
184 uint32_t data_type_id = (
data >> 31) & 0x1;
185 if( data_type_id == 1 )
191 *
fDebugFile <<
"VLDModule::Decode:: VLD DATA TYPES"
192 <<
" >> data = " << hex <<
data << dec
193 <<
" >> data word id = " << data_type_id
220 *
fDebugFile <<
"**********************************************************************"
233 for(
vsiz_t iclus = 0; iclus < vld_data.connectid.size(); iclus++ )
234 sldat->
loadData(
"scaler", 0, vld_data.connectid[iclus], vld_data.connectid[iclus]);
235 for(
vsiz_t iclus = 0; iclus < vld_data.lohi.size(); iclus++ )
236 sldat->
loadData(
"scaler", 0, vld_data.lohi[iclus], vld_data.lohi[iclus]);
237 for(
vsiz_t iclus = 0; iclus < vld_data.chnmask.size(); iclus++ )
238 sldat->
loadData(
"scaler", 0, vld_data.chnmask[iclus], vld_data.chnmask[iclus]);
247 return LoadSlot(sldat, evbuffer, 0, pstop + 1 - evbuffer);
257 const auto*
p = evbuffer +
pos;
258 const auto*
q =
p +
len;
272static void PrintBlock(
const uint32_t* codabuffer, uint32_t pos, uint32_t len )
280 uint32_t
data = codabuffer[idx];
284 cout <<
"Block header"
286 <<
" num_vld = " << ((
data >> 16) & 0x1F)
287 <<
" read = " << ((
data >> 8) & 0xFF)
288 <<
" write = " << (
data & 0xFF);
291 cout <<
"Block trailer"
293 <<
" nwords = " << (
data & 0x3FFFFF);
296 cout <<
" Slot header"
298 <<
" slot = " << ((
data >> 16) & 0x1F)
299 <<
" nwords = " << (
data & 0xFF);
302 cout <<
" Type = " <<
type
326 "VLDModule::LoadBank: Missing block header. Call expert.");
340 assert( ibeg >=
pos && iend > ibeg && iend <
pos+
len );
342 return LoadSlot(sldat, evbuffer, ibeg, iend+1-ibeg);
349 throw logic_error(
"VLDModule::LoadNextEvBuffer called. This module "
350 "does not support multi-block mode. Call expert.");
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
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::vector< uint32_t > lohi
std::vector< uint32_t > chnmask
std::vector< uint32_t > connectid
std::ofstream * fDebugFile
static Long64_t FindIDWord(const uint32_t *buf, size_t start, size_t len, uint32_t type)
virtual void Clear(Option_t *opt="")
Long64_t VerifyBlockTrailer(const UInt_t *evbuffer, UInt_t pos, UInt_t len, Long64_t ibeg, Long64_t iend) const
Int_t loadData(const char *type, UInt_t chan, UInt_t dat, UInt_t raw)
virtual void Clear(Option_t *opt="")
void DecodeSlotHeader(UInt_t pdat, uint32_t data_type_id)
Bool_t block_header_found
void DecodeBlockTrailer(UInt_t pdat)
virtual UInt_t LoadSlot(THaSlotData *sldat, const UInt_t *evbuffer, const UInt_t *pstop)
static TypeIter_t fgThisType
virtual Int_t Decode(const UInt_t *data)
void UnsupportedType(UInt_t pdat, uint32_t data_type_id)
void DecodeBlockHeader(UInt_t pdat, uint32_t data_type_id)
virtual UInt_t LoadNextEvBuffer(THaSlotData *sldat)
virtual UInt_t LoadBank(THaSlotData *sldat, const UInt_t *evbuffer, UInt_t pos, UInt_t len)
Bool_t block_trailer_found
void LoadTHaSlotDataObj(THaSlotData *sldat)
vector< int >::size_type vsiz_t
static void PrintBlock(const uint32_t *codabuffer, uint32_t pos, uint32_t len)