]>
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 | ||
7f8acd80 | 173 | switch (detNum) |
dce3e5ce | 174 | { |
7f8acd80 | 175 | case 0: // SPD |
176 | case 1: // SDD | |
177 | case 2: // SSD | |
178 | if (ddlNum >= 32) return false; // only have 1 32-bit word. | |
15ede44e | 179 | // the 3 ITS detectors have one word each |
dce3e5ce | 180 | wordIndex = detNum; |
7f8acd80 | 181 | break; |
182 | case 3: // TPC | |
15ede44e | 183 | // the TPC bitfield has in total 8 words |
dce3e5ce | 184 | wordIndex = detNum + (ddlNum >> 5); |
7f8acd80 | 185 | break; |
186 | case 4: // TRD | |
187 | if (ddlNum >= 32) return false; // only have 1 32-bit word. | |
188 | // the TRD bitfield starts at word 11 (3 words ITS + 8 words TPC) | |
189 | wordIndex = 11; | |
190 | break; | |
191 | case 5: // TOF | |
192 | if (ddlNum >= 3*32) return false; // only have 3 32-bit words. | |
15ede44e | 193 | // TOF has 72 DDLs, the bitfield is 3 words starting at position 12 |
7f8acd80 | 194 | wordIndex = 12 + (ddlNum >> 5); |
195 | break; | |
196 | case 6: // HMPID | |
197 | case 7: // PHOS | |
198 | case 8: // CPV | |
199 | case 9: // PMD | |
200 | case 10: // MUONTRK (MCH) | |
201 | case 11: // MUONTRG (MTR) | |
202 | case 12: // FMD | |
203 | case 13: // T0 | |
204 | case 14: // V0 | |
205 | case 15: // ZDC | |
206 | case 16: // ACORDE | |
207 | case 17: // TRG | |
7f8acd80 | 208 | if (ddlNum >= 32) return false; // only have 1 32-bit word. |
a9a3028c | 209 | // all these detectors fit into one word, the offset is due to |
15ede44e | 210 | // TPC and TOF |
dce3e5ce | 211 | wordIndex = detNum + 9; |
7f8acd80 | 212 | break; |
a9a3028c | 213 | case 18: // EMCAL |
214 | if (ddlNum >= 2*32) return false; // only have 2 32-bit words. | |
215 | // 2 words for EMCAL + DCAL | |
216 | wordIndex = detNum + 7; | |
217 | wordIndex = 27 + (ddlNum >> 5); | |
218 | break; | |
219 | case 19: // DAQTEST | |
220 | if (ddlNum >= 32) return false; // only have 1 32-bit word. | |
221 | wordIndex = 29; | |
222 | break; | |
7f8acd80 | 223 | case 30: // HLT |
224 | if (ddlNum >= 32) return false; // only have 1 32-bit word. | |
225 | // the HLT bitfield is in the last word | |
a9a3028c | 226 | wordIndex = 30; |
7f8acd80 | 227 | break; |
228 | default: | |
229 | return false; | |
dce3e5ce | 230 | } |
231 | ||
a9a3028c | 232 | if (ddlNum >= AliHLTDAQ::NumberOfDdls(detNum == 30 ? 20 : detNum)) return false; |
233 | ||
dce3e5ce | 234 | // The bit index within the word indicated by wordIndex. |
7f8acd80 | 235 | bitIndex = ddlNum % 32; |
dce3e5ce | 236 | return true; |
237 | } | |
238 | ||
239 | ||
240 | Bool_t AliHLTReadoutList::GetDDLBit(Int_t ddlId) const | |
241 | { | |
242 | // Fetches the bit value for a particular DDL in the readout list. | |
243 | // See header file for more details. | |
244 | ||
245 | Int_t wordIndex, bitIndex; | |
246 | if (! DecodeDDLID(ddlId, wordIndex, bitIndex)) return kFALSE; | |
247 | return ((fReadoutList.fList[wordIndex] >> bitIndex) & 0x1) == 0x1; | |
248 | } | |
249 | ||
250 | ||
251 | void AliHLTReadoutList::SetDDLBit(Int_t ddlId, Bool_t state) | |
252 | { | |
253 | // Sets the bit value for a particular DDL in the readout list. | |
254 | // See header file for more details. | |
255 | ||
256 | Int_t wordIndex, bitIndex; | |
257 | if (! DecodeDDLID(ddlId, wordIndex, bitIndex)) return; | |
258 | ||
259 | // To set, 'OR' word with bit mask | |
260 | if ( state ) | |
261 | fReadoutList.fList[wordIndex] |= (0x00000001 << bitIndex); | |
262 | // To unset, 'AND' word with bit mask | |
263 | else | |
264 | fReadoutList.fList[wordIndex] &= (0xFFFFFFFF ^ (0x00000001 << bitIndex)); | |
265 | } | |
266 | ||
267 | ||
268 | void AliHLTReadoutList::Enable(Int_t detector) | |
269 | { | |
270 | // Enables all DDLs for a particular detector or detectors. | |
271 | // See header file for more details. | |
272 | ||
273 | if ((detector & kITSSPD) != 0) fReadoutList.fList[0] = 0x000FFFFF; | |
274 | if ((detector & kITSSDD) != 0) fReadoutList.fList[1] = 0x00FFFFFF; | |
275 | if ((detector & kITSSSD) != 0) fReadoutList.fList[2] = 0x0000FFFF; | |
276 | if ((detector & kTPC) != 0) | |
277 | { | |
278 | fReadoutList.fList[3] = 0xFFFFFFFF; | |
279 | fReadoutList.fList[4] = 0xFFFFFFFF; | |
280 | fReadoutList.fList[5] = 0xFFFFFFFF; | |
281 | fReadoutList.fList[6] = 0xFFFFFFFF; | |
282 | fReadoutList.fList[7] = 0xFFFFFFFF; | |
283 | fReadoutList.fList[8] = 0xFFFFFFFF; | |
284 | fReadoutList.fList[9] = 0x00FFFFFF; | |
285 | fReadoutList.fList[10] = 0x00000000; | |
286 | } | |
287 | if ((detector & kTRD) != 0) fReadoutList.fList[11] = 0x0003FFFF; | |
288 | if ((detector & kTOF) != 0) | |
289 | { | |
290 | fReadoutList.fList[12] = 0xFFFFFFFF; | |
291 | fReadoutList.fList[13] = 0xFFFFFFFF; | |
292 | fReadoutList.fList[14] = 0x000000FF; | |
293 | } | |
14da6b98 | 294 | if ((detector & kHMPID) != 0) fReadoutList.fList[15] = 0x000FFFFF; |
dce3e5ce | 295 | if ((detector & kPHOS) != 0) fReadoutList.fList[16] = 0x000FFFFF; |
296 | if ((detector & kCPV) != 0) fReadoutList.fList[17] = 0x000003FF; | |
297 | if ((detector & kPMD) != 0) fReadoutList.fList[18] = 0x0000003F; | |
298 | if ((detector & kMUONTRK) != 0) fReadoutList.fList[19] = 0x000FFFFF; | |
299 | if ((detector & kMUONTRG) != 0) fReadoutList.fList[20] = 0x00000003; | |
300 | if ((detector & kFMD) != 0) fReadoutList.fList[21] = 0x00000007; | |
301 | if ((detector & kT0) != 0) fReadoutList.fList[22] = 0x00000001; | |
302 | if ((detector & kV0) != 0) fReadoutList.fList[23] = 0x00000001; | |
303 | if ((detector & kZDC) != 0) fReadoutList.fList[24] = 0x00000001; | |
304 | if ((detector & kACORDE) != 0) fReadoutList.fList[25] = 0x00000001; | |
305 | if ((detector & kTRG) != 0) fReadoutList.fList[26] = 0x00000001; | |
a9a3028c | 306 | if ((detector & kEMCAL) != 0) |
307 | { | |
308 | fReadoutList.fList[27] = 0xFFFFFFFF; | |
309 | fReadoutList.fList[28] = 0x00003FFF; | |
310 | } | |
311 | if ((detector & kDAQTEST) != 0) fReadoutList.fList[29] = 0x00000001; | |
312 | if ((detector & kHLT) != 0) fReadoutList.fList[30] = 0x000003FF; | |
dce3e5ce | 313 | } |
314 | ||
315 | ||
316 | void AliHLTReadoutList::Disable(Int_t detector) | |
317 | { | |
318 | // Disables all DDLs for a particular detector or detectors. | |
319 | // See header file for more details. | |
320 | ||
321 | if ((detector & kITSSPD) != 0) fReadoutList.fList[0] = 0x00000000; | |
322 | if ((detector & kITSSDD) != 0) fReadoutList.fList[1] = 0x00000000; | |
323 | if ((detector & kITSSSD) != 0) fReadoutList.fList[2] = 0x00000000; | |
324 | if ((detector & kTPC) != 0) | |
325 | { | |
326 | fReadoutList.fList[3] = 0x00000000; | |
327 | fReadoutList.fList[4] = 0x00000000; | |
328 | fReadoutList.fList[5] = 0x00000000; | |
329 | fReadoutList.fList[6] = 0x00000000; | |
330 | fReadoutList.fList[7] = 0x00000000; | |
331 | fReadoutList.fList[8] = 0x00000000; | |
332 | fReadoutList.fList[9] = 0x00000000; | |
333 | fReadoutList.fList[10] = 0x00000000; | |
334 | } | |
335 | if ((detector & kTRD) != 0) fReadoutList.fList[11] = 0x00000000; | |
336 | if ((detector & kTOF) != 0) | |
337 | { | |
338 | fReadoutList.fList[12] = 0x00000000; | |
339 | fReadoutList.fList[13] = 0x00000000; | |
340 | fReadoutList.fList[14] = 0x00000000; | |
341 | } | |
342 | if ((detector & kHMPID) != 0) fReadoutList.fList[15] = 0x00000000; | |
343 | if ((detector & kPHOS) != 0) fReadoutList.fList[16] = 0x00000000; | |
344 | if ((detector & kCPV) != 0) fReadoutList.fList[17] = 0x00000000; | |
345 | if ((detector & kPMD) != 0) fReadoutList.fList[18] = 0x00000000; | |
346 | if ((detector & kMUONTRK) != 0) fReadoutList.fList[19] = 0x00000000; | |
347 | if ((detector & kMUONTRG) != 0) fReadoutList.fList[20] = 0x00000000; | |
348 | if ((detector & kFMD) != 0) fReadoutList.fList[21] = 0x00000000; | |
349 | if ((detector & kT0) != 0) fReadoutList.fList[22] = 0x00000000; | |
350 | if ((detector & kV0) != 0) fReadoutList.fList[23] = 0x00000000; | |
351 | if ((detector & kZDC) != 0) fReadoutList.fList[24] = 0x00000000; | |
352 | if ((detector & kACORDE) != 0) fReadoutList.fList[25] = 0x00000000; | |
353 | if ((detector & kTRG) != 0) fReadoutList.fList[26] = 0x00000000; | |
a9a3028c | 354 | if ((detector & kEMCAL) != 0) |
355 | { | |
356 | fReadoutList.fList[27] = 0x00000000; | |
357 | fReadoutList.fList[28] = 0x00000000; | |
358 | } | |
359 | if ((detector & kDAQTEST) != 0) fReadoutList.fList[29] = 0x00000000; | |
360 | if ((detector & kHLT) != 0) fReadoutList.fList[30] = 0x00000000; | |
dce3e5ce | 361 | } |
362 | ||
363 | ||
52f67e50 | 364 | bool AliHLTReadoutList::DetectorEnabled(Int_t detector) const |
365 | { | |
366 | // Checks if a particular detector's DDLs are enabled. | |
367 | // See header file for more details. | |
368 | ||
369 | bool result = true; | |
370 | if ((detector & kITSSPD) != 0) result &= fReadoutList.fList[0] == 0x000FFFFF; | |
371 | if ((detector & kITSSDD) != 0) result &= fReadoutList.fList[1] == 0x00FFFFFF; | |
372 | if ((detector & kITSSSD) != 0) result &= fReadoutList.fList[2] == 0x0000FFFF; | |
373 | if ((detector & kTPC) != 0) | |
374 | { | |
375 | result &= fReadoutList.fList[3] == 0xFFFFFFFF; | |
376 | result &= fReadoutList.fList[4] == 0xFFFFFFFF; | |
377 | result &= fReadoutList.fList[5] == 0xFFFFFFFF; | |
378 | result &= fReadoutList.fList[6] == 0xFFFFFFFF; | |
379 | result &= fReadoutList.fList[7] == 0xFFFFFFFF; | |
380 | result &= fReadoutList.fList[8] == 0xFFFFFFFF; | |
381 | result &= fReadoutList.fList[9] == 0x00FFFFFF; | |
382 | } | |
383 | if ((detector & kTRD) != 0) result &= fReadoutList.fList[11] == 0x0003FFFF; | |
384 | if ((detector & kTOF) != 0) | |
385 | { | |
386 | result &= fReadoutList.fList[12] == 0xFFFFFFFF; | |
387 | result &= fReadoutList.fList[13] == 0xFFFFFFFF; | |
388 | result &= fReadoutList.fList[14] == 0x000000FF; | |
389 | } | |
14da6b98 | 390 | if ((detector & kHMPID) != 0) result &= fReadoutList.fList[15] == 0x000FFFFF; |
52f67e50 | 391 | if ((detector & kPHOS) != 0) result &= fReadoutList.fList[16] == 0x000FFFFF; |
392 | if ((detector & kCPV) != 0) result &= fReadoutList.fList[17] == 0x000003FF; | |
393 | if ((detector & kPMD) != 0) result &= fReadoutList.fList[18] == 0x0000003F; | |
394 | if ((detector & kMUONTRK) != 0) result &= fReadoutList.fList[19] == 0x000FFFFF; | |
395 | if ((detector & kMUONTRG) != 0) result &= fReadoutList.fList[20] == 0x00000003; | |
396 | if ((detector & kFMD) != 0) result &= fReadoutList.fList[21] == 0x00000007; | |
397 | if ((detector & kT0) != 0) result &= fReadoutList.fList[22] == 0x00000001; | |
398 | if ((detector & kV0) != 0) result &= fReadoutList.fList[23] == 0x00000001; | |
399 | if ((detector & kZDC) != 0) result &= fReadoutList.fList[24] == 0x00000001; | |
400 | if ((detector & kACORDE) != 0) result &= fReadoutList.fList[25] == 0x00000001; | |
401 | if ((detector & kTRG) != 0) result &= fReadoutList.fList[26] == 0x00000001; | |
a9a3028c | 402 | if ((detector & kEMCAL) != 0) |
403 | { | |
404 | result &= fReadoutList.fList[27] == 0xFFFFFFFF; | |
405 | result &= fReadoutList.fList[28] == 0x00003FFF; | |
406 | } | |
407 | if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000001; | |
408 | if ((detector & kHLT) != 0) result &= fReadoutList.fList[30] == 0x000003FF; | |
52f67e50 | 409 | |
410 | return result; | |
411 | } | |
412 | ||
413 | ||
dce3e5ce | 414 | void AliHLTReadoutList::Print(Option_t* /*option*/) const |
415 | { | |
416 | // Prints the DDLs that will be readout according to this readout list. | |
417 | ||
418 | cout << "Readout enabled for DDLs:" << endl; | |
52647727 | 419 | for (Int_t i = 0; i < AliHLTDAQ::NumberOfDetectors(); i++) |
dce3e5ce | 420 | { |
52647727 | 421 | Int_t maxddls = AliHLTDAQ::NumberOfDdls(i); |
422 | cout << AliHLTDAQ::DetectorName(i) << ":"; | |
dce3e5ce | 423 | bool nonefound = true; |
424 | for (Int_t j = 0; j < maxddls; j++) | |
425 | { | |
52647727 | 426 | Int_t ddlId = ( ((i == AliHLTDAQ::NumberOfDetectors()-1) ? 30 : i) << 8 ) + j; |
dce3e5ce | 427 | if (GetDDLBit(ddlId)) |
428 | { | |
429 | cout << " " << ddlId; | |
430 | nonefound = false; | |
431 | } | |
432 | } | |
433 | if (nonefound) cout << " none"; | |
434 | cout << endl; | |
435 | } | |
436 | } | |
437 | ||
438 | ||
439 | AliHLTReadoutList& AliHLTReadoutList::operator = (const AliHLTReadoutList& list) | |
440 | { | |
441 | // Assignment operator performs a deep copy. | |
442 | ||
443 | TObject::operator = (list); | |
444 | if (&list != this) | |
445 | { | |
446 | memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList)); | |
447 | } | |
448 | return *this; | |
449 | } | |
450 | ||
451 | ||
452 | AliHLTReadoutList& AliHLTReadoutList::operator |= (const AliHLTReadoutList& list) | |
453 | { | |
454 | // This operator performs a bitwise inclusive or operation on all DDL bits. | |
455 | // See header file for more details. | |
e5339167 | 456 | this->OrEq(list); |
457 | return *this; | |
458 | } | |
459 | ||
460 | AliHLTReadoutList& AliHLTReadoutList::OrEq(const AliHLTReadoutList& list) | |
461 | { | |
462 | // a bitwise inclusive or operation on all DDL bits. | |
463 | // See header file for more details. | |
dce3e5ce | 464 | |
15ede44e | 465 | assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); |
dce3e5ce | 466 | for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) |
467 | { | |
468 | fReadoutList.fList[i] |= list.fReadoutList.fList[i]; | |
469 | } | |
470 | return *this; | |
471 | } | |
472 | ||
473 | ||
474 | AliHLTReadoutList& AliHLTReadoutList::operator ^= (const AliHLTReadoutList& list) | |
475 | { | |
476 | // This operator performs a bitwise exclusive or (xor) operation on all DDL bits. | |
477 | // See header file for more details. | |
e5339167 | 478 | |
479 | this->XorEq(list); | |
480 | return *this; | |
481 | } | |
482 | ||
483 | AliHLTReadoutList& AliHLTReadoutList::XorEq(const AliHLTReadoutList& list) | |
484 | { | |
485 | // bitwise exclusive or (xor) operation on all DDL bits. | |
486 | // See header file for more details. | |
dce3e5ce | 487 | |
15ede44e | 488 | assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); |
dce3e5ce | 489 | for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) |
490 | { | |
491 | fReadoutList.fList[i] ^= list.fReadoutList.fList[i]; | |
492 | } | |
493 | return *this; | |
494 | } | |
495 | ||
496 | ||
497 | AliHLTReadoutList& AliHLTReadoutList::operator &= (const AliHLTReadoutList& list) | |
498 | { | |
499 | // This operator performs a bitwise and operation on all DDL bits. | |
500 | // See header file for more details. | |
e5339167 | 501 | |
502 | this->AndEq(list); | |
503 | return *this; | |
504 | } | |
505 | ||
506 | AliHLTReadoutList& AliHLTReadoutList::AndEq(const AliHLTReadoutList& list) | |
507 | { | |
508 | // bitwise and operation on all DDL bits. | |
509 | // See header file for more details. | |
510 | ||
15ede44e | 511 | assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); |
dce3e5ce | 512 | for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) |
513 | { | |
514 | fReadoutList.fList[i] &= list.fReadoutList.fList[i]; | |
515 | } | |
516 | return *this; | |
517 | } | |
518 | ||
dce3e5ce | 519 | AliHLTReadoutList& AliHLTReadoutList::operator -= (const AliHLTReadoutList& list) |
520 | { | |
521 | // This operator removes all the DDLs specified in list from this readout list. | |
522 | // See header file for more details. | |
523 | ||
15ede44e | 524 | assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); |
dce3e5ce | 525 | for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) |
526 | { | |
527 | // Effectively apply: this = this & (~ (this & list)) | |
528 | // i.e. this = this & (this ^ list) | |
529 | fReadoutList.fList[i] &= fReadoutList.fList[i] ^ list.fReadoutList.fList[i]; | |
530 | } | |
531 | return *this; | |
532 | } | |
533 | ||
534 | ||
535 | AliHLTReadoutList AliHLTReadoutList::operator ~ () const | |
536 | { | |
537 | // This operator performs a bitwise ones compliment on all DDL bits. | |
538 | // See header file for more details. | |
539 | ||
540 | AliHLTReadoutList readoutlist; | |
541 | readoutlist.fReadoutList.fCount = fReadoutList.fCount; | |
542 | readoutlist.fReadoutList.fList[0] = 0x000FFFFF & (~fReadoutList.fList[0]); | |
543 | readoutlist.fReadoutList.fList[1] = 0x00FFFFFF & (~fReadoutList.fList[1]); | |
544 | readoutlist.fReadoutList.fList[2] = 0x0000FFFF & (~fReadoutList.fList[2]); | |
545 | readoutlist.fReadoutList.fList[3] = 0xFFFFFFFF & (~fReadoutList.fList[3]); | |
546 | readoutlist.fReadoutList.fList[4] = 0xFFFFFFFF & (~fReadoutList.fList[4]); | |
547 | readoutlist.fReadoutList.fList[5] = 0xFFFFFFFF & (~fReadoutList.fList[5]); | |
548 | readoutlist.fReadoutList.fList[6] = 0xFFFFFFFF & (~fReadoutList.fList[6]); | |
549 | readoutlist.fReadoutList.fList[7] = 0xFFFFFFFF & (~fReadoutList.fList[7]); | |
550 | readoutlist.fReadoutList.fList[8] = 0xFFFFFFFF & (~fReadoutList.fList[8]); | |
551 | readoutlist.fReadoutList.fList[9] = 0x00FFFFFF & (~fReadoutList.fList[9]); | |
552 | readoutlist.fReadoutList.fList[10] = 0x00000000 & (~fReadoutList.fList[10]); | |
553 | readoutlist.fReadoutList.fList[11] = 0x0003FFFF & (~fReadoutList.fList[11]); | |
554 | readoutlist.fReadoutList.fList[12] = 0xFFFFFFFF & (~fReadoutList.fList[12]); | |
555 | readoutlist.fReadoutList.fList[13] = 0xFFFFFFFF & (~fReadoutList.fList[13]); | |
556 | readoutlist.fReadoutList.fList[14] = 0x000000FF & (~fReadoutList.fList[14]); | |
14da6b98 | 557 | readoutlist.fReadoutList.fList[15] = 0x000FFFFF & (~fReadoutList.fList[15]); |
dce3e5ce | 558 | readoutlist.fReadoutList.fList[16] = 0x000FFFFF & (~fReadoutList.fList[16]); |
559 | readoutlist.fReadoutList.fList[17] = 0x000003FF & (~fReadoutList.fList[17]); | |
560 | readoutlist.fReadoutList.fList[18] = 0x0000003F & (~fReadoutList.fList[18]); | |
561 | readoutlist.fReadoutList.fList[19] = 0x000FFFFF & (~fReadoutList.fList[19]); | |
562 | readoutlist.fReadoutList.fList[20] = 0x00000003 & (~fReadoutList.fList[20]); | |
563 | readoutlist.fReadoutList.fList[21] = 0x00000007 & (~fReadoutList.fList[21]); | |
564 | readoutlist.fReadoutList.fList[22] = 0x00000001 & (~fReadoutList.fList[22]); | |
565 | readoutlist.fReadoutList.fList[23] = 0x00000001 & (~fReadoutList.fList[23]); | |
566 | readoutlist.fReadoutList.fList[24] = 0x00000001 & (~fReadoutList.fList[24]); | |
567 | readoutlist.fReadoutList.fList[25] = 0x00000001 & (~fReadoutList.fList[25]); | |
568 | readoutlist.fReadoutList.fList[26] = 0x00000001 & (~fReadoutList.fList[26]); | |
a9a3028c | 569 | readoutlist.fReadoutList.fList[27] = 0xFFFFFFFF & (~fReadoutList.fList[27]); |
570 | readoutlist.fReadoutList.fList[28] = 0x00003FFF & (~fReadoutList.fList[28]); | |
571 | readoutlist.fReadoutList.fList[29] = 0x00000001 & (~fReadoutList.fList[29]); | |
572 | readoutlist.fReadoutList.fList[30] = 0x000003FF & (~fReadoutList.fList[30]); | |
dce3e5ce | 573 | return readoutlist; |
574 | } | |
575 |