3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
9 * Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
10 * for The ALICE HLT Project. *
12 * Permission to use, copy, modify and distribute this software and its *
13 * documentation strictly for non-commercial purposes is hereby granted *
14 * without fee, provided that the above copyright notice appears in all *
15 * copies and that both the copyright notice and this permission notice *
16 * appear in the supporting documentation. The authors make no claims *
17 * about the suitability of this software for any purpose. It is *
18 * provided "as is" without express or implied warranty. *
19 **************************************************************************/
21 /** @file AliHLTTPCDigitReader.cxx
22 @author Timm Steinbeck, Jochen Thaeder, Matthias Richter, Kenneth Aamodt
24 @brief An abstract reader class for TPC data.
27 // see header file for class documentation
29 // refer to README to build package
31 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
37 #include "AliHLTTPCDigitReader.h"
38 #include "AliHLTTPCTransform.h"
39 #include "AliHLTStdIncludes.h"
41 ClassImp(AliHLTTPCDigitReader)
43 AliHLTTPCDigitReader::AliHLTTPCDigitReader()
49 // see header file for class documentation
51 // refer to README to build package
53 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
56 AliHLTTPCDigitReader::~AliHLTTPCDigitReader()
58 // see header file for class documentation
61 int AliHLTTPCDigitReader::InitBlock(void* ptr,unsigned long size,Int_t firstrow,Int_t lastrow, Int_t patch, Int_t slice)
63 // see header file for class documentation
64 if (patch<0 || patch>=AliHLTTPCTransform::GetNumberOfPatches()) {
65 HLTError("invalid readout partition number %d", patch);
68 if (firstrow!=AliHLTTPCTransform::GetFirstRow(patch)) {
69 HLTWarning("The firstrow parameter does not match the layout of the readout partition %d "
70 "(firstrow=%d). Parameter is ignored", patch, AliHLTTPCTransform::GetFirstRow(patch));
72 if (lastrow!=AliHLTTPCTransform::GetLastRow(patch)) {
73 HLTWarning("The lastrow parameter does not match the layout of the readout partition %d "
74 "(lastrow=%d). Parameter is ignored", patch, AliHLTTPCTransform::GetLastRow(patch));
76 return InitBlock(ptr, size, patch, slice);
79 void AliHLTTPCDigitReader::SetOldRCUFormat(Bool_t /*oldrcuformat*/)
81 // default method of the base class
84 void AliHLTTPCDigitReader::SetUnsorted(Bool_t /*unsorted*/)
86 // default method of the base class
87 HLTWarning("common sorting functionality has not yet been implemented");
90 bool AliHLTTPCDigitReader::Next(int /*type*/)
92 // see header file for class documentation
93 if (!CheckFlag(kLocked)) return NextSignal();
96 if (!CheckFlag(kChannelOverwrap))
97 haveData=NextSignal();
99 if (haveData && (fLckRow!=GetRow() || fLckPad!=GetPad())) {
100 SetFlag(kChannelOverwrap);
107 bool AliHLTTPCDigitReader::NextChannel()
109 // see header file for class documentation
110 PrintWarningOnce(kWarnMissFastAccess,"\n"
111 " !!! This digit reader does not implement the methods for !!!\n"
112 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
116 int AliHLTTPCDigitReader::NextBunch()
118 // see header file for class documentation
119 PrintWarningOnce(kWarnMissFastAccess,"\n"
120 " !!! This digit reader does not implement the methods for !!!\n"
121 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
125 const UInt_t* AliHLTTPCDigitReader::GetSignals()
127 // see header file for class documentation
128 PrintWarningOnce(kWarnMissFastAccess,"\n"
129 " !!! This digit reader does not implement the methods for !!!\n"
130 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
134 void AliHLTTPCDigitReader::EnableCaching(bool bCache)
136 // see header file for class documentation
137 if (bCache) SetFlag(kChannelCaching);
138 else ClearFlag(kChannelCaching);
141 int AliHLTTPCDigitReader::RewindChannel()
143 // see header file for class documentation
149 unsigned int AliHLTTPCDigitReader::SetFlag(unsigned int flag)
151 // see header file for class documentation
155 unsigned int AliHLTTPCDigitReader::ClearFlag(unsigned int flag)
157 // see header file for class documentation
158 return fFlags&=~flag;
161 // int operator[](int timebin)
166 int AliHLTTPCDigitReader::RewindCurrentChannel()
168 // see header file for class documentation
170 if (!CheckFlag(kChannelCaching)) return -ENODATA;
174 int AliHLTTPCDigitReader::RewindToPrevChannel()
176 // see header file for class documentation
178 if (!CheckFlag(kChannelCaching)) return -ENODATA;
182 int AliHLTTPCDigitReader::GetBunchSize()
184 // see header file for class documentation
185 PrintWarningOnce(kWarnMissFastAccess,"\n"
186 " !!! This digit reader does not implement the methods for !!!\n"
187 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
191 int AliHLTTPCDigitReader::GetRowOffset() const
193 // see header file for class documentation
197 AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr() const
199 // see header file for class documentation
203 AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr(Int_t /*row*/, Int_t /*pad*/) const
205 // see header file for class documentation
209 int AliHLTTPCDigitReader::GetRCUTrailerSize()
211 // see header file for class documentation
212 PrintWarningOnce(kWarnMissTrailerGetters,"\n"
213 " !!! This digit reader does not implement the Getters !!!\n"
214 " !!! for RCU trailer. Ignoring call. !!!");
218 bool AliHLTTPCDigitReader::GetRCUTrailerData(UChar_t*& trData)
220 // see header file for class documentation
221 PrintWarningOnce(kWarnMissTrailerGetters,"\n"
222 " !!! This digit reader does not implement the Getters !!!\n"
223 " !!! for RCU trailer. Ignoring call. !!!");
224 if (trData) trData=NULL;
229 void AliHLTTPCDigitReader::PrintWarningOnce(int type, const char* message)
231 // see header file for class documentation
232 if (CheckFlag(type)) return;