// $Id$
/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * This file is property of and copyright by the ALICE HLT Project *
+ * ALICE Experiment at CERN, All rights reserved. *
* *
- * Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
- * Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
- * for The ALICE Off-line Project. *
+ * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
+ * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
+ * Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
+ * for The ALICE HLT Project. *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-///////////////////////////////////////////////////////////////////////////////
-// //
-// base class for reading packed and unpacked data for the HLT //
-// //
-///////////////////////////////////////////////////////////////////////////////
+/** @file AliHLTTPCDigitReader.cxx
+ @author Timm Steinbeck, Jochen Thaeder, Matthias Richter, Kenneth Aamodt
+ @date
+ @brief An abstract reader class for TPC data.
+*/
-#if __GNUC__== 3
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#if __GNUC__>= 3
using namespace std;
#endif
#include "AliHLTTPCDigitReader.h"
+#include "AliHLTTPCTransform.h"
+#include "AliHLTStdIncludes.h"
ClassImp(AliHLTTPCDigitReader)
-AliHLTTPCDigitReader::AliHLTTPCDigitReader(){
+AliHLTTPCDigitReader::AliHLTTPCDigitReader()
+ :
+ fFlags(0),
+ fLckRow(-1),
+ fLckPad(-1)
+{
+ // see header file for class documentation
+ // or
+ // refer to README to build package
+ // or
+ // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTTPCDigitReader::~AliHLTTPCDigitReader()
+{
+ // see header file for class documentation
+}
+
+int AliHLTTPCDigitReader::InitBlock(void* ptr,unsigned long size,Int_t firstrow,Int_t lastrow, Int_t patch, Int_t slice)
+{
+ // see header file for class documentation
+ if (patch<0 || patch>=AliHLTTPCTransform::GetNumberOfPatches()) {
+ HLTError("invalid readout partition number %d", patch);
+ return -EINVAL;
+ }
+ if (firstrow!=AliHLTTPCTransform::GetFirstRow(patch)) {
+ HLTWarning("The firstrow parameter does not match the layout of the readout partition %d "
+ "(firstrow=%d). Parameter is ignored", patch, AliHLTTPCTransform::GetFirstRow(patch));
+ }
+ if (lastrow!=AliHLTTPCTransform::GetLastRow(patch)) {
+ HLTWarning("The lastrow parameter does not match the layout of the readout partition %d "
+ "(lastrow=%d). Parameter is ignored", patch, AliHLTTPCTransform::GetLastRow(patch));
+ }
+ return InitBlock(ptr, size, patch, slice);
+}
+
+void AliHLTTPCDigitReader::SetOldRCUFormat(Bool_t /*oldrcuformat*/)
+{
+ // default method of the base class
+}
+
+void AliHLTTPCDigitReader::SetUnsorted(Bool_t /*unsorted*/)
+{
+ // default method of the base class
+ HLTWarning("common sorting functionality has not yet been implemented");
+}
+
+bool AliHLTTPCDigitReader::Next(int /*type*/)
+{
+ // see header file for class documentation
+ if (!CheckFlag(kLocked)) return NextSignal();
+
+ bool haveData=false;
+ if (!CheckFlag(kChannelOverwrap))
+ haveData=NextSignal();
+
+ if (haveData && (fLckRow!=GetRow() || fLckPad!=GetPad())) {
+ SetFlag(kChannelOverwrap);
+ haveData=false;
+ }
+
+ return haveData;
+}
+
+bool AliHLTTPCDigitReader::NextChannel()
+{
+ // see header file for class documentation
+ PrintMissingFastAccessWarning();
+ return false;
+}
+
+int AliHLTTPCDigitReader::NextBunch()
+{
+ // see header file for class documentation
+ PrintMissingFastAccessWarning();
+ return false;
+}
+
+const UInt_t* AliHLTTPCDigitReader::GetSignals()
+{
+ // see header file for class documentation
+ PrintMissingFastAccessWarning();
+ return 0;
}
-AliHLTTPCDigitReader::~AliHLTTPCDigitReader(){
+void AliHLTTPCDigitReader::EnableCaching(bool bCache)
+{
+ // see header file for class documentation
+ if (bCache) SetFlag(kChannelCaching);
+ else ClearFlag(kChannelCaching);
}
+int AliHLTTPCDigitReader::RewindChannel()
+{
+ // see header file for class documentation
+ int iResult=0;
+
+ return iResult;
+}
+
+unsigned int AliHLTTPCDigitReader::SetFlag(unsigned int flag)
+{
+ // see header file for class documentation
+ return fFlags|=flag;
+}
+
+unsigned int AliHLTTPCDigitReader::ClearFlag(unsigned int flag)
+{
+ // see header file for class documentation
+ return fFlags&=~flag;
+}
+
+// int operator[](int timebin)
+// {
+// return -1;
+// }
+
+int AliHLTTPCDigitReader::RewindCurrentChannel()
+{
+ // see header file for class documentation
+ SetFlag(kNoRewind);
+ if (!CheckFlag(kChannelCaching)) return -ENODATA;
+ return -ENOSYS;
+}
+
+int AliHLTTPCDigitReader::RewindToPrevChannel()
+{
+ // see header file for class documentation
+ SetFlag(kNoRewind);
+ if (!CheckFlag(kChannelCaching)) return -ENODATA;
+ return -ENOSYS;
+}
+
+int AliHLTTPCDigitReader::GetBunchSize()
+{
+ // see header file for class documentation
+ PrintMissingFastAccessWarning();
+ return 0;
+}
+
+int AliHLTTPCDigitReader::GetRowOffset() const
+{
+ // see header file for class documentation
+ return 0;
+}
+
+AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr() const
+{
+ // see header file for class documentation
+ return 0;
+}
+
+AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr(Int_t /*row*/, Int_t /*pad*/) const
+{
+ // see header file for class documentation
+ return 0;
+}
+
+void AliHLTTPCDigitReader::PrintMissingFastAccessWarning()
+{
+ // see header file for class documentation
+ if (CheckFlag(kWarnMissFastAccess)) return;
+ SetFlag(kWarnMissFastAccess);
+ HLTWarning("\n"
+ " !!! This digit reader does not implement the methods for !!!\n"
+ " !!! fast data access on channel/bunch basis. Data is discarded !!!");
+}