]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/AliHLTReadoutList.cxx
CMake: removing qpythia from the depedencies
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTReadoutList.cxx
CommitLineData
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"
1504b66c 34#include "AliDAQ.h"
dce3e5ce 35#include "Riostream.h"
36#include "TString.h"
37#include "TObjString.h"
38#include "TObjArray.h"
39#include <cassert>
40
41ClassImp(AliHLTReadoutList)
42
43
89413559 44const char* AliHLTReadoutList::DetectorIdToString(EDetectorId id)
45{
46 // Converts a detector ID to a user readable string.
47 switch (id)
48 {
49 case kNoDetector: return "kNoDetector";
50 case kITSSPD: return "kITSSPD";
51 case kITSSDD: return "kITSSDD";
52 case kITSSSD: return "kITSSSD";
53 case kTPC: return "kTPC";
54 case kTRD: return "kTRD";
55 case kTOF: return "kTOF";
56 case kHMPID: return "kHMPID";
57 case kPHOS: return "kPHOS";
58 case kCPV: return "kCPV";
59 case kPMD: return "kPMD";
60 case kMUONTRK: return "kMUONTRK";
61 case kMUONTRG: return "kMUONTRG";
62 case kFMD: return "kFMD";
63 case kT0: return "kT0";
64 case kV0: return "kV0";
65 case kZDC: return "kZDC";
66 case kACORDE: return "kACORDE";
67 case kTRG: return "kTRG";
68 case kEMCAL: return "kEMCAL";
69 case kDAQTEST: return "kDAQTEST";
5fc83467 70 case kAD: return "kAD";
89413559 71 case kHLT: return "kHLT";
72 case kALLDET: return "kALLDET";
73 default: return "UNKNOWN!";
74 }
75}
76
77
dce3e5ce 78AliHLTReadoutList::AliHLTReadoutList() :
1462df14 79 TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."),
dce3e5ce 80 fReadoutList()
81{
82 // Default constructor.
83
84 fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015
85 memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
86}
87
88
89AliHLTReadoutList::AliHLTReadoutList(Int_t enabledDetectors) :
1462df14 90 TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."),
dce3e5ce 91 fReadoutList()
92{
93 // Constructor to select which detectors to enable for readout.
94 // See header file for more details.
95
96 fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015
97 memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
98 Enable(enabledDetectors);
99}
100
101
102AliHLTReadoutList::AliHLTReadoutList(const char* enabledList) :
1462df14 103 TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."),
dce3e5ce 104 fReadoutList()
105{
106 // Constructor to select which detectors and DDLs to enable for readout.
107 // See header file for more details.
108
109 fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015
110 memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
111
112 TString str(enabledList);
113 str.ToUpper();
114 Int_t enabledDetectors = 0;
dce3e5ce 115 TObjArray* list = str.Tokenize(" ");
116 TIter next(list);
117 const TObjString* objstr = NULL;
118 while ((objstr = dynamic_cast<const TObjString*>(next())) != NULL)
119 {
120 str = objstr->GetString();
121 if (str.IsDigit()) EnableDDLBit(str.Atoi());
a777c59e 122 if (str == "ITSSPD") enabledDetectors |= kITSSPD;
123 if (str == "ITSSDD") enabledDetectors |= kITSSDD;
124 if (str == "ITSSSD") enabledDetectors |= kITSSSD;
125 if (str == "TPC") enabledDetectors |= kTPC;
126 if (str == "TRD") enabledDetectors |= kTRD;
127 if (str == "TOF") enabledDetectors |= kTOF;
128 if (str == "HMPID") enabledDetectors |= kHMPID;
129 if (str == "PHOS") enabledDetectors |= kPHOS;
130 if (str == "CPV") enabledDetectors |= kCPV;
131 if (str == "PMD") enabledDetectors |= kPMD;
132 if (str == "MUONTRK") enabledDetectors |= kMUONTRK;
133 if (str == "MUONTRG") enabledDetectors |= kMUONTRG;
134 if (str == "FMD") enabledDetectors |= kFMD;
135 if (str == "T0") enabledDetectors |= kT0;
136 if (str == "V0") enabledDetectors |= kV0;
137 if (str == "ZDC") enabledDetectors |= kZDC;
138 if (str == "ACORDE") enabledDetectors |= kACORDE;
139 if (str == "TRG") enabledDetectors |= kTRG;
140 if (str == "EMCAL") enabledDetectors |= kEMCAL;
141 if (str == "DAQTEST") enabledDetectors |= kDAQTEST;
5fc83467 142 if (str == "AD") enabledDetectors |= kAD;
a777c59e 143 if (str == "HLT") enabledDetectors |= kHLT;
144 if (str == "ALL") enabledDetectors |= kALLDET;
dce3e5ce 145 }
146 delete list;
a777c59e 147 Enable(enabledDetectors);
dce3e5ce 148}
149
150
151AliHLTReadoutList::AliHLTReadoutList(const AliHLTEventDDL& list) :
1462df14 152 TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."),
dce3e5ce 153 fReadoutList()
154{
155 // Constructor to create readout list from AliHLTEventDDL structure.
156 // See header file for more details.
489fb1d7 157 FillStruct(list);
158}
159
160
161AliHLTReadoutList::AliHLTReadoutList(const AliHLTReadoutList& list) :
162 TNamed(list),
163 fReadoutList()
164{
165 // Copy constructor performs a deep copy.
166
167 if (list.fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize)
168 {
169 memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList));
170 }
171 else
172 {
173 FillStruct(list);
174 }
175}
176
177
178void AliHLTReadoutList::FillStruct(const AliHLTEventDDL& list)
179{
180 // Fills internal DDL bits structure.
181
89413559 182 fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015
183 memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
184 // Handle lists of different sizes. If the size is for a known version
185 // of AliHLTEventDDL then handle appropriately, otherwise just copy only
186 // the overlapping part of the list.
489fb1d7 187 if (list.fCount == (unsigned)gkAliHLTDDLListSizeV0)
89413559 188 {
5fc83467 189 memcpy(&fReadoutList.fList[0], &list.fList[0], sizeof(AliHLTUInt32_t)*28); //up to EMCAL
190 //fReadoutList.fList[28] = 0x0; //by construction
191 fReadoutList.fList[29] = list.fList[28]; //DAQTEST
192 fReadoutList.fList[30] = 0x0; //AD
193 fReadoutList.fList[31] = list.fList[29]; //HLT
89413559 194 }
489fb1d7 195 else if (list.fCount == (unsigned)gkAliHLTDDLListSizeV1)
5fc83467 196 {
197 memcpy(&fReadoutList.fList[0], &list.fList[0], sizeof(AliHLTUInt32_t)*30); //up to DAQTEST
198 fReadoutList.fList[31] = list.fList[30]; //HLT
199 fReadoutList.fList[30] = 0x0; //AD
200 }
201 else if (list.fCount == (unsigned)gkAliHLTDDLListSizeV2)
89413559 202 {
61cfa442 203 memcpy(&fReadoutList, &list, sizeof(AliHLTEventDDL));
89413559 204 }
205 else
206 {
207 memcpy(&fReadoutList.fList, &list.fList, (fReadoutList.fCount<list.fCount?fReadoutList.fCount:list.fCount)*sizeof(AliHLTUInt32_t));
208 }
dce3e5ce 209}
210
211
dce3e5ce 212AliHLTReadoutList::~AliHLTReadoutList()
213{
214 // Default destructor.
215}
216
217
8b745301 218bool AliHLTReadoutList::Empty() const
219{
220 // Returns true if the readout list has no DDLs enabled.
221
edddbe3a 222 for (size_t i = 0; i < sizeof(fReadoutList.fList) / sizeof(fReadoutList.fList[0]); i++)
8b745301 223 {
224 if (fReadoutList.fList[i] != 0x0) return false;
225 }
226 return true;
227}
228
229
acc7214e 230void AliHLTReadoutList::Clear(Option_t* /*option*/)
231{
232 // Resets all the DDL readout bits.
233 memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
489fb1d7 234
235#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
236 // Check if we need to convert to new format and do so.
5fc83467 237 if (fReadoutList.fCount != (unsigned)gkAliHLTDDLListSize)
489fb1d7 238 {
239 fReadoutList.fCount = gkAliHLTDDLListSize;
240 }
241#endif
acc7214e 242}
243
244
dce3e5ce 245bool AliHLTReadoutList::DecodeDDLID(Int_t ddlId, Int_t& wordIndex, Int_t& bitIndex)
246{
247 // Decodes the word index and bit index within that word for the readout list structure.
248 // See header file for more details.
249
250 // The detector number is bits 15..8 of ddlId and DDL number is bits 7..0.
251 Int_t detNum = ddlId >> 8;
252 Int_t ddlNum = ddlId & 0xFF;
253
7f8acd80 254 switch (detNum)
dce3e5ce 255 {
7f8acd80 256 case 0: // SPD
257 case 1: // SDD
258 case 2: // SSD
259 if (ddlNum >= 32) return false; // only have 1 32-bit word.
15ede44e 260 // the 3 ITS detectors have one word each
dce3e5ce 261 wordIndex = detNum;
7f8acd80 262 break;
263 case 3: // TPC
15ede44e 264 // the TPC bitfield has in total 8 words
dce3e5ce 265 wordIndex = detNum + (ddlNum >> 5);
7f8acd80 266 break;
267 case 4: // TRD
268 if (ddlNum >= 32) return false; // only have 1 32-bit word.
269 // the TRD bitfield starts at word 11 (3 words ITS + 8 words TPC)
270 wordIndex = 11;
271 break;
272 case 5: // TOF
273 if (ddlNum >= 3*32) return false; // only have 3 32-bit words.
15ede44e 274 // TOF has 72 DDLs, the bitfield is 3 words starting at position 12
7f8acd80 275 wordIndex = 12 + (ddlNum >> 5);
276 break;
277 case 6: // HMPID
278 case 7: // PHOS
279 case 8: // CPV
280 case 9: // PMD
281 case 10: // MUONTRK (MCH)
282 case 11: // MUONTRG (MTR)
283 case 12: // FMD
284 case 13: // T0
285 case 14: // V0
286 case 15: // ZDC
287 case 16: // ACORDE
288 case 17: // TRG
7f8acd80 289 if (ddlNum >= 32) return false; // only have 1 32-bit word.
a9a3028c 290 // all these detectors fit into one word, the offset is due to
15ede44e 291 // TPC and TOF
dce3e5ce 292 wordIndex = detNum + 9;
7f8acd80 293 break;
a9a3028c 294 case 18: // EMCAL
295 if (ddlNum >= 2*32) return false; // only have 2 32-bit words.
296 // 2 words for EMCAL + DCAL
297 wordIndex = detNum + 7;
298 wordIndex = 27 + (ddlNum >> 5);
299 break;
300 case 19: // DAQTEST
301 if (ddlNum >= 32) return false; // only have 1 32-bit word.
302 wordIndex = 29;
303 break;
1504b66c 304 case 21: // AD
7f8acd80 305 if (ddlNum >= 32) return false; // only have 1 32-bit word.
5fc83467 306 // 1 word for AD, 1 DDL
a9a3028c 307 wordIndex = 30;
7f8acd80 308 break;
1504b66c 309 case 30: // HLT
5fc83467 310 if (ddlNum >= 32) return false; // only have 1 32-bit word.
311 // the HLT bitfield is in the last word
312 wordIndex = 31;
313 break;
7f8acd80 314 default:
315 return false;
dce3e5ce 316 }
317
1504b66c 318 if (ddlNum >= AliHLTDAQ::NumberOfDdls(detNum == AliDAQ::kHLTId ? AliDAQ::kNDetectors-1 : detNum)) return false;
a9a3028c 319
dce3e5ce 320 // The bit index within the word indicated by wordIndex.
7f8acd80 321 bitIndex = ddlNum % 32;
dce3e5ce 322 return true;
323}
324
325
326Bool_t AliHLTReadoutList::GetDDLBit(Int_t ddlId) const
327{
328 // Fetches the bit value for a particular DDL in the readout list.
329 // See header file for more details.
330
331 Int_t wordIndex, bitIndex;
332 if (! DecodeDDLID(ddlId, wordIndex, bitIndex)) return kFALSE;
489fb1d7 333
334#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
335 // Check if we need to convert to new format and do so.
336 if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
337 {
338 if (wordIndex == 27)
339 {
340 if (bitIndex >= 24) return kFALSE;
341 }
342 else if (wordIndex == 28)
343 {
344 return kFALSE;
345 }
346 else if (wordIndex > 28)
347 {
348 --wordIndex;
349 }
350 }
5fc83467 351 else if ( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV1 )
352 {
353 if (wordIndex == 30) { return kFALSE; } //there is no AD in V1
354 if (wordIndex == 31) { wordIndex = 30; } //HLT is at word 30 in V1
355 }
489fb1d7 356#endif
357
dce3e5ce 358 return ((fReadoutList.fList[wordIndex] >> bitIndex) & 0x1) == 0x1;
359}
360
361
362void AliHLTReadoutList::SetDDLBit(Int_t ddlId, Bool_t state)
363{
364 // Sets the bit value for a particular DDL in the readout list.
365 // See header file for more details.
489fb1d7 366
367#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
368 // Check if we need to convert to new format and do so.
369 if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
370 {
371 AliHLTEventDDL copy = fReadoutList;
372 FillStruct(copy);
373 }
374#endif
375 assert(fReadoutList.fCount == gkAliHLTDDLListSize);
dce3e5ce 376
377 Int_t wordIndex, bitIndex;
378 if (! DecodeDDLID(ddlId, wordIndex, bitIndex)) return;
379
380 // To set, 'OR' word with bit mask
381 if ( state )
382 fReadoutList.fList[wordIndex] |= (0x00000001 << bitIndex);
383 // To unset, 'AND' word with bit mask
384 else
385 fReadoutList.fList[wordIndex] &= (0xFFFFFFFF ^ (0x00000001 << bitIndex));
386}
387
388
389void AliHLTReadoutList::Enable(Int_t detector)
390{
391 // Enables all DDLs for a particular detector or detectors.
392 // See header file for more details.
489fb1d7 393
394#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
395 // Check if we need to convert to new format and do so.
5fc83467 396 if (fReadoutList.fCount != (unsigned)gkAliHLTDDLListSize)
489fb1d7 397 {
398 AliHLTEventDDL copy = fReadoutList;
399 FillStruct(copy);
400 }
401#endif
402 assert(fReadoutList.fCount == gkAliHLTDDLListSize);
dce3e5ce 403
404 if ((detector & kITSSPD) != 0) fReadoutList.fList[0] = 0x000FFFFF;
405 if ((detector & kITSSDD) != 0) fReadoutList.fList[1] = 0x00FFFFFF;
406 if ((detector & kITSSSD) != 0) fReadoutList.fList[2] = 0x0000FFFF;
407 if ((detector & kTPC) != 0)
408 {
409 fReadoutList.fList[3] = 0xFFFFFFFF;
410 fReadoutList.fList[4] = 0xFFFFFFFF;
411 fReadoutList.fList[5] = 0xFFFFFFFF;
412 fReadoutList.fList[6] = 0xFFFFFFFF;
413 fReadoutList.fList[7] = 0xFFFFFFFF;
414 fReadoutList.fList[8] = 0xFFFFFFFF;
415 fReadoutList.fList[9] = 0x00FFFFFF;
416 fReadoutList.fList[10] = 0x00000000;
417 }
418 if ((detector & kTRD) != 0) fReadoutList.fList[11] = 0x0003FFFF;
419 if ((detector & kTOF) != 0)
420 {
421 fReadoutList.fList[12] = 0xFFFFFFFF;
422 fReadoutList.fList[13] = 0xFFFFFFFF;
423 fReadoutList.fList[14] = 0x000000FF;
424 }
14da6b98 425 if ((detector & kHMPID) != 0) fReadoutList.fList[15] = 0x000FFFFF;
dce3e5ce 426 if ((detector & kPHOS) != 0) fReadoutList.fList[16] = 0x000FFFFF;
427 if ((detector & kCPV) != 0) fReadoutList.fList[17] = 0x000003FF;
428 if ((detector & kPMD) != 0) fReadoutList.fList[18] = 0x0000003F;
429 if ((detector & kMUONTRK) != 0) fReadoutList.fList[19] = 0x000FFFFF;
430 if ((detector & kMUONTRG) != 0) fReadoutList.fList[20] = 0x00000003;
431 if ((detector & kFMD) != 0) fReadoutList.fList[21] = 0x00000007;
432 if ((detector & kT0) != 0) fReadoutList.fList[22] = 0x00000001;
433 if ((detector & kV0) != 0) fReadoutList.fList[23] = 0x00000001;
434 if ((detector & kZDC) != 0) fReadoutList.fList[24] = 0x00000001;
435 if ((detector & kACORDE) != 0) fReadoutList.fList[25] = 0x00000001;
436 if ((detector & kTRG) != 0) fReadoutList.fList[26] = 0x00000001;
a9a3028c 437 if ((detector & kEMCAL) != 0)
438 {
439 fReadoutList.fList[27] = 0xFFFFFFFF;
440 fReadoutList.fList[28] = 0x00003FFF;
441 }
442 if ((detector & kDAQTEST) != 0) fReadoutList.fList[29] = 0x00000001;
5fc83467 443 if ((detector & kAD) != 0) fReadoutList.fList[30] = 0x00000001;
444 if ((detector & kHLT) != 0) fReadoutList.fList[31] = 0x0FFFFFFF;
dce3e5ce 445}
446
447
448void AliHLTReadoutList::Disable(Int_t detector)
449{
450 // Disables all DDLs for a particular detector or detectors.
451 // See header file for more details.
489fb1d7 452
453#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
454 // Check if we need to convert to new format and do so.
5fc83467 455 if (fReadoutList.fCount != (unsigned)gkAliHLTDDLListSize)
489fb1d7 456 {
457 AliHLTEventDDL copy = fReadoutList;
458 FillStruct(copy);
459 }
460#endif
461 assert(fReadoutList.fCount == gkAliHLTDDLListSize);
dce3e5ce 462
463 if ((detector & kITSSPD) != 0) fReadoutList.fList[0] = 0x00000000;
464 if ((detector & kITSSDD) != 0) fReadoutList.fList[1] = 0x00000000;
465 if ((detector & kITSSSD) != 0) fReadoutList.fList[2] = 0x00000000;
466 if ((detector & kTPC) != 0)
467 {
468 fReadoutList.fList[3] = 0x00000000;
469 fReadoutList.fList[4] = 0x00000000;
470 fReadoutList.fList[5] = 0x00000000;
471 fReadoutList.fList[6] = 0x00000000;
472 fReadoutList.fList[7] = 0x00000000;
473 fReadoutList.fList[8] = 0x00000000;
474 fReadoutList.fList[9] = 0x00000000;
475 fReadoutList.fList[10] = 0x00000000;
476 }
477 if ((detector & kTRD) != 0) fReadoutList.fList[11] = 0x00000000;
478 if ((detector & kTOF) != 0)
479 {
480 fReadoutList.fList[12] = 0x00000000;
481 fReadoutList.fList[13] = 0x00000000;
482 fReadoutList.fList[14] = 0x00000000;
483 }
484 if ((detector & kHMPID) != 0) fReadoutList.fList[15] = 0x00000000;
485 if ((detector & kPHOS) != 0) fReadoutList.fList[16] = 0x00000000;
486 if ((detector & kCPV) != 0) fReadoutList.fList[17] = 0x00000000;
487 if ((detector & kPMD) != 0) fReadoutList.fList[18] = 0x00000000;
488 if ((detector & kMUONTRK) != 0) fReadoutList.fList[19] = 0x00000000;
489 if ((detector & kMUONTRG) != 0) fReadoutList.fList[20] = 0x00000000;
490 if ((detector & kFMD) != 0) fReadoutList.fList[21] = 0x00000000;
491 if ((detector & kT0) != 0) fReadoutList.fList[22] = 0x00000000;
492 if ((detector & kV0) != 0) fReadoutList.fList[23] = 0x00000000;
493 if ((detector & kZDC) != 0) fReadoutList.fList[24] = 0x00000000;
494 if ((detector & kACORDE) != 0) fReadoutList.fList[25] = 0x00000000;
495 if ((detector & kTRG) != 0) fReadoutList.fList[26] = 0x00000000;
a9a3028c 496 if ((detector & kEMCAL) != 0)
497 {
498 fReadoutList.fList[27] = 0x00000000;
499 fReadoutList.fList[28] = 0x00000000;
500 }
501 if ((detector & kDAQTEST) != 0) fReadoutList.fList[29] = 0x00000000;
5fc83467 502 if ((detector & kAD) != 0) fReadoutList.fList[30] = 0x00000000;
503 if ((detector & kHLT) != 0) fReadoutList.fList[31] = 0x00000000;
dce3e5ce 504}
505
506
52f67e50 507bool AliHLTReadoutList::DetectorEnabled(Int_t detector) const
508{
509 // Checks if a particular detector's DDLs are enabled.
510 // See header file for more details.
511
512 bool result = true;
513 if ((detector & kITSSPD) != 0) result &= fReadoutList.fList[0] == 0x000FFFFF;
514 if ((detector & kITSSDD) != 0) result &= fReadoutList.fList[1] == 0x00FFFFFF;
515 if ((detector & kITSSSD) != 0) result &= fReadoutList.fList[2] == 0x0000FFFF;
516 if ((detector & kTPC) != 0)
517 {
518 result &= fReadoutList.fList[3] == 0xFFFFFFFF;
519 result &= fReadoutList.fList[4] == 0xFFFFFFFF;
520 result &= fReadoutList.fList[5] == 0xFFFFFFFF;
521 result &= fReadoutList.fList[6] == 0xFFFFFFFF;
522 result &= fReadoutList.fList[7] == 0xFFFFFFFF;
523 result &= fReadoutList.fList[8] == 0xFFFFFFFF;
524 result &= fReadoutList.fList[9] == 0x00FFFFFF;
525 }
526 if ((detector & kTRD) != 0) result &= fReadoutList.fList[11] == 0x0003FFFF;
527 if ((detector & kTOF) != 0)
528 {
529 result &= fReadoutList.fList[12] == 0xFFFFFFFF;
530 result &= fReadoutList.fList[13] == 0xFFFFFFFF;
531 result &= fReadoutList.fList[14] == 0x000000FF;
532 }
14da6b98 533 if ((detector & kHMPID) != 0) result &= fReadoutList.fList[15] == 0x000FFFFF;
52f67e50 534 if ((detector & kPHOS) != 0) result &= fReadoutList.fList[16] == 0x000FFFFF;
535 if ((detector & kCPV) != 0) result &= fReadoutList.fList[17] == 0x000003FF;
536 if ((detector & kPMD) != 0) result &= fReadoutList.fList[18] == 0x0000003F;
537 if ((detector & kMUONTRK) != 0) result &= fReadoutList.fList[19] == 0x000FFFFF;
538 if ((detector & kMUONTRG) != 0) result &= fReadoutList.fList[20] == 0x00000003;
539 if ((detector & kFMD) != 0) result &= fReadoutList.fList[21] == 0x00000007;
540 if ((detector & kT0) != 0) result &= fReadoutList.fList[22] == 0x00000001;
541 if ((detector & kV0) != 0) result &= fReadoutList.fList[23] == 0x00000001;
542 if ((detector & kZDC) != 0) result &= fReadoutList.fList[24] == 0x00000001;
543 if ((detector & kACORDE) != 0) result &= fReadoutList.fList[25] == 0x00000001;
544 if ((detector & kTRG) != 0) result &= fReadoutList.fList[26] == 0x00000001;
489fb1d7 545#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
546 if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
a9a3028c 547 {
489fb1d7 548 if ((detector & kEMCAL) != 0) result &= fReadoutList.fList[27] == 0x00FFFFFF;
549 if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[28] == 0x00000001;
550 if ((detector & kHLT) != 0) result &= fReadoutList.fList[29] == 0x000003FF;
551 }
5fc83467 552 else if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV1)
553 {
554 if ((detector & kEMCAL) != 0)
555 {
556 result &= fReadoutList.fList[27] == 0xFFFFFFFF;
557 result &= fReadoutList.fList[28] == 0x00003FFF;
558 }
559 if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000001;
560 if ((detector & kHLT) != 0) result &= fReadoutList.fList[30] == 0x0FFFFFFF;
561 }
562 else if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV2)
489fb1d7 563#endif
564 {
565 if ((detector & kEMCAL) != 0)
566 {
567 result &= fReadoutList.fList[27] == 0xFFFFFFFF;
568 result &= fReadoutList.fList[28] == 0x00003FFF;
569 }
570 if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000001;
5fc83467 571 if ((detector & kAD) != 0) result &= fReadoutList.fList[30] == 0x00000001;
572 if ((detector & kHLT) != 0) result &= fReadoutList.fList[31] == 0x0FFFFFFF;
a9a3028c 573 }
52f67e50 574
575 return result;
576}
577
578
89413559 579bool AliHLTReadoutList::DetectorDisabled(Int_t detector) const
580{
581 // Checks if a particular detector's DDLs are disabled.
582 // See header file for more details.
583
584 bool result = true;
585 if ((detector & kITSSPD) != 0) result &= fReadoutList.fList[0] == 0x00000000;
586 if ((detector & kITSSDD) != 0) result &= fReadoutList.fList[1] == 0x00000000;
587 if ((detector & kITSSSD) != 0) result &= fReadoutList.fList[2] == 0x00000000;
588 if ((detector & kTPC) != 0)
589 {
590 result &= fReadoutList.fList[3] == 0x00000000;
591 result &= fReadoutList.fList[4] == 0x00000000;
592 result &= fReadoutList.fList[5] == 0x00000000;
593 result &= fReadoutList.fList[6] == 0x00000000;
594 result &= fReadoutList.fList[7] == 0x00000000;
595 result &= fReadoutList.fList[8] == 0x00000000;
596 result &= fReadoutList.fList[9] == 0x00000000;
597 }
598 if ((detector & kTRD) != 0) result &= fReadoutList.fList[11] == 0x00000000;
599 if ((detector & kTOF) != 0)
600 {
601 result &= fReadoutList.fList[12] == 0x00000000;
602 result &= fReadoutList.fList[13] == 0x00000000;
603 result &= fReadoutList.fList[14] == 0x00000000;
604 }
605 if ((detector & kHMPID) != 0) result &= fReadoutList.fList[15] == 0x00000000;
606 if ((detector & kPHOS) != 0) result &= fReadoutList.fList[16] == 0x00000000;
607 if ((detector & kCPV) != 0) result &= fReadoutList.fList[17] == 0x00000000;
608 if ((detector & kPMD) != 0) result &= fReadoutList.fList[18] == 0x00000000;
609 if ((detector & kMUONTRK) != 0) result &= fReadoutList.fList[19] == 0x00000000;
610 if ((detector & kMUONTRG) != 0) result &= fReadoutList.fList[20] == 0x00000000;
611 if ((detector & kFMD) != 0) result &= fReadoutList.fList[21] == 0x00000000;
612 if ((detector & kT0) != 0) result &= fReadoutList.fList[22] == 0x00000000;
613 if ((detector & kV0) != 0) result &= fReadoutList.fList[23] == 0x00000000;
614 if ((detector & kZDC) != 0) result &= fReadoutList.fList[24] == 0x00000000;
615 if ((detector & kACORDE) != 0) result &= fReadoutList.fList[25] == 0x00000000;
616 if ((detector & kTRG) != 0) result &= fReadoutList.fList[26] == 0x00000000;
489fb1d7 617#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
618 if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
89413559 619 {
489fb1d7 620 if ((detector & kEMCAL) != 0) result &= fReadoutList.fList[27] == 0x00000000;
621 if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[28] == 0x00000000;
622 if ((detector & kHLT) != 0) result &= fReadoutList.fList[29] == 0x00000000;
623 }
5fc83467 624 else if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV1)
489fb1d7 625 {
626 if ((detector & kEMCAL) != 0)
627 {
628 result &= fReadoutList.fList[27] == 0x00000000;
629 result &= fReadoutList.fList[28] == 0x00000000;
630 }
631 if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000000;
632 if ((detector & kHLT) != 0) result &= fReadoutList.fList[30] == 0x00000000;
89413559 633 }
5fc83467 634 else if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV2)
635#endif
636 {
637 if ((detector & kEMCAL) != 0)
638 {
639 result &= fReadoutList.fList[27] == 0x00000000;
640 result &= fReadoutList.fList[28] == 0x00000000;
641 }
642 if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000000;
643 if ((detector & kAD) != 0) result &= fReadoutList.fList[30] == 0x00000000;
644 if ((detector & kHLT) != 0) result &= fReadoutList.fList[31] == 0x00000000;
645 }
89413559 646
647 return result;
648}
649
650
651Int_t AliHLTReadoutList::GetFirstWord(EDetectorId detector)
652{
653 // See header file for more details.
654 switch (detector)
655 {
656 case kITSSPD: return 0;
657 case kITSSDD: return 1;
658 case kITSSSD: return 2;
659 case kTPC: return 3;
660 case kTRD: return 11;
661 case kTOF: return 12;
662 case kHMPID: return 15;
663 case kPHOS: return 16;
664 case kCPV: return 17;
665 case kPMD: return 18;
666 case kMUONTRK: return 19;
667 case kMUONTRG: return 20;
668 case kFMD: return 21;
669 case kT0: return 22;
670 case kV0: return 23;
671 case kZDC: return 24;
672 case kACORDE: return 25;
673 case kTRG: return 26;
5fc83467 674 case kEMCAL: return 27;
675 case kDAQTEST: return 29; //V0:28
676 case kAD: return 30;
677 case kHLT: return 31; //V0:29 V1:30
89413559 678 default: return -1;
679 }
680}
681
682
683Int_t AliHLTReadoutList::GetWordCount(EDetectorId detector)
684{
685 // See header file for more details.
686 switch (detector)
687 {
688 case kITSSPD: return 1;
689 case kITSSDD: return 1;
690 case kITSSSD: return 1;
691 case kTPC: return 8;
692 case kTRD: return 1;
693 case kTOF: return 3;
694 case kHMPID: return 1;
695 case kPHOS: return 1;
696 case kCPV: return 1;
697 case kPMD: return 1;
698 case kMUONTRK: return 1;
699 case kMUONTRG: return 1;
700 case kFMD: return 1;
701 case kT0: return 1;
702 case kV0: return 1;
703 case kZDC: return 1;
704 case kACORDE: return 1;
705 case kTRG: return 1;
706 case kEMCAL: return 2;
707 case kDAQTEST: return 1;
5fc83467 708 case kAD: return 1;
89413559 709 case kHLT: return 1;
710 default: return 0;
711 }
712}
713
714
7c69da51 715AliHLTReadoutList::EDetectorId AliHLTReadoutList::GetDetectorFromWord(Int_t wordindex)
716{
717 // See header file for more details.
718 switch (wordindex)
719 {
720 case 0: return kITSSPD;
721 case 1: return kITSSDD;
722 case 2: return kITSSSD;
723 case 3: return kTPC;
724 case 4: return kTPC;
725 case 5: return kTPC;
726 case 6: return kTPC;
727 case 7: return kTPC;
728 case 8: return kTPC;
729 case 9: return kTPC;
730 case 10: return kTPC;
731 case 11: return kTRD;
732 case 12: return kTOF;
733 case 13: return kTOF;
734 case 14: return kTOF;
735 case 15: return kHMPID;
736 case 16: return kPHOS;
737 case 17: return kCPV;
738 case 18: return kPMD;
739 case 19: return kMUONTRK;
740 case 20: return kMUONTRG;
741 case 21: return kFMD;
742 case 22: return kT0;
743 case 23: return kV0;
744 case 24: return kZDC;
745 case 25: return kACORDE;
746 case 26: return kTRG;
747 case 27: return kEMCAL;
748 case 28: return kEMCAL;
749 case 29: return kDAQTEST;
5fc83467 750 case 30: return kAD;
751 case 31: return kHLT;
7c69da51 752 default: return kNoDetector;
753 }
754}
755
756
89413559 757AliHLTReadoutList::EDetectorId AliHLTReadoutList::GetFirstUsedDetector(EDetectorId startAfter) const
758{
759 // See header file for more details.
489fb1d7 760
89413559 761 if (startAfter < kITSSPD and fReadoutList.fList[0] != 0x00000000) return kITSSPD;
762 if (startAfter < kITSSDD and fReadoutList.fList[1] != 0x00000000) return kITSSDD;
763 if (startAfter < kITSSSD and fReadoutList.fList[2] != 0x00000000) return kITSSSD;
764 if (startAfter < kTPC and fReadoutList.fList[3] != 0x00000000) return kTPC;
765 if (startAfter < kTPC and fReadoutList.fList[4] != 0x00000000) return kTPC;
766 if (startAfter < kTPC and fReadoutList.fList[5] != 0x00000000) return kTPC;
767 if (startAfter < kTPC and fReadoutList.fList[6] != 0x00000000) return kTPC;
768 if (startAfter < kTPC and fReadoutList.fList[7] != 0x00000000) return kTPC;
769 if (startAfter < kTPC and fReadoutList.fList[8] != 0x00000000) return kTPC;
770 if (startAfter < kTPC and fReadoutList.fList[9] != 0x00000000) return kTPC;
771 if (startAfter < kTPC and fReadoutList.fList[10] != 0x00000000) return kTPC;
772 if (startAfter < kTRD and fReadoutList.fList[11] != 0x00000000) return kTRD;
773 if (startAfter < kTOF and fReadoutList.fList[12] != 0x00000000) return kTOF;
774 if (startAfter < kTOF and fReadoutList.fList[13] != 0x00000000) return kTOF;
775 if (startAfter < kTOF and fReadoutList.fList[14] != 0x00000000) return kTOF;
776 if (startAfter < kHMPID and fReadoutList.fList[15] != 0x00000000) return kHMPID;
777 if (startAfter < kPHOS and fReadoutList.fList[16] != 0x00000000) return kPHOS;
778 if (startAfter < kCPV and fReadoutList.fList[17] != 0x00000000) return kCPV;
779 if (startAfter < kPMD and fReadoutList.fList[18] != 0x00000000) return kPMD;
780 if (startAfter < kMUONTRK and fReadoutList.fList[19] != 0x00000000) return kMUONTRK;
781 if (startAfter < kMUONTRG and fReadoutList.fList[20] != 0x00000000) return kMUONTRG;
782 if (startAfter < kFMD and fReadoutList.fList[21] != 0x00000000) return kFMD;
783 if (startAfter < kT0 and fReadoutList.fList[22] != 0x00000000) return kT0;
784 if (startAfter < kV0 and fReadoutList.fList[23] != 0x00000000) return kV0;
785 if (startAfter < kZDC and fReadoutList.fList[24] != 0x00000000) return kZDC;
786 if (startAfter < kACORDE and fReadoutList.fList[25] != 0x00000000) return kACORDE;
787 if (startAfter < kTRG and fReadoutList.fList[26] != 0x00000000) return kTRG;
788 if (startAfter < kEMCAL and fReadoutList.fList[27] != 0x00000000) return kEMCAL;
489fb1d7 789#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
790 // Check if we need to convert to new format and do so.
791 if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
792 {
793 if (startAfter < kDAQTEST and fReadoutList.fList[28] != 0x00000000) return kDAQTEST;
794 if (startAfter < kHLT and fReadoutList.fList[29] != 0x00000000) return kHLT;
795 }
5fc83467 796 else if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV1)
489fb1d7 797 {
798 if (startAfter < kEMCAL and fReadoutList.fList[28] != 0x00000000) return kEMCAL;
799 if (startAfter < kDAQTEST and fReadoutList.fList[29] != 0x00000000) return kDAQTEST;
800 if (startAfter < kHLT and fReadoutList.fList[30] != 0x00000000) return kHLT;
801 }
5fc83467 802 else if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV2)
803#endif
804 {
805 if (startAfter < kEMCAL and fReadoutList.fList[28] != 0x00000000) return kEMCAL;
806 if (startAfter < kDAQTEST and fReadoutList.fList[29] != 0x00000000) return kDAQTEST;
807 if (startAfter < kAD and fReadoutList.fList[30] != 0x00000000) return kAD;
808 if (startAfter < kHLT and fReadoutList.fList[31] != 0x00000000) return kHLT;
809 }
89413559 810 return kNoDetector;
811}
812
813
dce3e5ce 814void AliHLTReadoutList::Print(Option_t* /*option*/) const
815{
816 // Prints the DDLs that will be readout according to this readout list.
817
818 cout << "Readout enabled for DDLs:" << endl;
52647727 819 for (Int_t i = 0; i < AliHLTDAQ::NumberOfDetectors(); i++)
dce3e5ce 820 {
52647727 821 Int_t maxddls = AliHLTDAQ::NumberOfDdls(i);
822 cout << AliHLTDAQ::DetectorName(i) << ":";
dce3e5ce 823 bool nonefound = true;
824 for (Int_t j = 0; j < maxddls; j++)
825 {
52647727 826 Int_t ddlId = ( ((i == AliHLTDAQ::NumberOfDetectors()-1) ? 30 : i) << 8 ) + j;
dce3e5ce 827 if (GetDDLBit(ddlId))
828 {
829 cout << " " << ddlId;
830 nonefound = false;
831 }
832 }
833 if (nonefound) cout << " none";
834 cout << endl;
835 }
5fc83467 836 printf("readout list in hex:");
837 for (unsigned int i=0; i<fReadoutList.fCount; i++)
838 {
839 printf(" %x", fReadoutList.fList[i]);
840 }
841 printf("\n");
dce3e5ce 842}
843
844
845AliHLTReadoutList& AliHLTReadoutList::operator = (const AliHLTReadoutList& list)
846{
847 // Assignment operator performs a deep copy.
848
849 TObject::operator = (list);
850 if (&list != this)
851 {
489fb1d7 852 if (list.fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize)
853 {
854 memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList));
855 }
856 else
857 {
858 FillStruct(list);
859 }
dce3e5ce 860 }
861 return *this;
862}
863
864
865AliHLTReadoutList& AliHLTReadoutList::operator |= (const AliHLTReadoutList& list)
866{
867 // This operator performs a bitwise inclusive or operation on all DDL bits.
868 // See header file for more details.
e5339167 869 this->OrEq(list);
870 return *this;
871}
872
873AliHLTReadoutList& AliHLTReadoutList::OrEq(const AliHLTReadoutList& list)
874{
875 // a bitwise inclusive or operation on all DDL bits.
876 // See header file for more details.
dce3e5ce 877
15ede44e 878 assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
7cd66daa 879 assert( fReadoutList.fCount == list.fReadoutList.fCount );
dce3e5ce 880 for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
881 {
882 fReadoutList.fList[i] |= list.fReadoutList.fList[i];
883 }
884 return *this;
885}
886
887
888AliHLTReadoutList& AliHLTReadoutList::operator ^= (const AliHLTReadoutList& list)
889{
890 // This operator performs a bitwise exclusive or (xor) operation on all DDL bits.
891 // See header file for more details.
e5339167 892
893 this->XorEq(list);
894 return *this;
895}
896
897AliHLTReadoutList& AliHLTReadoutList::XorEq(const AliHLTReadoutList& list)
898{
899 // bitwise exclusive or (xor) operation on all DDL bits.
900 // See header file for more details.
dce3e5ce 901
15ede44e 902 assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
7cd66daa 903 assert( fReadoutList.fCount == list.fReadoutList.fCount );
dce3e5ce 904 for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
905 {
906 fReadoutList.fList[i] ^= list.fReadoutList.fList[i];
907 }
908 return *this;
909}
910
911
912AliHLTReadoutList& AliHLTReadoutList::operator &= (const AliHLTReadoutList& list)
913{
914 // This operator performs a bitwise and operation on all DDL bits.
915 // See header file for more details.
e5339167 916
917 this->AndEq(list);
918 return *this;
919}
920
921AliHLTReadoutList& AliHLTReadoutList::AndEq(const AliHLTReadoutList& list)
922{
923 // bitwise and operation on all DDL bits.
924 // See header file for more details.
925
15ede44e 926 assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
7cd66daa 927 assert( fReadoutList.fCount == list.fReadoutList.fCount );
dce3e5ce 928 for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
929 {
930 fReadoutList.fList[i] &= list.fReadoutList.fList[i];
931 }
932 return *this;
933}
934
dce3e5ce 935AliHLTReadoutList& AliHLTReadoutList::operator -= (const AliHLTReadoutList& list)
936{
937 // This operator removes all the DDLs specified in list from this readout list.
938 // See header file for more details.
939
15ede44e 940 assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
7cd66daa 941 assert( fReadoutList.fCount == list.fReadoutList.fCount );
dce3e5ce 942 for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
943 {
944 // Effectively apply: this = this & (~ (this & list))
945 // i.e. this = this & (this ^ list)
946 fReadoutList.fList[i] &= fReadoutList.fList[i] ^ list.fReadoutList.fList[i];
947 }
948 return *this;
949}
950
951
952AliHLTReadoutList AliHLTReadoutList::operator ~ () const
953{
954 // This operator performs a bitwise ones compliment on all DDL bits.
955 // See header file for more details.
956
957 AliHLTReadoutList readoutlist;
489fb1d7 958 readoutlist.fReadoutList.fCount = gkAliHLTDDLListSize;
dce3e5ce 959 readoutlist.fReadoutList.fList[0] = 0x000FFFFF & (~fReadoutList.fList[0]);
960 readoutlist.fReadoutList.fList[1] = 0x00FFFFFF & (~fReadoutList.fList[1]);
961 readoutlist.fReadoutList.fList[2] = 0x0000FFFF & (~fReadoutList.fList[2]);
962 readoutlist.fReadoutList.fList[3] = 0xFFFFFFFF & (~fReadoutList.fList[3]);
963 readoutlist.fReadoutList.fList[4] = 0xFFFFFFFF & (~fReadoutList.fList[4]);
964 readoutlist.fReadoutList.fList[5] = 0xFFFFFFFF & (~fReadoutList.fList[5]);
965 readoutlist.fReadoutList.fList[6] = 0xFFFFFFFF & (~fReadoutList.fList[6]);
966 readoutlist.fReadoutList.fList[7] = 0xFFFFFFFF & (~fReadoutList.fList[7]);
967 readoutlist.fReadoutList.fList[8] = 0xFFFFFFFF & (~fReadoutList.fList[8]);
968 readoutlist.fReadoutList.fList[9] = 0x00FFFFFF & (~fReadoutList.fList[9]);
dfc9f48d 969 readoutlist.fReadoutList.fList[10] = 0x00000000;// & (~fReadoutList.fList[10]); // Commented out the end part to suppress coverty warning.
dce3e5ce 970 readoutlist.fReadoutList.fList[11] = 0x0003FFFF & (~fReadoutList.fList[11]);
971 readoutlist.fReadoutList.fList[12] = 0xFFFFFFFF & (~fReadoutList.fList[12]);
972 readoutlist.fReadoutList.fList[13] = 0xFFFFFFFF & (~fReadoutList.fList[13]);
973 readoutlist.fReadoutList.fList[14] = 0x000000FF & (~fReadoutList.fList[14]);
14da6b98 974 readoutlist.fReadoutList.fList[15] = 0x000FFFFF & (~fReadoutList.fList[15]);
dce3e5ce 975 readoutlist.fReadoutList.fList[16] = 0x000FFFFF & (~fReadoutList.fList[16]);
976 readoutlist.fReadoutList.fList[17] = 0x000003FF & (~fReadoutList.fList[17]);
977 readoutlist.fReadoutList.fList[18] = 0x0000003F & (~fReadoutList.fList[18]);
978 readoutlist.fReadoutList.fList[19] = 0x000FFFFF & (~fReadoutList.fList[19]);
979 readoutlist.fReadoutList.fList[20] = 0x00000003 & (~fReadoutList.fList[20]);
980 readoutlist.fReadoutList.fList[21] = 0x00000007 & (~fReadoutList.fList[21]);
981 readoutlist.fReadoutList.fList[22] = 0x00000001 & (~fReadoutList.fList[22]);
982 readoutlist.fReadoutList.fList[23] = 0x00000001 & (~fReadoutList.fList[23]);
983 readoutlist.fReadoutList.fList[24] = 0x00000001 & (~fReadoutList.fList[24]);
984 readoutlist.fReadoutList.fList[25] = 0x00000001 & (~fReadoutList.fList[25]);
985 readoutlist.fReadoutList.fList[26] = 0x00000001 & (~fReadoutList.fList[26]);
489fb1d7 986#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
987 // Check if we need to convert to new format and do so.
988 if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
989 {
990 readoutlist.fReadoutList.fList[27] = 0x00FFFFFF & (~fReadoutList.fList[27]);
991 readoutlist.fReadoutList.fList[28] = 0x00000000;
992 readoutlist.fReadoutList.fList[29] = 0x00000001 & (~fReadoutList.fList[28]);
5fc83467 993 readoutlist.fReadoutList.fList[30] = 0x00000000;
994 readoutlist.fReadoutList.fList[31] = 0x000003FF & (~fReadoutList.fList[29]);
489fb1d7 995 }
5fc83467 996 else if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV1)
489fb1d7 997#endif
998 {
999 readoutlist.fReadoutList.fList[27] = 0xFFFFFFFF & (~fReadoutList.fList[27]);
1000 readoutlist.fReadoutList.fList[28] = 0x00003FFF & (~fReadoutList.fList[28]);
1001 readoutlist.fReadoutList.fList[29] = 0x00000001 & (~fReadoutList.fList[29]);
5fc83467 1002 readoutlist.fReadoutList.fList[30] = 0x00000000;
08879175 1003 readoutlist.fReadoutList.fList[30] = 0x0FFFFFFF & (~fReadoutList.fList[30]);
489fb1d7 1004 }
5fc83467 1005 else if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV2)
1006 {
1007 readoutlist.fReadoutList.fList[27] = 0xFFFFFFFF & (~fReadoutList.fList[27]);
1008 readoutlist.fReadoutList.fList[28] = 0x00003FFF & (~fReadoutList.fList[28]);
1009 readoutlist.fReadoutList.fList[29] = 0x00000001 & (~fReadoutList.fList[29]);
1010 readoutlist.fReadoutList.fList[30] = 0x00000001 & (~fReadoutList.fList[30]);
1011 readoutlist.fReadoutList.fList[31] = 0x0FFFFFFF & (~fReadoutList.fList[31]);
1012 }
dce3e5ce 1013 return readoutlist;
1014}
1015
489fb1d7 1016#if ROOT_VERSION_CODE < ROOT_VERSION(5,26,0)
1017void AliHLTReadoutList::Streamer(TBuffer &R__b)
1018{
1019 // Stream an object of class AliHLTReadoutList.
1020
1021 if (R__b.IsReading()) {
1022 R__b.ReadClassBuffer(AliHLTReadoutList::Class(),this);
1023 // Convert old structure to new version if necessary.
1024 if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
1025 {
5fc83467 1026 fReadoutList.fList[31] = fReadoutList.fList[29];
489fb1d7 1027 fReadoutList.fList[29] = fReadoutList.fList[28];
5fc83467 1028 fReadoutList.fList[30] = 0x0;
1029 fReadoutList.fCount = gkAliHLTDDLListSizeV2;
1030 }
1031 else if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV1)
1032 {
1033 fReadoutList.fList[31] = fReadoutList.fList[30]; //move HLT from 30 to 31
1034 fReadoutList.fList[30] = 0x0; //set AD to 0
1035 fReadoutList.fCount = gkAliHLTDDLListSizeV2;
489fb1d7 1036 }
1037 } else {
1038 R__b.WriteClassBuffer(AliHLTReadoutList::Class(),this);
1039 }
1040}
1041#endif // ROOT version check.