*/
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
| kACORDE | kTRG | kEMCAL | kHLT)
};
+ /// Converts a detector ID to a user readable string.
+ static const char* DetectorIdToString(EDetectorId id);
+
/**
* Default constructor.
*/
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
/**
* 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
return result.operator -= (list);
}
- private:
-
/**
* Decodes the word index and bit index within that word for the readout list structure.
- * \param ddlId <i>[in]</i> The ID number of the DDL to decode.
- * \param wordIndex <i>[out]</i> the word index of the word to modify or check
- * within fReadoutList.fList
- * \param bitIndex <i>[out]</i> 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 <i>wordIndex</i>.
* \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
*/
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.