iResult = InitCalibration();
}
+ // Reset the DDLNumberList
+ memset( fDDLNumber, 0, gkAliHLTFXSHeaderfDDLNumberSize);
+
return iResult;
}
const AliHLTComponentBlockData* blkEOR = NULL;
blkEOR = GetFirstInputBlock( kAliHLTDataTypeEOR );
- // const AliHLTComponentBlockData* blkDDL = NULL;
-
- HLTInfo( "Event ID: %lu", evtData.fEventID );
-
-
- // -------------- GET DDLNumber -----------------
- // blkDDL = GetFirstInputBlock( kAliHLTDataTypeDDL );
-
- // if ( blkDDL ) {
- //HLTInfo("DDLLIST block received, size: %u", blkDDL->fSize );
- //AliHLTEventDDL ddlList = ( AliHLTEventDDL* ) blkDDL->fPtr;
- //}
-
- // ------------ decide which event type ----------
-
- // - if event Type is not SOR or EOR -> process data
+ // ** if event Type is not SOR or EOR -> fill DDLNumber list and process data
if ( ! blkEOR && !blkSOR ) {
+
+ // ** 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) {
+
+ // ** ProcessData
iResult = ProcessCalibration( evtData, blocks, trigData, outputPtr, size, outputBlocks );
fEventCounter++;
}
* ######################## CreateFXSHeader #####################
*/
-Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTFXSHeader &pHeader, const char* pDetector, const char* pFileID, const char* pDDLNumber ) {
+Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTFXSHeader &pHeader, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
// see header file for class documentation
Int_t iResult = 0;
- AliHLTUInt32_t runNumber = GetRunNo(); // debug : 2176;
-
- HLTDebug( "RunNumber = %d", runNumber );
-
- /* STILL TO BE DONE .. but interface fixed */
-
- // if ( pDDLNumber != "" ) {
- char ddltmp[5] = "4444";
- strncpy ( fDDLNumber, ddltmp, gkAliHLTFXSHeaderfDDLNumberSize );
- //}
- //else {
- //strncpy ( fDDLNumber, pDDLNumber, gkAliHLTFXSHeaderfDDLNumberSize );
- //}
-
- fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize] = 0;
-
- // -- Fill Header
-
- // Fill header version
+ // ** Fill header version
pHeader.fHeaderVersion = AliHLTCalibrationProcessor::fgkFXSProtocolHeaderVersion;
- // Fill run number
- pHeader.fRunNumber = runNumber;
+ // ** Fill run number
+ pHeader.fRunNumber = GetRunNo();
- // Fill origin
+ // ** Fill origin
HLTDebug( "FXS Header Detector size max %i - actual %i .",gkAliHLTFXSHeaderfOriginSize, strlen( pDetector ) );
strncpy ( pHeader.fOrigin, pDetector, gkAliHLTFXSHeaderfOriginSize ) ;
// To take care if fileIDs which are longer than gkAliHLTFXSHeaderfOriginSize, write one 0 is cheaper than an if.
pHeader.fOrigin[gkAliHLTFXSHeaderfOriginSize] = 0;
- // Fill file ID
+ // ** Fill file ID
HLTInfo( "FXS Header FileID size max %i - actual %i .",gkAliHLTFXSHeaderfFileIDSize, strlen( pFileID ) );
strncpy ( pHeader.fFileID, pFileID, gkAliHLTFXSHeaderfFileIDSize ) ;
// To take care if fileIDs which are longer than gkAliHLTFXSHeaderfFileIDSize, write one 0 is cheaper than an if.
pHeader.fFileID[gkAliHLTFXSHeaderfFileIDSize] = 0;
- // Fill DDL number
- HLTInfo( "FXS Header DDLNumber size max %i - actual %i .", gkAliHLTFXSHeaderfDDLNumberSize, strlen( pDDLNumber ) );
- strncpy ( pHeader.fDDLNumber, fDDLNumber, gkAliHLTFXSHeaderfDDLNumberSize) ;
-
- // To take care if DDLNumber which are longer than gkAliHLTFXSHeaderfDDLNumberSize, write one 0 is cheaper than an if.
- pHeader.fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize] = 0;
+ // ** Fill DDL number
+ // -- if component provides list, convert to fDDLNumber
+ 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;
+
+ // check word for word
+ for ( Int_t ndx = 0; ndx < wordCount; ndx++ ) {
+ AliHLTUInt32_t word = pDDLList->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 ) {
+ else
+ iResult = wordNdx;
+ } // if ( pDDLList ) {
+
+ // -- fill header with ascii chars
+ for (Int_t ndx = 0; ndx < gkAliHLTFXSHeaderfDDLNumberSize; ndx++ ){
+ Int_t numberToChar = (Int_t) fDDLNumber[ndx];
+ // Get ASCII
+ if ( numberToChar > 9 ) numberToChar += 55;
+ else numberToChar += 48;
+
+ pHeader.fDDLNumber[ndx] = (Char_t) numberToChar;
+ }
+
return iResult;
-} // Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTXSHeader &pHeader, const char* pDetector, const char* pFileID, const char* pDDLNumber ) {
+} // Int_t AliHLTCalibrationProcessor::CreateFXSHeader( AliHLTXSHeader &pHeader, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
/*
* ######################## PushToFXS #####################
*/
-Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* pDetector, const char* pFileID, const char* pDDLNumber ) {
+Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
// see header file for class documentation
Int_t iResult = 0;
AliHLTFXSHeader pHeader;
- CreateFXSHeader( pHeader, pDetector, pFileID, pDDLNumber );
+ CreateFXSHeader( pHeader, pDetector, pFileID, pDDLList );
if ( pObject ) {
return iResult;
-} // Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* detector, const char* pFileID, const char* pDDLNumber ) {
+} // Int_t AliHLTCalibrationProcessor::PushToFXS(TObject* pObject, const char* detector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
-Int_t AliHLTCalibrationProcessor::PushToFXS( void* pBuffer, int iSize, const char* pDetector, const char* pFileID, const char* pDDLNumber ) {
+Int_t AliHLTCalibrationProcessor::PushToFXS( void* pBuffer, int iSize, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
// see header file for class documentation
Int_t iResult = 0;
AliHLTFXSHeader pHeader;
- CreateFXSHeader( pHeader, pDetector, pFileID, pDDLNumber );
+ CreateFXSHeader( pHeader, pDetector, pFileID, pDDLList );
iResult = PushBack( pBuffer, iSize, kAliHLTDataTypeFXSCalib, kAliHLTVoidDataSpec, (void*) (&pHeader), AliHLTCalibrationProcessor::fgkFXSProtocolHeaderSize );
return iResult;
-} // Int_t AliHLTCalibrationProcessor::PushToFXS(void* pBuffer, int iSize, const char* pDdetector, const char* pFileID, const char* pDDLNumber = "") {
+} // Int_t AliHLTCalibrationProcessor::PushToFXS(void* pBuffer, int iSize, const char* pDdetector, const char* pFileID, AliHLTEventDDL* pDDLList ) {
* @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 pDDLNumber number of DDLs participating in the processing/
- * creation of this calibration data, will be filled
- * automatically if not supplied by the componenet.
+ * @param pDDLList pointer to ReadoutList ( struct @ref AliHLTEventDDL) of
+ * participating DDLs. Have to be set with @ref EnableDLLBit(),
+ * or unset with @ref DisableDLLBit.
+ * 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, const char* pDDLNumber = "");
+ Int_t PushToFXS(TObject* pObject, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList = NULL);
/**
* 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 pDDLNumber number of DDLs participating in the processing/
- * creation of this calibration data, will be filled
- * automatically if not supplied by the componenet.
+ * @param pDDLList pointer to ReadoutList ( struct @ref AliHLTEventDDL) of
+ * participating DDLs. Have to be set with @ref EnableDLLBit(),
+ * or unset with @ref DisableDLLBit.
+ * 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, const char* pDDLNumber = "");
+ Int_t PushToFXS(void* pBuffer, int iSize, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList = NULL);
/** Constants */
static const AliHLTUInt32_t fgkFXSProtocolHeaderSize;
*/
virtual Int_t ScanArgument(int argc, const char** argv);
-
/*
* ######################## DeinitCalibration #####################
*/
* @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 pDDLNumber number of DDLs participating in the processing/
- * creation of this calibration data, will be filled
- * automatically if not supplied by the componenet.
+ * @param pDDLList pointer to ReadoutList ( struct @ref AliHLTEventDDL) 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, const char* pDDLNumber );
-
+ Int_t CreateFXSHeader( AliHLTFXSHeader &pHeader, const char* pDetector, const char* pFileID, AliHLTEventDDL* pDDLList );
/*
* ######################## Members #####################
/**
* Bit Array of participating DDL Numbers.
- * Scheme: lower 4 Bits of each Byte convert to
- * digit (0 - F)
+ * Scheme: every 4 Bits of each Byte convert digit
+ * (0 - F), before writing to FXS Header
*/
- //Char_t fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize]; // see above
- Char_t fDDLNumber[64]; // see above
+ //Char_t fDDLNumber[gkAliHLTFXSHeaderfDDLNumberSize];// see above
+ Char_t fDDLNumber[64]; // see above
/** Dummy in order to cope with RC 11 */
Int_t fDummy; // see above
#include "AliHLTComponentHandler.h"
#include "AliHLTMessage.h"
#include "TString.h"
+#include "TMath.h"
#include "TObjArray.h"
#include "TObjectTable.h"
#include "TClass.h"
}
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 GetRunType() 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
- integration into AliSimulation
- HLTOUT framework
- component registration via agents
+ - DDL List interface of AliHLTCalibrationProcessor base class
+ slightly changed and helper methods added to simplify usage
- TPC:
- zero suppression enhanced in Pad/PadArray classes
- AltroChannelSelector component
/*
* --- setter for rcuformat need in AliTPCCalibPedestal class
*/
-Int_t AliHLTTPCCalibPedestalComponent::ProcessCalibration( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ ) {
+Int_t AliHLTTPCCalibPedestalComponent::ProcessCalibration( const AliHLTComponentEventData& /*evtData*/,
+ AliHLTComponentTriggerData& /*trigData*/ ) {
// see header file for class documentation
const AliHLTComponentBlockData* iter = NULL;
Int_t ddlId = 0;
// ** Loop over all input blocks and specify which data format should be read - only select Raw Data
- iter = GetFirstInputBlock( AliHLTTPCDefinitions::fgkDDLPackedRawDataType );
+ iter = GetFirstInputBlock( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC);
while ( iter != NULL ) {
// ** Print Debug output which data format was received
// char tmp1[14], tmp2[14];
- //DataType2Text( iter->fDataType, tmp1 );
- //DataType2Text( AliHLTTPCDefinitions::fgkDDLPackedRawDataType, tmp2 );
-
-// HLTDebug ( "Event received - Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
-// evtData.fEventID, evtData.fEventID, tmp1, tmp2 );
+ // DataType2Text( iter->fDataType, tmp1 );
+ // DataType2Text( AliHLTTPCDefinitions::fgkDDLPackedRawDataType, tmp2 );
+ // HLTDebug ( "Event received - Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
+ // evtData.fEventID, evtData.fEventID, tmp1, tmp2 );
// ** Get DDL ID in order to tell the memory reader which slice/patch to use
slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
} // Int_t AliHLTTPCCalibPedestalComponent::ProcessCalibration( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData ) {
-Int_t AliHLTTPCCalibPedestalComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ ) {
+Int_t AliHLTTPCCalibPedestalComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/,
+ AliHLTComponentTriggerData& /*trigData*/ ) {
// see header file for class documentation
if ( fEnableAnalysis )
/*
* --- setter for rcuformat need in AliTPCCalibPulser class
*/
-Int_t AliHLTTPCCalibPulserComponent::ProcessCalibration( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ ) {
+Int_t AliHLTTPCCalibPulserComponent::ProcessCalibration( const AliHLTComponentEventData& /*evtData*/,
+ AliHLTComponentTriggerData& /*trigData*/ ) {
// see header file for class documentation
const AliHLTComponentBlockData* iter = NULL;
Int_t ddlId = 0;
// ** Loop over all input blocks and specify which data format should be read - only select Raw Data
- iter = GetFirstInputBlock( AliHLTTPCDefinitions::fgkDDLPackedRawDataType );
+ iter = GetFirstInputBlock( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC);
while ( iter != NULL ) {
// ** Print Debug output which data format was received
- char tmp1[14], tmp2[14];
- DataType2Text( iter->fDataType, tmp1 );
- DataType2Text( AliHLTTPCDefinitions::fgkDDLPackedRawDataType, tmp2 );
-
-// HLTDebug ( "Event received - Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
-// evtData.fEventID, evtData.fEventID, tmp1, tmp2 );
+ // char tmp1[14], tmp2[14];
+ // DataType2Text( iter->fDataType, tmp1 );
+ // DataType2Text( AliHLTTPCDefinitions::fgkDDLPackedRawDataType, tmp2 );
+ // HLTDebug ( "Event received - Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
+ // evtData.fEventID, evtData.fEventID, tmp1, tmp2 );
// ** Get DDL ID in order to tell the memory reader which slice/patch to use
slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
} // Int_t AliHLTTPCCalibPulserComponent::ProcessCalibration( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData ) {
-Int_t AliHLTTPCCalibPulserComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/ ) {
+Int_t AliHLTTPCCalibPulserComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/,
+ AliHLTComponentTriggerData& /*trigData*/ ) {
// see header file for class documentation
#ifndef HAVE_NOT_ALITPCCALIBPULSER
#include "AliHLTTriggerSelectiveReadoutComponent.h"
#include "AliHLTTPCDefinitions.h"
+#include "TMath.h"
+
#include <cstdlib>
#include <cerrno>
// see header file for class documentation
constBase = sizeof( AliHLTEventDDL );
-
- if ( ! fDetector.CompareTo("TPC") )
- inputMultiplier = 216.0;
- else
- HLTError("Output DataSize for Detector '%s' has not been implemented", fDetector.Data() );
+ inputMultiplier = 0.0;
}
// Spawn function, return new instance of this class
if ( argument.IsNull() ) continue;
// -detector
- if ( argument.CompareTo("-detector") == 0) {
+ if ( ! argument.CompareTo("-detector") ) {
if ( ( bMissingParam=( ++ii >= argc ) ) ) break;
fDetector = argv[ii];
fDetector.Remove(TString::kLeading, ' ');
+ fDetector.Resize(4);
- fDetector = parameter;
HLTInfo( "Detector has been set to '%s'.", fDetector.Data() );
}
else if ( ! argument.CompareTo("-enableThreshold") ) {
if ( ( bMissingParam=( ++ii >= argc ) ) ) break;
-
- parameter = argv[ii];
- parameter.Remove(TString::kLeading, ' ');
+ parameter = argv[ii];
+ parameter.Remove( TString::kLeading, ' ' );
+
if ( ! parameter.CompareTo("size") ) {
fEnableThresholdSize = kTRUE;
HLTInfo( "Threshold on data 'size' has been enabled." );
}
}
- // -enableThreshold
- else if ( ! argument.CompareTo("-treshold") ) {
- HLTError("Not yet implemented '%s'", argument.Data() );
+ // -threshold
+ else if ( ! argument.CompareTo("-threshold") ) {
+
+ if ( ( bMissingParam=( ++ii >= argc ) ) ) break;
+
+ Int_t jj = 0;
+
+ for ( jj ; ( jj < fkNThreshold ) && ( ( ii + jj ) < argc ); jj++ ) {
+
+ parameter = argv[ii+jj];
+ parameter.Remove( TString::kLeading, ' ' );
+
+ if ( parameter.BeginsWith( '-' ) ) break;
+
+ if (parameter.IsDigit() ) {
+ fThreshold[jj] = (AliHLTUInt32_t) parameter.Atoi();
+ HLTInfo( "Threshold for %d is set to %d.", jj, fThreshold[jj] );
+ }
+ else {
+ HLTError( "Cannot convert %d. threshold specifier '%s'.", jj, parameter.Data() );
+ iResult = -EINVAL;
+ break;
+ }
+ } // for ( jj ; ( jj < fkNThreshold ) && ( ( ii + jj ) < argc ); jj++ ) {
+
+ ii += --jj;
}
// - unknow parameter
}
} // for ( Int_t ii=0; ii<argc && iResult>=0; ii++ ) {
-
+
if ( bMissingParam ) {
HLTError( "Missing parameter for argument '%s'.", argument.Data() );
iResult = -EPROTO;
}
+ if ( fDetector.IsNull() ) {
+ HLTError( "No Detector has been supplied, this is mandatory." );
+ iResult = -EPROTO;
+ }
+
return iResult;
}
Int_t AliHLTTriggerSelectiveReadoutComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& trigData ) {
// see header file for class documentation
+ // ** No readout list for SOR and EOR event
+ if ( GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR ) )
+ return 0;
+
// ** Create empty Readoutlist
AliHLTEventDDL readoutList;
memset( &readoutList, 0, sizeof(AliHLTEventDDL) );
AliHLTUInt8_t patch = 0;
// ** Loop over all input blocks and specify which data format should be read - only select Raw Data
- iter = GetFirstInputBlock( kAliHLTDataTypeDDLRaw );
-
- while ( iter != NULL ) {
+ for ( iter = GetFirstInputBlock(kAliHLTDataTypeDDLRaw|fDetector.Data()); iter != NULL; iter = GetNextInputBlock() ) {
- // ** Check if block has the origin as specified in fDetector
- if ( fDetector.CompareTo( iter->fDataType.fOrigin ) == 0 ) {
- iter = GetNextInputBlock();
- continue;
- }
-
// ** Check if block has only the CDH Header ( 32 Bytes = gkAliHLTCommonHeaderCount *sizeof(AliHLTUInt32_t) )
if ( iter->fSize <= ( gkAliHLTCommonHeaderCount * sizeof(AliHLTUInt32_t) ) ) {
- iter = GetNextInputBlock();
continue;
}
//
// ** Check for TPC specifc specification
- if ( fDetector.CompareTo("TPC") == 0 ) {
-
+ if ( ! fDetector.CompareTo("TPC ") ) {
// ** Get DDL ID
AliHLTUInt8_t slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
-
if (patch < 2) ddlId = 768 + (2 * slice) + patch;
else ddlId = 838 + (4*slice) + patch;
-
HLTDebug ( "Input Data - TPC - Slice/Patch: %d/%d - EquipmentID : %d.", slice, patch, ddlId );
- } // if ( fDetector.CompareTo("TPC") == 0 ) {
+ } // if ( ! fDetector.CompareTo("TPC ") ) {
// ** Check for other detector specifc specification
else {
HLTError("Detector '%s' has not been implemented yet.", fDetector.Data() );
- iter = GetNextInputBlock();
continue;
}
-
+
//
// ** Check if threshold should be considerd
//
-
- if ( fEnableThresholdSize ) {
+ if ( fEnableThresholdSize ) {
// ** Check for TPC threshold
- if ( ! fDetector.CompareTo("TPC") ) {
+ if ( ! fDetector.CompareTo("TPC ") ) {
if ( patch < fkNThreshold ){
-
// ** if datablock to big, do not put it in HLT readout, enable for DAQ readout
if ( ( fThreshold[patch] !=0 ) && ( iter->fSize > fThreshold[patch] ) ) {
- //----------------------SetEnableDDL( &readoutList, ddlId );
- iter = GetNextInputBlock();
+ EnableDDLBit( readoutList, ddlId );
+ HLTDebug ( "DDL Id %d enabled for DAQ readout - size %d > threshold %d.", ddlId, iter->fSize, fThreshold[patch] );
continue;
}
-
}
- } // if ( ! fDetector.CompareTo("TPC") ) {
+ } // if ( ! fDetector.CompareTo("TPC ") ) {
// ** Check for other detector threshold
else
HLTError("Check for size threshold as not been implemented yet for Detector '%s'.", fDetector.Data() );
} // if ( fEnableThresholdSize ) {
-
- // ** PushBack data block
+
+ //
+ // ** PushForward data block
+ //
+
PushBack( iter->fPtr , iter->fSize, iter->fDataType, iter->fSpecification);
- // ** Get next input block, with the same specification as defined in GetFirstInputBlock()
- iter = GetNextInputBlock();
-
- } // while ( iter != NULL ) {
-
+ } // for ( iter = GetFirstInputBlock(kAliHLTDataTypeDDLRaw|fDetector.Data()); iter != NULL; iter = GetNextInputBlock() ) {
+
+ //
// ** PushBack readout list
- PushBack( &readoutList, sizeof(AliHLTEventDDL), kAliHLTDataTypeDDL, (AliHLTUInt32_t) 0 );
+ //
+ PushBack( &readoutList, sizeof(AliHLTEventDDL), kAliHLTDataTypeDDL, (AliHLTUInt32_t) 0 );
+
return 0;
}
* forwarded and Bit for this readout partition in ReadoutList will be set for DAQ readout.
*
* The component has the following component arguments:
- * -detector <TPC|PHOS|TRD|MUON> : Select Detector for discarding raw data.
+ * -detector <TPC |PHOS|TRD |MUON> : Select Detector for discarding raw data, use 4 Char_t origin format.
* -enableThreshold <size> : Enables threshold on size ( default is kFALSE )
* -threshold < Int_t threshold[6]> : Size threshold in Byte for different patches for TPC -> This will be disappear later on, will be taken from xCDB entry.
*
private:
/** size of the threshold array */
- static const int fkNThreshold = 6;
+ static const int fkNThreshold = 6; // see above
/** copy constructor prohibited */
AliHLTTriggerSelectiveReadoutComponent(const AliHLTTriggerSelectiveReadoutComponent&);
/** assignment operator prohibited */
AliHLTTriggerSelectiveReadoutComponent& operator=(const AliHLTTriggerSelectiveReadoutComponent&);
- /** Detector name */
- TString fDetector; //! transient
+ /** Detector name in HLT origin format */
+ TString fDetector; //! transient
/** Enable of the size Threshold */
- Bool_t fEnableThresholdSize; //! transient
+ Bool_t fEnableThresholdSize; //! transient
/** Threshold in Bytes for each a readout partition */
- AliHLTUInt32_t fThreshold[fkNThreshold]; //! transient
+ AliHLTUInt32_t fThreshold[fkNThreshold]; //! transient
ClassDef(AliHLTTriggerSelectiveReadoutComponent, 0);