#include "TArrayL64.h"
#include "AliHLTLogging.h"
#include "AliHLTDataTypes.h"
+#include "AliHLTReadoutList.h"
+
/**
* @class AliHLTCTPData
*/
int InitCTPTriggerClasses(const char* ctpString);
+ /// etract the active trigger mask from the trigger data
+ static AliHLTUInt64_t ActiveTriggers(const AliHLTComponentTriggerData& trigData);
+
/**
* Evaluate an expression of trigger class ids with respect to the trigger mask.
*/
- bool EvaluateCTPTriggerClass(const char* expression, AliHLTComponentTriggerData& trigData) const;
+ bool EvaluateCTPTriggerClass(const char* expression, const AliHLTComponentTriggerData& trigData) const;
+
+ /**
+ * Evaluate an expression of trigger class ids with respect to the trigger mask.
+ */
+ bool EvaluateCTPTriggerClass(const char* expression, AliHLTUInt64_t triggerMask) const;
+
+ /**
+ * Evaluate an expression of trigger class ids with respect to the current trigger mask.
+ */
+ bool EvaluateCTPTriggerClass(const char* expression) const {
+ return EvaluateCTPTriggerClass(expression, fTriggers);
+ }
/**
* Reset all counters
*/
int Index(const char* name) const;
+ /**
+ * Check state of a trigger class.
+ * If the class name is not part of the current trigger setup (i.e. ECS parameter
+ * does not contain a trigger definition for this class name) the function
+ * returns -1
+ * @return -1 class name not initialized,
+ * 0 trigger not active
+ * 1 trigger active
+ */
+ int CheckTrigger(const char* name) const;
+
/**
* Increment counter for CTP trigger classes
* @param classIds comma separated list of class ids
* Return a readout list for the active trigger classes.
* The list is an 'OR' of the active trugger classes.
*/
- AliHLTEventDDL ReadoutList(const AliHLTComponentTriggerData& trigData) const;
+ AliHLTReadoutList ReadoutList(const AliHLTComponentTriggerData& trigData) const;
+
+ /**
+ * Return a readout list for the active trigger classes.
+ * The list is an 'OR' of the active trugger classes.
+ */
+ AliHLTReadoutList ReadoutList(AliHLTUInt64_t triggerMask) const;
+
+ /**
+ * Return a readout list for the active trigger classes.
+ * The list is an 'OR' of the active trugger classes.
+ */
+ AliHLTReadoutList ReadoutList() const {
+ return ReadoutList(fTriggers);
+ }
/**
* Inherited from TObject, this prints the contents of the trigger decision.
virtual void Print(Option_t* option = "") const;
AliHLTUInt64_t Mask() const { return fMask; }
+ AliHLTUInt64_t Triggers() const { return fTriggers; }
+ void SetTriggers(AliHLTUInt64_t triggers) { fTriggers=triggers; }
+ void SetTriggers(AliHLTComponentTriggerData trigData) {SetTriggers(ActiveTriggers(trigData));}
const TArrayL64& Counters() const { return fCounters; }
AliHLTUInt64_t Counter(int index) const;
AliHLTUInt64_t Counter(const char* classId) const;
*/
int Add(const AliHLTCTPData& src, int factor, int &skipped);
+ /**
+ * Read the map of trigger class indexes
+ * The map is used in the generation of the TFormula from the trigger
+ * expression in order to handle similar class names correctly.
+ * For names like 'base', 'baseA', 'baseB' the class with the longer name
+ * has to be replaced first.
+ */
+ int ReadMap(vector<unsigned> &map) const;
+
+ int ReadMap() {return ReadMap(fMap);}
+
AliHLTUInt64_t fMask; /// mask of initialized trigger classes
+ AliHLTUInt64_t fTriggers; /// current trigger
TClonesArray fClassIds; /// array of trigger class ids
TArrayL64 fCounters; /// trigger class counters
+ vector<unsigned> fMap; //! index map for trigger expression evaluation
- ClassDef(AliHLTCTPData, 0)
+ ClassDef(AliHLTCTPData, 2)
};
#endif