///////////////////////////////////////////////////////////////////////////////
#include "AliHLTTPCDefinitions.h"
-
+#include "AliHLTTPCTransform.h"
+#include <cerrno>
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTTPCDefinitions)
return true;
}
+Int_t AliHLTTPCDefinitions::GetSingleSliceNr( ULong_t spec )
+{
+ // get the slice number provided that spec encodes a single slice
+ // return -EINVAL if encoded min and max slice differ
+ // return -ERANGE if slice number out of range
+ AliHLTUInt8_t min=GetMinSliceNr(spec);
+ AliHLTUInt8_t max=GetMaxSliceNr(spec);
+ if (min!=max) return -EINVAL;
+ if (max>=AliHLTTPCTransform::GetNSlice()) return -ERANGE;
+ return min;
+}
+
+Int_t AliHLTTPCDefinitions::GetSinglePatchNr( ULong_t spec )
+{
+ // get the patch number provided that spec encodes a single patch
+ // return -EINVAL if encoded min and max patch differ
+ // return -ERANGE if patch number out of range
+ AliHLTUInt8_t min=GetMinPatchNr(spec);
+ AliHLTUInt8_t max=GetMaxPatchNr(spec);
+ if (min!=max) return -EINVAL;
+ if (max>=AliHLTTPCTransform::GetNumberOfPatches()) return -ERANGE;
+ return min;
+}
{
return (AliHLTUInt8_t)( (spec & 0xFF000000) >> 24 );
}
+ static Int_t GetSingleSliceNr( const AliHLTComponentBlockData& block )
+ {
+ return GetSingleSliceNr(block.fSpecification);
+ }
+ static Int_t GetSingleSliceNr( ULong_t spec );
static AliHLTUInt8_t GetMinPatchNr( const AliHLTComponentBlockData& block )
{
return (AliHLTUInt8_t)( (block.fSpecification & 0x000000FF) );
{
return (AliHLTUInt8_t)( (spec & 0x0000FF00) >> 8 );
}
-
+ static Int_t GetSinglePatchNr( const AliHLTComponentBlockData& block )
+ {
+ return GetSinglePatchNr(block.fSpecification);
+ }
+ static Int_t GetSinglePatchNr( ULong_t spec );
static AliHLTUInt32_t EncodeDataSpecification( AliHLTUInt8_t minSliceNr,
AliHLTUInt8_t maxSliceNr,
AliHLTUInt8_t minPatchNr,