Removed some deprecated methods from AliHLTComponent which are better placed inside AliHLTReadoutList.
Cleaned up and centralised manipulation of DDL readout list bits. Now AliHLTReadoutList is the common interface to use.
// @note
#include "AliHLTCTPData.h"
-#include "AliHLTReadoutList.h"
#include "TClass.h"
#include "TObjString.h"
#include "TFormula.h"
+#include "AliHLTComponent.h"
+#include "AliRawDataHeader.h"
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTCTPData)
AliHLTUInt64_t AliHLTCTPData::ActiveTriggers(const AliHLTComponentTriggerData& trigData)
{
// extract active triggers from the trigger data
-
- if (trigData.fDataSize != sizeof(AliHLTEventTriggerData)) return (AliHLTUInt64_t)0;
+ const AliRawDataHeader* cdh = NULL;
+ if (AliHLTComponent::ExtractTriggerData(trigData, NULL, NULL, &cdh, NULL) != 0) return (AliHLTUInt64_t)0;
// trigger mask is 50 bit wide and is stored in word 5 and 6 of the CDH
- AliHLTEventTriggerData* evtData=reinterpret_cast<AliHLTEventTriggerData*>(trigData.fData);
- AliHLTUInt64_t triggerMask=evtData->fCommonHeader[6]&0x3ffff;
- triggerMask<<=32;
- triggerMask|=evtData->fCommonHeader[5];
+ AliHLTUInt64_t triggerMask = cdh->GetTriggerClasses();
return triggerMask;
}
bool AliHLTCTPData::EvaluateCTPTriggerClass(const char* expression, const AliHLTComponentTriggerData& trigData) const
{
// see header file for function documentation
- if (trigData.fDataSize != sizeof(AliHLTEventTriggerData)) {
- HLTError("invalid trigger data size: %d expected %d", trigData.fDataSize, sizeof(AliHLTEventTriggerData));
- return false;
- }
-
+
+ const AliRawDataHeader* cdh = NULL;
+ if (AliHLTComponent::ExtractTriggerData(trigData, NULL, NULL, &cdh, NULL, true) != 0) return false;
// trigger mask is 50 bit wide and is stored in word 5 and 6 of the CDH
- AliHLTEventTriggerData* evtData=reinterpret_cast<AliHLTEventTriggerData*>(trigData.fData);
- AliHLTUInt64_t triggerMask=evtData->fCommonHeader[6]&0x3ffff;
- triggerMask<<=32;
- triggerMask|=evtData->fCommonHeader[5];
+ AliHLTUInt64_t triggerMask = cdh->GetTriggerClasses();
if (fMask!=0 && (triggerMask & fMask)==0) {
+ AliHLTEventTriggerData* evtData=reinterpret_cast<AliHLTEventTriggerData*>(trigData.fData);
HLTWarning("invalid trigger mask 0x%llx, unknown CTP trigger, initialized 0x%llx", triggerMask, fMask);
for (int i=0; i<8; i++) HLTWarning("\t CDH[%d]=0x%lx", i, evtData->fCommonHeader[i]);
return false;
int AliHLTCTPData::Increment(AliHLTComponentTriggerData& trigData)
{
// see header file for function documentation
- if (trigData.fDataSize != sizeof(AliHLTEventTriggerData)) {
- HLTError("invalid trigger data size: %d expected %d", trigData.fDataSize, sizeof(AliHLTEventTriggerData));
- return -EBADF;
- }
-
+ const AliRawDataHeader* cdh = NULL;
+ int result = AliHLTComponent::ExtractTriggerData(trigData, NULL, NULL, &cdh, NULL, true);
+ if (result != 0) return result;
// trigger mask is 50 bit wide and is stored in word 5 and 6 of the CDH
- AliHLTEventTriggerData* evtData=reinterpret_cast<AliHLTEventTriggerData*>(trigData.fData);
- AliHLTUInt64_t triggerMask=evtData->fCommonHeader[6]&0x3ffff;
- triggerMask<<=32;
- triggerMask|=evtData->fCommonHeader[5];
+ AliHLTUInt64_t triggerMask = cdh->GetTriggerClasses();
if (fMask!=0 && (triggerMask & fMask)==0) {
+ AliHLTEventTriggerData* evtData=reinterpret_cast<AliHLTEventTriggerData*>(trigData.fData);
HLTWarning("invalid trigger mask 0x%llx, unknown CTP trigger, initialized 0x%llx", triggerMask, fMask);
for (int i=0; i<8; i++) HLTWarning("\t CDH[%d]=0x%lx", i, evtData->fCommonHeader[i]);
}
}
-AliHLTEventDDL AliHLTCTPData::ReadoutList(const AliHLTComponentTriggerData& trigData) const
+AliHLTReadoutList AliHLTCTPData::ReadoutList(const AliHLTComponentTriggerData& trigData) const
{
// see header file for function documentation
- if (trigData.fDataSize != sizeof(AliHLTEventTriggerData)) {
- HLTError("invalid trigger data size: %d expected %d", trigData.fDataSize, sizeof(AliHLTEventTriggerData));
- AliHLTEventDDL dummy;
- memset(&dummy, 0, sizeof(AliHLTEventDDL));
- return dummy;
- }
+ const AliRawDataHeader* cdh = NULL;
+ if (AliHLTComponent::ExtractTriggerData(trigData, NULL, NULL, &cdh, NULL, true) != 0) return AliHLTReadoutList();
// trigger mask is 50 bit wide and is stored in word 5 and 6 of the CDH
- AliHLTEventTriggerData* evtData=reinterpret_cast<AliHLTEventTriggerData*>(trigData.fData);
- AliHLTUInt64_t triggerMask=evtData->fCommonHeader[6]&0x3ffff;
- triggerMask<<=32;
- triggerMask|=evtData->fCommonHeader[5];
+ AliHLTUInt64_t triggerMask = cdh->GetTriggerClasses();
if (fMask!=0 && (triggerMask & fMask)==0) {
+ AliHLTEventTriggerData* evtData=reinterpret_cast<AliHLTEventTriggerData*>(trigData.fData);
HLTWarning("invalid trigger mask 0x%llx, unknown CTP trigger, initialized 0x%llx", triggerMask, fMask);
for (int i=0; i<8; i++) HLTWarning("\t CDH[%d]=0x%lx", i, evtData->fCommonHeader[i]);
}
return ReadoutList(triggerMask);
}
-AliHLTEventDDL AliHLTCTPData::ReadoutList(AliHLTUInt64_t triggerMask) const
+AliHLTReadoutList AliHLTCTPData::ReadoutList(AliHLTUInt64_t triggerMask) const
{
// take an 'OR' of all active trigger classes
AliHLTReadoutList list;
#include "TArrayL64.h"
#include "AliHLTLogging.h"
#include "AliHLTDataTypes.h"
+#include "AliHLTReadoutList.h"
+
/**
* @class AliHLTCTPData
* 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.
*/
- AliHLTEventDDL ReadoutList(AliHLTUInt64_t triggerMask) const;
+ 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.
*/
- AliHLTEventDDL ReadoutList() const {
+ AliHLTReadoutList ReadoutList() const {
return ReadoutList(fTriggers);
}
#include "AliHLTCalibrationProcessor.h"
#include "AliHLTMemoryFile.h"
+#include "AliHLTReadoutList.h"
#include <cstdlib>
#include <cerrno>
// ** if event Type is not SOR or EOR -> fill DDLNumber list and process data
if ( ! blkEOR && !blkSOR ) {
-
-#if 0
- // ** Set DDLNumber List
- if ( trigData.fData != NULL) {
- AliHLTEventTriggerData* trg = ( AliHLTEventTriggerData* ) trigData.fData;
- if ( trg != NULL) {
- AliHLTEventDDL list = (AliHLTEventDDL) trg->fReadoutList;
-
- Int_t wordNdx = GetFirstUsedDDLWord(list);
- if ( wordNdx >=0 ) {
-
- Int_t wordCount = 1;
- // Handle special TPC and TOF case
- if ( wordNdx == 3 )
- wordCount = 8;
- else if ( wordNdx == 12 )
- wordCount = 3;
-
- // check word for word and binary OR it with existing DDLNumberList
- for ( Int_t ndx = 0; ndx < wordCount; ndx++ ) {
- AliHLTUInt32_t word = list.fList[wordNdx+ndx];
-
- // set only 4 bit into one Char_t
- for ( Int_t charNdx = 0; charNdx < 8; charNdx++) {
- fDDLNumber[(8*ndx)+charNdx] |= (Char_t) word & 0x0000000F;
- word = word >> 4;
- }
- }
- } // if ( wordNdx > 0 ) {
- } // if ( trg != NULL) {
- } // if ( trigData.fData != NULL) {
-#endif
-
// ** ProcessData
iResult = ProcessCalibration( evtData, blocks, trigData, outputPtr, size, outputBlocks );
fEventCounter++;
* ######################## CreateFXSHeader #####################
*/
-Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTFXSHeader &pHeader, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTFXSHeader &pHeader, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
// see header file for class documentation
Int_t iResult = 0;
if ( pDDLList ) {
// use user list
- Int_t wordNdx = GetFirstUsedDDLWord( *(pDDLList) );
- if ( wordNdx >=0 ) {
-
- Int_t wordCount = 1;
- // Handle special TPC and TOF case
- if ( wordNdx == 3 )
- wordCount = 8;
- else if ( wordNdx == 12 )
- wordCount = 3;
-
+ AliHLTReadoutList::EDetectorId detid = pDDLList->GetFirstUsedDetector();
+ Int_t wordNdx = AliHLTReadoutList::GetFirstWord(detid);
+ Int_t wordCount = AliHLTReadoutList::GetWordCount(detid);
+
+ if (pDDLList->GetFirstUsedDetector(detid) != AliHLTReadoutList::kNoDetector or wordNdx < 0)
+ {
+ HLTError("DDLIDs for minimum of TWO detectors ( %s, %s ) set, this function works only for ONE detector.",
+ AliHLTReadoutList::DetectorIdToString(detid),
+ AliHLTReadoutList::DetectorIdToString(pDDLList->GetFirstUsedDetector(detid))
+ );
+ iResult = -1;
+ }
+ else
+ {
// check word for word
for ( Int_t ndx = 0; ndx < wordCount; ndx++ ) {
- AliHLTUInt32_t word = pDDLList->fList[wordNdx+ndx];
+ AliHLTUInt32_t word = pDDLList->Buffer()->fList[wordNdx+ndx];
// set only 4 bit into one Char_t
for ( Int_t charNdx = 0; charNdx < 8; charNdx++) {
word = word >> 4;
}
}
- } // if ( wordNdx > 0 ) {
- else
- iResult = wordNdx;
+ }
} // if ( pDDLList ) {
// -- fill header with ascii chars
}
return iResult;
-} // Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTXSHeader &pHeader, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+} // Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTXSHeader &pHeader, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
/*
* ######################## PushToFXS #####################
*/
-Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
// see header file for class documentation
Int_t iResult = 0;
return iResult;
-} // Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* detector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+} // Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* detector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
-Int_t AliHLTCalibrationProcessor::PushToFXS( void* pBuffer, int iSize, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+Int_t AliHLTCalibrationProcessor::PushToFXS( void* pBuffer, int iSize, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
// see header file for class documentation
Int_t iResult = 0;
return iResult;
-} // Int_t AliHLTCalibrationProcessor::PushToFXS(void* pBuffer, int iSize, const char* pDdetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
+} // Int_t AliHLTCalibrationProcessor::PushToFXS(void* pBuffer, int iSize, const char* pDdetector, const char* pFileID, const AliHLTReadoutList* pDDLList ) {
#include "AliHLTMessage.h"
#include "AliHLTDataTypes.h"
+class AliHLTReadoutList;
+
/**
* @class AliHLTCalibrationProcessor
* Base class of HLT calibration components.
* @param pObject pointer to root object
* @param pDetector 4 byte Detector identifier
* @param pFileID name of the file to which the data shall be stored
- * @param pDDLList pointer to ReadoutList ( struct @ref AliHLTEventDDL) of
+ * @param pDDLList pointer to ReadoutList ( class @ref AliHLTReadoutList) of
* participating DDLs. Have to be set or unset with @ref
* AliHLTComponent::EnableDDLBit() and @ref AliHLTComponent::DisableDDLBit().
* Will be filled automatically if not supplied by the component.
* @return neg. error code if failed
*/
- Int_t PushToFXS(TObject* pObject, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList);
+ Int_t PushToFXS(TObject* pObject, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList);
/**
* Insert an object into the output. FXS header will be inserted before the root object.
* @param iSize size of the buffer
* @param pDetector 4 byte Detector identifier
* @param pFileID name of the file to which the data shall be stored
- * @param pDDLList pointer to ReadoutList ( struct @ref AliHLTEventDDL) of
+ * @param pDDLList pointer to ReadoutList ( class @ref AliHLTReadoutList) of
* participating DDLs. Have to be set or unset with @ref
* AliHLTComponent::EnableDDLBit() and @ref AliHLTComponent::DisableDDLBit().
* Will be filled automatically if not supplied by the component.
* @return neg. error code if failed
*/
- Int_t PushToFXS(void* pBuffer, int iSize, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList);
+ Int_t PushToFXS(void* pBuffer, int iSize, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList);
/** Constants */
static const AliHLTUInt32_t fgkFXSProtocolHeaderSize;
* @param pHeader pointer to AliHLTFXSHeader
* @param pDetector 4 byte Detector identifier
* @param pFileID name of the file to which the data shall be stored
- * @param pDDLList pointer to ReadoutList ( struct @ref AliHLTEventDDL) of
+ * @param pDDLList pointer to ReadoutList ( class @ref AliHLTReadoutList) of
* participating DDLs. Will be filled automatically if not
* supplied by the component.
* @return neg. error code if failed
*/
- Int_t CreateFXSHeader( AliHLTFXSHeader &pHeader, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList );
+ Int_t CreateFXSHeader( AliHLTFXSHeader &pHeader, const char* pDetector, const char* pFileID, const AliHLTReadoutList* pDDLList );
/*
* ######################## Members #####################
#include "AliHLTComponentHandler.h"
#include "AliHLTMessage.h"
#include "AliHLTCTPData.h"
+#include "AliRawDataHeader.h"
#include "TString.h"
#include "TMath.h"
#include "TObjArray.h"
fpStopwatches(new TObjArray(kSWTypeCount)),
fMemFiles(),
fpRunDesc(NULL),
- fpDDLList(NULL),
fCDBSetRunNoFunc(false),
fChainId(),
fChainIdCrc(0),
return iResult;
}
-void AliHLTComponent::SetDDLBit(AliHLTEventDDL &list, Int_t ddlId, Bool_t state ) const
-{
- // see header file for function documentation
-
- // -- Detector offset
- Int_t ddlIdBase = TMath::FloorNint( (Double_t) ddlId / 256.0 );
-
- // -- Word Base = 1. word of detector ( TPC has 8 words, TOF 3 )
- Int_t wordBase = 0;
-
- if ( ddlIdBase <= 3 )
- wordBase = ddlIdBase;
- else if ( ddlIdBase > 3 && ddlIdBase < 5 )
- wordBase = ddlIdBase + 7;
- else
- wordBase = ddlIdBase + 9;
-
- // -- Bit index in Word
- Int_t bitIdx = ddlId % 32;
-
- // -- Index of word
- Int_t wordIdx = wordBase;
-
- // -- if TPC (3) or TOD (5) add word idx
- if ( ( ddlIdBase == 3 ) || ( ddlIdBase == 5 ) ) {
- wordIdx += TMath::FloorNint( (Double_t) ( ddlId - ( ddlIdBase * 256 ) ) / 32.0 );
- }
-
- // -- Set -- 'OR' word with bit mask;
- if ( state )
- list.fList[wordIdx] |= ( 0x00000001 << bitIdx );
- // -- Unset -- 'AND' word with bit mask;
- else
- list.fList[wordIdx] &= ( 0xFFFFFFFF ^ ( 0x00000001 << bitIdx ) );
-}
-
-Int_t AliHLTComponent::GetFirstUsedDDLWord(AliHLTEventDDL &list) const
-{
- // see header file for function documentation
-
- Int_t iResult = -1;
-
- for ( Int_t wordNdx = 0 ; wordNdx < gkAliHLTDDLListSize ; wordNdx++ ) {
-
- if ( list.fList[wordNdx] != 0 && iResult == -1 ) {
- // check for special cases TPC and TOF
- if ( wordNdx > 3 && wordNdx <= 10 ) {
- wordNdx = 10;
- iResult = 3;
- }
- else if ( wordNdx > 12 && wordNdx <= 14 ) {
- wordNdx = 14;
- iResult = 12;
- }
- else
- iResult = wordNdx;
- }
- else if ( list.fList[wordNdx] != 0 && iResult >= 0 ) {
- HLTError( "DDLIDs for minimum of TWO detectors ( %d, %d ) set, this function works only for ONE detector.", iResult, wordNdx );
- iResult = -1;
- break;
- }
- }
-
- return iResult;
-}
-
AliHLTUInt32_t AliHLTComponent::CalculateChecksum(const AliHLTUInt8_t* buffer, int size)
{
// see header file for function documentation
return 1;
}
+int AliHLTComponent::ExtractTriggerData(
+ const AliHLTComponentTriggerData& trigData,
+ const AliHLTUInt8_t (**attributes)[gkAliHLTBlockDAttributeCount],
+ AliHLTUInt64_t* status,
+ const AliRawDataHeader** cdh,
+ AliHLTReadoutList* readoutlist,
+ bool printErrors
+ )
+{
+ // see header file for function documentation
+
+ // Check that the trigger data structure is the correct size.
+ if (trigData.fStructSize != sizeof(AliHLTComponentTriggerData))
+ {
+ if (printErrors)
+ {
+ AliHLTLogging log;
+ log.LoggingVarargs(kHLTLogError, Class_Name(), FUNCTIONNAME(), __FILE__, __LINE__,
+ "Invalid trigger structure size: %d but expected %d.", trigData.fStructSize, sizeof(AliHLTComponentTriggerData)
+ );
+ }
+ return -ENOENT;
+ }
+
+ // Check that the trigger data pointer points to data of a size we can handle.
+ // Either it is the size of AliHLTEventTriggerData or 32 bits less for the old
+ // version of AliHLTEventDDL, i.e. AliHLTEventDDLV0.
+ if (trigData.fDataSize != sizeof(AliHLTEventTriggerData) and
+ trigData.fDataSize != sizeof(AliHLTEventTriggerData) - sizeof(AliHLTUInt32_t)
+ )
+ {
+ if (printErrors)
+ {
+ AliHLTLogging log;
+ log.LoggingVarargs(kHLTLogError, Class_Name(), FUNCTIONNAME(), __FILE__, __LINE__,
+ "Invalid trigger data size: %d but expected %d.", trigData.fDataSize, sizeof(AliHLTEventTriggerData)
+ );
+ }
+ return -EBADF;
+ }
+
+ AliHLTEventTriggerData* evtData = reinterpret_cast<AliHLTEventTriggerData*>(trigData.fData);
+ assert(evtData != NULL);
+
+ // Check that the CDH has 8 words.
+ if (cdh != NULL and evtData->fCommonHeaderWordCnt != 8)
+ {
+ if (printErrors)
+ {
+ AliHLTLogging log;
+ log.LoggingVarargs(kHLTLogError, Class_Name(), FUNCTIONNAME(), __FILE__, __LINE__,
+ "Common Data Header (CDH) has wrong number of data words: %d but expected %d",
+ evtData->fCommonHeaderWordCnt, sizeof(AliRawDataHeader)/sizeof(AliHLTUInt32_t)
+ );
+ }
+ return -EBADMSG;
+ }
+
+ // Check that the readout list has the correct count of words. i.e. something we can handle,
+ if (readoutlist != NULL and
+ evtData->fReadoutList.fCount != (unsigned)gkAliHLTDDLListSizeV0 and
+ evtData->fReadoutList.fCount != (unsigned)gkAliHLTDDLListSizeV1
+ )
+ {
+ if (printErrors)
+ {
+ AliHLTLogging log;
+ log.LoggingVarargs(kHLTLogError, Class_Name(), FUNCTIONNAME(), __FILE__, __LINE__,
+ "Readout list structure has wrong number of data words: %d but expected %d",
+ evtData->fReadoutList.fCount, gkAliHLTDDLListSize
+ );
+ }
+ return -EPROTO;
+ }
+
+ if (attributes != NULL)
+ {
+ *attributes = &evtData->fAttributes;
+ }
+ if (status != NULL)
+ {
+ *status = evtData->fHLTStatus;
+ }
+ if (cdh != NULL)
+ {
+ const AliRawDataHeader* cdhptr = reinterpret_cast<const AliRawDataHeader*>(&evtData->fCommonHeader);
+ *cdh = cdhptr;
+ }
+ if (readoutlist != NULL)
+ {
+ *readoutlist = AliHLTReadoutList(evtData->fReadoutList);
+ }
+ return 0;
+}
+
int AliHLTComponent::LoggingVarargs(AliHLTComponentLogSeverity severity,
const char* originClass, const char* originFunc,
const char* file, int line, ... ) const
class TObjArray;
class TMap;
class TStopwatch;
+class AliRawDataHeader;
class AliHLTComponent;
class AliHLTMemoryFile;
class AliHLTCTPData;
+class AliHLTReadoutList;
/** list of component data type structures */
typedef vector<AliHLTComponentDataType> AliHLTComponentDataTypeList;
static int ExtractComponentTableEntry(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size,
string& chainId, string& compId, string& compParam,
vector<AliHLTUInt32_t>& parents);
+
+ /**
+ * Extracts the different data parts from the trigger data structure.
+ * [in] @param trigData The trigger data as passed to the DoProcessing method.
+ * [out] @param attributes The data block attributes given by the HLT framework.
+ * [out] @param status The HLT status bits given by the HLT framework.
+ * [out] @param cdh The common data header received from DDL links.
+ * [out] @param readoutlist The readout list to fill with readout list bits
+ * passed on by the HLT framework.
+ * [in] @param printErrors If true then error messages are generated as necessary
+ * and suppressed otherwise.
+ * @note If any of the output parameters are set to NULL then the field is not set.
+ * For example, the following line will only fill the CDH pointer.
+ * \code
+ * AliRawDataHeader* cdh;
+ * ExtractTriggerData(trigData, NULL, NULL, &cdh, NULL);
+ * \endcode
+ * @return the zero on success and one of the following error codes on failure.
+ * if a non-zero error code is returned then none of the output parameters are
+ * modified.
+ * \li -ENOENT The <i>trigData</i> structure size is wrong.
+ * \li -EBADF The <i>trigData</i> data size is wrong.
+ * \li -EBADMSG The common data header (CDH) in the trigger data has the wrong
+ * number of words indicated.
+ * \li -EPROTO The readout list structure in the trigger data has the wrong
+ * number of words indicated.
+ */
+ static int ExtractTriggerData(
+ const AliHLTComponentTriggerData& trigData,
+ const AliHLTUInt8_t (**attributes)[gkAliHLTBlockDAttributeCount],
+ AliHLTUInt64_t* status,
+ const AliRawDataHeader** cdh,
+ AliHLTReadoutList* readoutlist,
+ bool printErrors = false
+ );
+
+ /**
+ * Extracts the readout list from a trigger data structure.
+ * [in] @param trigData The trigger data as passed to the DoProcessing method.
+ * [out] @param list The output readout list to fill.
+ * [in] @param printErrors If true then error messages are generated as necessary
+ * and suppressed otherwise.
+ * @return the zero on success or one of the error codes returned by ExtractTriggerData.
+ */
+ static int GetReadoutList(
+ const AliHLTComponentTriggerData& trigData, AliHLTReadoutList& list,
+ bool printErrors = false
+ )
+ {
+ return ExtractTriggerData(trigData, NULL, NULL, NULL, &list, printErrors);
+ }
+
/**
* Stopwatch type for benchmarking.
*/
*/
bool IsDataEvent(AliHLTUInt32_t* pTgt=NULL) const;
- /**
- * Set a bit to 1 in a readout list ( = AliHLTEventDDL )
- * -> enable DDL for readout
- * @param list readout list
- * @param ddlId DDL Id to be turned on ( Decimal )
- */
- void EnableDDLBit(AliHLTEventDDL &list, Int_t ddlId ) const {
- SetDDLBit( list, ddlId, kTRUE );
- }
-
- /**
- * Set a bit to 0 in a readout list ( = AliHLTEventDDL )
- * -> disable DDL for readout
- * @param list readout list
- * @param ddlId DDL Id to be turned on ( Decimal )
- */
- void DisableDDLBit(AliHLTEventDDL &list, Int_t ddlId ) const {
- SetDDLBit( list, ddlId, kFALSE );
- }
-
- /**
- * Set or unset bit a readout list ( = AliHLTEventDDL )
- * -> enable or disable DDL for readout
- * @param list readout list
- * @param ddlId DDL Id to be turned on ( Decimal )
- * @param state kTRUE sets it, kFALSE unsets it
- */
- void SetDDLBit(AliHLTEventDDL &list, Int_t ddlId, Bool_t state ) const;
-
- /**
- * Get the first word of a detector, which has a set DDL bit.
- * Beware, this only works if DDLs of 1 detector are set. In the
- * case of the TPC and TOF, which use 8 and 3 words, the first
- * word is returned.
- * @param list readout list
- * @return returns the detector index, -1 if no bit is set
- * at all or several detectors (=error)
- */
- Int_t GetFirstUsedDDLWord(AliHLTEventDDL &list) const;
-
/**
* Copy a struct from block data.
* The function checks for block size and struct size. The least common
/** descriptor of the current run */
AliHLTRunDesc* fpRunDesc; //! transient
- /** the current DDL list */
- AliHLTEventDDL* fpDDLList; //! transient
-
/** external fct to set CDB run no, indicates external CDB initialization */
void (*fCDBSetRunNoFunc)(); //! transient
ClassImp(AliHLTReadoutList)
+const char* AliHLTReadoutList::DetectorIdToString(EDetectorId id)
+{
+ // Converts a detector ID to a user readable string.
+ switch (id)
+ {
+ case kNoDetector: return "kNoDetector";
+ case kITSSPD: return "kITSSPD";
+ case kITSSDD: return "kITSSDD";
+ case kITSSSD: return "kITSSSD";
+ case kTPC: return "kTPC";
+ case kTRD: return "kTRD";
+ case kTOF: return "kTOF";
+ case kHMPID: return "kHMPID";
+ case kPHOS: return "kPHOS";
+ case kCPV: return "kCPV";
+ case kPMD: return "kPMD";
+ case kMUONTRK: return "kMUONTRK";
+ case kMUONTRG: return "kMUONTRG";
+ case kFMD: return "kFMD";
+ case kT0: return "kT0";
+ case kV0: return "kV0";
+ case kZDC: return "kZDC";
+ case kACORDE: return "kACORDE";
+ case kTRG: return "kTRG";
+ case kEMCAL: return "kEMCAL";
+ case kDAQTEST: return "kDAQTEST";
+ case kHLT: return "kHLT";
+ case kALLDET: return "kALLDET";
+ default: return "UNKNOWN!";
+ }
+}
+
+
AliHLTReadoutList::AliHLTReadoutList() :
TNamed("AliHLTReadoutList", "Readout list object used for manipulating and storing an AliHLTEventDDL structure."),
fReadoutList()
{
// Constructor to create readout list from AliHLTEventDDL structure.
// See header file for more details.
- 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<list.fCount?fReadoutList.fCount:list.fCount)*sizeof(AliHLTUInt32_t));
+ fReadoutList.fCount = gkAliHLTDDLListSize; // Required by ALICE-INT-2007-015
+ memset(fReadoutList.fList, 0x0, sizeof(fReadoutList.fList));
+ // Handle lists of different sizes. If the size is for a known version
+ // of AliHLTEventDDL then handle appropriately, otherwise just copy only
+ // the overlapping part of the list.
+ if (list.fCount == gkAliHLTDDLListSizeV0)
+ {
+ memcpy(&fReadoutList.fList[0], &list.fList[0], sizeof(AliHLTUInt32_t)*28);
+ memcpy(&fReadoutList.fList[29], &list.fList[28], sizeof(AliHLTUInt32_t)*2);
+ }
+ else if (list.fCount == gkAliHLTDDLListSizeV1)
+ {
+ memcpy(&fReadoutList.fList, &list.fList, sizeof(AliHLTEventDDL));
+ }
+ else
+ {
+ memcpy(&fReadoutList.fList, &list.fList, (fReadoutList.fCount<list.fCount?fReadoutList.fCount:list.fCount)*sizeof(AliHLTUInt32_t));
+ }
}
}
+bool AliHLTReadoutList::DetectorDisabled(Int_t detector) const
+{
+ // Checks if a particular detector's DDLs are disabled.
+ // See header file for more details.
+
+ bool result = true;
+ if ((detector & kITSSPD) != 0) result &= fReadoutList.fList[0] == 0x00000000;
+ if ((detector & kITSSDD) != 0) result &= fReadoutList.fList[1] == 0x00000000;
+ if ((detector & kITSSSD) != 0) result &= fReadoutList.fList[2] == 0x00000000;
+ if ((detector & kTPC) != 0)
+ {
+ result &= fReadoutList.fList[3] == 0x00000000;
+ result &= fReadoutList.fList[4] == 0x00000000;
+ result &= fReadoutList.fList[5] == 0x00000000;
+ result &= fReadoutList.fList[6] == 0x00000000;
+ result &= fReadoutList.fList[7] == 0x00000000;
+ result &= fReadoutList.fList[8] == 0x00000000;
+ result &= fReadoutList.fList[9] == 0x00000000;
+ }
+ if ((detector & kTRD) != 0) result &= fReadoutList.fList[11] == 0x00000000;
+ if ((detector & kTOF) != 0)
+ {
+ result &= fReadoutList.fList[12] == 0x00000000;
+ result &= fReadoutList.fList[13] == 0x00000000;
+ result &= fReadoutList.fList[14] == 0x00000000;
+ }
+ if ((detector & kHMPID) != 0) result &= fReadoutList.fList[15] == 0x00000000;
+ if ((detector & kPHOS) != 0) result &= fReadoutList.fList[16] == 0x00000000;
+ if ((detector & kCPV) != 0) result &= fReadoutList.fList[17] == 0x00000000;
+ if ((detector & kPMD) != 0) result &= fReadoutList.fList[18] == 0x00000000;
+ if ((detector & kMUONTRK) != 0) result &= fReadoutList.fList[19] == 0x00000000;
+ if ((detector & kMUONTRG) != 0) result &= fReadoutList.fList[20] == 0x00000000;
+ if ((detector & kFMD) != 0) result &= fReadoutList.fList[21] == 0x00000000;
+ if ((detector & kT0) != 0) result &= fReadoutList.fList[22] == 0x00000000;
+ if ((detector & kV0) != 0) result &= fReadoutList.fList[23] == 0x00000000;
+ if ((detector & kZDC) != 0) result &= fReadoutList.fList[24] == 0x00000000;
+ if ((detector & kACORDE) != 0) result &= fReadoutList.fList[25] == 0x00000000;
+ if ((detector & kTRG) != 0) result &= fReadoutList.fList[26] == 0x00000000;
+ if ((detector & kEMCAL) != 0)
+ {
+ result &= fReadoutList.fList[27] == 0x00000000;
+ result &= fReadoutList.fList[28] == 0x00000000;
+ }
+ if ((detector & kDAQTEST) != 0) result &= fReadoutList.fList[29] == 0x00000000;
+ if ((detector & kHLT) != 0) result &= fReadoutList.fList[30] == 0x00000000;
+
+ return result;
+}
+
+
+Int_t AliHLTReadoutList::GetFirstWord(EDetectorId detector)
+{
+ // See header file for more details.
+ switch (detector)
+ {
+ case kITSSPD: return 0;
+ case kITSSDD: return 1;
+ case kITSSSD: return 2;
+ case kTPC: return 3;
+ case kTRD: return 11;
+ case kTOF: return 12;
+ case kHMPID: return 15;
+ case kPHOS: return 16;
+ case kCPV: return 17;
+ case kPMD: return 18;
+ case kMUONTRK: return 19;
+ case kMUONTRG: return 20;
+ case kFMD: return 21;
+ case kT0: return 22;
+ case kV0: return 23;
+ case kZDC: return 24;
+ case kACORDE: return 25;
+ case kTRG: return 26;
+ case kEMCAL: return 27;
+ case kDAQTEST: return 29;
+ case kHLT: return 30;
+ default: return -1;
+ }
+}
+
+
+Int_t AliHLTReadoutList::GetWordCount(EDetectorId detector)
+{
+ // See header file for more details.
+ switch (detector)
+ {
+ case kITSSPD: return 1;
+ case kITSSDD: return 1;
+ case kITSSSD: return 1;
+ case kTPC: return 8;
+ case kTRD: return 1;
+ case kTOF: return 3;
+ case kHMPID: return 1;
+ case kPHOS: return 1;
+ case kCPV: return 1;
+ case kPMD: return 1;
+ case kMUONTRK: return 1;
+ case kMUONTRG: return 1;
+ case kFMD: return 1;
+ case kT0: return 1;
+ case kV0: return 1;
+ case kZDC: return 1;
+ case kACORDE: return 1;
+ case kTRG: return 1;
+ case kEMCAL: return 2;
+ case kDAQTEST: return 1;
+ case kHLT: return 1;
+ default: return 0;
+ }
+}
+
+
+AliHLTReadoutList::EDetectorId AliHLTReadoutList::GetFirstUsedDetector(EDetectorId startAfter) const
+{
+ // See header file for more details.
+ if (startAfter < kITSSPD and fReadoutList.fList[0] != 0x00000000) return kITSSPD;
+ if (startAfter < kITSSDD and fReadoutList.fList[1] != 0x00000000) return kITSSDD;
+ if (startAfter < kITSSSD and fReadoutList.fList[2] != 0x00000000) return kITSSSD;
+ if (startAfter < kTPC and fReadoutList.fList[3] != 0x00000000) return kTPC;
+ if (startAfter < kTPC and fReadoutList.fList[4] != 0x00000000) return kTPC;
+ if (startAfter < kTPC and fReadoutList.fList[5] != 0x00000000) return kTPC;
+ if (startAfter < kTPC and fReadoutList.fList[6] != 0x00000000) return kTPC;
+ if (startAfter < kTPC and fReadoutList.fList[7] != 0x00000000) return kTPC;
+ if (startAfter < kTPC and fReadoutList.fList[8] != 0x00000000) return kTPC;
+ if (startAfter < kTPC and fReadoutList.fList[9] != 0x00000000) return kTPC;
+ if (startAfter < kTPC and fReadoutList.fList[10] != 0x00000000) return kTPC;
+ if (startAfter < kTRD and fReadoutList.fList[11] != 0x00000000) return kTRD;
+ if (startAfter < kTOF and fReadoutList.fList[12] != 0x00000000) return kTOF;
+ if (startAfter < kTOF and fReadoutList.fList[13] != 0x00000000) return kTOF;
+ if (startAfter < kTOF and fReadoutList.fList[14] != 0x00000000) return kTOF;
+ if (startAfter < kHMPID and fReadoutList.fList[15] != 0x00000000) return kHMPID;
+ if (startAfter < kPHOS and fReadoutList.fList[16] != 0x00000000) return kPHOS;
+ if (startAfter < kCPV and fReadoutList.fList[17] != 0x00000000) return kCPV;
+ if (startAfter < kPMD and fReadoutList.fList[18] != 0x00000000) return kPMD;
+ if (startAfter < kMUONTRK and fReadoutList.fList[19] != 0x00000000) return kMUONTRK;
+ if (startAfter < kMUONTRG and fReadoutList.fList[20] != 0x00000000) return kMUONTRG;
+ if (startAfter < kFMD and fReadoutList.fList[21] != 0x00000000) return kFMD;
+ if (startAfter < kT0 and fReadoutList.fList[22] != 0x00000000) return kT0;
+ if (startAfter < kV0 and fReadoutList.fList[23] != 0x00000000) return kV0;
+ if (startAfter < kZDC and fReadoutList.fList[24] != 0x00000000) return kZDC;
+ if (startAfter < kACORDE and fReadoutList.fList[25] != 0x00000000) return kACORDE;
+ if (startAfter < kTRG and fReadoutList.fList[26] != 0x00000000) return kTRG;
+ if (startAfter < kEMCAL and fReadoutList.fList[27] != 0x00000000) return kEMCAL;
+ if (startAfter < kEMCAL and fReadoutList.fList[28] != 0x00000000) return kEMCAL;
+ if (startAfter < kDAQTEST and fReadoutList.fList[29] != 0x00000000) return kDAQTEST;
+ if (startAfter < kHLT and fReadoutList.fList[30] != 0x00000000) return kHLT;
+ return kNoDetector;
+}
+
+
void AliHLTReadoutList::Print(Option_t* /*option*/) const
{
// Prints the DDLs that will be readout according to this readout list.
*/
enum EDetectorId
{
+ kNoDetector = 0, /// No detector value
kITSSPD = 0x1 << 0, /// ID for SPD detector
kITSSDD = 0x1 << 1, /// ID for SDD detector
kITSSSD = 0x1 << 2, /// ID for SSD detector
| kACORDE | kTRG | kEMCAL | kHLT)
};
+ /// Converts a detector ID to a user readable string.
+ static const char* DetectorIdToString(EDetectorId id);
+
/**
* Default constructor.
*/
void Disable(Int_t detector);
/**
- * Checks if a particular detector's DDLs are enabled for readout.
+ * Checks if a particular detector's DDLs are all enabled for readout.
* \param detector A bitmap of detectors to check. Should be any values from
* EDetectorId that can be or'ed together for multiple detector selection.
* \return true if all DDLs for the specified detectors are enabled for readout.
*/
- bool DetectorEnabled(Int_t ddlId) const;
+ bool DetectorEnabled(Int_t detector) const;
+
+ /**
+ * Checks if a particular detector's DDLs are all disabled for readout.
+ * \param detector A bitmap of detectors to check. Should be any values from
+ * EDetectorId that can be or'ed together for multiple detector selection.
+ * \return true if all DDLs for the specified detectors are disabled for readout.
+ * \note If both DetectorEnabled(x) and DetectorDisabled(x) return false then
+ * it means that only part of the detectors DDLs are enabled.
+ */
+ bool DetectorDisabled(Int_t detector) const;
+
+ /**
+ * Returns the first word of DDL bits for a given detector in the internal structure.
+ * \param detector The detector code for which to return the starting word.
+ * \returns the first word of DDL bits for the detector or -1 if an invalid code is given.
+ */
+ static Int_t GetFirstWord(EDetectorId detector);
+
+ /**
+ * Returns the first word of DDL bits for a given detector in the internal structure.
+ * \param detector The detector code for which to return the starting word.
+ * \returns the first word of DDL bits for the detector or -1 if an invalid code is given.
+ */
+ static Int_t GetWordCount(EDetectorId detector);
+
+ /**
+ * Returns the first detector with non-zero DDL bits.
+ * \param startAfter The detector code after which to start looking from.
+ * If kTOF is used for example then only detectors after kTOF will be checked,
+ * not including kTOF, in the order of precedence indicated by EDetectorId.
+ * \returns the code of the first used detector.
+ */
+ EDetectorId GetFirstUsedDetector(EDetectorId startAfter = kNoDetector) const;
/**
* Inherited from TObject. Prints the DDLs that will be readout according to
<< CodeToString(code[j]) << " by constructor." << endl;
return false;
}
+ if (rl.DetectorDisabled(code[j]) == true)
+ {
+ cerr << "ERROR: DetectorDisabled returned and incorrect result"
+ " when detectors enabled for "
+ << CodeToString(code[j]) << " by constructor." << endl;
+ return false;
+ }
// Also check each bit individualy according to AliHLTDAQ values.
int det = detNum[j];
<< CodeToString(code[j]) << "." << endl;
return false;
}
+ if (rl.DetectorDisabled(code[j]) == false)
+ {
+ cerr << "ERROR: DetectorDisabled returned and incorrect result"
+ " when calling AliHLTReadoutList::Disable(x) for "
+ << CodeToString(code[j]) << "." << endl;
+ return false;
+ }
}
// Fetch the raw bits for the readout list structure and check that they
return true;
}
+/**
+ * Tests if using incorrect DDL IDs returns zero or is ignored as expected.
+ */
+bool CheckWordIndexAndCount()
+{
+ int wordCovered[gkAliHLTDDLListSize];
+ for (int j = 0; j < gkAliHLTDDLListSize; ++j) wordCovered[j] = 0;
+
+ for (int i = 0; i < kgNumberOfCodes; ++i)
+ {
+ AliHLTReadoutList rl;
+ Int_t firstword = rl.GetFirstWord((AliHLTReadoutList::EDetectorId)kgDetCodes[i]);
+ if (firstword < 0 or gkAliHLTDDLListSize-1 < firstword)
+ {
+ cerr << "ERROR: AliHLTReadoutList::GetFirstWord(" << kgDetCodeName[i]
+ << ") returns " << firstword
+ << ", which is outside the valid range of [0.." << gkAliHLTDDLListSize-1
+ << "]." << endl;
+ return false;
+ }
+
+ Int_t lastword = firstword + rl.GetWordCount((AliHLTReadoutList::EDetectorId)kgDetCodes[i]);
+ if (lastword < 1 or gkAliHLTDDLListSize < lastword)
+ {
+ cerr << "ERROR: The sum AliHLTReadoutList::GetFirstWord(" << kgDetCodeName[i]
+ << ") + AliHLTReadoutList::GetWordCount(" << kgDetCodeName[i]
+ << ") gives " << lastword
+ << ", which is outside the valid range of [1.." << gkAliHLTDDLListSize
+ << "]." << endl;
+ return false;
+ }
+
+ for (int j = firstword; j < lastword; ++j)
+ {
+ if (wordCovered[j] == 1)
+ {
+ cerr << "ERROR: The combination of AliHLTReadoutList::GetWordCount(" << kgDetCodeName[i]
+ << ") and AliHLTReadoutList::GetWordCount(" << kgDetCodeName[i]
+ << ") overlaps with previous detectors. Check the mapping in these functions."
+ << endl;
+ return false;
+ }
+ wordCovered[j] = 1;
+ }
+
+ Int_t maxddls = AliHLTDAQ::NumberOfDdls(i);
+ Int_t ddlid = AliHLTDAQ::DdlIDOffset(i) | (gRandom->Integer(maxddls) & 0xFF);
+ rl.EnableDDLBit(ddlid);
+ if (rl.GetFirstUsedDetector() != kgDetCodes[i])
+ {
+ cerr << "ERROR: AliHLTReadoutList::GetFirstUsedDetector() did not return the correct value of"
+ << kgDetCodeName[i] << " after calling AliHLTReadoutList::EnableDDLBit("
+ << ddlid << ")." << endl;
+ return false;
+ }
+ if (rl.GetFirstUsedDetector((AliHLTReadoutList::EDetectorId)kgDetCodes[i]) != AliHLTReadoutList::kNoDetector)
+ {
+ cerr << "ERROR: AliHLTReadoutList::GetFirstUsedDetector(" << kgDetCodeName[i]
+ << "+1) did not return the correct value of AliHLTReadoutList::kNoDetector"
+ " after calling AliHLTReadoutList::EnableDDLBit("
+ << ddlid << ")." << endl;
+ return false;
+ }
+ }
+
+ for (int j = 0; j < gkAliHLTDDLListSize; ++j)
+ {
+ if (wordCovered[j] == 0)
+ {
+ cerr << "ERROR: The functions AliHLTReadoutList::GetWordCount"
+ " and AliHLTReadoutList::GetWordCount do not fully cover"
+ " all DDL readout list words." << endl;
+ return false;
+ }
+ }
+
+ return true;
+}
+
/**
* Runs the unit test for the AliHLTReadoutList class.
* \returns true if the class passed the test and false otherwise.
if (not CheckEnablingDisabling()) return false;
if (not CheckEnablingDisablingDDLs()) return false;
if (not CheckIncorrectIDs()) return false;
+ if (not CheckWordIndexAndCount()) return false;
return true;
}
pBlock && iResult>=0;
pBlock=GetNextInputBlock()) {
if (pBlock->fDataType!=hltrdlstdt) continue;
- if (pBlock->fSize==sizeof(AliHLTEventDDL)) {
+ if (pBlock->fSize==sizeof(AliHLTEventDDL) or pBlock->fSize==sizeof(AliHLTEventDDLV0)) {
HLTDebug("Filling histograms from binary buffer");
- FillReadoutListHistogram(fBitsHisto, reinterpret_cast<AliHLTEventDDL*>(pBlock->fPtr));
- FillReadoutListVsCTP(fBitsVsCTP, reinterpret_cast<AliHLTEventDDL*>(pBlock->fPtr), &trigData);
+ AliHLTReadoutList readoutlist(*reinterpret_cast<AliHLTEventDDL*>(pBlock->fPtr));
+ FillReadoutListHistogram(fBitsHisto, &readoutlist);
+ FillReadoutListVsCTP(fBitsVsCTP, &readoutlist, &trigData);
} else {
- HLTError("HLTRDLST size missmatch: %d, expected %d", pBlock->fSize, sizeof(AliHLTEventDDL));
+ HLTError("HLTRDLST size missmatch: %d, expected %d or %d", pBlock->fSize, sizeof(AliHLTEventDDL), sizeof(AliHLTEventDDLV0));
}
}
} else if (fMode==AliHLTReadoutListDumpComponent::kModeHLTDecision) {
// see header file for class documentation
if (!histo || !list) return -EINVAL;
if (list->BufferSize()!=sizeof(AliHLTEventDDL)) return -EBADF;
-
- return FillReadoutListHistogram(histo, list->Buffer());
-}
-
-int AliHLTReadoutListDumpComponent::FillReadoutListHistogram(TH1I* histo, const AliHLTEventDDL* field)
-{
- // see header file for class documentation
- if (!histo || !field) return -EINVAL;
-
- if (field->fCount!=(unsigned)gkAliHLTDDLListSize) return -EBADF;
+ if (list->Buffer()->fCount!=(unsigned)gkAliHLTDDLListSize) return -EBADF;
for (int word=0; word<gkAliHLTDDLListSize; word++) {
for (unsigned bit=0; bit<sizeof(AliHLTUInt32_t)*8; bit++) {
- if (field->fList[word]&0x1<<bit) histo->Fill(word*sizeof(AliHLTUInt32_t)*8+bit);
+ if (list->Buffer()->fList[word]&0x1<<bit) histo->Fill(word*sizeof(AliHLTUInt32_t)*8+bit);
}
}
-
+
return 0;
}
// see header file for class documentation
if (!histo || !list || !trigData) return -EINVAL;
if (list->BufferSize()!=sizeof(AliHLTEventDDL)) return -EBADF;
-
- return FillReadoutListVsCTP(histo, list->Buffer(), trigData);
-}
-
-int AliHLTReadoutListDumpComponent::FillReadoutListVsCTP(TH2I* histo, const AliHLTEventDDL* field, const AliHLTComponentTriggerData* trigData)
-{
- // see header file for class documentation
- if (!histo || !field || !trigData) return -EINVAL;
-
- if (field->fCount!=(unsigned)gkAliHLTDDLListSize) return -EBADF;
+ if (list->Buffer()->fCount!=(unsigned)gkAliHLTDDLListSize) return -EBADF;
AliHLTUInt64_t triggerMask=AliHLTCTPData::ActiveTriggers(*trigData);
AliHLTUInt64_t bit0=0x1;
for (int word=0; word<gkAliHLTDDLListSize; word++) {
for (unsigned bit=0; bit<sizeof(AliHLTUInt32_t)*8; bit++) {
- if (field->fList[word]&0x1<<bit) {
+ if (list->Buffer()->fList[word]&0x1<<bit) {
for (int trigger=0; trigger<gkNCTPTriggerClasses; trigger++) {
if ((triggerMask&(bit0<<trigger))!=0) {
histo->Fill(word*sizeof(AliHLTUInt32_t)*8+bit, trigger);
* Fill histogram from the readout list.
*/
static int FillReadoutListHistogram(TH1I* histo, const AliHLTReadoutList* list);
- /**
- * Fill histogram from the readout list.
- */
- static int FillReadoutListHistogram(TH1I* histo, const AliHLTEventDDL* field);
+
/**
* Fill histogram from the readout list.
*/
static int FillReadoutListVsCTP(TH2I* histo, const AliHLTReadoutList* list, const AliHLTComponentTriggerData* trigData);
- /**
- * Fill histogram from the readout list.
- */
- static int FillReadoutListVsCTP(TH2I* histo, const AliHLTEventDDL* field, const AliHLTComponentTriggerData* trigData);
private:
/** copy constructor prohibited */
// prepare final result and ship to FXS
AliHLTReadoutList rdList(AliHLTReadoutList::kHLT);
- PushToFXS(fHisto, "HLT", "TestHisto", rdList.Buffer());
+ PushToFXS(fHisto, "HLT", "TestHisto", &rdList);
return 0;
}
delete file;
// the vdriftArray is pushed to the HLT-FXSsubscriber
- PushToFXS( (TObject*)vdriftArray, "TPC", "TIMEDRIFT", rdList.Buffer() );
+ PushToFXS( (TObject*)vdriftArray, "TPC", "TIMEDRIFT", &rdList );
//Should array be deleted now?
// if(vdriftArray){
if(fEnableAnalysis) fCalibTimeGain->Analyze();
static AliHLTReadoutList rdList(AliHLTReadoutList::kTPC);
- PushToFXS( (TObject*) fCalibTimeGain, "TPC", "TimeGain", rdList.Buffer() ) ;
+ PushToFXS( (TObject*) fCalibTimeGain, "TPC", "TimeGain", &rdList ) ;
return 0;
}
if(fEnableAnalysis) fCalibTask->Analyze();
static AliHLTReadoutList rdList(AliHLTReadoutList::kTPC);
- PushToFXS( (TObject*) fCalibTask, "TPC", "CALIB", rdList.Buffer() ) ;
+ PushToFXS( (TObject*) fCalibTask, "TPC", "CALIB", &rdList ) ;
return 0;
}
fTPCcalibTracks->Analyze();
}
static AliHLTReadoutList rdList(AliHLTReadoutList::kTPC);
- PushToFXS((TObject*)fTPCcalibAlign, "TPC", "TPCcalibAlign", rdList.Buffer()) ;
- PushToFXS((TObject*)fTPCcalibTracksGain, "TPC", "TPCcalibTracksGain", rdList.Buffer()) ;
- PushToFXS((TObject*)fTPCcalibTracks, "TPC", "TPCcalibTracks", rdList.Buffer()) ;
+ PushToFXS((TObject*)fTPCcalibAlign, "TPC", "TPCcalibAlign", &rdList) ;
+ PushToFXS((TObject*)fTPCcalibTracksGain, "TPC", "TPCcalibTracksGain", &rdList) ;
+ PushToFXS((TObject*)fTPCcalibTracks, "TPC", "TPCcalibTracks", &rdList) ;
return 0;
}
HLTDebug("Size of the fOutArray is %d\n",fOutArray->GetEntriesFast());
- PushToFXS((TObject*)fOutArray, "TRD", "GAINDRIFTPRF", rdList.Buffer() );
+ PushToFXS((TObject*)fOutArray, "TRD", "GAINDRIFTPRF", &rdList );
//PushToFXS((TObject*)fOutArray->FindObject("CH2d"), "TRD", "GAINDRIFTPRF", rdList.Buffer() );
return 0;
HLTDebug("Size of the fOutArray is %d\n",fOutArray->GetEntriesFast());
- PushToFXS((TObject*)fOutArray, "TRD", "GAINDRIFTPRF", rdList.Buffer() );
+ PushToFXS((TObject*)fOutArray, "TRD", "GAINDRIFTPRF", &rdList );
//PushToFXS((TObject*)fOutArray->FindObject("CH2d"), "TRD", "GAINDRIFTPRF", rdList.Buffer() );
return 0;
fHuffmanData->SetOCDBSpecifications(fOrigin, dataspec);
static AliHLTReadoutList rdList(AliHLTReadoutList::kTPC);
- PushToFXS( (TObject*) fHuffmanData, "TPC", "HuffmanData", rdList.Buffer() ) ;
+ PushToFXS( (TObject*) fHuffmanData, "TPC", "HuffmanData", &rdList ) ;
return 0;
} // Int_t AliHLTCOMPHuffmanAltroCalibComponent::ShipDataToFXS( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData ) {
#include "AliHLTEventSummaryProducerComponent.h"
#include "AliHLTTPCEventStatistics.h"
+#include "AliRawDataHeader.h"
#include <cerrno>
void AliHLTEventSummaryProducerComponent::ProcessTriggerData( AliHLTComponentTriggerData& trigData ) {
// see header file for class documentation
- AliHLTEventTriggerData* trg = ( AliHLTEventTriggerData* ) trigData.fData;
-
- AliHLTUInt64_t triggerClass = 0;
-
- // ** Higher bits
- triggerClass |= ( trg->fCommonHeader[6] & 0x3FFFF );
-
- triggerClass = triggerClass << 32;
-
- // ** Lower bits
- triggerClass |= trg->fCommonHeader[5] ;
-
+ const AliRawDataHeader* cdh = NULL;
+ if (AliHLTComponent::ExtractTriggerData(trigData, NULL, NULL, &cdh, NULL, true) != 0) return;
+ AliHLTUInt64_t triggerClass = cdh->GetTriggerClasses();
fEventSummary->SetTriggerClass( triggerClass );
}
#include "AliHLTRunSummaryProducerComponent.h"
#include "AliHLTEventSummary.h"
#include "AliHLTDataTypes.h"
+#include "AliRawDataHeader.h"
#include <cerrno>
void AliHLTRunSummaryProducerComponent::ProcessTriggerData( AliHLTComponentTriggerData& trigData ) {
// see header file for class documentation
- AliHLTEventTriggerData* trg = ( AliHLTEventTriggerData* ) trigData.fData;
-
- AliHLTUInt64_t triggerClasses = 0;
-
- // ** Higher bits
- triggerClasses |= ( trg->fCommonHeader[6] & 0x3FFFF );
-
- triggerClasses = triggerClasses << 32;
-
- // ** Lower bits
- triggerClasses |= trg->fCommonHeader[5] ;
+ const AliRawDataHeader* cdh = NULL;
+ if (AliHLTComponent::ExtractTriggerData(trigData, NULL, NULL, &cdh, NULL, true) != 0) return;
+ AliHLTUInt64_t triggerClasses = cdh->GetTriggerClasses();
for ( Int_t ndx = 0; ndx < gkNCTPTriggerClasses; ndx ++ ) {
// mask the readout list according to the CTP trigger
// if the classes have been initialized (mask non-zero)
if (CTPData() != NULL and CTPData()->Mask() != 0x0) {
- AliHLTEventDDL eventDDL = CTPData()->ReadoutList(*GetTriggerData());
- AliHLTReadoutList ctpreadout(eventDDL);
+ AliHLTReadoutList ctpreadout = CTPData()->ReadoutList(*GetTriggerData());
ctpreadout.Enable(AliHLTReadoutList::kHLT);
readoutlist.AndEq(ctpreadout);
result->ReadoutList(readoutlist); // override the readout list with the masked one.
*/
void EnableDDLBit(Int_t ddlId)
{
- AliHLTComponent::SetDDLBit(fReadoutList, ddlId, kTRUE);
+ fReadoutList.EnableDDLBit(ddlId);
}
/**
*/
void DisableDDLBit(Int_t ddlId)
{
- AliHLTComponent::SetDDLBit(fReadoutList, ddlId, kFALSE);
+ fReadoutList.DisableDDLBit(ddlId);
}
/**
*/
void SetDDLBit(Int_t ddlId, Bool_t state)
{
- AliHLTComponent::SetDDLBit(fReadoutList, ddlId, state);
+ fReadoutList.SetDDLBit(ddlId, state);
}
/**