]>
Commit | Line | Data |
---|---|---|
a38a7850 | 1 | // $Id$ |
2 | ||
3 | /************************************************************************** | |
9be2600f | 4 | * This file is property of and copyright by the ALICE HLT Project * |
5 | * ALICE Experiment at CERN, All rights reserved. * | |
a38a7850 | 6 | * * |
9be2600f | 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. * | |
a38a7850 | 11 | * * |
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 | **************************************************************************/ | |
20 | ||
84645eb0 | 21 | /** @file AliHLTTPCDigitReader.cxx |
27f5f8ed | 22 | @author Timm Steinbeck, Jochen Thaeder, Matthias Richter, Kenneth Aamodt |
84645eb0 | 23 | @date |
24 | @brief An abstract reader class for TPC data. | |
25 | */ | |
a38a7850 | 26 | |
f32b83e1 | 27 | // see header file for class documentation |
28 | // or | |
29 | // refer to README to build package | |
30 | // or | |
31 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
32 | ||
db16520a | 33 | #if __GNUC__>= 3 |
a38a7850 | 34 | using namespace std; |
35 | #endif | |
36 | ||
37 | #include "AliHLTTPCDigitReader.h" | |
84645eb0 | 38 | #include "AliHLTTPCTransform.h" |
39 | #include "AliHLTStdIncludes.h" | |
a38a7850 | 40 | |
41 | ClassImp(AliHLTTPCDigitReader) | |
42 | ||
f44e97dc | 43 | AliHLTTPCDigitReader::AliHLTTPCDigitReader() |
44 | : | |
45 | fFlags(0), | |
46 | fLckRow(-1), | |
47 | fLckPad(-1) | |
48 | { | |
f32b83e1 | 49 | // see header file for class documentation |
50 | // or | |
51 | // refer to README to build package | |
52 | // or | |
53 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
a38a7850 | 54 | } |
55 | ||
f44e97dc | 56 | AliHLTTPCDigitReader::~AliHLTTPCDigitReader() |
57 | { | |
f32b83e1 | 58 | // see header file for class documentation |
a38a7850 | 59 | } |
60 | ||
f44e97dc | 61 | int AliHLTTPCDigitReader::InitBlock(void* ptr,unsigned long size,Int_t firstrow,Int_t lastrow, Int_t patch, Int_t slice) |
62 | { | |
f32b83e1 | 63 | // see header file for class documentation |
84645eb0 | 64 | if (patch<0 || patch>=AliHLTTPCTransform::GetNumberOfPatches()) { |
65 | HLTError("invalid readout partition number %d", patch); | |
66 | return -EINVAL; | |
67 | } | |
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)); | |
71 | } | |
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)); | |
75 | } | |
76 | return InitBlock(ptr, size, patch, slice); | |
77 | } | |
78 | ||
e419b223 | 79 | void AliHLTTPCDigitReader::SetOldRCUFormat(Bool_t /*oldrcuformat*/) |
80 | { | |
f32b83e1 | 81 | // default method of the base class |
27f5f8ed | 82 | } |
f32b83e1 | 83 | |
84 | void AliHLTTPCDigitReader::SetUnsorted(Bool_t /*unsorted*/) | |
85 | { | |
86 | // default method of the base class | |
e03c4cc0 | 87 | HLTWarning("common sorting functionality has not yet been implemented"); |
01f43166 | 88 | } |
f44e97dc | 89 | |
a74855c2 | 90 | bool AliHLTTPCDigitReader::Next(int /*type*/) |
f44e97dc | 91 | { |
f32b83e1 | 92 | // see header file for class documentation |
f44e97dc | 93 | if (!CheckFlag(kLocked)) return NextSignal(); |
94 | ||
95 | bool haveData=false; | |
96 | if (!CheckFlag(kChannelOverwrap)) | |
97 | haveData=NextSignal(); | |
98 | ||
99 | if (haveData && (fLckRow!=GetRow() || fLckPad!=GetPad())) { | |
100 | SetFlag(kChannelOverwrap); | |
101 | haveData=false; | |
102 | } | |
103 | ||
104 | return haveData; | |
105 | } | |
106 | ||
e03c4cc0 | 107 | bool AliHLTTPCDigitReader::NextChannel() |
108 | { | |
109 | // see header file for class documentation | |
110 | PrintMissingFastAccessWarning(); | |
111 | return false; | |
112 | } | |
113 | ||
114 | int AliHLTTPCDigitReader::NextBunch() | |
115 | { | |
116 | // see header file for class documentation | |
117 | PrintMissingFastAccessWarning(); | |
118 | return false; | |
119 | } | |
120 | ||
7dceaa9b | 121 | const UInt_t* AliHLTTPCDigitReader::GetSignals() |
e03c4cc0 | 122 | { |
123 | // see header file for class documentation | |
124 | PrintMissingFastAccessWarning(); | |
125 | return 0; | |
126 | } | |
127 | ||
f44e97dc | 128 | void AliHLTTPCDigitReader::EnableCaching(bool bCache) |
129 | { | |
f32b83e1 | 130 | // see header file for class documentation |
f44e97dc | 131 | if (bCache) SetFlag(kChannelCaching); |
132 | else ClearFlag(kChannelCaching); | |
133 | } | |
134 | ||
135 | int AliHLTTPCDigitReader::RewindChannel() | |
136 | { | |
f32b83e1 | 137 | // see header file for class documentation |
f44e97dc | 138 | int iResult=0; |
139 | ||
140 | return iResult; | |
141 | } | |
142 | ||
143 | unsigned int AliHLTTPCDigitReader::SetFlag(unsigned int flag) | |
144 | { | |
f32b83e1 | 145 | // see header file for class documentation |
f44e97dc | 146 | return fFlags|=flag; |
147 | } | |
148 | ||
149 | unsigned int AliHLTTPCDigitReader::ClearFlag(unsigned int flag) | |
150 | { | |
f32b83e1 | 151 | // see header file for class documentation |
f44e97dc | 152 | return fFlags&=~flag; |
153 | } | |
154 | ||
155 | // int operator[](int timebin) | |
156 | // { | |
157 | // return -1; | |
158 | // } | |
159 | ||
160 | int AliHLTTPCDigitReader::RewindCurrentChannel() | |
161 | { | |
f32b83e1 | 162 | // see header file for class documentation |
f44e97dc | 163 | SetFlag(kNoRewind); |
164 | if (!CheckFlag(kChannelCaching)) return -ENODATA; | |
165 | return -ENOSYS; | |
166 | } | |
167 | ||
168 | int AliHLTTPCDigitReader::RewindToPrevChannel() | |
169 | { | |
f32b83e1 | 170 | // see header file for class documentation |
f44e97dc | 171 | SetFlag(kNoRewind); |
172 | if (!CheckFlag(kChannelCaching)) return -ENODATA; | |
173 | return -ENOSYS; | |
174 | } | |
e03c4cc0 | 175 | |
7dceaa9b | 176 | int AliHLTTPCDigitReader::GetBunchSize() |
177 | { | |
178 | // see header file for class documentation | |
179 | PrintMissingFastAccessWarning(); | |
180 | return 0; | |
181 | } | |
182 | ||
d2f725e4 | 183 | int AliHLTTPCDigitReader::GetRowOffset() const |
184 | { | |
185 | // see header file for class documentation | |
186 | return 0; | |
187 | } | |
188 | ||
70d0b23e | 189 | AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr() const |
190 | { | |
092a1374 | 191 | // see header file for class documentation |
192 | return 0; | |
193 | } | |
194 | ||
195 | AliHLTUInt32_t AliHLTTPCDigitReader::GetAltroBlockHWaddr(Int_t /*row*/, Int_t /*pad*/) const | |
196 | { | |
197 | // see header file for class documentation | |
70d0b23e | 198 | return 0; |
199 | } | |
200 | ||
e03c4cc0 | 201 | void AliHLTTPCDigitReader::PrintMissingFastAccessWarning() |
202 | { | |
203 | // see header file for class documentation | |
204 | if (CheckFlag(kWarnMissFastAccess)) return; | |
205 | SetFlag(kWarnMissFastAccess); | |
c3800c65 | 206 | HLTWarning("\n" |
207 | " !!! This digit reader does not implement the methods for !!!\n" | |
208 | " !!! fast data access on channel/bunch basis. Data is discarded !!!"); | |
e03c4cc0 | 209 | } |