]>
Commit | Line | Data |
---|---|---|
15ede44e | 1 | // $Id$ |
dce3e5ce | 2 | /************************************************************************** |
3 | * This file is property of and copyright by the ALICE HLT Project * | |
4 | * ALICE Experiment at CERN, All rights reserved. * | |
5 | * * | |
6 | * Primary Authors: Artur Szostak <artursz@iafrica.com> * | |
7 | * for The ALICE HLT Project. * | |
8 | * * | |
9 | * Permission to use, copy, modify and distribute this software and its * | |
10 | * documentation strictly for non-commercial purposes is hereby granted * | |
11 | * without fee, provided that the above copyright notice appears in all * | |
12 | * copies and that both the copyright notice and this permission notice * | |
13 | * appear in the supporting documentation. The authors make no claims * | |
14 | * about the suitability of this software for any purpose. It is * | |
15 | * provided "as is" without express or implied warranty. * | |
16 | **************************************************************************/ | |
17 | ||
18 | /// @file AliHLTReadoutList.cxx | |
19 | /// @author Artur Szostak <artursz@iafrica.com> | |
20 | /// @date 19 Nov 2008 | |
21 | /// @brief Implementation of the AliHLTReadoutList class. | |
22 | /// | |
23 | /// The AliHLTReadoutList class is used as an interface to the AliHLTEventDDL | |
24 | /// structure. It makes it easy to manipulate the bits in this structure, which | |
25 | /// define what DDLs should be readout by DAQ. | |
26 | /// Several operators are also overloaded which are meant to be used in the trigger | |
27 | /// menu specification for the AliHLTGlobalTrigger. It allows one to construct | |
28 | /// expressions for the readout lists, which is necessary to be able to evaluate | |
29 | /// or compose the final readout list, given multiple input readout lists received | |
30 | /// from individual components that derive from AliHLTTrigger. | |
31 | ||
32 | #include "AliHLTReadoutList.h" | |
52647727 | 33 | #include "AliHLTDAQ.h" |
dce3e5ce | 34 | #include "Riostream.h" |
35 | #include "TString.h" | |
36 | #include "TObjString.h" | |
37 | #include "TObjArray.h" | |
38 | #include <cassert> | |
39 | ||
40 | ClassImp(AliHLTReadoutList) | |
41 | ||
42 | ||
43 | AliHLTReadoutList::AliHLTReadoutList() : | |
1462df14 | 44 | TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."), |
dce3e5ce | 45 | fReadoutList() |
46 | { | |
47 | // Default constructor. | |
48 | ||
49 | fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015 | |
50 | memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList)); | |
51 | } | |
52 | ||
53 | ||
54 | AliHLTReadoutList::AliHLTReadoutList(Int_t enabledDetectors) : | |
1462df14 | 55 | TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."), |
dce3e5ce | 56 | fReadoutList() |
57 | { | |
58 | // Constructor to select which detectors to enable for readout. | |
59 | // See header file for more details. | |
60 | ||
61 | fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015 | |
62 | memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList)); | |
63 | Enable(enabledDetectors); | |
64 | } | |
65 | ||
66 | ||
67 | AliHLTReadoutList::AliHLTReadoutList(const char* enabledList) : | |
1462df14 | 68 | TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."), |
dce3e5ce | 69 | fReadoutList() |
70 | { | |
71 | // Constructor to select which detectors and DDLs to enable for readout. | |
72 | // See header file for more details. | |
73 | ||
74 | fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015 | |
75 | memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList)); | |
76 | ||
77 | TString str(enabledList); | |
78 | str.ToUpper(); | |
79 | Int_t enabledDetectors = 0; | |
80 | if (str.Contains("ITSSPD")) enabledDetectors |= kITSSPD; | |
81 | if (str.Contains("ITSSDD")) enabledDetectors |= kITSSDD; | |
82 | if (str.Contains("ITSSSD")) enabledDetectors |= kITSSSD; | |
83 | if (str.Contains("TPC")) enabledDetectors |= kTPC; | |
84 | if (str.Contains("TRD")) enabledDetectors |= kTRD; | |
85 | if (str.Contains("TOF")) enabledDetectors |= kTOF; | |
86 | if (str.Contains("HMPID")) enabledDetectors |= kHMPID; | |
87 | if (str.Contains("PHOS")) enabledDetectors |= kPHOS; | |
88 | if (str.Contains("CPV")) enabledDetectors |= kCPV; | |
89 | if (str.Contains("PMD")) enabledDetectors |= kPMD; | |
90 | if (str.Contains("MUONTRK")) enabledDetectors |= kMUONTRK; | |
91 | if (str.Contains("MUONTRG")) enabledDetectors |= kMUONTRG; | |
92 | if (str.Contains("FMD")) enabledDetectors |= kFMD; | |
93 | if (str.Contains("T0")) enabledDetectors |= kT0; | |
94 | if (str.Contains("V0")) enabledDetectors |= kV0; | |
95 | if (str.Contains("ZDC")) enabledDetectors |= kZDC; | |
96 | if (str.Contains("ACORDE")) enabledDetectors |= kACORDE; | |
97 | if (str.Contains("TRG")) enabledDetectors |= kTRG; | |
98 | if (str.Contains("EMCAL")) enabledDetectors |= kEMCAL; | |
99 | if (str.Contains("DAQTEST")) enabledDetectors |= kDAQTEST; | |
100 | if (str.Contains("HLT")) enabledDetectors |= kHLT; | |
101 | if (str.Contains("ALL")) enabledDetectors |= kALLDET; | |
102 | Enable(enabledDetectors); | |
103 | ||
104 | TObjArray* list = str.Tokenize(" "); | |
105 | TIter next(list); | |
106 | const TObjString* objstr = NULL; | |
107 | while ((objstr = dynamic_cast<const TObjString*>(next())) != NULL) | |
108 | { | |
109 | str = objstr->GetString(); | |
110 | if (str.IsDigit()) EnableDDLBit(str.Atoi()); | |
111 | } | |
112 | delete list; | |
113 | } | |
114 | ||
115 | ||
116 | AliHLTReadoutList::AliHLTReadoutList(const AliHLTEventDDL& list) : | |
1462df14 | 117 | TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."), |
dce3e5ce | 118 | fReadoutList() |
119 | { | |
120 | // Constructor to create readout list from AliHLTEventDDL structure. | |
121 | // See header file for more details. | |
15ede44e | 122 | memset(&fReadoutList, 0, sizeof(fReadoutList)); |
123 | // handle lists of different sizes, copy only the overlapping part of the list | |
124 | fReadoutList.fCount=sizeof(fReadoutList.fList)/sizeof(AliHLTUInt32_t); | |
125 | memcpy(&fReadoutList.fList, &list.fList, (fReadoutList.fCount<list.fCount?fReadoutList.fCount:list.fCount)*sizeof(AliHLTUInt32_t)); | |
dce3e5ce | 126 | } |
127 | ||
128 | ||
129 | AliHLTReadoutList::AliHLTReadoutList(const AliHLTReadoutList& list) : | |
1462df14 | 130 | TNamed(list), |
dce3e5ce | 131 | fReadoutList() |
132 | { | |
133 | // Copy constructor performs a deep copy. | |
134 | ||
135 | memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList)); | |
136 | } | |
137 | ||
138 | ||
139 | AliHLTReadoutList::~AliHLTReadoutList() | |
140 | { | |
141 | // Default destructor. | |
142 | } | |
143 | ||
144 | ||
8b745301 | 145 | bool AliHLTReadoutList::Empty() const |
146 | { | |
147 | // Returns true if the readout list has no DDLs enabled. | |
148 | ||
edddbe3a | 149 | for (size_t i = 0; i < sizeof(fReadoutList.fList) / sizeof(fReadoutList.fList[0]); i++) |
8b745301 | 150 | { |
151 | if (fReadoutList.fList[i] != 0x0) return false; | |
152 | } | |
153 | return true; | |
154 | } | |
155 | ||
156 | ||
acc7214e | 157 | void AliHLTReadoutList::Clear(Option_t* /*option*/) |
158 | { | |
159 | // Resets all the DDL readout bits. | |
160 | memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList)); | |
161 | } | |
162 | ||
163 | ||
dce3e5ce | 164 | bool AliHLTReadoutList::DecodeDDLID(Int_t ddlId, Int_t& wordIndex, Int_t& bitIndex) |
165 | { | |
166 | // Decodes the word index and bit index within that word for the readout list structure. | |
167 | // See header file for more details. | |
168 | ||
169 | // The detector number is bits 15..8 of ddlId and DDL number is bits 7..0. | |
170 | Int_t detNum = ddlId >> 8; | |
171 | Int_t ddlNum = ddlId & 0xFF; | |
172 | ||
173 | if (detNum < 3) | |
174 | { | |
15ede44e | 175 | // the 3 ITS detectors have one word each |
dce3e5ce | 176 | wordIndex = detNum; |
177 | } | |
178 | else if (detNum == 3) | |
179 | { | |
15ede44e | 180 | // the TPC bitfield has in total 8 words |
dce3e5ce | 181 | wordIndex = detNum + (ddlNum >> 5); |
182 | } | |
183 | else if (detNum == 4) | |
184 | { | |
15ede44e | 185 | // the TRD bitfield starts at position 11 (3 ITS + 8 TPC) |
dce3e5ce | 186 | wordIndex = detNum + 7; |
187 | } | |
188 | else if (detNum == 5) | |
189 | { | |
15ede44e | 190 | // TOF has 72 DDLs, the bitfield is 3 words starting at position 12 |
dce3e5ce | 191 | wordIndex = detNum + 7 + (ddlNum >> 5); |
192 | } | |
193 | else if (detNum == 30) | |
194 | { | |
15ede44e | 195 | // the HLT bitfield is in the last word |
dce3e5ce | 196 | wordIndex = 29; |
197 | } | |
198 | else | |
199 | { | |
15ede44e | 200 | // all other detectors fit into one word, the offset is due to |
201 | // TPC and TOF | |
dce3e5ce | 202 | wordIndex = detNum + 9; |
203 | } | |
204 | ||
205 | if (wordIndex < 0 or gkAliHLTDDLListSize <= wordIndex) return false; | |
206 | ||
207 | // The bit index within the word indicated by wordIndex. | |
208 | bitIndex = (ddlId & 0xFF) % 32; | |
209 | return true; | |
210 | } | |
211 | ||
212 | ||
213 | Bool_t AliHLTReadoutList::GetDDLBit(Int_t ddlId) const | |
214 | { | |
215 | // Fetches the bit value for a particular DDL in the readout list. | |
216 | // See header file for more details. | |
217 | ||
218 | Int_t wordIndex, bitIndex; | |
219 | if (! DecodeDDLID(ddlId, wordIndex, bitIndex)) return kFALSE; | |
220 | return ((fReadoutList.fList[wordIndex] >> bitIndex) & 0x1) == 0x1; | |
221 | } | |
222 | ||
223 | ||
224 | void AliHLTReadoutList::SetDDLBit(Int_t ddlId, Bool_t state) | |
225 | { | |
226 | // Sets the bit value for a particular DDL in the readout list. | |
227 | // See header file for more details. | |
228 | ||
229 | Int_t wordIndex, bitIndex; | |
230 | if (! DecodeDDLID(ddlId, wordIndex, bitIndex)) return; | |
231 | ||
232 | // To set, 'OR' word with bit mask | |
233 | if ( state ) | |
234 | fReadoutList.fList[wordIndex] |= (0x00000001 << bitIndex); | |
235 | // To unset, 'AND' word with bit mask | |
236 | else | |
237 | fReadoutList.fList[wordIndex] &= (0xFFFFFFFF ^ (0x00000001 << bitIndex)); | |
238 | } | |
239 | ||
240 | ||
241 | void AliHLTReadoutList::Enable(Int_t detector) | |
242 | { | |
243 | // Enables all DDLs for a particular detector or detectors. | |
244 | // See header file for more details. | |
245 | ||
246 | if ((detector & kITSSPD) != 0) fReadoutList.fList[0] = 0x000FFFFF; | |
247 | if ((detector & kITSSDD) != 0) fReadoutList.fList[1] = 0x00FFFFFF; | |
248 | if ((detector & kITSSSD) != 0) fReadoutList.fList[2] = 0x0000FFFF; | |
249 | if ((detector & kTPC) != 0) | |
250 | { | |
251 | fReadoutList.fList[3] = 0xFFFFFFFF; | |
252 | fReadoutList.fList[4] = 0xFFFFFFFF; | |
253 | fReadoutList.fList[5] = 0xFFFFFFFF; | |
254 | fReadoutList.fList[6] = 0xFFFFFFFF; | |
255 | fReadoutList.fList[7] = 0xFFFFFFFF; | |
256 | fReadoutList.fList[8] = 0xFFFFFFFF; | |
257 | fReadoutList.fList[9] = 0x00FFFFFF; | |
258 | fReadoutList.fList[10] = 0x00000000; | |
259 | } | |
260 | if ((detector & kTRD) != 0) fReadoutList.fList[11] = 0x0003FFFF; | |
261 | if ((detector & kTOF) != 0) | |
262 | { | |
263 | fReadoutList.fList[12] = 0xFFFFFFFF; | |
264 | fReadoutList.fList[13] = 0xFFFFFFFF; | |
265 | fReadoutList.fList[14] = 0x000000FF; | |
266 | } | |
267 | if ((detector & kHMPID) != 0) fReadoutList.fList[15] = 0x00003FFF; | |
268 | if ((detector & kPHOS) != 0) fReadoutList.fList[16] = 0x000FFFFF; | |
269 | if ((detector & kCPV) != 0) fReadoutList.fList[17] = 0x000003FF; | |
270 | if ((detector & kPMD) != 0) fReadoutList.fList[18] = 0x0000003F; | |
271 | if ((detector & kMUONTRK) != 0) fReadoutList.fList[19] = 0x000FFFFF; | |
272 | if ((detector & kMUONTRG) != 0) fReadoutList.fList[20] = 0x00000003; | |
273 | if ((detector & kFMD) != 0) fReadoutList.fList[21] = 0x00000007; | |
274 | if ((detector & kT0) != 0) fReadoutList.fList[22] = 0x00000001; | |
275 | if ((detector & kV0) != 0) fReadoutList.fList[23] = 0x00000001; | |
276 | if ((detector & kZDC) != 0) fReadoutList.fList[24] = 0x00000001; | |
277 | if ((detector & kACORDE) != 0) fReadoutList.fList[25] = 0x00000001; | |
278 | if ((detector & kTRG) != 0) fReadoutList.fList[26] = 0x00000001; | |
279 | if ((detector & kEMCAL) != 0) fReadoutList.fList[27] = 0x00FFFFFF; | |
280 | if ((detector & kDAQTEST) != 0) fReadoutList.fList[28] = 0x00000001; | |
281 | if ((detector & kHLT) != 0) fReadoutList.fList[29] = 0x000003FF; | |
282 | } | |
283 | ||
284 | ||
285 | void AliHLTReadoutList::Disable(Int_t detector) | |
286 | { | |
287 | // Disables all DDLs for a particular detector or detectors. | |
288 | // See header file for more details. | |
289 | ||
290 | if ((detector & kITSSPD) != 0) fReadoutList.fList[0] = 0x00000000; | |
291 | if ((detector & kITSSDD) != 0) fReadoutList.fList[1] = 0x00000000; | |
292 | if ((detector & kITSSSD) != 0) fReadoutList.fList[2] = 0x00000000; | |
293 | if ((detector & kTPC) != 0) | |
294 | { | |
295 | fReadoutList.fList[3] = 0x00000000; | |
296 | fReadoutList.fList[4] = 0x00000000; | |
297 | fReadoutList.fList[5] = 0x00000000; | |
298 | fReadoutList.fList[6] = 0x00000000; | |
299 | fReadoutList.fList[7] = 0x00000000; | |
300 | fReadoutList.fList[8] = 0x00000000; | |
301 | fReadoutList.fList[9] = 0x00000000; | |
302 | fReadoutList.fList[10] = 0x00000000; | |
303 | } | |
304 | if ((detector & kTRD) != 0) fReadoutList.fList[11] = 0x00000000; | |
305 | if ((detector & kTOF) != 0) | |
306 | { | |
307 | fReadoutList.fList[12] = 0x00000000; | |
308 | fReadoutList.fList[13] = 0x00000000; | |
309 | fReadoutList.fList[14] = 0x00000000; | |
310 | } | |
311 | if ((detector & kHMPID) != 0) fReadoutList.fList[15] = 0x00000000; | |
312 | if ((detector & kPHOS) != 0) fReadoutList.fList[16] = 0x00000000; | |
313 | if ((detector & kCPV) != 0) fReadoutList.fList[17] = 0x00000000; | |
314 | if ((detector & kPMD) != 0) fReadoutList.fList[18] = 0x00000000; | |
315 | if ((detector & kMUONTRK) != 0) fReadoutList.fList[19] = 0x00000000; | |
316 | if ((detector & kMUONTRG) != 0) fReadoutList.fList[20] = 0x00000000; | |
317 | if ((detector & kFMD) != 0) fReadoutList.fList[21] = 0x00000000; | |
318 | if ((detector & kT0) != 0) fReadoutList.fList[22] = 0x00000000; | |
319 | if ((detector & kV0) != 0) fReadoutList.fList[23] = 0x00000000; | |
320 | if ((detector & kZDC) != 0) fReadoutList.fList[24] = 0x00000000; | |
321 | if ((detector & kACORDE) != 0) fReadoutList.fList[25] = 0x00000000; | |
322 | if ((detector & kTRG) != 0) fReadoutList.fList[26] = 0x00000000; | |
323 | if ((detector & kEMCAL) != 0) fReadoutList.fList[27] = 0x00000000; | |
324 | if ((detector & kDAQTEST) != 0) fReadoutList.fList[28] = 0x00000000; | |
325 | if ((detector & kHLT) != 0) fReadoutList.fList[29] = 0x00000000; | |
326 | } | |
327 | ||
328 | ||
52f67e50 | 329 | bool AliHLTReadoutList::DetectorEnabled(Int_t detector) const |
330 | { | |
331 | // Checks if a particular detector's DDLs are enabled. | |
332 | // See header file for more details. | |
333 | ||
334 | bool result = true; | |
335 | if ((detector & kITSSPD) != 0) result &= fReadoutList.fList[0] == 0x000FFFFF; | |
336 | if ((detector & kITSSDD) != 0) result &= fReadoutList.fList[1] == 0x00FFFFFF; | |
337 | if ((detector & kITSSSD) != 0) result &= fReadoutList.fList[2] == 0x0000FFFF; | |
338 | if ((detector & kTPC) != 0) | |
339 | { | |
340 | result &= fReadoutList.fList[3] == 0xFFFFFFFF; | |
341 | result &= fReadoutList.fList[4] == 0xFFFFFFFF; | |
342 | result &= fReadoutList.fList[5] == 0xFFFFFFFF; | |
343 | result &= fReadoutList.fList[6] == 0xFFFFFFFF; | |
344 | result &= fReadoutList.fList[7] == 0xFFFFFFFF; | |
345 | result &= fReadoutList.fList[8] == 0xFFFFFFFF; | |
346 | result &= fReadoutList.fList[9] == 0x00FFFFFF; | |
347 | } | |
348 | if ((detector & kTRD) != 0) result &= fReadoutList.fList[11] == 0x0003FFFF; | |
349 | if ((detector & kTOF) != 0) | |
350 | { | |
351 | result &= fReadoutList.fList[12] == 0xFFFFFFFF; | |
352 | result &= fReadoutList.fList[13] == 0xFFFFFFFF; | |
353 | result &= fReadoutList.fList[14] == 0x000000FF; | |
354 | } | |
355 | if ((detector & kHMPID) != 0) result &= fReadoutList.fList[15] == 0x00003FFF; | |
356 | if ((detector & kPHOS) != 0) result &= fReadoutList.fList[16] == 0x000FFFFF; | |
357 | if ((detector & kCPV) != 0) result &= fReadoutList.fList[17] == 0x000003FF; | |
358 | if ((detector & kPMD) != 0) result &= fReadoutList.fList[18] == 0x0000003F; | |
359 | if ((detector & kMUONTRK) != 0) result &= fReadoutList.fList[19] == 0x000FFFFF; | |
360 | if ((detector & kMUONTRG) != 0) result &= fReadoutList.fList[20] == 0x00000003; | |
361 | if ((detector & kFMD) != 0) result &= fReadoutList.fList[21] == 0x00000007; | |
362 | if ((detector & kT0) != 0) result &= fReadoutList.fList[22] == 0x00000001; | |
363 | if ((detector & kV0) != 0) result &= fReadoutList.fList[23] == 0x00000001; | |
364 | if ((detector & kZDC) != 0) result &= fReadoutList.fList[24] == 0x00000001; | |
365 | if ((detector & kACORDE) != 0) result &= fReadoutList.fList[25] == 0x00000001; | |
366 | if ((detector & kTRG) != 0) result &= fReadoutList.fList[26] == 0x00000001; | |
367 | if ((detector & kEMCAL) != 0) result &= fReadoutList.fList[27] == 0x00FFFFFF; | |
368 | if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[28] == 0x00000001; | |
369 | if ((detector & kHLT) != 0) result &= fReadoutList.fList[29] == 0x000003FF; | |
370 | ||
371 | return result; | |
372 | } | |
373 | ||
374 | ||
dce3e5ce | 375 | void AliHLTReadoutList::Print(Option_t* /*option*/) const |
376 | { | |
377 | // Prints the DDLs that will be readout according to this readout list. | |
378 | ||
379 | cout << "Readout enabled for DDLs:" << endl; | |
52647727 | 380 | for (Int_t i = 0; i < AliHLTDAQ::NumberOfDetectors(); i++) |
dce3e5ce | 381 | { |
52647727 | 382 | Int_t maxddls = AliHLTDAQ::NumberOfDdls(i); |
383 | cout << AliHLTDAQ::DetectorName(i) << ":"; | |
dce3e5ce | 384 | bool nonefound = true; |
385 | for (Int_t j = 0; j < maxddls; j++) | |
386 | { | |
52647727 | 387 | Int_t ddlId = ( ((i == AliHLTDAQ::NumberOfDetectors()-1) ? 30 : i) << 8 ) + j; |
dce3e5ce | 388 | if (GetDDLBit(ddlId)) |
389 | { | |
390 | cout << " " << ddlId; | |
391 | nonefound = false; | |
392 | } | |
393 | } | |
394 | if (nonefound) cout << " none"; | |
395 | cout << endl; | |
396 | } | |
397 | } | |
398 | ||
399 | ||
400 | AliHLTReadoutList& AliHLTReadoutList::operator = (const AliHLTReadoutList& list) | |
401 | { | |
402 | // Assignment operator performs a deep copy. | |
403 | ||
404 | TObject::operator = (list); | |
405 | if (&list != this) | |
406 | { | |
407 | memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList)); | |
408 | } | |
409 | return *this; | |
410 | } | |
411 | ||
412 | ||
413 | AliHLTReadoutList& AliHLTReadoutList::operator |= (const AliHLTReadoutList& list) | |
414 | { | |
415 | // This operator performs a bitwise inclusive or operation on all DDL bits. | |
416 | // See header file for more details. | |
e5339167 | 417 | this->OrEq(list); |
418 | return *this; | |
419 | } | |
420 | ||
421 | AliHLTReadoutList& AliHLTReadoutList::OrEq(const AliHLTReadoutList& list) | |
422 | { | |
423 | // a bitwise inclusive or operation on all DDL bits. | |
424 | // See header file for more details. | |
dce3e5ce | 425 | |
15ede44e | 426 | assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); |
dce3e5ce | 427 | for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) |
428 | { | |
429 | fReadoutList.fList[i] |= list.fReadoutList.fList[i]; | |
430 | } | |
431 | return *this; | |
432 | } | |
433 | ||
434 | ||
435 | AliHLTReadoutList& AliHLTReadoutList::operator ^= (const AliHLTReadoutList& list) | |
436 | { | |
437 | // This operator performs a bitwise exclusive or (xor) operation on all DDL bits. | |
438 | // See header file for more details. | |
e5339167 | 439 | |
440 | this->XorEq(list); | |
441 | return *this; | |
442 | } | |
443 | ||
444 | AliHLTReadoutList& AliHLTReadoutList::XorEq(const AliHLTReadoutList& list) | |
445 | { | |
446 | // bitwise exclusive or (xor) operation on all DDL bits. | |
447 | // See header file for more details. | |
dce3e5ce | 448 | |
15ede44e | 449 | assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); |
dce3e5ce | 450 | for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) |
451 | { | |
452 | fReadoutList.fList[i] ^= list.fReadoutList.fList[i]; | |
453 | } | |
454 | return *this; | |
455 | } | |
456 | ||
457 | ||
458 | AliHLTReadoutList& AliHLTReadoutList::operator &= (const AliHLTReadoutList& list) | |
459 | { | |
460 | // This operator performs a bitwise and operation on all DDL bits. | |
461 | // See header file for more details. | |
e5339167 | 462 | |
463 | this->AndEq(list); | |
464 | return *this; | |
465 | } | |
466 | ||
467 | AliHLTReadoutList& AliHLTReadoutList::AndEq(const AliHLTReadoutList& list) | |
468 | { | |
469 | // bitwise and operation on all DDL bits. | |
470 | // See header file for more details. | |
471 | ||
15ede44e | 472 | assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); |
dce3e5ce | 473 | for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) |
474 | { | |
475 | fReadoutList.fList[i] &= list.fReadoutList.fList[i]; | |
476 | } | |
477 | return *this; | |
478 | } | |
479 | ||
dce3e5ce | 480 | AliHLTReadoutList& AliHLTReadoutList::operator -= (const AliHLTReadoutList& list) |
481 | { | |
482 | // This operator removes all the DDLs specified in list from this readout list. | |
483 | // See header file for more details. | |
484 | ||
15ede44e | 485 | assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); |
dce3e5ce | 486 | for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) |
487 | { | |
488 | // Effectively apply: this = this & (~ (this & list)) | |
489 | // i.e. this = this & (this ^ list) | |
490 | fReadoutList.fList[i] &= fReadoutList.fList[i] ^ list.fReadoutList.fList[i]; | |
491 | } | |
492 | return *this; | |
493 | } | |
494 | ||
495 | ||
496 | AliHLTReadoutList AliHLTReadoutList::operator ~ () const | |
497 | { | |
498 | // This operator performs a bitwise ones compliment on all DDL bits. | |
499 | // See header file for more details. | |
500 | ||
501 | AliHLTReadoutList readoutlist; | |
502 | readoutlist.fReadoutList.fCount = fReadoutList.fCount; | |
503 | readoutlist.fReadoutList.fList[0] = 0x000FFFFF & (~fReadoutList.fList[0]); | |
504 | readoutlist.fReadoutList.fList[1] = 0x00FFFFFF & (~fReadoutList.fList[1]); | |
505 | readoutlist.fReadoutList.fList[2] = 0x0000FFFF & (~fReadoutList.fList[2]); | |
506 | readoutlist.fReadoutList.fList[3] = 0xFFFFFFFF & (~fReadoutList.fList[3]); | |
507 | readoutlist.fReadoutList.fList[4] = 0xFFFFFFFF & (~fReadoutList.fList[4]); | |
508 | readoutlist.fReadoutList.fList[5] = 0xFFFFFFFF & (~fReadoutList.fList[5]); | |
509 | readoutlist.fReadoutList.fList[6] = 0xFFFFFFFF & (~fReadoutList.fList[6]); | |
510 | readoutlist.fReadoutList.fList[7] = 0xFFFFFFFF & (~fReadoutList.fList[7]); | |
511 | readoutlist.fReadoutList.fList[8] = 0xFFFFFFFF & (~fReadoutList.fList[8]); | |
512 | readoutlist.fReadoutList.fList[9] = 0x00FFFFFF & (~fReadoutList.fList[9]); | |
513 | readoutlist.fReadoutList.fList[10] = 0x00000000 & (~fReadoutList.fList[10]); | |
514 | readoutlist.fReadoutList.fList[11] = 0x0003FFFF & (~fReadoutList.fList[11]); | |
515 | readoutlist.fReadoutList.fList[12] = 0xFFFFFFFF & (~fReadoutList.fList[12]); | |
516 | readoutlist.fReadoutList.fList[13] = 0xFFFFFFFF & (~fReadoutList.fList[13]); | |
517 | readoutlist.fReadoutList.fList[14] = 0x000000FF & (~fReadoutList.fList[14]); | |
518 | readoutlist.fReadoutList.fList[15] = 0x00003FFF & (~fReadoutList.fList[15]); | |
519 | readoutlist.fReadoutList.fList[16] = 0x000FFFFF & (~fReadoutList.fList[16]); | |
520 | readoutlist.fReadoutList.fList[17] = 0x000003FF & (~fReadoutList.fList[17]); | |
521 | readoutlist.fReadoutList.fList[18] = 0x0000003F & (~fReadoutList.fList[18]); | |
522 | readoutlist.fReadoutList.fList[19] = 0x000FFFFF & (~fReadoutList.fList[19]); | |
523 | readoutlist.fReadoutList.fList[20] = 0x00000003 & (~fReadoutList.fList[20]); | |
524 | readoutlist.fReadoutList.fList[21] = 0x00000007 & (~fReadoutList.fList[21]); | |
525 | readoutlist.fReadoutList.fList[22] = 0x00000001 & (~fReadoutList.fList[22]); | |
526 | readoutlist.fReadoutList.fList[23] = 0x00000001 & (~fReadoutList.fList[23]); | |
527 | readoutlist.fReadoutList.fList[24] = 0x00000001 & (~fReadoutList.fList[24]); | |
528 | readoutlist.fReadoutList.fList[25] = 0x00000001 & (~fReadoutList.fList[25]); | |
529 | readoutlist.fReadoutList.fList[26] = 0x00000001 & (~fReadoutList.fList[26]); | |
530 | readoutlist.fReadoutList.fList[27] = 0x00FFFFFF & (~fReadoutList.fList[27]); | |
531 | readoutlist.fReadoutList.fList[28] = 0x00000001 & (~fReadoutList.fList[28]); | |
532 | readoutlist.fReadoutList.fList[29] = 0x000003FF & (~fReadoutList.fList[29]); | |
533 | return readoutlist; | |
534 | } | |
535 |