From 64defa03abe9db25106c9dcbad40d51fe5012d14 Mon Sep 17 00:00:00 2001 From: richterm Date: Wed, 5 Dec 2007 23:11:45 +0000 Subject: [PATCH] - bugfix TPCClusterFinder: set correct row no in list of active pads - implemented ActivePad list output TPCClusterFinder for all (rawreader and processing) modes - AltroChannelSelector generalized to allow also list of active hardware addresses, general data type {***:HWADDR16} added - minor cosmetics --- HLT/BASE/AliHLTDataTypes.cxx | 9 +++ HLT/BASE/AliHLTDataTypes.h | 10 ++++ .../AliHLTAltroChannelSelectorComponent.cxx | 56 ++++++++++++++----- .../AliHLTAltroChannelSelectorComponent.h | 15 ++++- HLT/TPCLib/AliHLTTPCClusterFinder.cxx | 42 ++++++++++++-- HLT/TPCLib/AliHLTTPCClusterFinder.h | 5 +- .../AliHLTTPCClusterFinderComponent.cxx | 13 ++++- HLT/TPCLib/AliHLTTPCClusterFinderComponent.h | 2 + HLT/TPCLib/AliHLTTPCPadArray.cxx | 4 +- HLT/rec/AliHLTOUTRawReader.h | 4 +- HLT/sim/AliHLTOUTComponent.cxx | 1 + HLT/sim/AliHLTOUTComponent.h | 2 +- 12 files changed, 134 insertions(+), 29 deletions(-) diff --git a/HLT/BASE/AliHLTDataTypes.cxx b/HLT/BASE/AliHLTDataTypes.cxx index 340caa25352..b47554f0fed 100644 --- a/HLT/BASE/AliHLTDataTypes.cxx +++ b/HLT/BASE/AliHLTDataTypes.cxx @@ -84,6 +84,15 @@ const AliHLTComponentDataType kAliHLTDataTypeESDTree = (AliHLTComponentDataType kAliHLTDataOriginAny }; +/** 16 bit Hardware address selection data specification, origin is 'any' */ +const AliHLTComponentDataType kAliHLTDataTypeHwAddr16 = (AliHLTComponentDataType) { + sizeof(AliHLTComponentDataType), + kAliHLTHwAddr16DataTypeID, + kAliHLTDataOriginAny +}; + + + ////////////////////////////////////////////////////////////////////////// // // Data urigin variables, to be used with the operator| diff --git a/HLT/BASE/AliHLTDataTypes.h b/HLT/BASE/AliHLTDataTypes.h index d9e1cc5366e..9e7318ef757 100644 --- a/HLT/BASE/AliHLTDataTypes.h +++ b/HLT/BASE/AliHLTDataTypes.h @@ -123,6 +123,13 @@ const int kAliHLTComponentDataTypefIDsize=8; */ # define kAliHLTESDTreeDataTypeID {'E','S','D','_','T','R','E','E'} + +/** HW Address selection data block + * - a selection list for 16 bit HW addresses + * - varying origin + */ +# define kAliHLTHwAddr16DataTypeID {'H','W','A','D','D','R','1','6'} + using namespace std; extern "C" { @@ -405,6 +412,9 @@ extern "C" { /** ESD Tree data specification, origin is 'any' */ extern const AliHLTComponentDataType kAliHLTDataTypeESDTree; + /** 16 bit Hardware address selection data specification, origin is 'any' */ + extern const AliHLTComponentDataType kAliHLTDataTypeHwAddr16; + ////////////////////////////////////////////////////////////////////////// // // FXS subscriber meta information diff --git a/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.cxx b/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.cxx index 47a9c575e21..40a9d32871e 100644 --- a/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.cxx +++ b/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.cxx @@ -66,6 +66,7 @@ void AliHLTAltroChannelSelectorComponent::GetInputDataTypes(AliHLTComponentDataT list.clear(); list.push_back(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC); list.push_back(AliHLTTPCDefinitions::fgkActivePadsDataType); + list.push_back(kAliHLTDataTypeHwAddr16); } AliHLTComponentDataType AliHLTAltroChannelSelectorComponent::GetOutputDataType() @@ -147,17 +148,32 @@ int AliHLTAltroChannelSelectorComponent::DoEvent(const AliHLTComponentEventData& // search for the active pad information AliHLTTPCPadArray::AliHLTTPCActivePads* pActivePadsArray=NULL; - int iNofActivePads=0; + AliHLTUInt16_t* pActiveHwAddressArray=NULL; + int iArraySize=0; for (int i=0; i<(int)evtData.fBlockCnt; i++ ) { - if (blocks[i].fDataType == AliHLTTPCDefinitions::fgkActivePadsDataType && - blocks[i].fSpecification==pDesc->fSpecification) { - pActivePadsArray=reinterpret_cast(blocks[i].fPtr); - iNofActivePads=blocks[i].fSize/sizeof(AliHLTTPCPadArray::AliHLTTPCActivePads); + const AliHLTComponentBlockData* iter=NULL; + // search for selection data of row/pad type + for (iter=GetFirstInputBlock(AliHLTTPCDefinitions::fgkActivePadsDataType); iter!=NULL; iter=GetNextInputBlock()) { + if (iter->fSpecification==pDesc->fSpecification) { + pActivePadsArray=reinterpret_cast(iter->fPtr); + iArraySize=iter->fSize/sizeof(AliHLTTPCPadArray::AliHLTTPCActivePads); + break; + } + } + + // search for selection data of hw address type + for (iter=GetFirstInputBlock(kAliHLTDataTypeHwAddr16); iter!=NULL; iter=GetNextInputBlock()) { + if (iter->fSpecification==pDesc->fSpecification) { + pActiveHwAddressArray=reinterpret_cast(iter->fPtr); + iArraySize=iter->fSize/sizeof(AliHLTUInt16_t); + break; + } } } - if (pActivePadsArray==NULL) { - HLTWarning("no block of type %s for specification 0x%08x available, data block unchanged", + if (pActivePadsArray==NULL && pActiveHwAddressArray==NULL) { + HLTWarning("no block of type %s or %s for specification 0x%08x available, data block unchanged", DataType2Text(AliHLTTPCDefinitions::fgkActivePadsDataType).c_str(), + DataType2Text(kAliHLTDataTypeHwAddr16).c_str(), pDesc->fSpecification); // forward the whole block outputBlocks.push_back(*pDesc); @@ -179,22 +195,32 @@ int AliHLTAltroChannelSelectorComponent::DoEvent(const AliHLTComponentEventData& AliHLTUInt32_t iCapacity=size; while (reader.NextAltroBlock()) { iTotal++; + + void* pChannel=NULL; + AliHLTUInt16_t hwAddress=~(AliHLTUInt16_t)0; + int channelSize=reader.GetAltroChannelRawData(pChannel, hwAddress); + int active=0; - for (; active=iNofActivePads) { + if (active>=iArraySize) { HLTDebug("ALTRO block Row %d, Pad %d discarded (inactive)", reader.GetRow(), reader.GetPad()); continue; } iSelected++; - void* pChannel=NULL; - AliHLTUInt16_t hwAddress=~(AliHLTUInt16_t)0; - int channelSize=reader.GetAltroChannelRawData(pChannel, hwAddress); HLTDebug("ALTRO block hwAddress 0x%08x Row/Pad %d/%d selected (active), size %d", hwAddress, reader.GetRow(), reader.GetPad(), channelSize); if (channelSize>0 && pChannel!=NULL) { if (iOutputSize==0) { diff --git a/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.h b/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.h index d1b8406425c..af01b368a44 100644 --- a/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.h +++ b/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.h @@ -23,8 +23,19 @@ /** * @class AliHLTAltroChannelSelectorComponent - * A converter for digit data of the TPC input to ASCII output. - * Data is written to file. + * A selector component for ALTRO Raw data. The component subscribes + * to the RAW data {***:DDL_RAW } and gets in addition a list of channels + * to select. The list must be of identical specification as the RAW data + * and can be of data type: + * - {TPC :ACTIVPAD}: description in coordinates of the TPC readout: row and + * pad + * - {***:HWADDR16}: 16 bit hardware addresses + * + * Currently, the DigitReaderRaw is used to read the data, the rawreader + * mode has to be set correctly ([0,5], see AliHLTTPCClusterFinderComponent). + * Later on if the fast Altro decoder is used as default input decoder for + * TPC offline reconstruction, we will move to a new DigitReader using + * this decoder. * * Component ID: \b AltroChannelSelector
* Library: \b libAliHLTTPC diff --git a/HLT/TPCLib/AliHLTTPCClusterFinder.cxx b/HLT/TPCLib/AliHLTTPCClusterFinder.cxx index f6aede0efff..ad3981a4951 100644 --- a/HLT/TPCLib/AliHLTTPCClusterFinder.cxx +++ b/HLT/TPCLib/AliHLTTPCClusterFinder.cxx @@ -136,13 +136,15 @@ AliHLTTPCClusterFinder::AliHLTTPCClusterFinder() fMatch(1), fThreshold(10), fSignalThreshold(-1), + fNSigmaThreshold(0), fNClusters(0), fMaxNClusters(0), fXYErr(0.2), fZErr(0.3), fOccupancyLimit(1.0), fPadArray(NULL), - fNSigmaThreshold(0) + fUnsorted(0), + fActivePads() { //constructor } @@ -197,6 +199,7 @@ void AliHLTTPCClusterFinder::ProcessDigits() AliHLTTPCSignal_t charge=0; fNClusters = 0; + fActivePads.clear(); // initialize block for reading packed data fDigitReader->InitBlock(fPtr,fSize,fFirstRow,fLastRow,fCurrentPatch,fCurrentSlice); @@ -317,6 +320,15 @@ void AliHLTTPCClusterFinder::ProcessDigits() } } + if (fActivePads.size()==0 || + fActivePads.back().fRow!=fCurrentRow-rowOffset || + fActivePads.back().fPad!=pad) { + AliHLTTPCPadArray::AliHLTTPCActivePads entry; + entry.fRow=fCurrentRow-rowOffset; + entry.fPad=pad; + fActivePads.push_back(entry); + } + if (pCurrentPad) { Float_t occupancy=pCurrentPad->GetOccupancy(); //HLTDebug("pad %d occupancy level: %f", pCurrentPad->GetPadNumber(), occupancy); @@ -686,12 +698,14 @@ void AliHLTTPCClusterFinder::GetTrackID(Int_t pad,Int_t time,Int_t *trackID) //----------------------------------Methods for the new unsorted way of reading the data -------------------------------- -void AliHLTTPCClusterFinder::SetPadArray(AliHLTTPCPadArray * padArray){ +void AliHLTTPCClusterFinder::SetPadArray(AliHLTTPCPadArray * padArray) +{ // see header file for function documentation fPadArray=padArray; } -void AliHLTTPCClusterFinder::ReadDataUnsorted(void* ptr,unsigned long size){ +void AliHLTTPCClusterFinder::ReadDataUnsorted(void* ptr,unsigned long size) +{ //set input pointer fPtr = (UChar_t*)ptr; fSize = size; @@ -708,7 +722,9 @@ void AliHLTTPCClusterFinder::ReadDataUnsorted(void* ptr,unsigned long size){ } fPadArray->ReadData(); } -void AliHLTTPCClusterFinder::FindClusters(){ + +void AliHLTTPCClusterFinder::FindClusters() +{ // see header file for function documentation fPadArray->FindClusterCandidates(); fPadArray->FindClusters(fMatch); @@ -731,10 +747,24 @@ void AliHLTTPCClusterFinder::FindClusters(){ delete [] clusterlist; fPadArray->DataToDefault(); } -Int_t AliHLTTPCClusterFinder::GetActivePads(AliHLTTPCPadArray::AliHLTTPCActivePads* activePads,Int_t maxActivePads){ + +Int_t AliHLTTPCClusterFinder::GetActivePads(AliHLTTPCPadArray::AliHLTTPCActivePads* activePads,Int_t maxActivePads) +{ // see header file for function documentation - return fPadArray->GetActivePads((AliHLTTPCPadArray::AliHLTTPCActivePads*)activePads , maxActivePads); + Int_t iResult=0; + if (fPadArray) { + iResult=fPadArray->GetActivePads((AliHLTTPCPadArray::AliHLTTPCActivePads*)activePads , maxActivePads); + } else if ((iResult=fActivePads.size())>0) { + if (iResult>maxActivePads) { + HLTWarning("target array (%d) not big enough to receive %d active pad descriptors", maxActivePads, iResult); + iResult=maxActivePads; + } + memcpy(activePads, &fActivePads[0], iResult*sizeof(AliHLTTPCPadArray::AliHLTTPCActivePads)); + } + + return iResult; } + void AliHLTTPCClusterFinder::WriteClusters(Int_t nclusters,AliHLTTPCClusters *list)//This is used when using the AliHLTTPCClusters class for cluster data { //write cluster to output pointer diff --git a/HLT/TPCLib/AliHLTTPCClusterFinder.h b/HLT/TPCLib/AliHLTTPCClusterFinder.h index c72de532c35..8baa31faefd 100644 --- a/HLT/TPCLib/AliHLTTPCClusterFinder.h +++ b/HLT/TPCLib/AliHLTTPCClusterFinder.h @@ -121,10 +121,13 @@ class AliHLTTPCClusterFinder : public AliHLTLogging { Int_t fUnsorted; // enable for processing of unsorted digit data + /** list of active pads if PadArray is not used */ + vector fActivePads; //!transient + #ifdef do_mc void GetTrackID(Int_t pad,Int_t time,Int_t *trackID); #endif - ClassDef(AliHLTTPCClusterFinder,2) //Fast cluster finder + ClassDef(AliHLTTPCClusterFinder,3) //Fast cluster finder }; #endif diff --git a/HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx b/HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx index e39c0d1dce7..b23c9a03e07 100644 --- a/HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx @@ -103,7 +103,17 @@ void AliHLTTPCClusterFinderComponent::GetInputDataTypes( vectorfSpecification; + bd.fDataType = AliHLTTPCDefinitions::fgkClustersDataType; //AliHLTSubEventDescriptor::FillBlockAttributes( bd.fAttributes ); outputBlocks.push_back( bd ); diff --git a/HLT/TPCLib/AliHLTTPCClusterFinderComponent.h b/HLT/TPCLib/AliHLTTPCClusterFinderComponent.h index 3b024b06892..2c7b48ce19e 100644 --- a/HLT/TPCLib/AliHLTTPCClusterFinderComponent.h +++ b/HLT/TPCLib/AliHLTTPCClusterFinderComponent.h @@ -68,6 +68,8 @@ class AliHLTTPCClusterFinderComponent : public AliHLTProcessor /** interface function, see @ref AliHLTComponent for description */ AliHLTComponentDataType GetOutputDataType(); /** interface function, see @ref AliHLTComponent for description */ + int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList); + /** interface function, see @ref AliHLTComponent for description */ virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ); /** interface function, see @ref AliHLTComponent for description */ AliHLTComponent* Spawn(); diff --git a/HLT/TPCLib/AliHLTTPCPadArray.cxx b/HLT/TPCLib/AliHLTTPCPadArray.cxx index 8c2fdeceece..8ac199fe8ae 100644 --- a/HLT/TPCLib/AliHLTTPCPadArray.cxx +++ b/HLT/TPCLib/AliHLTTPCPadArray.cxx @@ -497,8 +497,10 @@ Int_t AliHLTTPCPadArray::GetActivePads(AliHLTTPCActivePads * activePads,Int_t ma for(Int_t row=0;rowfClusterCandidates.size()>0){ + Int_t rowOffset=AliHLTTPCTransform::GetFirstRow(fPatch); + if (fPatch>=2) rowOffset-=AliHLTTPCTransform::GetFirstRow(2); AliHLTTPCActivePads tmpAP; - tmpAP.fRow=row; + tmpAP.fRow=row+rowOffset; tmpAP.fPad=pad; activePads[counter]= tmpAP; counter++; diff --git a/HLT/rec/AliHLTOUTRawReader.h b/HLT/rec/AliHLTOUTRawReader.h index 7c508a0a8ff..c483aa6f856 100644 --- a/HLT/rec/AliHLTOUTRawReader.h +++ b/HLT/rec/AliHLTOUTRawReader.h @@ -11,13 +11,13 @@ @author Matthias Richter @date @brief HLTOUT data wrapper for AliRawReader. - + */ // see below for class documentation // or // refer to README to build package // or // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt - */ + #include "AliHLTOUTHomerBuffer.h" class AliRawReader; diff --git a/HLT/sim/AliHLTOUTComponent.cxx b/HLT/sim/AliHLTOUTComponent.cxx index 06fe1ba13d2..f0655d5d8d9 100644 --- a/HLT/sim/AliHLTOUTComponent.cxx +++ b/HLT/sim/AliHLTOUTComponent.cxx @@ -35,6 +35,7 @@ using namespace std; #include #include "AliHLTOUTComponent.h" #include "AliHLTOUT.h" +#include "AliHLTHOMERLibManager.h" #include "AliHLTHOMERWriter.h" #include "AliDAQ.h" // equipment Ids #include "AliRawDataHeader.h" // Common Data Header diff --git a/HLT/sim/AliHLTOUTComponent.h b/HLT/sim/AliHLTOUTComponent.h index 754e249b90b..d32ab5b927b 100644 --- a/HLT/sim/AliHLTOUTComponent.h +++ b/HLT/sim/AliHLTOUTComponent.h @@ -20,8 +20,8 @@ #include #include "AliHLTOfflineDataSink.h" -#include "AliHLTHOMERLibManager.h" +class AliHLTHOMERLibManager; class AliHLTMonitoringWriter; typedef vector AliHLTMonitoringWriterPVector; -- 2.43.0