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
33 #include "AliHLTTPCDigitReader.h"
34 #include "AliHLTTPCTransform.h"
35 #include "AliHLTStdIncludes.h"
39 ClassImp(AliHLTTPCDigitReader)
41 AliHLTTPCDigitReader::AliHLTTPCDigitReader()
47 // see header file for class documentation
49 // refer to README to build package
51 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
54 AliHLTTPCDigitReader::~AliHLTTPCDigitReader()
56 // see header file for class documentation
59 int AliHLTTPCDigitReader::InitBlock(void* ptr,unsigned long size,Int_t firstrow,Int_t lastrow, Int_t patch, Int_t slice)
61 // see header file for class documentation
62 if (patch<0 || patch>=AliHLTTPCTransform::GetNumberOfPatches()) {
63 HLTError("invalid readout partition number %d", patch);
66 if (firstrow!=AliHLTTPCTransform::GetFirstRow(patch)) {
67 HLTWarning("The firstrow parameter does not match the layout of the readout partition %d "
68 "(firstrow=%d). Parameter is ignored", patch, AliHLTTPCTransform::GetFirstRow(patch));
70 if (lastrow!=AliHLTTPCTransform::GetLastRow(patch)) {
71 HLTWarning("The lastrow parameter does not match the layout of the readout partition %d "
72 "(lastrow=%d). Parameter is ignored", patch, AliHLTTPCTransform::GetLastRow(patch));
74 return InitBlock(ptr, size, patch, slice);
77 void AliHLTTPCDigitReader::SetOldRCUFormat(Bool_t /*oldrcuformat*/)
79 // default method of the base class
82 void AliHLTTPCDigitReader::SetUnsorted(Bool_t /*unsorted*/)
84 // default method of the base class
85 HLTWarning("common sorting functionality has not yet been implemented");
88 bool AliHLTTPCDigitReader::Next(int /*type*/)
90 // see header file for class documentation
91 if (!CheckFlag(kLocked)) return NextSignal();
94 if (!CheckFlag(kChannelOverwrap))
95 haveData=NextSignal();
97 if (haveData && (fLckRow!=GetRow() || fLckPad!=GetPad())) {
98 SetFlag(kChannelOverwrap);
105 bool AliHLTTPCDigitReader::NextChannel()
107 // see header file for class documentation
108 PrintWarningOnce(kWarnMissFastAccess,"\n"
109 " !!! This digit reader does not implement the methods for !!!\n"
110 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
114 int AliHLTTPCDigitReader::NextBunch()
116 // see header file for class documentation
117 PrintWarningOnce(kWarnMissFastAccess,"\n"
118 " !!! This digit reader does not implement the methods for !!!\n"
119 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
123 const UInt_t* AliHLTTPCDigitReader::GetSignals()
125 // see header file for class documentation
126 PrintWarningOnce(kWarnMissFastAccess,"\n"
127 " !!! This digit reader does not implement the methods for !!!\n"
128 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
132 const UShort_t* AliHLTTPCDigitReader::GetSignalsShort()
134 // see header file for class documentation
135 PrintWarningOnce(kWarnMissFastAccess,"\n"
136 " !!! This digit reader does not implement the methods for !!!\n"
137 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
141 void AliHLTTPCDigitReader::EnableCaching(bool bCache)
143 // see header file for class documentation
144 if (bCache) SetFlag(kChannelCaching);
145 else ClearFlag(kChannelCaching);
148 int AliHLTTPCDigitReader::RewindChannel()
150 // see header file for class documentation
156 unsigned int AliHLTTPCDigitReader::SetFlag(unsigned int flag)
158 // see header file for class documentation
162 unsigned int AliHLTTPCDigitReader::ClearFlag(unsigned int flag)
164 // see header file for class documentation
165 return fFlags&=~flag;
168 // int operator[](int timebin)
173 int AliHLTTPCDigitReader::RewindCurrentChannel()
175 // see header file for class documentation
177 if (!CheckFlag(kChannelCaching)) return -ENODATA;
181 int AliHLTTPCDigitReader::RewindToPrevChannel()
183 // see header file for class documentation
185 if (!CheckFlag(kChannelCaching)) return -ENODATA;
189 int AliHLTTPCDigitReader::GetBunchSize()
191 // see header file for class documentation
192 PrintWarningOnce(kWarnMissFastAccess,"\n"
193 " !!! This digit reader does not implement the methods for !!!\n"
194 " !!! fast data access on channel/bunch basis. Data is discarded !!!");
198 int AliHLTTPCDigitReader::GetRowOffset() const
200 // see header file for class documentation
204 AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr() const
206 // see header file for class documentation
210 AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr(Int_t /*row*/, Int_t /*pad*/) const
212 // see header file for class documentation
216 int AliHLTTPCDigitReader::GetRCUTrailerSize()
218 // see header file for class documentation
219 PrintWarningOnce(kWarnMissTrailerGetters,"\n"
220 " !!! This digit reader does not implement the Getters !!!\n"
221 " !!! for RCU trailer. Ignoring call. !!!");
225 bool AliHLTTPCDigitReader::GetRCUTrailerData(UChar_t*& trData)
227 // see header file for class documentation
228 PrintWarningOnce(kWarnMissTrailerGetters,"\n"
229 " !!! This digit reader does not implement the Getters !!!\n"
230 " !!! for RCU trailer. Ignoring call. !!!");
231 if (trData) trData=NULL;
236 void AliHLTTPCDigitReader::PrintWarningOnce(int type, const char* message)
238 // see header file for class documentation
239 if (CheckFlag(type)) return;