From e43f69202b88a2cf698a8b3a0335c4d1ac49ed6f Mon Sep 17 00:00:00 2001 From: sgorbuno Date: Thu, 27 Jun 2013 00:18:04 +0000 Subject: [PATCH] bug fixes --- .../AliHLTTPCHWClusterDecoderComponent.cxx | 21 ++++++------ .../AliHLTTPCHWClusterMergerV1.cxx | 34 +++++++++++-------- .../HWCFemulator/AliHLTTPCHWClusterMergerV1.h | 3 ++ 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/HLT/TPCLib/AliHLTTPCHWClusterDecoderComponent.cxx b/HLT/TPCLib/AliHLTTPCHWClusterDecoderComponent.cxx index a378a491b3e..149583e6a9f 100644 --- a/HLT/TPCLib/AliHLTTPCHWClusterDecoderComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCHWClusterDecoderComponent.cxx @@ -129,7 +129,7 @@ int AliHLTTPCHWClusterDecoderComponent::DoInit( int argc, const char** argv ) fDoMerge = 1; - if (iResult>=0) iResult = ConfigureFromCDBTObjString(fgkOCDBEntry); + //!! if (iResult>=0) iResult = ConfigureFromCDBTObjString(fgkOCDBEntry); if (iResult>=0 && argc>0) iResult = ConfigureFromArgumentString(argc, argv); @@ -151,7 +151,8 @@ int AliHLTTPCHWClusterDecoderComponent::Reconfigure(const char* /*cdbEntry*/, co // see header file for class documentation fDoMerge = 1; - int iResult = ConfigureFromCDBTObjString(fgkOCDBEntry); + int iResult = 0; + //!! iResult = ConfigureFromCDBTObjString(fgkOCDBEntry); if ( iResult>=0 ) iResult = InitClusterMerger(); return iResult; } @@ -204,7 +205,7 @@ void AliHLTTPCHWClusterDecoderComponent::GetOCDBObjectDescription( TMap* const t // OCDB entries for component arguments - targetMap->Add(new TObjString(fgkOCDBEntry), new TObjString("component argument for HW cluster decoder")); + //!! targetMap->Add(new TObjString(fgkOCDBEntry), new TObjString("component argument for HW cluster decoder")); } @@ -225,7 +226,8 @@ int AliHLTTPCHWClusterDecoderComponent::DoEvent(const AliHLTComponentEventData& fBenchmark.StartNewEvent(); fBenchmark.Start(0); - UInt_t outputBlocksSize = outputBlocks.size(); + AliHLTUInt8_t* origOutputPtr = outputPtr; + UInt_t origOutputBlocksSize = outputBlocks.size(); for( unsigned long ndx=0; ndxfSize; - bd.fPtr = outputPtr; + bd.fSize = iter->fSize; bd.fSpecification = iter->fSpecification; bd.fDataType = iter->fDataType; outputBlocks.push_back( bd ); @@ -315,8 +316,7 @@ int AliHLTTPCHWClusterDecoderComponent::DoEvent(const AliHLTComponentEventData& // fill into HLT output data AliHLTComponentBlockData bdRawClusters; FillBlockData( bdRawClusters ); - bdRawClusters.fOffset = size; - bdRawClusters.fPtr = outputPtr; + bdRawClusters.fOffset = size; bdRawClusters.fSize = sizeof(AliHLTTPCRawClusterData)+outputRaw->fCount*sizeof(AliHLTTPCRawCluster); bdRawClusters.fSpecification = iter->fSpecification; bdRawClusters.fDataType = AliHLTTPCDefinitions::fgkRawClustersDataType | kAliHLTDataOriginTPC; @@ -332,14 +332,15 @@ int AliHLTTPCHWClusterDecoderComponent::DoEvent(const AliHLTComponentEventData& if( fDoMerge && fpClusterMerger ){ fpClusterMerger->Clear(); - for( UInt_t i=outputBlocksSize; iSetDataPointer(origOutputPtr); + for( UInt_t i=origOutputBlocksSize; iSetDataBlock(&(outputBlocks[i])); } int nMerged = fpClusterMerger->Merge(); fpClusterMerger->Clear(); HLTInfo("Merged %d clusters",nMerged); } - + fBenchmark.Stop(0); HLTInfo(fBenchmark.GetStatistics()); diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.cxx index 79f60a2a732..ec30f8553d9 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.cxx @@ -40,6 +40,7 @@ AliHLTTPCHWClusterMergerV1::AliHLTTPCHWClusterMergerV1() , fNBorders(0) , fMapping(0) , fBorders() + , fpData(NULL) , fRawClusterBlocks(NULL) , fMCBlocks(NULL) { @@ -140,6 +141,8 @@ Int_t AliHLTTPCHWClusterMergerV1::Init() } } + Clear(); + return iResult; } @@ -155,11 +158,6 @@ Int_t AliHLTTPCHWClusterMergerV1::SetDataBlock( AliHLTComponentBlockData *block HLTError("Input NULL pointer to data block"); return -1; } - - if( !block->fPtr ){ - HLTError("fPtr pointer to data is not set in the input data block"); - return -1; - } Int_t blockType=0; @@ -201,6 +199,7 @@ void AliHLTTPCHWClusterMergerV1::Clear() // fClusters.~vector(); // new(&fClusters) vector; + fpData = NULL; for( int i=0; ifPtr); + AliHLTTPCRawClusterData* clusters= (AliHLTTPCRawClusterData*)( fpData + block->fOffset); if(!clusters) continue; AliHLTComponentBlockData *mcblock = fMCBlocks[iSlicePatch]; AliHLTTPCClusterMCData* mclabels = 0; - if( mcblock ) mclabels = (AliHLTTPCClusterMCData*)(mcblock->fPtr); + if( mcblock ) mclabels = (AliHLTTPCClusterMCData*)(fpData + mcblock->fOffset ); if( mclabels && mclabels->fCount != clusters->fCount ){ HLTError("Slice %d, patch %d: Number of MC labels (%d) not equal to N clusters (%d)", iSlice, iPatch, mclabels->fCount, clusters->fCount ); mclabels->fCount = 0; @@ -241,7 +246,7 @@ int AliHLTTPCHWClusterMergerV1::Merge() mclabels = 0; fMCBlocks[iSlicePatch] = 0; } - + for( UInt_t iCluster=0; iClusterfCount; iCluster++){ AliHLTTPCRawCluster &cluster = clusters->fClusters[iCluster]; @@ -273,11 +278,11 @@ int AliHLTTPCHWClusterMergerV1::Merge() } // patches - for( int iBorder=0; iBorder &border1 = fBorderClusters[iBorder]; vector &border2 = fBorderClusters[iBorder+1]; UInt_t n1 = border1.size(); - UInt_t n2 = border2.size(); + UInt_t n2 = border2.size(); if( n1==0 || n2==0 ) continue; // sort @@ -366,19 +371,20 @@ int AliHLTTPCHWClusterMergerV1::Merge() } } // iBorder + // remove merged clusters from data for( int iPatch=0; iPatchfPtr); + AliHLTTPCRawClusterData* clusters= (AliHLTTPCRawClusterData*)(fpData + block->fOffset); if(!clusters) continue; AliHLTUInt32_t nClustersOrig = clusters->fCount; AliHLTComponentBlockData *mcblock = fMCBlocks[iSlicePatch]; AliHLTTPCClusterMCData* mclabels = 0; - if( mcblock ) mclabels = (AliHLTTPCClusterMCData*)(mcblock->fPtr); + if( mcblock ) mclabels = (AliHLTTPCClusterMCData*)(fpData + mcblock->fOffset); if( mclabels && mclabels->fCount != nClustersOrig ) mclabels = 0; clusters->fCount=0; diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.h b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.h index 68626016265..b16a9192c34 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.h +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.h @@ -35,6 +35,8 @@ class AliHLTTPCHWClusterMergerV1 : public AliHLTLogging Int_t Init(); + void SetDataPointer( AliHLTUInt8_t *data ){ fpData=data; } + Int_t SetDataBlock( AliHLTComponentBlockData *block); /// merge clusters @@ -91,6 +93,7 @@ class AliHLTTPCHWClusterMergerV1 : public AliHLTLogging AliHLTInt16_t *fMapping;//! std::vector fBorders; //! + AliHLTUInt8_t *fpData; AliHLTComponentBlockData **fRawClusterBlocks; //! AliHLTComponentBlockData **fMCBlocks; //! }; -- 2.39.3