ClassImp(AliTRDRawStreamV2)
+UInt_t AliTRDRawStreamV2::fgDumpHead = 0;
+
//_____________________________________________________________________________
AliTRDRawStreamV2::AliTRDRawStreamV2()
:AliTRDrawStreamBase()
,fBufSize(0)
,fkBufferSet(kFALSE)
,fPos(NULL)
+ ,fpBegin(NULL)
+ ,fpEnd(NULL)
,fDataWord(NULL)
,fTimeBinsCalib(0)
,fADClookup()
,fBufSize(0)
,fkBufferSet(kFALSE)
,fPos(NULL)
+ ,fpBegin(NULL)
+ ,fpEnd(NULL)
,fDataWord(NULL)
,fTimeBinsCalib(0)
,fADClookup()
,fBufSize(0)
,fkBufferSet(kFALSE)
,fPos(NULL)
+ ,fpBegin(NULL)
+ ,fpEnd(NULL)
,fDataWord(NULL)
,fTimeBinsCalib(0)
,fADClookup()
fBufSize = 0;
fDataWord = NULL;
fPos = NULL;
+ fpBegin = NULL;
+ fpEnd = NULL;
fWordCtr = 0;
fkBufferSet = kFALSE;
int itemp = 1;
char* ptemp = (char*) &itemp;
+ fpBegin = (UInt_t*)fPos;
+ fpEnd = fpBegin + (fBufSize/sizeof(UInt_t));
if (ptemp[0] != 1)
{
// need to swap...
// assume we are at the begining of the buffer!
//AliDebug(5, "Swapping.");
- UInt_t *pbegin = (UInt_t*)fPos;
+ //UInt_t *pbegin = (UInt_t*)fPos;
UInt_t iutmp = 0;
for (UInt_t i = 0; i < fBufSize / fgkSizeWord; i++)
{
- fDataWord = pbegin + i;
+ fDataWord = fpBegin + i;
iutmp = (((*fDataWord & 0x000000ffU) << 24) | ((*fDataWord & 0x0000ff00U) << 8) |
((*fDataWord & 0x00ff0000U) >> 8) | ((*fDataWord & 0xff000000U) >> 24));
// here we override the value in the buffer!
*fDataWord = iutmp;
}
- fDataWord = pbegin;
+ fDataWord = fpBegin;
+ }
+
+ // dump words - debugging perpose
+ if (fgDumpHead > 0){
+ AliInfo(Form("---------- Dumping %u words from the beginnig of the buffer ----------",fgDumpHead));
+ if (DumpWords(fpBegin, fgDumpHead) == kFALSE){AliError("Dump failed. Not enough data.");}
+ AliInfo(Form("---------- Dumping ended ----------------------------------------------"));
}
+
}
//____________________________________________________________________________
Int_t AliTRDRawStreamV2::NextData()
//return kFALSE;
return -1;
}
+
+//____________________________________________________________________________
+Bool_t
+AliTRDRawStreamV2::DumpWords(UInt_t *px, UInt_t iw, UInt_t marker)
+{
+
+ TString tsreturn = Form("\n[ Dump Sequence at 0x%08x ] : ", px);
+ for (UInt_t i = 0; i < iw; i++)
+ {
+ if (px + iw >= fpEnd)
+ return kFALSE;
+
+ if (i % 8 == 0)
+ tsreturn += "\n ";
+ if (marker != 0 && marker == px[i])
+ tsreturn += Form(" *>0x%08x<* ", px[i]);
+ else
+ tsreturn += Form("0x%08x ", px[i]);
+ }
+ tsreturn += "\n";
+
+ AliInfo(tsreturn.Data());
+
+ return kTRUE;
+}
+
+