/// @brief Decoder methods for the HWCF format
///
-#include "AliHLTTPCRootTypes.h"
+#include "Rtypes.h"
#include "AliHLTDataTypes.h"
#include "AliHLTLogging.h"
#include "AliHLTErrorGuard.h"
bool CheckAssumption(int format, const AliHLTUInt8_t* pData, int size) const;
// check if index is within bounds
+
bool CheckBounds(int i) const {
if (fVersion<0) {
- ALIHLTERRORGUARD(1, "");
+ ErrorMsg("");
return false;
}
int elementsize=GetElementSize(fVersion);
case 0: return sizeof(AliHLTTPCHWClusterV0);
case 1: return sizeof(AliHLTTPCHWClusterV1);
default:
- ALIHLTERRORGUARD(1, "invalid format version %d", fVersion);
+ ErrorMsg(Form("invalid format version %d", fVersion));
}
return -1;
}
const AliHLTUInt8_t* GetRCUTrailer() const
{
if (fRCUTrailerSize<=0 || fpBuffer==NULL || fBufferSize<fRCUTrailerSize) return NULL;
- return fpBuffer+fRCUTrailerSize;
+ return fpBuffer+(fBufferSize-fRCUTrailerSize);
}
// size of RCU trailer
// print info
void Print(const char* option);
+ // print error message
+ void ErrorMsg( const char *str ) const;
+
// open a file and init
int Open(const char* filename);
Int_t GetPadRow() const;
Float_t GetPad() const {return fPad+0.5;}
Float_t GetTime() const {return fTime;}
- Float_t GetSigmaY2() const {return fSigmaY2;}
- Float_t GetSigmaZ2() const {return fSigmaZ2;}
+ Float_t GetSigmaY2() const {
+ Float_t sy2 = fSigmaY2 - fPad*fPad;
+ return (sy2>0) ?sy2 :0.;
+ }
+ Float_t GetSigmaZ2() const {
+ Float_t sz2 = fSigmaZ2 - fTime*fTime;
+ return (sz2>0) ?sz2 :0.;
+ }
Int_t GetCharge() const;
Int_t GetQMax() const {return -1;}
};
Int_t GetPadRow() const;
Float_t GetPad() const {return fPad+0.5;}
Float_t GetTime() const {return fTime;}
- Float_t GetSigmaY2() const {return fSigmaY2;}
- Float_t GetSigmaZ2() const {return fSigmaZ2;}
+ Float_t GetSigmaY2() const {
+ Float_t sy2 = fSigmaY2 - fPad*fPad;
+ return (sy2>0) ?sy2 :0.;
+ }
+ Float_t GetSigmaZ2() const {
+ Float_t sz2 = fSigmaZ2 - fTime*fTime;
+ return (sz2>0) ?sz2 :0.;
+ }
Int_t GetCharge() const;
Int_t GetQMax() const;
};
: fData(pData), fVersion(version), fElementSize(elementSize) {}
iterator(const iterator& i)
: fData(i.fData), fVersion(i.fVersion), fElementSize(i.fElementSize) {}
- iterator& operator=(const iterator& i)
- { fData=i.fData; fVersion=i.fVersion; fElementSize=i.fElementSize; return *this;}
+ iterator& operator=(const iterator& i) {
+ if (this==&i) return *this;
+ fData=i.fData; fVersion=i.fVersion; fElementSize=i.fElementSize; return *this;
+ }
~iterator() {fData=NULL;}
bool operator==(const iterator& i) const {return (fData!=NULL) && (fData==i.fData);}