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 const UShort_t* AliHLTTPCDigitReader::GetSignalsShort()
136 // see header file for class documentation
137 PrintWarningOnce(kWarnMissFastAccess,"\n"
138 " !!! This digit reader does not implement the methods for !!!\n"
139 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
143 void AliHLTTPCDigitReader::EnableCaching(bool bCache)
145 // see header file for class documentation
146 if (bCache) SetFlag(kChannelCaching);
147 else ClearFlag(kChannelCaching);
150 int AliHLTTPCDigitReader::RewindChannel()
152 // see header file for class documentation
158 unsigned int AliHLTTPCDigitReader::SetFlag(unsigned int flag)
160 // see header file for class documentation
164 unsigned int AliHLTTPCDigitReader::ClearFlag(unsigned int flag)
166 // see header file for class documentation
167 return fFlags&=~flag;
170 // int operator[](int timebin)
175 int AliHLTTPCDigitReader::RewindCurrentChannel()
177 // see header file for class documentation
179 if (!CheckFlag(kChannelCaching)) return -ENODATA;
183 int AliHLTTPCDigitReader::RewindToPrevChannel()
185 // see header file for class documentation
187 if (!CheckFlag(kChannelCaching)) return -ENODATA;
191 int AliHLTTPCDigitReader::GetBunchSize()
193 // see header file for class documentation
194 PrintWarningOnce(kWarnMissFastAccess,"\n"
195 " !!! This digit reader does not implement the methods for !!!\n"
196 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
200 int AliHLTTPCDigitReader::GetRowOffset() const
202 // see header file for class documentation
206 AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr() const
208 // see header file for class documentation
212 AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr(Int_t /*row*/, Int_t /*pad*/) const
214 // see header file for class documentation
218 int AliHLTTPCDigitReader::GetRCUTrailerSize()
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. !!!");
227 bool AliHLTTPCDigitReader::GetRCUTrailerData(UChar_t*& trData)
229 // see header file for class documentation
230 PrintWarningOnce(kWarnMissTrailerGetters,"\n"
231 " !!! This digit reader does not implement the Getters !!!\n"
232 " !!! for RCU trailer. Ignoring call. !!!");
233 if (trData) trData=NULL;
238 void AliHLTTPCDigitReader::PrintWarningOnce(int type, const char* message)
240 // see header file for class documentation
241 if (CheckFlag(type)) return;