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 PrintMissingFastAccessWarning();
114 int AliHLTTPCDigitReader::NextBunch()
116 // see header file for class documentation
117 PrintMissingFastAccessWarning();
121 const UInt_t* AliHLTTPCDigitReader::GetSignals()
123 // see header file for class documentation
124 PrintMissingFastAccessWarning();
128 void AliHLTTPCDigitReader::EnableCaching(bool bCache)
130 // see header file for class documentation
131 if (bCache) SetFlag(kChannelCaching);
132 else ClearFlag(kChannelCaching);
135 int AliHLTTPCDigitReader::RewindChannel()
137 // see header file for class documentation
143 unsigned int AliHLTTPCDigitReader::SetFlag(unsigned int flag)
145 // see header file for class documentation
149 unsigned int AliHLTTPCDigitReader::ClearFlag(unsigned int flag)
151 // see header file for class documentation
152 return fFlags&=~flag;
155 // int operator[](int timebin)
160 int AliHLTTPCDigitReader::RewindCurrentChannel()
162 // see header file for class documentation
164 if (!CheckFlag(kChannelCaching)) return -ENODATA;
168 int AliHLTTPCDigitReader::RewindToPrevChannel()
170 // see header file for class documentation
172 if (!CheckFlag(kChannelCaching)) return -ENODATA;
176 int AliHLTTPCDigitReader::GetBunchSize()
178 // see header file for class documentation
179 PrintMissingFastAccessWarning();
183 int AliHLTTPCDigitReader::GetRowOffset() const
185 // see header file for class documentation
189 AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr() const
194 void AliHLTTPCDigitReader::PrintMissingFastAccessWarning()
196 // see header file for class documentation
197 if (CheckFlag(kWarnMissFastAccess)) return;
198 SetFlag(kWarnMissFastAccess);
200 " !!! This digit reader does not implement the methods for !!!\n"
201 " !!! fast data access on channel/bunch basis. Data is discarded !!!");