]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCDigitReaderDecoder.cxx
correcting minor compilation and runtime warnings
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCDigitReaderDecoder.cxx
index 15324aa77511c546c3c787e7cd961d365e961ad9..5087cc7588eda9c22ce9f87d10d5e802b5fbc0b7 100644 (file)
@@ -34,6 +34,7 @@ using namespace std;
 #include "AliAltroDecoder.h"
 #include "AliAltroData.h"
 #include "AliAltroBunch.h"
+#include "AliHLTTPCTransform.h"
 
 ClassImp(AliHLTTPCDigitReaderDecoder)
 
@@ -87,10 +88,23 @@ int AliHLTTPCDigitReaderDecoder::InitBlock(void* ptr,unsigned long size, Int_t p
   return 0;
 }
 
+void AliHLTTPCDigitReaderDecoder::SetUnsorted(bool unsorted)
+{
+  // see header file for class documentation
+
+  // The DigitReaderDecoder does not support sorted data, forward to
+  // default if sorted data requested
+  if (!unsorted) AliHLTTPCDigitReader::SetUnsorted(unsorted);
+}
+
 bool AliHLTTPCDigitReaderDecoder::NextChannel()
 {
   // see header file for class documentation
-  return fAltroDecoder->NextChannel(&fAltroData);
+  Bool_t result=fAltroDecoder->NextChannel(&fAltroData);
+  if(result && !fMapping->IsValidHWAddress(fAltroData.GetHadd())){
+    result = fAltroDecoder->NextChannel(&fAltroData);
+  }
+  return result;
 }
 
 int AliHLTTPCDigitReaderDecoder::NextBunch()
@@ -157,13 +171,19 @@ int AliHLTTPCDigitReaderDecoder::GetSignal()
 int AliHLTTPCDigitReaderDecoder::GetTime()
 {
   // see header file for class documentation
+  int iResult=0;
   if(!fNextSignalMethodUsed){// this is true if the bunch approach is used
-    return fAltroBunch->GetStartTimeBin();
+    
+    iResult= fAltroBunch->GetStartTimeBin();
   }
   else{
     assert(fNextCounter>=0);
-    return fAltroBunch->GetStartTimeBin()+fNextCounter;
+    iResult = fAltroBunch->GetStartTimeBin()+fNextCounter;
   }
+  if(iResult<0 || iResult>AliHLTTPCTransform::GetNTimeBins()){
+    iResult=0;
+  }
+  return iResult;
 }
 
 int AliHLTTPCDigitReaderDecoder::GetBunchSize()
@@ -172,8 +192,22 @@ int AliHLTTPCDigitReaderDecoder::GetBunchSize()
   return fAltroBunch->GetBunchSize();
 }
 
+int AliHLTTPCDigitReaderDecoder::GetRowOffset() const
+{
+  return fMapping->GetRowOffset();
+}
 AliHLTUInt32_t AliHLTTPCDigitReaderDecoder::GetAltroBlockHWaddr() const
 {
   // see header file for class documentation
   return (AliHLTUInt32_t)fAltroData.GetHadd();
 }
+AliHLTUInt32_t AliHLTTPCDigitReaderDecoder::GetAltroBlockHWaddr(Int_t row, Int_t pad) const
+{
+  // see header file for class documentation
+  if(fMapping){
+    return fMapping->GetHwAddress(row,pad);
+  }
+  else{
+    return 0;
+  }
+}