]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.cxx
The segmentations are made data member of the AliITSUGeomTGeo, will be loaded
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCDigitReaderUnpacked.cxx
index c8be290b74d41953db96c63eaf03a51184b01367..85fbb454fdd8dc3f6b3c835a6c8f391818ede9fe 100644 (file)
     @brief  A digit reader implementation for unpacked TPC data.
 */
 
-#if __GNUC__== 3
-using namespace std;
-#endif
-
 #include <cassert>
 #include "AliHLTTPCDigitReaderUnpacked.h"
 #include "AliHLTTPCDigitData.h"
@@ -35,6 +31,8 @@ using namespace std;
 #include "AliHLTStdIncludes.h"
 #include "AliHLTTPCMapping.h"
 
+using namespace std;
+
 ClassImp(AliHLTTPCDigitReaderUnpacked)
 
 AliHLTTPCDigitReaderUnpacked::AliHLTTPCDigitReaderUnpacked()
@@ -134,6 +132,7 @@ int AliHLTTPCDigitReaderUnpacked::GetNextRowData(AliHLTTPCDigitRowData*& pRow) c
   AliHLTTPCDigitRowData* pCurrent=pRow;
   assert(pCurrent);
   pRow=NULL;
+  if (!pCurrent) return -EINVAL;
   Byte_t *tmp = (Byte_t*) pCurrent;
   Int_t size = sizeof(AliHLTTPCDigitRowData) + pCurrent->fNDigit*sizeof(AliHLTTPCDigitData);
   tmp += size;
@@ -292,6 +291,13 @@ AliHLTUInt32_t AliHLTTPCDigitReaderUnpacked::GetAltroBlockHWaddr() const
   return (AliHLTUInt32_t)(fMapping->GetHwAddress((UInt_t)GetSortedRow(),(UInt_t)GetSortedPad()));//fTPCRawStream->GetHWAddress();
 }
 
+AliHLTTPCDigitData AliHLTTPCDigitReaderUnpacked::GetSortedDigit(){
+  // see header file for class documentation
+  assert(fData);
+  if (!fData) return AliHLTTPCDigitData();
+  return fData[fBinRowPositionSorted.at(fBin)];
+}
+
 Int_t AliHLTTPCDigitReaderUnpacked::GetSortedTime(){
   // see header file for class documentation
   assert(fData);
@@ -389,7 +395,7 @@ int AliHLTTPCDigitReaderUnpacked::NextBunch()
   fPrevPad = GetSortedPad();
   fPrevRow = GetSortedRow();
   fDataBunch.push_back(GetSortedSignal());
-  fDigitsVector.push_back(fData[fBin]);
+  fDigitsVector.push_back(GetSortedDigit());
 
   do{
     if(NextSignal()){
@@ -398,7 +404,7 @@ int AliHLTTPCDigitReaderUnpacked::NextBunch()
            fPrevTime = GetSortedTime();
            //fDataBunch.insert(fDataBunch.begin(), GetSortedSignal());// add the signal to the beginning of the buffer     
            fDataBunch.push_back(GetSortedSignal());// add the signal to the beginning of the buffer
-           fDigitsVector.push_back(fData[fBin]);
+           fDigitsVector.push_back(GetSortedDigit());
          }
          else{//end of bunch but not of channel
            break;