#include "AliHLTErrorGuard.h"
#include "AliHLTTPCHWCFEmulator.h"
#include "AliHLTTPCTransform.h"
-#include "AliRawDataHeader.h"
+#include "AliHLTCDHWrapper.h"
#include "TFile.h"
#include <memory>
#include <ostream>
, fForcedVersion(forceVersion)
, fRCUTrailerSize(0)
, fpFileBuffer(NULL)
+ , fIterator()
+ , fIteratorEnd()
{
// constructor
}
// check if the first RCU trailer word starts with pattern '10'
rcuTrailer-=nofRCUTrailerWords-1;
if ((*rcuTrailer >> 30) != 2) {
- HLTError("inconsistent RCU trailer word: can not find indicator patter '10' in bit 30 and 31 (0x08x)", *rcuTrailer);
+ HLTError("inconsistent first RCU trailer word: can not find indicator pattern '10' in bit 31 and 30 (0x%08x): trailer size %d word(s), buffer size %d byte", *rcuTrailer, nofRCUTrailerWords, bufferSize);
return -ENODATA;
}
return (fBufferSize-fRCUTrailerSize)/elementsize;
}
-int AliHLTTPCHWCFData::GetElementSize(int version) const
-{
- // get the size of one element
- switch (version) {
- case 0: return sizeof(AliHLTTPCHWClusterV0);
- case 1: return sizeof(AliHLTTPCHWClusterV1);
- default:
- ALIHLTERRORGUARD(1, "invalid format version %d", fVersion);
- }
- return -1;
-}
-
-bool AliHLTTPCHWCFData::CheckBounds(int i) const
-{
- // check if index is within bounds
- if (fVersion<0) {
- ALIHLTERRORGUARD(1, "");
- return false;
- }
- int elementsize=GetElementSize(fVersion);
- if (elementsize<0) return false;
- return ((i+1)*elementsize+fRCUTrailerSize<=fBufferSize);
-}
-
Int_t AliHLTTPCHWCFData::GetPadRow(int i) const
{
// get raw coordinate
ALIHLTERRORGUARD(1, "invalid format version %d", fVersion);
}
}
- return -10000.;
+ return -1;
}
Int_t AliHLTTPCHWCFData::GetQMax(int i) const
ALIHLTERRORGUARD(1, "invalid format version %d", fVersion);
}
}
- return -10000.;
+ return -1;
}
void AliHLTTPCHWCFData::Print(const char* option)
}
}
+void AliHLTTPCHWCFData::ErrorMsg( const char *str ) const
+{
+ ALIHLTERRORGUARD(1, str);
+}
+
int AliHLTTPCHWCFData::Open(const char* filename)
{
// open block from file and add to collection
iResult=-ENODATA;
}
- AliHLTUInt8_t* pBuffer=reinterpret_cast<AliHLTUInt8_t*>(buffer->GetArray()+sizeof(AliRawDataHeader));
- unsigned bufferSize=buffer->GetSize()-sizeof(AliRawDataHeader);
+ AliHLTCDHWrapper header(buffer->GetArray());
+ AliHLTUInt8_t* pBuffer=reinterpret_cast<AliHLTUInt8_t*>(buffer->GetArray()+header.GetHeaderSize());
+ unsigned bufferSize=buffer->GetSize()-header.GetHeaderSize();
if ((iResult=Init(pBuffer, bufferSize))<0 ||
(iResult=CheckVersion())<0) {
Reset();
Int_t AliHLTTPCHWCFData::AliHLTTPCHWClusterV1::GetQMax() const
{
- // 24 bit fixed point number with 6 bits after the point
+ // 24 bit fixed point number with 12 bits after the point
AliHLTUInt32_t header=AliHLTTPCHWCFEmulator::ReadBigEndian(fHeader);
- return (header & 0xFFFFFF )>>6;
+ return (header & 0xFFFFFF )>>12;
}