]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding a member for the active CTP trigger mask to the CTP data object and setting...
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Sep 2009 13:02:20 +0000 (13:02 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Sep 2009 13:02:20 +0000 (13:02 +0000)
bugfix: the version number of the class was 0, so it was never streamed and thus not in the printout
of the HLT decision

HLT/BASE/AliHLTCTPData.cxx
HLT/BASE/AliHLTCTPData.h
HLT/BASE/AliHLTComponent.cxx

index 7ab0322f4fc0711115a2528d0a0ec124b31bec93..4d5b7ea05f414fb4ce0ac6a219eaa6ed6476a13e 100644 (file)
@@ -35,6 +35,7 @@ AliHLTCTPData::AliHLTCTPData()
   : TNamed("AliHLTCTPData", "HLT counters for the CTP")
   , AliHLTLogging()
   , fMask(0)
+  , fTriggers(0)
   , fClassIds(AliHLTReadoutList::Class(), gkNCTPTriggerClasses)
   , fCounters(gkNCTPTriggerClasses)
 {
@@ -49,6 +50,7 @@ AliHLTCTPData::AliHLTCTPData(const char* parameter)
   : TNamed("AliHLTCTPData", "HLT counters for the CTP")
   , AliHLTLogging()
   , fMask(0)
+  , fTriggers(0)
   , fClassIds(AliHLTReadoutList::Class(), gkNCTPTriggerClasses)
   , fCounters(gkNCTPTriggerClasses)
 {
@@ -66,6 +68,7 @@ AliHLTCTPData::AliHLTCTPData(const AliHLTCTPData& src)
   : TNamed(src.GetName(), src.GetTitle())
   , AliHLTLogging()
   , fMask(src.Mask())
+  , fTriggers(src.fTriggers)
   , fClassIds(src.fClassIds)
   , fCounters(src.Counters())
 {
@@ -229,7 +232,7 @@ AliHLTUInt64_t AliHLTCTPData::ActiveTriggers(const AliHLTComponentTriggerData& t
   return triggerMask;
 }
 
-bool AliHLTCTPData::EvaluateCTPTriggerClass(const char* expression, AliHLTComponentTriggerData& trigData) const
+bool AliHLTCTPData::EvaluateCTPTriggerClass(const char* expression, const AliHLTComponentTriggerData& trigData) const
 {
   // see header file for function documentation
   if (trigData.fDataSize != sizeof(AliHLTEventTriggerData)) {
@@ -249,6 +252,13 @@ bool AliHLTCTPData::EvaluateCTPTriggerClass(const char* expression, AliHLTCompon
     return false;
   }
 
+  return EvaluateCTPTriggerClass(expression, triggerMask);
+}
+
+bool AliHLTCTPData::EvaluateCTPTriggerClass(const char* expression, AliHLTUInt64_t triggerMask) const
+{
+  // see header file for function documentation
+
   // use a TFormula to interprete the expression
   // all classname are replaced by '[n]' which means the n'th parameter in the formula
   // the parameters are set to 0 or 1 depending on the bit in the trigger mask
@@ -408,6 +418,7 @@ void AliHLTCTPData::Print(Option_t* /*option*/) const
 {
   // see header file for function documentation
   cout << GetTitle() << endl;
+  cout << "\tactive trigger mask: 0x" << hex << fTriggers << dec << endl;
   int count=0;
   for (int i=0; i<gkNCTPTriggerClasses; i++) {
     if (i>=Counters().GetSize()) break;
index 7c07818faab202c4ace190cd76bce438f29ca85f..3b85adf398c5e908db61a819f516a2a3a1419414 100644 (file)
@@ -75,7 +75,19 @@ class AliHLTCTPData: public TNamed, public AliHLTLogging
   /**
    * 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
@@ -124,6 +136,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;
@@ -141,10 +156,11 @@ class AliHLTCTPData: public TNamed, public AliHLTLogging
   int Add(const AliHLTCTPData& src, int factor, int &skipped);
 
   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
 
-  ClassDef(AliHLTCTPData, 0)
+  ClassDef(AliHLTCTPData, 1)
 };
 
 #endif
index 671e29f0cf26b26265dd05d5bf66f5aa42bd36c8..e3e37ff72ad5156de68d77a75fb9033f01ca2dba 100644 (file)
@@ -1739,8 +1739,12 @@ int AliHLTComponent::ProcessEvent( const AliHLTComponentEventData& evtData,
   // for the private blocks
   if (fRequireSteeringBlocks) bSkipDataProcessing=0;
 
-  // increment CTP trigger counters if available
-  if (fpCTPData && IsDataEvent()) fpCTPData->Increment(trigData);
+  if (fpCTPData) {
+    // set the active triggers for this event
+    fpCTPData->SetTriggers(trigData);
+    // increment CTP trigger counters if available
+    if (IsDataEvent()) fpCTPData->Increment(trigData);
+  }
 
   AliHLTComponentBlockDataList blockData;
   if (iResult>=0 && !bSkipDataProcessing)
@@ -1823,6 +1827,9 @@ int AliHLTComponent::ProcessEvent( const AliHLTComponentEventData& evtData,
 
   // reset the internal EventData struct
   FillEventData(fCurrentEventData);
+
+  // reset the active triggers
+  if (fpCTPData) fpCTPData->SetTriggers(0);
   return iResult;
 }