]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
bug fixes
authorsgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Jun 2013 00:18:04 +0000 (00:18 +0000)
committersgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Jun 2013 00:18:04 +0000 (00:18 +0000)
HLT/TPCLib/AliHLTTPCHWClusterDecoderComponent.cxx
HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.cxx
HLT/TPCLib/HWCFemulator/AliHLTTPCHWClusterMergerV1.h

index a378a491b3eac82bca987222940cdb61ef64f089..149583e6a9f9a3f70be25efdc1dc79747ae64116 100644 (file)
@@ -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; ndx<evtData.fBlockCnt; ndx++ ){
      
@@ -252,8 +254,7 @@ int AliHLTTPCHWClusterDecoderComponent::DoEvent(const AliHLTComponentEventData&
       AliHLTComponentBlockData bd;
       FillBlockData( bd );
       bd.fOffset = size;
-      bd.fSize = iter->fSize;
-      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; i<outputBlocks.size(); i++){
+    fpClusterMerger->SetDataPointer(origOutputPtr);
+    for( UInt_t i=origOutputBlocksSize; i<outputBlocks.size(); i++){
       fpClusterMerger->SetDataBlock(&(outputBlocks[i]));
     }
     int nMerged = fpClusterMerger->Merge();
     fpClusterMerger->Clear();
     HLTInfo("Merged %d clusters",nMerged);   
   }
-
   fBenchmark.Stop(0);
   HLTInfo(fBenchmark.GetStatistics());
   
index 79f60a2a7325b4d68c94669203d56c6537783773..ec30f8553d97bf5871d026404f7ff85367ff9cc2 100644 (file)
@@ -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<AliClusterRecord>();
   // new(&fClusters) vector<AliClusterRecord>;
 
+  fpData = NULL;
   for( int i=0; i<fkNSlices*fkNPatches; i++){
     fRawClusterBlocks[i] = NULL;
     fMCBlocks[i] = NULL;
@@ -215,6 +214,12 @@ int AliHLTTPCHWClusterMergerV1::Merge()
   if( !fMapping ) Init();
   if( !fMapping ) return 0;
 
+  if( !fpData ){    
+    HLTError("Pointer to input data is not set");
+    return -1;
+  }
+
+  
   int iResult = 0;
   int count = 0;
 
@@ -225,15 +230,15 @@ int AliHLTTPCHWClusterMergerV1::Merge()
     for( int iBorder=0; iBorder<fNBorders; iBorder++) fBorderClusters[iBorder].clear();
     
     for( int iPatch=0; iPatch<fkNPatches; iPatch++){
-      int iSlicePatch =  iSlice*fkNSlices+iPatch;
+      int iSlicePatch =  iSlice*fkNPatches+iPatch;
       AliHLTComponentBlockData *block = fRawClusterBlocks[iSlicePatch];
       if( !block ) continue;
-      AliHLTTPCRawClusterData* clusters= (AliHLTTPCRawClusterData*)(block->fPtr);
+      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; iCluster<clusters->fCount; iCluster++){
        AliHLTTPCRawCluster &cluster = clusters->fClusters[iCluster];
 
@@ -273,11 +278,11 @@ int AliHLTTPCHWClusterMergerV1::Merge()
     } // patches
   
     
-    for( int iBorder=0; iBorder<fNBorders; iBorder+=2){
+    for( int iBorder=0; iBorder<fNBorders; iBorder+=2){      
       vector<AliBorderRecord> &border1 = fBorderClusters[iBorder];
       vector<AliBorderRecord> &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; iPatch<fkNPatches; iPatch++){
-      int iSlicePatch =  iSlice*fkNSlices+iPatch;
+      int iSlicePatch =  iSlice*fkNPatches+iPatch;
       AliHLTComponentBlockData *block = fRawClusterBlocks[iSlicePatch];
       if( !block ) continue;
-      AliHLTTPCRawClusterData* clusters= (AliHLTTPCRawClusterData*)(block->fPtr);
+      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;
index 68626016265f8d56695ed728611610683a7674e7..b16a9192c342e925159e4005213564849f105fc7 100644 (file)
@@ -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<AliBorderParam> fBorders; //!
+  AliHLTUInt8_t *fpData;
   AliHLTComponentBlockData **fRawClusterBlocks; //!
   AliHLTComponentBlockData **fMCBlocks; //!
 };