From 15ede44e2d1b2705b8eec189a7a7ea8314e64cd2 Mon Sep 17 00:00:00 2001 From: richterm Date: Sat, 1 Aug 2009 09:45:28 +0000 Subject: [PATCH] - adding the DAQ readout list block to the output of the trigger component - adding some comments and documentation in the ReadoutList handler - copy only the overlapping part of the list from an AliHLTEventDDL block --- HLT/BASE/AliHLTReadoutList.cxx | 23 ++++++++++++++++------- HLT/BASE/AliHLTReadoutList.h | 14 +++++++++++++- HLT/trigger/AliHLTTrigger.cxx | 9 ++++++--- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/HLT/BASE/AliHLTReadoutList.cxx b/HLT/BASE/AliHLTReadoutList.cxx index bd054c8fbc8..33ec0215b92 100644 --- a/HLT/BASE/AliHLTReadoutList.cxx +++ b/HLT/BASE/AliHLTReadoutList.cxx @@ -1,4 +1,4 @@ -// $Id:$ +// $Id$ /************************************************************************** * This file is property of and copyright by the ALICE HLT Project * * ALICE Experiment at CERN, All rights reserved. * @@ -119,8 +119,10 @@ AliHLTReadoutList::AliHLTReadoutList(const AliHLTEventDDL& list) : { // Constructor to create readout list from AliHLTEventDDL structure. // See header file for more details. - - memcpy(&fReadoutList, &list, sizeof(fReadoutList)); + memset(&fReadoutList, 0, sizeof(fReadoutList)); + // handle lists of different sizes, copy only the overlapping part of the list + fReadoutList.fCount=sizeof(fReadoutList.fList)/sizeof(AliHLTUInt32_t); + memcpy(&fReadoutList.fList, &list.fList, (fReadoutList.fCount> 5); } else if (detNum == 4) { + // the TRD bitfield starts at position 11 (3 ITS + 8 TPC) wordIndex = detNum + 7; } else if (detNum == 5) { + // TOF has 72 DDLs, the bitfield is 3 words starting at position 12 wordIndex = detNum + 7 + (ddlNum >> 5); } else if (detNum == 30) { + // the HLT bitfield is in the last word wordIndex = 29; } else { + // all other detectors fit into one word, the offset is due to + // TPC and TOF wordIndex = detNum + 9; } @@ -406,7 +415,7 @@ AliHLTReadoutList& AliHLTReadoutList::operator |= (const AliHLTReadoutList& list // This operator performs a bitwise inclusive or operation on all DDL bits. // See header file for more details. - assert( fReadoutList.fCount == gkAliHLTDDLListSize ); + assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) { fReadoutList.fList[i] |= list.fReadoutList.fList[i]; @@ -420,7 +429,7 @@ AliHLTReadoutList& AliHLTReadoutList::operator ^= (const AliHLTReadoutList& list // This operator performs a bitwise exclusive or (xor) operation on all DDL bits. // See header file for more details. - assert( fReadoutList.fCount == gkAliHLTDDLListSize ); + assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) { fReadoutList.fList[i] ^= list.fReadoutList.fList[i]; @@ -434,7 +443,7 @@ AliHLTReadoutList& AliHLTReadoutList::operator &= (const AliHLTReadoutList& list // This operator performs a bitwise and operation on all DDL bits. // See header file for more details. - assert( fReadoutList.fCount == gkAliHLTDDLListSize ); + assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) { fReadoutList.fList[i] &= list.fReadoutList.fList[i]; @@ -448,7 +457,7 @@ AliHLTReadoutList& AliHLTReadoutList::operator -= (const AliHLTReadoutList& list // This operator removes all the DDLs specified in list from this readout list. // See header file for more details. - assert( fReadoutList.fCount == gkAliHLTDDLListSize ); + assert( fReadoutList.fCount == (unsigned)gkAliHLTDDLListSize ); for (Int_t i = 0; i < gkAliHLTDDLListSize; i++) { // Effectively apply: this = this & (~ (this & list)) diff --git a/HLT/BASE/AliHLTReadoutList.h b/HLT/BASE/AliHLTReadoutList.h index aa125df1e8c..231ac1bdf7a 100644 --- a/HLT/BASE/AliHLTReadoutList.h +++ b/HLT/BASE/AliHLTReadoutList.h @@ -1,5 +1,5 @@ //-*- Mode: C++ -*- -// $Id:$ +// $Id$ #ifndef ALIHLTREADOUTLIST_H #define ALIHLTREADOUTLIST_H /* This file is property of and copyright by the ALICE HLT Project * @@ -213,6 +213,18 @@ class AliHLTReadoutList : public TObject * \return Reference to the AliHLTEventDDL raw structure. */ operator AliHLTEventDDL& () { return fReadoutList; } + + /** + * Access method to the binary buffer. + * \return pointer to the binary buffer. + */ + AliHLTEventDDL* Buffer() { return &fReadoutList; } + + /** + * Access to the size of the binary buffer. + * \return size of the binary buffer + */ + unsigned BufferSize() { return sizeof(fReadoutList); } /** * Assignment operator performs a deep copy. diff --git a/HLT/trigger/AliHLTTrigger.cxx b/HLT/trigger/AliHLTTrigger.cxx index bd6ac1521a4..1572b8fba06 100644 --- a/HLT/trigger/AliHLTTrigger.cxx +++ b/HLT/trigger/AliHLTTrigger.cxx @@ -24,6 +24,7 @@ #include "AliHLTTrigger.h" #include "AliHLTTriggerDecision.h" +#include "AliHLTReadoutList.h" ClassImp(AliHLTTrigger) @@ -105,9 +106,7 @@ int AliHLTTrigger::TriggerEvent(bool value) AliHLTTriggerDecision triggerResult(value, GetTriggerName(), fTriggerDomain, fDescription); // Append the readout list if it contains anything. triggerResult.TriggerDomain().Add(fReadoutList); - fTriggerEventResult = PushBack(&triggerResult, kAliHLTDataTypeTObject|kAliHLTDataOriginOut); - if (fTriggerEventResult == 0) fDecisionMade = true; - return fTriggerEventResult; + return TriggerEvent(&triggerResult, kAliHLTDataTypeTObject|kAliHLTDataOriginOut); } @@ -121,6 +120,10 @@ int AliHLTTrigger::TriggerEvent( if (fTriggerEventResult != 0) return fTriggerEventResult; // Do not do anything if a previous call failed. fTriggerEventResult = PushBack(result, type, spec); + if (fTriggerEventResult) { + fTriggerEventResult = PushBack(result->ReadoutList().Buffer(), result->ReadoutList().BufferSize(), kAliHLTDataTypeDAQRDOUT|kAliHLTDataOriginOut); + } + if (fTriggerEventResult == 0) fDecisionMade = true; return fTriggerEventResult; } -- 2.43.0