From edd723471464a5b6be14a781822a21c6236f2972 Mon Sep 17 00:00:00 2001 From: richterm Date: Tue, 29 Sep 2009 13:02:20 +0000 Subject: [PATCH 1/1] adding a member for the active CTP trigger mask to the CTP data object and setting it for each event 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 | 13 ++++++++++++- HLT/BASE/AliHLTCTPData.h | 20 ++++++++++++++++++-- HLT/BASE/AliHLTComponent.cxx | 11 +++++++++-- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/HLT/BASE/AliHLTCTPData.cxx b/HLT/BASE/AliHLTCTPData.cxx index 7ab0322f4fc..4d5b7ea05f4 100644 --- a/HLT/BASE/AliHLTCTPData.cxx +++ b/HLT/BASE/AliHLTCTPData.cxx @@ -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=Counters().GetSize()) break; diff --git a/HLT/BASE/AliHLTCTPData.h b/HLT/BASE/AliHLTCTPData.h index 7c07818faab..3b85adf398c 100644 --- a/HLT/BASE/AliHLTCTPData.h +++ b/HLT/BASE/AliHLTCTPData.h @@ -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 diff --git a/HLT/BASE/AliHLTComponent.cxx b/HLT/BASE/AliHLTComponent.cxx index 671e29f0cf2..e3e37ff72ad 100644 --- a/HLT/BASE/AliHLTComponent.cxx +++ b/HLT/BASE/AliHLTComponent.cxx @@ -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; } -- 2.39.3