2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
6 * Primary Authors: Artur Szostak <artursz@iafrica.com> *
7 * for The ALICE HLT Project. *
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 **************************************************************************/
18 /// @file AliHLTReadoutList.cxx
19 /// @author Artur Szostak <artursz@iafrica.com>
21 /// @brief Implementation of the AliHLTReadoutList class.
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.
32 #include "AliHLTReadoutList.h"
33 #include "AliHLTDAQ.h"
34 #include "Riostream.h"
36 #include "TObjString.h"
37 #include "TObjArray.h"
40 ClassImp(AliHLTReadoutList)
43 const char* AliHLTReadoutList::DetectorIdToString(EDetectorId id)
45 // Converts a detector ID to a user readable string.
48 case kNoDetector: return "kNoDetector";
49 case kITSSPD: return "kITSSPD";
50 case kITSSDD: return "kITSSDD";
51 case kITSSSD: return "kITSSSD";
52 case kTPC: return "kTPC";
53 case kTRD: return "kTRD";
54 case kTOF: return "kTOF";
55 case kHMPID: return "kHMPID";
56 case kPHOS: return "kPHOS";
57 case kCPV: return "kCPV";
58 case kPMD: return "kPMD";
59 case kMUONTRK: return "kMUONTRK";
60 case kMUONTRG: return "kMUONTRG";
61 case kFMD: return "kFMD";
62 case kT0: return "kT0";
63 case kV0: return "kV0";
64 case kZDC: return "kZDC";
65 case kACORDE: return "kACORDE";
66 case kTRG: return "kTRG";
67 case kEMCAL: return "kEMCAL";
68 case kDAQTEST: return "kDAQTEST";
69 case kHLT: return "kHLT";
70 case kALLDET: return "kALLDET";
71 default: return "UNKNOWN!";
76 AliHLTReadoutList::AliHLTReadoutList() :
77 TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."),
80 // Default constructor.
82 fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015
83 memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
87 AliHLTReadoutList::AliHLTReadoutList(Int_t enabledDetectors) :
88 TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."),
91 // Constructor to select which detectors to enable for readout.
92 // See header file for more details.
94 fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015
95 memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
96 Enable(enabledDetectors);
100 AliHLTReadoutList::AliHLTReadoutList(const char* enabledList) :
101 TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."),
104 // Constructor to select which detectors and DDLs to enable for readout.
105 // See header file for more details.
107 fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015
108 memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
110 TString str(enabledList);
112 Int_t enabledDetectors = 0;
113 if (str.Contains("ITSSPD")) enabledDetectors |= kITSSPD;
114 if (str.Contains("ITSSDD")) enabledDetectors |= kITSSDD;
115 if (str.Contains("ITSSSD")) enabledDetectors |= kITSSSD;
116 if (str.Contains("TPC")) enabledDetectors |= kTPC;
117 if (str.Contains("TRD")) enabledDetectors |= kTRD;
118 if (str.Contains("TOF")) enabledDetectors |= kTOF;
119 if (str.Contains("HMPID")) enabledDetectors |= kHMPID;
120 if (str.Contains("PHOS")) enabledDetectors |= kPHOS;
121 if (str.Contains("CPV")) enabledDetectors |= kCPV;
122 if (str.Contains("PMD")) enabledDetectors |= kPMD;
123 if (str.Contains("MUONTRK")) enabledDetectors |= kMUONTRK;
124 if (str.Contains("MUONTRG")) enabledDetectors |= kMUONTRG;
125 if (str.Contains("FMD")) enabledDetectors |= kFMD;
126 if (str.Contains("T0")) enabledDetectors |= kT0;
127 if (str.Contains("V0")) enabledDetectors |= kV0;
128 if (str.Contains("ZDC")) enabledDetectors |= kZDC;
129 if (str.Contains("ACORDE")) enabledDetectors |= kACORDE;
130 if (str.Contains("TRG")) enabledDetectors |= kTRG;
131 if (str.Contains("EMCAL")) enabledDetectors |= kEMCAL;
132 if (str.Contains("DAQTEST")) enabledDetectors |= kDAQTEST;
133 if (str.Contains("HLT")) enabledDetectors |= kHLT;
134 if (str.Contains("ALL")) enabledDetectors |= kALLDET;
135 Enable(enabledDetectors);
137 TObjArray* list = str.Tokenize(" ");
139 const TObjString* objstr = NULL;
140 while ((objstr = dynamic_cast<const TObjString*>(next())) != NULL)
142 str = objstr->GetString();
143 if (str.IsDigit()) EnableDDLBit(str.Atoi());
149 AliHLTReadoutList::AliHLTReadoutList(const AliHLTEventDDL& list) :
150 TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."),
153 // Constructor to create readout list from AliHLTEventDDL structure.
154 // See header file for more details.
155 fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015
156 memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
157 // Handle lists of different sizes. If the size is for a known version
158 // of AliHLTEventDDL then handle appropriately, otherwise just copy only
159 // the overlapping part of the list.
160 if (list.fCount == gkAliHLTDDLListSizeV0)
162 memcpy(&fReadoutList.fList[0], &list.fList[0], sizeof(AliHLTUInt32_t)*28);
163 memcpy(&fReadoutList.fList[29], &list.fList[28], sizeof(AliHLTUInt32_t)*2);
165 else if (list.fCount == gkAliHLTDDLListSizeV1)
167 memcpy(&fReadoutList.fList, &list.fList, sizeof(AliHLTEventDDL));
171 memcpy(&fReadoutList.fList, &list.fList, (fReadoutList.fCount<list.fCount?fReadoutList.fCount:list.fCount)*sizeof(AliHLTUInt32_t));
176 AliHLTReadoutList::AliHLTReadoutList(const AliHLTReadoutList& list) :
180 // Copy constructor performs a deep copy.
182 memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList));
186 AliHLTReadoutList::~AliHLTReadoutList()
188 // Default destructor.
192 bool AliHLTReadoutList::Empty() const
194 // Returns true if the readout list has no DDLs enabled.
196 for (size_t i = 0; i < sizeof(fReadoutList.fList) / sizeof(fReadoutList.fList[0]); i++)
198 if (fReadoutList.fList[i] != 0x0) return false;
204 void AliHLTReadoutList::Clear(Option_t* /*option*/)
206 // Resets all the DDL readout bits.
207 memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
211 bool AliHLTReadoutList::DecodeDDLID(Int_t ddlId, Int_t& wordIndex, Int_t& bitIndex)
213 // Decodes the word index and bit index within that word for the readout list structure.
214 // See header file for more details.
216 // The detector number is bits 15..8 of ddlId and DDL number is bits 7..0.
217 Int_t detNum = ddlId >> 8;
218 Int_t ddlNum = ddlId & 0xFF;
225 if (ddlNum >= 32) return false; // only have 1 32-bit word.
226 // the 3 ITS detectors have one word each
230 // the TPC bitfield has in total 8 words
231 wordIndex = detNum + (ddlNum >> 5);
234 if (ddlNum >= 32) return false; // only have 1 32-bit word.
235 // the TRD bitfield starts at word 11 (3 words ITS + 8 words TPC)
239 if (ddlNum >= 3*32) return false; // only have 3 32-bit words.
240 // TOF has 72 DDLs, the bitfield is 3 words starting at position 12
241 wordIndex = 12 + (ddlNum >> 5);
247 case 10: // MUONTRK (MCH)
248 case 11: // MUONTRG (MTR)
255 if (ddlNum >= 32) return false; // only have 1 32-bit word.
256 // all these detectors fit into one word, the offset is due to
258 wordIndex = detNum + 9;
261 if (ddlNum >= 2*32) return false; // only have 2 32-bit words.
262 // 2 words for EMCAL + DCAL
263 wordIndex = detNum + 7;
264 wordIndex = 27 + (ddlNum >> 5);
267 if (ddlNum >= 32) return false; // only have 1 32-bit word.
271 if (ddlNum >= 32) return false; // only have 1 32-bit word.
272 // the HLT bitfield is in the last word
279 if (ddlNum >= AliHLTDAQ::NumberOfDdls(detNum == 30 ? 20 : detNum)) return false;
281 // The bit index within the word indicated by wordIndex.
282 bitIndex = ddlNum % 32;
287 Bool_t AliHLTReadoutList::GetDDLBit(Int_t ddlId) const
289 // Fetches the bit value for a particular DDL in the readout list.
290 // See header file for more details.
292 Int_t wordIndex, bitIndex;
293 if (! DecodeDDLID(ddlId, wordIndex, bitIndex)) return kFALSE;
294 return ((fReadoutList.fList[wordIndex] >> bitIndex) & 0x1) == 0x1;
298 void AliHLTReadoutList::SetDDLBit(Int_t ddlId, Bool_t state)
300 // Sets the bit value for a particular DDL in the readout list.
301 // See header file for more details.
303 Int_t wordIndex, bitIndex;
304 if (! DecodeDDLID(ddlId, wordIndex, bitIndex)) return;
306 // To set, 'OR' word with bit mask
308 fReadoutList.fList[wordIndex] |= (0x00000001 << bitIndex);
309 // To unset, 'AND' word with bit mask
311 fReadoutList.fList[wordIndex] &= (0xFFFFFFFF ^ (0x00000001 << bitIndex));
315 void AliHLTReadoutList::Enable(Int_t detector)
317 // Enables all DDLs for a particular detector or detectors.
318 // See header file for more details.
320 if ((detector & kITSSPD) != 0) fReadoutList.fList[0] = 0x000FFFFF;
321 if ((detector & kITSSDD) != 0) fReadoutList.fList[1] = 0x00FFFFFF;
322 if ((detector & kITSSSD) != 0) fReadoutList.fList[2] = 0x0000FFFF;
323 if ((detector & kTPC) != 0)
325 fReadoutList.fList[3] = 0xFFFFFFFF;
326 fReadoutList.fList[4] = 0xFFFFFFFF;
327 fReadoutList.fList[5] = 0xFFFFFFFF;
328 fReadoutList.fList[6] = 0xFFFFFFFF;
329 fReadoutList.fList[7] = 0xFFFFFFFF;
330 fReadoutList.fList[8] = 0xFFFFFFFF;
331 fReadoutList.fList[9] = 0x00FFFFFF;
332 fReadoutList.fList[10] = 0x00000000;
334 if ((detector & kTRD) != 0) fReadoutList.fList[11] = 0x0003FFFF;
335 if ((detector & kTOF) != 0)
337 fReadoutList.fList[12] = 0xFFFFFFFF;
338 fReadoutList.fList[13] = 0xFFFFFFFF;
339 fReadoutList.fList[14] = 0x000000FF;
341 if ((detector & kHMPID) != 0) fReadoutList.fList[15] = 0x000FFFFF;
342 if ((detector & kPHOS) != 0) fReadoutList.fList[16] = 0x000FFFFF;
343 if ((detector & kCPV) != 0) fReadoutList.fList[17] = 0x000003FF;
344 if ((detector & kPMD) != 0) fReadoutList.fList[18] = 0x0000003F;
345 if ((detector & kMUONTRK) != 0) fReadoutList.fList[19] = 0x000FFFFF;
346 if ((detector & kMUONTRG) != 0) fReadoutList.fList[20] = 0x00000003;
347 if ((detector & kFMD) != 0) fReadoutList.fList[21] = 0x00000007;
348 if ((detector & kT0) != 0) fReadoutList.fList[22] = 0x00000001;
349 if ((detector & kV0) != 0) fReadoutList.fList[23] = 0x00000001;
350 if ((detector & kZDC) != 0) fReadoutList.fList[24] = 0x00000001;
351 if ((detector & kACORDE) != 0) fReadoutList.fList[25] = 0x00000001;
352 if ((detector & kTRG) != 0) fReadoutList.fList[26] = 0x00000001;
353 if ((detector & kEMCAL) != 0)
355 fReadoutList.fList[27] = 0xFFFFFFFF;
356 fReadoutList.fList[28] = 0x00003FFF;
358 if ((detector & kDAQTEST) != 0) fReadoutList.fList[29] = 0x00000001;
359 if ((detector & kHLT) != 0) fReadoutList.fList[30] = 0x000003FF;
363 void AliHLTReadoutList::Disable(Int_t detector)
365 // Disables all DDLs for a particular detector or detectors.
366 // See header file for more details.
368 if ((detector & kITSSPD) != 0) fReadoutList.fList[0] = 0x00000000;
369 if ((detector & kITSSDD) != 0) fReadoutList.fList[1] = 0x00000000;
370 if ((detector & kITSSSD) != 0) fReadoutList.fList[2] = 0x00000000;
371 if ((detector & kTPC) != 0)
373 fReadoutList.fList[3] = 0x00000000;
374 fReadoutList.fList[4] = 0x00000000;
375 fReadoutList.fList[5] = 0x00000000;
376 fReadoutList.fList[6] = 0x00000000;
377 fReadoutList.fList[7] = 0x00000000;
378 fReadoutList.fList[8] = 0x00000000;
379 fReadoutList.fList[9] = 0x00000000;
380 fReadoutList.fList[10] = 0x00000000;
382 if ((detector & kTRD) != 0) fReadoutList.fList[11] = 0x00000000;
383 if ((detector & kTOF) != 0)
385 fReadoutList.fList[12] = 0x00000000;
386 fReadoutList.fList[13] = 0x00000000;
387 fReadoutList.fList[14] = 0x00000000;
389 if ((detector & kHMPID) != 0) fReadoutList.fList[15] = 0x00000000;
390 if ((detector & kPHOS) != 0) fReadoutList.fList[16] = 0x00000000;
391 if ((detector & kCPV) != 0) fReadoutList.fList[17] = 0x00000000;
392 if ((detector & kPMD) != 0) fReadoutList.fList[18] = 0x00000000;
393 if ((detector & kMUONTRK) != 0) fReadoutList.fList[19] = 0x00000000;
394 if ((detector & kMUONTRG) != 0) fReadoutList.fList[20] = 0x00000000;
395 if ((detector & kFMD) != 0) fReadoutList.fList[21] = 0x00000000;
396 if ((detector & kT0) != 0) fReadoutList.fList[22] = 0x00000000;
397 if ((detector & kV0) != 0) fReadoutList.fList[23] = 0x00000000;
398 if ((detector & kZDC) != 0) fReadoutList.fList[24] = 0x00000000;
399 if ((detector & kACORDE) != 0) fReadoutList.fList[25] = 0x00000000;
400 if ((detector & kTRG) != 0) fReadoutList.fList[26] = 0x00000000;
401 if ((detector & kEMCAL) != 0)
403 fReadoutList.fList[27] = 0x00000000;
404 fReadoutList.fList[28] = 0x00000000;
406 if ((detector & kDAQTEST) != 0) fReadoutList.fList[29] = 0x00000000;
407 if ((detector & kHLT) != 0) fReadoutList.fList[30] = 0x00000000;
411 bool AliHLTReadoutList::DetectorEnabled(Int_t detector) const
413 // Checks if a particular detector's DDLs are enabled.
414 // See header file for more details.
417 if ((detector & kITSSPD) != 0) result &= fReadoutList.fList[0] == 0x000FFFFF;
418 if ((detector & kITSSDD) != 0) result &= fReadoutList.fList[1] == 0x00FFFFFF;
419 if ((detector & kITSSSD) != 0) result &= fReadoutList.fList[2] == 0x0000FFFF;
420 if ((detector & kTPC) != 0)
422 result &= fReadoutList.fList[3] == 0xFFFFFFFF;
423 result &= fReadoutList.fList[4] == 0xFFFFFFFF;
424 result &= fReadoutList.fList[5] == 0xFFFFFFFF;
425 result &= fReadoutList.fList[6] == 0xFFFFFFFF;
426 result &= fReadoutList.fList[7] == 0xFFFFFFFF;
427 result &= fReadoutList.fList[8] == 0xFFFFFFFF;
428 result &= fReadoutList.fList[9] == 0x00FFFFFF;
430 if ((detector & kTRD) != 0) result &= fReadoutList.fList[11] == 0x0003FFFF;
431 if ((detector & kTOF) != 0)
433 result &= fReadoutList.fList[12] == 0xFFFFFFFF;
434 result &= fReadoutList.fList[13] == 0xFFFFFFFF;
435 result &= fReadoutList.fList[14] == 0x000000FF;
437 if ((detector & kHMPID) != 0) result &= fReadoutList.fList[15] == 0x000FFFFF;
438 if ((detector & kPHOS) != 0) result &= fReadoutList.fList[16] == 0x000FFFFF;
439 if ((detector & kCPV) != 0) result &= fReadoutList.fList[17] == 0x000003FF;
440 if ((detector & kPMD) != 0) result &= fReadoutList.fList[18] == 0x0000003F;
441 if ((detector & kMUONTRK) != 0) result &= fReadoutList.fList[19] == 0x000FFFFF;
442 if ((detector & kMUONTRG) != 0) result &= fReadoutList.fList[20] == 0x00000003;
443 if ((detector & kFMD) != 0) result &= fReadoutList.fList[21] == 0x00000007;
444 if ((detector & kT0) != 0) result &= fReadoutList.fList[22] == 0x00000001;
445 if ((detector & kV0) != 0) result &= fReadoutList.fList[23] == 0x00000001;
446 if ((detector & kZDC) != 0) result &= fReadoutList.fList[24] == 0x00000001;
447 if ((detector & kACORDE) != 0) result &= fReadoutList.fList[25] == 0x00000001;
448 if ((detector & kTRG) != 0) result &= fReadoutList.fList[26] == 0x00000001;
449 if ((detector & kEMCAL) != 0)
451 result &= fReadoutList.fList[27] == 0xFFFFFFFF;
452 result &= fReadoutList.fList[28] == 0x00003FFF;
454 if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000001;
455 if ((detector & kHLT) != 0) result &= fReadoutList.fList[30] == 0x000003FF;
461 bool AliHLTReadoutList::DetectorDisabled(Int_t detector) const
463 // Checks if a particular detector's DDLs are disabled.
464 // See header file for more details.
467 if ((detector & kITSSPD) != 0) result &= fReadoutList.fList[0] == 0x00000000;
468 if ((detector & kITSSDD) != 0) result &= fReadoutList.fList[1] == 0x00000000;
469 if ((detector & kITSSSD) != 0) result &= fReadoutList.fList[2] == 0x00000000;
470 if ((detector & kTPC) != 0)
472 result &= fReadoutList.fList[3] == 0x00000000;
473 result &= fReadoutList.fList[4] == 0x00000000;
474 result &= fReadoutList.fList[5] == 0x00000000;
475 result &= fReadoutList.fList[6] == 0x00000000;
476 result &= fReadoutList.fList[7] == 0x00000000;
477 result &= fReadoutList.fList[8] == 0x00000000;
478 result &= fReadoutList.fList[9] == 0x00000000;
480 if ((detector & kTRD) != 0) result &= fReadoutList.fList[11] == 0x00000000;
481 if ((detector & kTOF) != 0)
483 result &= fReadoutList.fList[12] == 0x00000000;
484 result &= fReadoutList.fList[13] == 0x00000000;
485 result &= fReadoutList.fList[14] == 0x00000000;
487 if ((detector & kHMPID) != 0) result &= fReadoutList.fList[15] == 0x00000000;
488 if ((detector & kPHOS) != 0) result &= fReadoutList.fList[16] == 0x00000000;
489 if ((detector & kCPV) != 0) result &= fReadoutList.fList[17] == 0x00000000;
490 if ((detector & kPMD) != 0) result &= fReadoutList.fList[18] == 0x00000000;
491 if ((detector & kMUONTRK) != 0) result &= fReadoutList.fList[19] == 0x00000000;
492 if ((detector & kMUONTRG) != 0) result &= fReadoutList.fList[20] == 0x00000000;
493 if ((detector & kFMD) != 0) result &= fReadoutList.fList[21] == 0x00000000;
494 if ((detector & kT0) != 0) result &= fReadoutList.fList[22] == 0x00000000;
495 if ((detector & kV0) != 0) result &= fReadoutList.fList[23] == 0x00000000;
496 if ((detector & kZDC) != 0) result &= fReadoutList.fList[24] == 0x00000000;
497 if ((detector & kACORDE) != 0) result &= fReadoutList.fList[25] == 0x00000000;
498 if ((detector & kTRG) != 0) result &= fReadoutList.fList[26] == 0x00000000;
499 if ((detector & kEMCAL) != 0)
501 result &= fReadoutList.fList[27] == 0x00000000;
502 result &= fReadoutList.fList[28] == 0x00000000;
504 if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000000;
505 if ((detector & kHLT) != 0) result &= fReadoutList.fList[30] == 0x00000000;
511 Int_t AliHLTReadoutList::GetFirstWord(EDetectorId detector)
513 // See header file for more details.
516 case kITSSPD: return 0;
517 case kITSSDD: return 1;
518 case kITSSSD: return 2;
520 case kTRD: return 11;
521 case kTOF: return 12;
522 case kHMPID: return 15;
523 case kPHOS: return 16;
524 case kCPV: return 17;
525 case kPMD: return 18;
526 case kMUONTRK: return 19;
527 case kMUONTRG: return 20;
528 case kFMD: return 21;
531 case kZDC: return 24;
532 case kACORDE: return 25;
533 case kTRG: return 26;
534 case kEMCAL: return 27;
535 case kDAQTEST: return 29;
536 case kHLT: return 30;
542 Int_t AliHLTReadoutList::GetWordCount(EDetectorId detector)
544 // See header file for more details.
547 case kITSSPD: return 1;
548 case kITSSDD: return 1;
549 case kITSSSD: return 1;
553 case kHMPID: return 1;
554 case kPHOS: return 1;
557 case kMUONTRK: return 1;
558 case kMUONTRG: return 1;
563 case kACORDE: return 1;
565 case kEMCAL: return 2;
566 case kDAQTEST: return 1;
573 AliHLTReadoutList::EDetectorId AliHLTReadoutList::GetFirstUsedDetector(EDetectorId startAfter) const
575 // See header file for more details.
576 if (startAfter < kITSSPD and fReadoutList.fList[0] != 0x00000000) return kITSSPD;
577 if (startAfter < kITSSDD and fReadoutList.fList[1] != 0x00000000) return kITSSDD;
578 if (startAfter < kITSSSD and fReadoutList.fList[2] != 0x00000000) return kITSSSD;
579 if (startAfter < kTPC and fReadoutList.fList[3] != 0x00000000) return kTPC;
580 if (startAfter < kTPC and fReadoutList.fList[4] != 0x00000000) return kTPC;
581 if (startAfter < kTPC and fReadoutList.fList[5] != 0x00000000) return kTPC;
582 if (startAfter < kTPC and fReadoutList.fList[6] != 0x00000000) return kTPC;
583 if (startAfter < kTPC and fReadoutList.fList[7] != 0x00000000) return kTPC;
584 if (startAfter < kTPC and fReadoutList.fList[8] != 0x00000000) return kTPC;
585 if (startAfter < kTPC and fReadoutList.fList[9] != 0x00000000) return kTPC;
586 if (startAfter < kTPC and fReadoutList.fList[10] != 0x00000000) return kTPC;
587 if (startAfter < kTRD and fReadoutList.fList[11] != 0x00000000) return kTRD;
588 if (startAfter < kTOF and fReadoutList.fList[12] != 0x00000000) return kTOF;
589 if (startAfter < kTOF and fReadoutList.fList[13] != 0x00000000) return kTOF;
590 if (startAfter < kTOF and fReadoutList.fList[14] != 0x00000000) return kTOF;
591 if (startAfter < kHMPID and fReadoutList.fList[15] != 0x00000000) return kHMPID;
592 if (startAfter < kPHOS and fReadoutList.fList[16] != 0x00000000) return kPHOS;
593 if (startAfter < kCPV and fReadoutList.fList[17] != 0x00000000) return kCPV;
594 if (startAfter < kPMD and fReadoutList.fList[18] != 0x00000000) return kPMD;
595 if (startAfter < kMUONTRK and fReadoutList.fList[19] != 0x00000000) return kMUONTRK;
596 if (startAfter < kMUONTRG and fReadoutList.fList[20] != 0x00000000) return kMUONTRG;
597 if (startAfter < kFMD and fReadoutList.fList[21] != 0x00000000) return kFMD;
598 if (startAfter < kT0 and fReadoutList.fList[22] != 0x00000000) return kT0;
599 if (startAfter < kV0 and fReadoutList.fList[23] != 0x00000000) return kV0;
600 if (startAfter < kZDC and fReadoutList.fList[24] != 0x00000000) return kZDC;
601 if (startAfter < kACORDE and fReadoutList.fList[25] != 0x00000000) return kACORDE;
602 if (startAfter < kTRG and fReadoutList.fList[26] != 0x00000000) return kTRG;
603 if (startAfter < kEMCAL and fReadoutList.fList[27] != 0x00000000) return kEMCAL;
604 if (startAfter < kEMCAL and fReadoutList.fList[28] != 0x00000000) return kEMCAL;
605 if (startAfter < kDAQTEST and fReadoutList.fList[29] != 0x00000000) return kDAQTEST;
606 if (startAfter < kHLT and fReadoutList.fList[30] != 0x00000000) return kHLT;
611 void AliHLTReadoutList::Print(Option_t* /*option*/) const
613 // Prints the DDLs that will be readout according to this readout list.
615 cout << "Readout enabled for DDLs:" << endl;
616 for (Int_t i = 0; i < AliHLTDAQ::NumberOfDetectors(); i++)
618 Int_t maxddls = AliHLTDAQ::NumberOfDdls(i);
619 cout << AliHLTDAQ::DetectorName(i) << ":";
620 bool nonefound = true;
621 for (Int_t j = 0; j < maxddls; j++)
623 Int_t ddlId = ( ((i == AliHLTDAQ::NumberOfDetectors()-1) ? 30 : i) << 8 ) + j;
624 if (GetDDLBit(ddlId))
626 cout << " " << ddlId;
630 if (nonefound) cout << " none";
636 AliHLTReadoutList& AliHLTReadoutList::operator = (const AliHLTReadoutList& list)
638 // Assignment operator performs a deep copy.
640 TObject::operator = (list);
643 memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList));
649 AliHLTReadoutList& AliHLTReadoutList::operator |= (const AliHLTReadoutList& list)
651 // This operator performs a bitwise inclusive or operation on all DDL bits.
652 // See header file for more details.
657 AliHLTReadoutList& AliHLTReadoutList::OrEq(const AliHLTReadoutList& list)
659 // a bitwise inclusive or operation on all DDL bits.
660 // See header file for more details.
662 assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
663 for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
665 fReadoutList.fList[i] |= list.fReadoutList.fList[i];
671 AliHLTReadoutList& AliHLTReadoutList::operator ^= (const AliHLTReadoutList& list)
673 // This operator performs a bitwise exclusive or (xor) operation on all DDL bits.
674 // See header file for more details.
680 AliHLTReadoutList& AliHLTReadoutList::XorEq(const AliHLTReadoutList& list)
682 // bitwise exclusive or (xor) operation on all DDL bits.
683 // See header file for more details.
685 assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
686 for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
688 fReadoutList.fList[i] ^= list.fReadoutList.fList[i];
694 AliHLTReadoutList& AliHLTReadoutList::operator &= (const AliHLTReadoutList& list)
696 // This operator performs a bitwise and operation on all DDL bits.
697 // See header file for more details.
703 AliHLTReadoutList& AliHLTReadoutList::AndEq(const AliHLTReadoutList& list)
705 // bitwise and operation on all DDL bits.
706 // See header file for more details.
708 assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
709 for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
711 fReadoutList.fList[i] &= list.fReadoutList.fList[i];
716 AliHLTReadoutList& AliHLTReadoutList::operator -= (const AliHLTReadoutList& list)
718 // This operator removes all the DDLs specified in list from this readout list.
719 // See header file for more details.
721 assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
722 for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
724 // Effectively apply: this = this & (~ (this & list))
725 // i.e. this = this & (this ^ list)
726 fReadoutList.fList[i] &= fReadoutList.fList[i] ^ list.fReadoutList.fList[i];
732 AliHLTReadoutList AliHLTReadoutList::operator ~ () const
734 // This operator performs a bitwise ones compliment on all DDL bits.
735 // See header file for more details.
737 AliHLTReadoutList readoutlist;
738 readoutlist.fReadoutList.fCount = fReadoutList.fCount;
739 readoutlist.fReadoutList.fList[0] = 0x000FFFFF & (~fReadoutList.fList[0]);
740 readoutlist.fReadoutList.fList[1] = 0x00FFFFFF & (~fReadoutList.fList[1]);
741 readoutlist.fReadoutList.fList[2] = 0x0000FFFF & (~fReadoutList.fList[2]);
742 readoutlist.fReadoutList.fList[3] = 0xFFFFFFFF & (~fReadoutList.fList[3]);
743 readoutlist.fReadoutList.fList[4] = 0xFFFFFFFF & (~fReadoutList.fList[4]);
744 readoutlist.fReadoutList.fList[5] = 0xFFFFFFFF & (~fReadoutList.fList[5]);
745 readoutlist.fReadoutList.fList[6] = 0xFFFFFFFF & (~fReadoutList.fList[6]);
746 readoutlist.fReadoutList.fList[7] = 0xFFFFFFFF & (~fReadoutList.fList[7]);
747 readoutlist.fReadoutList.fList[8] = 0xFFFFFFFF & (~fReadoutList.fList[8]);
748 readoutlist.fReadoutList.fList[9] = 0x00FFFFFF & (~fReadoutList.fList[9]);
749 readoutlist.fReadoutList.fList[10] = 0x00000000 & (~fReadoutList.fList[10]);
750 readoutlist.fReadoutList.fList[11] = 0x0003FFFF & (~fReadoutList.fList[11]);
751 readoutlist.fReadoutList.fList[12] = 0xFFFFFFFF & (~fReadoutList.fList[12]);
752 readoutlist.fReadoutList.fList[13] = 0xFFFFFFFF & (~fReadoutList.fList[13]);
753 readoutlist.fReadoutList.fList[14] = 0x000000FF & (~fReadoutList.fList[14]);
754 readoutlist.fReadoutList.fList[15] = 0x000FFFFF & (~fReadoutList.fList[15]);
755 readoutlist.fReadoutList.fList[16] = 0x000FFFFF & (~fReadoutList.fList[16]);
756 readoutlist.fReadoutList.fList[17] = 0x000003FF & (~fReadoutList.fList[17]);
757 readoutlist.fReadoutList.fList[18] = 0x0000003F & (~fReadoutList.fList[18]);
758 readoutlist.fReadoutList.fList[19] = 0x000FFFFF & (~fReadoutList.fList[19]);
759 readoutlist.fReadoutList.fList[20] = 0x00000003 & (~fReadoutList.fList[20]);
760 readoutlist.fReadoutList.fList[21] = 0x00000007 & (~fReadoutList.fList[21]);
761 readoutlist.fReadoutList.fList[22] = 0x00000001 & (~fReadoutList.fList[22]);
762 readoutlist.fReadoutList.fList[23] = 0x00000001 & (~fReadoutList.fList[23]);
763 readoutlist.fReadoutList.fList[24] = 0x00000001 & (~fReadoutList.fList[24]);
764 readoutlist.fReadoutList.fList[25] = 0x00000001 & (~fReadoutList.fList[25]);
765 readoutlist.fReadoutList.fList[26] = 0x00000001 & (~fReadoutList.fList[26]);
766 readoutlist.fReadoutList.fList[27] = 0xFFFFFFFF & (~fReadoutList.fList[27]);
767 readoutlist.fReadoutList.fList[28] = 0x00003FFF & (~fReadoutList.fList[28]);
768 readoutlist.fReadoutList.fList[29] = 0x00000001 & (~fReadoutList.fList[29]);
769 readoutlist.fReadoutList.fList[30] = 0x000003FF & (~fReadoutList.fList[30]);