]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTCTPData.h
Updated macro for K* in pA analysis
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTCTPData.h
index 4cfc95a0fa225117688714838597d76befd219b9..42d8e16b969b7a0c3b42ec2efe09060519936c51 100644 (file)
@@ -18,6 +18,8 @@
 #include "TArrayL64.h"
 #include "AliHLTLogging.h"
 #include "AliHLTDataTypes.h"
+#include "AliHLTReadoutList.h"
+
 
 /**
  * @class AliHLTCTPData
@@ -69,10 +71,25 @@ class AliHLTCTPData: public TNamed, public AliHLTLogging
    */
   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
@@ -84,6 +101,17 @@ class AliHLTCTPData: public TNamed, public AliHLTLogging
    */
   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
@@ -113,7 +141,21 @@ class AliHLTCTPData: public TNamed, public AliHLTLogging
    * 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.
@@ -121,6 +163,9 @@ class AliHLTCTPData: public TNamed, public AliHLTLogging
   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;
@@ -137,11 +182,24 @@ class AliHLTCTPData: public TNamed, public AliHLTLogging
    */
   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