TString str(enabledList);
str.ToUpper();
Int_t enabledDetectors = 0;
- if (str.Contains("ITSSPD")) enabledDetectors |= kITSSPD;
- if (str.Contains("ITSSDD")) enabledDetectors |= kITSSDD;
- if (str.Contains("ITSSSD")) enabledDetectors |= kITSSSD;
- if (str.Contains("TPC")) enabledDetectors |= kTPC;
- if (str.Contains("TRD")) enabledDetectors |= kTRD;
- if (str.Contains("TOF")) enabledDetectors |= kTOF;
- if (str.Contains("HMPID")) enabledDetectors |= kHMPID;
- if (str.Contains("PHOS")) enabledDetectors |= kPHOS;
- if (str.Contains("CPV")) enabledDetectors |= kCPV;
- if (str.Contains("PMD")) enabledDetectors |= kPMD;
- if (str.Contains("MUONTRK")) enabledDetectors |= kMUONTRK;
- if (str.Contains("MUONTRG")) enabledDetectors |= kMUONTRG;
- if (str.Contains("FMD")) enabledDetectors |= kFMD;
- if (str.Contains("T0")) enabledDetectors |= kT0;
- if (str.Contains("V0")) enabledDetectors |= kV0;
- if (str.Contains("ZDC")) enabledDetectors |= kZDC;
- if (str.Contains("ACORDE")) enabledDetectors |= kACORDE;
- if (str.Contains("TRG")) enabledDetectors |= kTRG;
- if (str.Contains("EMCAL")) enabledDetectors |= kEMCAL;
- if (str.Contains("DAQTEST")) enabledDetectors |= kDAQTEST;
- if (str.Contains("HLT")) enabledDetectors |= kHLT;
- if (str.Contains("ALL")) enabledDetectors |= kALLDET;
- Enable(enabledDetectors);
-
TObjArray* list = str.Tokenize(" ");
TIter next(list);
const TObjString* objstr = NULL;
{
str = objstr->GetString();
if (str.IsDigit()) EnableDDLBit(str.Atoi());
+ if (str == "ITSSPD") enabledDetectors |= kITSSPD;
+ if (str == "ITSSDD") enabledDetectors |= kITSSDD;
+ if (str == "ITSSSD") enabledDetectors |= kITSSSD;
+ if (str == "TPC") enabledDetectors |= kTPC;
+ if (str == "TRD") enabledDetectors |= kTRD;
+ if (str == "TOF") enabledDetectors |= kTOF;
+ if (str == "HMPID") enabledDetectors |= kHMPID;
+ if (str == "PHOS") enabledDetectors |= kPHOS;
+ if (str == "CPV") enabledDetectors |= kCPV;
+ if (str == "PMD") enabledDetectors |= kPMD;
+ if (str == "MUONTRK") enabledDetectors |= kMUONTRK;
+ if (str == "MUONTRG") enabledDetectors |= kMUONTRG;
+ if (str == "FMD") enabledDetectors |= kFMD;
+ if (str == "T0") enabledDetectors |= kT0;
+ if (str == "V0") enabledDetectors |= kV0;
+ if (str == "ZDC") enabledDetectors |= kZDC;
+ if (str == "ACORDE") enabledDetectors |= kACORDE;
+ if (str == "TRG") enabledDetectors |= kTRG;
+ if (str == "EMCAL") enabledDetectors |= kEMCAL;
+ if (str == "DAQTEST") enabledDetectors |= kDAQTEST;
+ if (str == "HLT") enabledDetectors |= kHLT;
+ if (str == "ALL") enabledDetectors |= kALLDET;
}
delete list;
+ Enable(enabledDetectors);
}
{
// Constructor to create readout list from AliHLTEventDDL structure.
// See header file for more details.
+ FillStruct(list);
+}
+
+
+AliHLTReadoutList::AliHLTReadoutList(const AliHLTReadoutList& list) :
+ TNamed(list),
+ fReadoutList()
+{
+ // Copy constructor performs a deep copy.
+
+ if (list.fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize)
+ {
+ memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList));
+ }
+ else
+ {
+ FillStruct(list);
+ }
+}
+
+
+void AliHLTReadoutList::FillStruct(const AliHLTEventDDL& list)
+{
+ // Fills internal DDL bits structure.
+
fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015
memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
// Handle lists of different sizes. If the size is for a known version
// of AliHLTEventDDL then handle appropriately, otherwise just copy only
// the overlapping part of the list.
- if (list.fCount == gkAliHLTDDLListSizeV0)
+ if (list.fCount == (unsigned)gkAliHLTDDLListSizeV0)
{
memcpy(&fReadoutList.fList[0], &list.fList[0], sizeof(AliHLTUInt32_t)*28);
memcpy(&fReadoutList.fList[29], &list.fList[28], sizeof(AliHLTUInt32_t)*2);
}
- else if (list.fCount == gkAliHLTDDLListSizeV1)
+ else if (list.fCount == (unsigned)gkAliHLTDDLListSizeV1)
{
- memcpy(&fReadoutList.fList, &list.fList, sizeof(AliHLTEventDDL));
+ memcpy(&fReadoutList, &list, sizeof(AliHLTEventDDL));
}
else
{
}
-AliHLTReadoutList::AliHLTReadoutList(const AliHLTReadoutList& list) :
- TNamed(list),
- fReadoutList()
-{
- // Copy constructor performs a deep copy.
-
- memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList));
-}
-
-
AliHLTReadoutList::~AliHLTReadoutList()
{
// Default destructor.
{
// Resets all the DDL readout bits.
memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
+
+#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
+ // Check if we need to convert to new format and do so.
+ if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
+ {
+ fReadoutList.fCount = gkAliHLTDDLListSize;
+ }
+#endif
}
Int_t wordIndex, bitIndex;
if (! DecodeDDLID(ddlId, wordIndex, bitIndex)) return kFALSE;
+
+#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
+ // Check if we need to convert to new format and do so.
+ if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
+ {
+ if (wordIndex == 27)
+ {
+ if (bitIndex >= 24) return kFALSE;
+ }
+ else if (wordIndex == 28)
+ {
+ return kFALSE;
+ }
+ else if (wordIndex > 28)
+ {
+ --wordIndex;
+ }
+ }
+#endif
+
return ((fReadoutList.fList[wordIndex] >> bitIndex) & 0x1) == 0x1;
}
{
// Sets the bit value for a particular DDL in the readout list.
// See header file for more details.
+
+#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
+ // Check if we need to convert to new format and do so.
+ if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
+ {
+ AliHLTEventDDL copy = fReadoutList;
+ FillStruct(copy);
+ }
+#endif
+ assert(fReadoutList.fCount == gkAliHLTDDLListSize);
Int_t wordIndex, bitIndex;
if (! DecodeDDLID(ddlId, wordIndex, bitIndex)) return;
{
// Enables all DDLs for a particular detector or detectors.
// See header file for more details.
+
+#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
+ // Check if we need to convert to new format and do so.
+ if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
+ {
+ AliHLTEventDDL copy = fReadoutList;
+ FillStruct(copy);
+ }
+#endif
+ assert(fReadoutList.fCount == gkAliHLTDDLListSize);
if ((detector & kITSSPD) != 0) fReadoutList.fList[0] = 0x000FFFFF;
if ((detector & kITSSDD) != 0) fReadoutList.fList[1] = 0x00FFFFFF;
fReadoutList.fList[28] = 0x00003FFF;
}
if ((detector & kDAQTEST) != 0) fReadoutList.fList[29] = 0x00000001;
- if ((detector & kHLT) != 0) fReadoutList.fList[30] = 0x000003FF;
+ if ((detector & kHLT) != 0) fReadoutList.fList[30] = 0x0FFFFFFF;
}
{
// Disables all DDLs for a particular detector or detectors.
// See header file for more details.
+
+#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
+ // Check if we need to convert to new format and do so.
+ if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
+ {
+ AliHLTEventDDL copy = fReadoutList;
+ FillStruct(copy);
+ }
+#endif
+ assert(fReadoutList.fCount == gkAliHLTDDLListSize);
if ((detector & kITSSPD) != 0) fReadoutList.fList[0] = 0x00000000;
if ((detector & kITSSDD) != 0) fReadoutList.fList[1] = 0x00000000;
if ((detector & kZDC) != 0) result &= fReadoutList.fList[24] == 0x00000001;
if ((detector & kACORDE) != 0) result &= fReadoutList.fList[25] == 0x00000001;
if ((detector & kTRG) != 0) result &= fReadoutList.fList[26] == 0x00000001;
- if ((detector & kEMCAL) != 0)
+#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
+ if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
{
- result &= fReadoutList.fList[27] == 0xFFFFFFFF;
- result &= fReadoutList.fList[28] == 0x00003FFF;
+ if ((detector & kEMCAL) != 0) result &= fReadoutList.fList[27] == 0x00FFFFFF;
+ if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[28] == 0x00000001;
+ if ((detector & kHLT) != 0) result &= fReadoutList.fList[29] == 0x000003FF;
+ }
+ else
+#endif
+ {
+ if ((detector & kEMCAL) != 0)
+ {
+ result &= fReadoutList.fList[27] == 0xFFFFFFFF;
+ result &= fReadoutList.fList[28] == 0x00003FFF;
+ }
+ if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000001;
+ if ((detector & kHLT) != 0) result &= fReadoutList.fList[30] == 0x0FFFFFFF;
}
- if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000001;
- if ((detector & kHLT) != 0) result &= fReadoutList.fList[30] == 0x000003FF;
return result;
}
if ((detector & kZDC) != 0) result &= fReadoutList.fList[24] == 0x00000000;
if ((detector & kACORDE) != 0) result &= fReadoutList.fList[25] == 0x00000000;
if ((detector & kTRG) != 0) result &= fReadoutList.fList[26] == 0x00000000;
- if ((detector & kEMCAL) != 0)
+#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
+ if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
{
- result &= fReadoutList.fList[27] == 0x00000000;
- result &= fReadoutList.fList[28] == 0x00000000;
+ if ((detector & kEMCAL) != 0) result &= fReadoutList.fList[27] == 0x00000000;
+ if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[28] == 0x00000000;
+ if ((detector & kHLT) != 0) result &= fReadoutList.fList[29] == 0x00000000;
+ }
+ else
+#endif
+ {
+ if ((detector & kEMCAL) != 0)
+ {
+ result &= fReadoutList.fList[27] == 0x00000000;
+ result &= fReadoutList.fList[28] == 0x00000000;
+ }
+ if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000000;
+ if ((detector & kHLT) != 0) result &= fReadoutList.fList[30] == 0x00000000;
}
- if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000000;
- if ((detector & kHLT) != 0) result &= fReadoutList.fList[30] == 0x00000000;
return result;
}
AliHLTReadoutList::EDetectorId AliHLTReadoutList::GetFirstUsedDetector(EDetectorId startAfter) const
{
// See header file for more details.
+
if (startAfter < kITSSPD and fReadoutList.fList[0] != 0x00000000) return kITSSPD;
if (startAfter < kITSSDD and fReadoutList.fList[1] != 0x00000000) return kITSSDD;
if (startAfter < kITSSSD and fReadoutList.fList[2] != 0x00000000) return kITSSSD;
if (startAfter < kACORDE and fReadoutList.fList[25] != 0x00000000) return kACORDE;
if (startAfter < kTRG and fReadoutList.fList[26] != 0x00000000) return kTRG;
if (startAfter < kEMCAL and fReadoutList.fList[27] != 0x00000000) return kEMCAL;
- if (startAfter < kEMCAL and fReadoutList.fList[28] != 0x00000000) return kEMCAL;
- if (startAfter < kDAQTEST and fReadoutList.fList[29] != 0x00000000) return kDAQTEST;
- if (startAfter < kHLT and fReadoutList.fList[30] != 0x00000000) return kHLT;
+#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
+ // Check if we need to convert to new format and do so.
+ if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
+ {
+ if (startAfter < kDAQTEST and fReadoutList.fList[28] != 0x00000000) return kDAQTEST;
+ if (startAfter < kHLT and fReadoutList.fList[29] != 0x00000000) return kHLT;
+ }
+ else
+#endif
+ {
+ if (startAfter < kEMCAL and fReadoutList.fList[28] != 0x00000000) return kEMCAL;
+ if (startAfter < kDAQTEST and fReadoutList.fList[29] != 0x00000000) return kDAQTEST;
+ if (startAfter < kHLT and fReadoutList.fList[30] != 0x00000000) return kHLT;
+ }
return kNoDetector;
}
TObject::operator = (list);
if (&list != this)
{
- memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList));
+ if (list.fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize)
+ {
+ memcpy(&fReadoutList, &list.fReadoutList, sizeof(fReadoutList));
+ }
+ else
+ {
+ FillStruct(list);
+ }
}
return *this;
}
// See header file for more details.
assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
+ assert( fReadoutList.fCount == list.fReadoutList.fCount );
for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
{
fReadoutList.fList[i] |= list.fReadoutList.fList[i];
// See header file for more details.
assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
+ assert( fReadoutList.fCount == list.fReadoutList.fCount );
for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
{
fReadoutList.fList[i] ^= list.fReadoutList.fList[i];
// See header file for more details.
assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
+ assert( fReadoutList.fCount == list.fReadoutList.fCount );
for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
{
fReadoutList.fList[i] &= list.fReadoutList.fList[i];
// See header file for more details.
assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize );
+ assert( fReadoutList.fCount == list.fReadoutList.fCount );
for (Int_t i = 0; i < gkAliHLTDDLListSize; i++)
{
// Effectively apply: this = this & (~ (this & list))
// See header file for more details.
AliHLTReadoutList readoutlist;
- readoutlist.fReadoutList.fCount = fReadoutList.fCount;
+ readoutlist.fReadoutList.fCount = gkAliHLTDDLListSize;
readoutlist.fReadoutList.fList[0] = 0x000FFFFF & (~fReadoutList.fList[0]);
readoutlist.fReadoutList.fList[1] = 0x00FFFFFF & (~fReadoutList.fList[1]);
readoutlist.fReadoutList.fList[2] = 0x0000FFFF & (~fReadoutList.fList[2]);
readoutlist.fReadoutList.fList[7] = 0xFFFFFFFF & (~fReadoutList.fList[7]);
readoutlist.fReadoutList.fList[8] = 0xFFFFFFFF & (~fReadoutList.fList[8]);
readoutlist.fReadoutList.fList[9] = 0x00FFFFFF & (~fReadoutList.fList[9]);
- readoutlist.fReadoutList.fList[10] = 0x00000000 & (~fReadoutList.fList[10]);
+ readoutlist.fReadoutList.fList[10] = 0x00000000;// & (~fReadoutList.fList[10]); // Commented out the end part to suppress coverty warning.
readoutlist.fReadoutList.fList[11] = 0x0003FFFF & (~fReadoutList.fList[11]);
readoutlist.fReadoutList.fList[12] = 0xFFFFFFFF & (~fReadoutList.fList[12]);
readoutlist.fReadoutList.fList[13] = 0xFFFFFFFF & (~fReadoutList.fList[13]);
readoutlist.fReadoutList.fList[24] = 0x00000001 & (~fReadoutList.fList[24]);
readoutlist.fReadoutList.fList[25] = 0x00000001 & (~fReadoutList.fList[25]);
readoutlist.fReadoutList.fList[26] = 0x00000001 & (~fReadoutList.fList[26]);
- readoutlist.fReadoutList.fList[27] = 0xFFFFFFFF & (~fReadoutList.fList[27]);
- readoutlist.fReadoutList.fList[28] = 0x00003FFF & (~fReadoutList.fList[28]);
- readoutlist.fReadoutList.fList[29] = 0x00000001 & (~fReadoutList.fList[29]);
- readoutlist.fReadoutList.fList[30] = 0x000003FF & (~fReadoutList.fList[30]);
+#if 1 // ROOT_SVN_REVISION < 9999 //FIXME: after fixed https://savannah.cern.ch/bugs/?69241
+ // Check if we need to convert to new format and do so.
+ if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
+ {
+ readoutlist.fReadoutList.fList[27] = 0x00FFFFFF & (~fReadoutList.fList[27]);
+ readoutlist.fReadoutList.fList[28] = 0x00000000;
+ readoutlist.fReadoutList.fList[29] = 0x00000001 & (~fReadoutList.fList[28]);
+ readoutlist.fReadoutList.fList[30] = 0x000003FF & (~fReadoutList.fList[29]);
+ }
+ else
+#endif
+ {
+ readoutlist.fReadoutList.fList[27] = 0xFFFFFFFF & (~fReadoutList.fList[27]);
+ readoutlist.fReadoutList.fList[28] = 0x00003FFF & (~fReadoutList.fList[28]);
+ readoutlist.fReadoutList.fList[29] = 0x00000001 & (~fReadoutList.fList[29]);
+ readoutlist.fReadoutList.fList[30] = 0x0FFFFFFF & (~fReadoutList.fList[30]);
+ }
return readoutlist;
}
+#if ROOT_VERSION_CODE < ROOT_VERSION(5,26,0)
+void AliHLTReadoutList::Streamer(TBuffer &R__b)
+{
+ // Stream an object of class AliHLTReadoutList.
+
+ if (R__b.IsReading()) {
+ R__b.ReadClassBuffer(AliHLTReadoutList::Class(),this);
+ // Convert old structure to new version if necessary.
+ if (fReadoutList.fCount == (unsigned)gkAliHLTDDLListSizeV0)
+ {
+ fReadoutList.fList[30] = fReadoutList.fList[29];
+ fReadoutList.fList[29] = fReadoutList.fList[28];
+ fReadoutList.fList[28] = 0x0;
+ fReadoutList.fCount = gkAliHLTDDLListSizeV1;
+ }
+ } else {
+ R__b.WriteClassBuffer(AliHLTReadoutList::Class(),this);
+ }
+}
+#endif // ROOT version check.