X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2FBASE%2FAliHLTReadoutList.h;h=339c0d03cd7c95901e0183d9b1e3b7c2c36f1628;hb=68ec89f292c215ed469dfde554e59cb68f6e7ed9;hp=f835d6d0c525c15f789c311dbf4f13f6e4efeda2;hpb=a9a3028c6fdd06ee015968fc53154c8ebc3e5d96;p=u%2Fmrichter%2FAliRoot.git
diff --git a/HLT/BASE/AliHLTReadoutList.h b/HLT/BASE/AliHLTReadoutList.h
index f835d6d0c52..339c0d03cd7 100644
--- a/HLT/BASE/AliHLTReadoutList.h
+++ b/HLT/BASE/AliHLTReadoutList.h
@@ -41,6 +41,7 @@ class AliHLTReadoutList : public TNamed
*/
enum EDetectorId
{
+ kNoDetector = 0, /// No detector value
kITSSPD = 0x1 << 0, /// ID for SPD detector
kITSSDD = 0x1 << 1, /// ID for SDD detector
kITSSSD = 0x1 << 2, /// ID for SSD detector
@@ -68,6 +69,9 @@ class AliHLTReadoutList : public TNamed
| kACORDE | kTRG | kEMCAL | kHLT)
};
+ /// Converts a detector ID to a user readable string.
+ static const char* DetectorIdToString(EDetectorId id);
+
/**
* Default constructor.
*/
@@ -186,12 +190,53 @@ class AliHLTReadoutList : public TNamed
void Disable(Int_t detector);
/**
- * Checks if a particular detector's DDLs are enabled for readout.
+ * Checks if a particular detector's DDLs are all enabled for readout.
* \param detector A bitmap of detectors to check. Should be any values from
* EDetectorId that can be or'ed together for multiple detector selection.
* \return true if all DDLs for the specified detectors are enabled for readout.
*/
- bool DetectorEnabled(Int_t ddlId) const;
+ bool DetectorEnabled(Int_t detector) const;
+
+ /**
+ * Checks if a particular detector's DDLs are all disabled for readout.
+ * \param detector A bitmap of detectors to check. Should be any values from
+ * EDetectorId that can be or'ed together for multiple detector selection.
+ * \return true if all DDLs for the specified detectors are disabled for readout.
+ * \note If both DetectorEnabled(x) and DetectorDisabled(x) return false then
+ * it means that only part of the detectors DDLs are enabled.
+ */
+ bool DetectorDisabled(Int_t detector) const;
+
+ /**
+ * Returns the first word of DDL bits for a given detector in the internal structure.
+ * \param detector The detector code for which to return the starting word.
+ * \returns the first word of DDL bits for the detector or -1 if an invalid code is given.
+ */
+ static Int_t GetFirstWord(EDetectorId detector);
+
+ /**
+ * Returns the first word of DDL bits for a given detector in the internal structure.
+ * \param detector The detector code for which to return the starting word.
+ * \returns the first word of DDL bits for the detector or -1 if an invalid code is given.
+ */
+ static Int_t GetWordCount(EDetectorId detector);
+
+ /**
+ * Returns the corresponding detector ID code for the given word index into the
+ * internal data structure.
+ * \param wordindex The position of the word from the start of the DDL readout bit list.
+ * \returns the code of the corresponding detector or kNoDetector if invalid.
+ */
+ static EDetectorId GetDetectorFromWord(Int_t wordindex);
+
+ /**
+ * Returns the first detector with non-zero DDL bits.
+ * \param startAfter The detector code after which to start looking from.
+ * If kTOF is used for example then only detectors after kTOF will be checked,
+ * not including kTOF, in the order of precedence indicated by EDetectorId.
+ * \returns the code of the first used detector.
+ */
+ EDetectorId GetFirstUsedDetector(EDetectorId startAfter = kNoDetector) const;
/**
* Inherited from TObject. Prints the DDLs that will be readout according to
@@ -203,9 +248,9 @@ class AliHLTReadoutList : public TNamed
/**
* This typecast operator converts the readout list to the AliHLTEventDDL
* structure format.
- * \return Copy of the AliHLTEventDDL raw structure.
+ * \return Constant reference to the AliHLTEventDDL raw structure.
*/
- operator AliHLTEventDDL () const { return fReadoutList; }
+ operator const AliHLTEventDDL& () const { return fReadoutList; }
/**
* This typecast operator converts the readout list to the AliHLTEventDDL
@@ -336,14 +381,11 @@ class AliHLTReadoutList : public TNamed
return result.operator -= (list);
}
- private:
-
/**
* Decodes the word index and bit index within that word for the readout list structure.
- * \param ddlId [in] The ID number of the DDL to decode.
- * \param wordIndex [out] the word index of the word to modify or check
- * within fReadoutList.fList
- * \param bitIndex [out] the bit index of the bit to modify or check
+ * \param [in] ddlId The ID number of the DDL to decode.
+ * \param [out] wordIndex the word index of the word to modify or check within fReadoutList.fList
+ * \param [out] bitIndex the bit index of the bit to modify or check
* within the word pointed to by wordIndex.
* \return true if the ddlId was decoded and false if it was invalid.
* \note We do not check extensively if the ddlId is invalid. Just simple checks
@@ -351,6 +393,15 @@ class AliHLTReadoutList : public TNamed
*/
static bool DecodeDDLID(Int_t ddlId, Int_t& wordIndex, Int_t& bitIndex);
+ private:
+
+ /**
+ * This method fills the internal bit field structure taking care of converting
+ * from the old format to the new one.
+ * \param list The raw DDL readout list bits.
+ */
+ void FillStruct(const AliHLTEventDDL& list);
+
AliHLTEventDDL fReadoutList; /// The DDL readout list structure.
ClassDef(AliHLTReadoutList, 3) // Readout list object used for manipulating and storing an AliHLTEventDDL structure.