]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCClusterFinderComponent.cxx
removing old CF configurations, ids redirected to HWCF; global tracking option enable...
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCClusterFinderComponent.cxx
index 0f9f6f557151f1f7917f9a69e2809d312e5fb209..2880d8c16de317bb022d3be5376861b5bfc7a6b8 100644 (file)
@@ -27,9 +27,7 @@
 using namespace std;
 #endif
 #include "AliHLTTPCClusterFinderComponent.h"
-#include "AliHLTTPCDigitReaderPacked.h"
 #include "AliHLTTPCDigitReaderUnpacked.h"
-#include "AliHLTTPCDigitReaderDecoder.h"
 #include "AliHLTTPCDigitReader32Bit.h"
 #include "AliHLTTPCClusterFinder.h"
 #include "AliHLTTPCSpacePointData.h"
@@ -43,6 +41,9 @@ using namespace std;
 #include "AliTPCcalibDB.h"
 #include "AliTPCCalPad.h"
 #include "AliTPCParam.h"
+#include "AliTPCTransform.h"
+#include "AliHLTTPCClusterMCData.h"
+
 //#include "AliHLTTPCCAInputDataCompressorComponent.h"
 //#include "AliHLTTPCCADef.h"
 
@@ -67,6 +68,7 @@ AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(int mode)
   fClusterFinder(NULL),
   fReader(NULL),
   fDeconvTime(kFALSE),
+  fTS(0),
   fDeconvPad(kFALSE),
   fClusterDeconv(false),
   fXYClusterError(-1),
@@ -79,6 +81,7 @@ AliHLTTPCClusterFinderComponent::AliHLTTPCClusterFinderComponent(int mode)
   fLastTimeBin(-1),
   fDoMC(kFALSE),
   fReleaseMemory( kFALSE ),
+  fPublishRawClusters(kFALSE),
   fBenchmark("TPCClusterFinder")
 {
   // see header file for class documentation
@@ -127,15 +130,11 @@ void AliHLTTPCClusterFinderComponent::GetInputDataTypes( vector<AliHLTComponentD
   // see header file for class documentation
   list.clear(); 
   switch(fModeSwitch){
-  case kClusterFinderPacked:
-    list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
-    break;
   case kClusterFinderUnpacked:          
     list.push_back( AliHLTTPCDefinitions::fgkUnpackedRawDataType );     
     break;
-  case kClusterFinderDecoder:
-    list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
-    break;
+  case kClusterFinderDecoder: // deprecated, falling back to 32bit reader
+  case kClusterFinderPacked: // deprecated, falling back to 32bit reader
   case kClusterFinder32Bit:
     list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC );
     break;
@@ -165,15 +164,11 @@ void AliHLTTPCClusterFinderComponent::GetOutputDataSize( unsigned long& constBas
   // XXX TODO: Find more realistic values.  
   constBase = 0;
   switch(fModeSwitch){
-  case kClusterFinderPacked:
-    inputMultiplier = (6 * 0.4);
-    break;
   case kClusterFinderUnpacked:
     inputMultiplier = 0.4;
     break;
-  case kClusterFinderDecoder:
-    inputMultiplier = (6 * 0.4);
-    break;
+  case kClusterFinderDecoder: // deprecated, falling back to 32bit reader
+  case kClusterFinderPacked: // deprecated, falling back to 32bit reader
   case kClusterFinder32Bit:
     inputMultiplier = (6 * 0.4);
     break;
@@ -199,6 +194,9 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
     HLTError("AliTPCcalibDB does not exist");
     return -ENOENT;
   }
+
+  fTS = calib->GetTransform();
+
   calib->SetRun(GetRunNo());
   calib->UpdateRunInformations(GetRunNo());
   AliTPCCalPad * time0TPC = calib->GetPadTime0(); 
@@ -277,23 +275,21 @@ int AliHLTTPCClusterFinderComponent::DoInit( int argc, const char** argv )
 
   // Choose reader
   if (fModeSwitch==kClusterFinderPacked) {
-      HLTDebug("using AliHLTTPCDigitReaderPacked");
-      fReader = new AliHLTTPCDigitReaderPacked();
-      if(fUnsorted==1){        fReader->SetUnsorted(kTRUE); }
-      fClusterFinder->SetReader(fReader);
+      HLTWarning("AliHLTTPCDigitReaderPacked is deprecated, falling back to AliHLTTPCDigitReader32Bit");
   }
-  else if(fModeSwitch==kClusterFinderUnpacked){         
+  else if(fModeSwitch==kClusterFinderDecoder){
+    HLTWarning("AliHLTTPCDigitReaderPacked is deprecated, falling back to AliHLTTPCDigitReader32Bit");
+  }
+  
+  if(fModeSwitch==kClusterFinderUnpacked){      
     HLTDebug("using AliHLTTPCDigitReaderUnpacked");     
     fReader = new AliHLTTPCDigitReaderUnpacked();       
     if(fUnsorted==1){  fReader->SetUnsorted(kTRUE); }
     fClusterFinder->SetReader(fReader);
   } 
-  else if(fModeSwitch==kClusterFinderDecoder){
-    HLTDebug("using AliHLTTPCDigitReaderDecoder");
-    fReader = new AliHLTTPCDigitReaderDecoder();
-    fClusterFinder->SetReader(fReader);
-  }
-  else if(fModeSwitch==kClusterFinder32Bit){
+  else if(fModeSwitch==kClusterFinder32Bit ||
+         fModeSwitch==kClusterFinderPacked ||
+         fModeSwitch==kClusterFinderDecoder){
     HLTDebug("using AliHLTTPCDigitReader32Bit");
     fReader = new AliHLTTPCDigitReader32Bit();
     fClusterFinder->SetReader(fReader);
@@ -358,6 +354,9 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& ev
   // fDeconvPad = kTRUE;
   //fClusterFinder->SetDeconvPad(fDeconvPad);
     
+  
+  fTS->SetCurrentTimeStamp(GetTimeStamp());
+  //fTS->SetCurrentTimeStamp(0);
 
   if(fReader == NULL){
     HLTFatal("Digit reader not initialized, skipping HLT TPC cluster reconstruction.");
@@ -411,15 +410,7 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& ev
                 DataType2Text( iter->fDataType).c_str(), 
                 DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
 
-       if (iter->fDataType == AliHLTTPCDefinitions::fgkDDLPackedRawDataType &&
-           GetEventCount()<2) {
-         HLTWarning("data type %s is depricated, use %s (kAliHLTDataTypeDDLRaw)!",
-                    DataType2Text(AliHLTTPCDefinitions::fgkDDLPackedRawDataType).c_str(),
-                    DataType2Text(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC).c_str());
-         }
-
-       if ( iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC) &&
-            iter->fDataType != AliHLTTPCDefinitions::fgkDDLPackedRawDataType ) continue;
+       if ( iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTPC)) continue;
 
       }
       else if(fModeSwitch==1){
@@ -446,6 +437,7 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& ev
 
       maxPoints = (size-tSize-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData);
 
+      fClusterFinder->SetFillRawClusters(fPublishRawClusters);
       fClusterFinder->InitSlice( slice, patch, maxPoints );
       fClusterFinder->SetOutputArray( (AliHLTTPCSpacePointData*)outPtr->fSpacePoints );
        
@@ -556,21 +548,36 @@ int AliHLTTPCClusterFinderComponent::DoEvent( const AliHLTComponentEventData& ev
       */
 
       if(fDoMC){
-       Int_t maxNumberOfClusterMCInfo = (Int_t)((size-tSize)/sizeof(AliHLTTPCClusterFinder::ClusterMCInfo)-1);
-       AliHLTTPCClusterFinder::ClusterMCInfo* outputMCInfo= (AliHLTTPCClusterFinder::ClusterMCInfo*)(outputPtr+tSize);
-       Int_t nMCInfo = fClusterFinder->FillOutputMCInfo(outputMCInfo, maxNumberOfClusterMCInfo);
-       
-       AliHLTComponentBlockData bdMCInfo;
-       FillBlockData( bdMCInfo );
-       bdMCInfo.fOffset = tSize ;
-       bdMCInfo.fSize = nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
-       bdMCInfo.fSpecification = iter->fSpecification;
-       bdMCInfo.fDataType = AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo;
-       outputBlocks.push_back( bdMCInfo );
-       fBenchmark.AddOutput(bdMCInfo.fSize);
-
-       tSize+=nMCInfo*sizeof(AliHLTTPCClusterFinder::ClusterMCInfo);
+       Int_t maxNumberOfClusterMCInfo = (Int_t)((size-tSize-sizeof(AliHLTTPCClusterMCData))/sizeof(AliHLTTPCClusterMCLabel)-1);
+       if( maxNumberOfClusterMCInfo>0 ){
+         AliHLTTPCClusterMCData* outputMCInfo= (AliHLTTPCClusterMCData*)(outputPtr+tSize);
+         outputMCInfo->fCount = fClusterFinder->FillOutputMCInfo(outputMCInfo->fLabels, maxNumberOfClusterMCInfo);
+         
+         AliHLTComponentBlockData bdMCInfo;
+         FillBlockData( bdMCInfo );
+         bdMCInfo.fOffset = tSize;
+         bdMCInfo.fSize = sizeof(AliHLTTPCClusterMCData)+outputMCInfo->fCount*sizeof(AliHLTTPCClusterMCLabel);
+         bdMCInfo.fSpecification = iter->fSpecification;
+         bdMCInfo.fDataType = AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo;
+         outputBlocks.push_back( bdMCInfo );
+         fBenchmark.AddOutput(bdMCInfo.fSize);
+         tSize+=bdMCInfo.fSize;
+       }
+      }
 
+      if (fPublishRawClusters) {
+       AliHLTTPCRawClusterData* outputRaw= (AliHLTTPCRawClusterData*)(outputPtr+tSize);
+       outputRaw->fCount = fClusterFinder->FillOutputRaw(outputRaw->fClusters, size-tSize);
+
+       AliHLTComponentBlockData bdRawClusters;
+       FillBlockData( bdRawClusters );
+       bdRawClusters.fOffset = tSize;
+       bdRawClusters.fSize = sizeof(AliHLTTPCRawClusterData)+outputRaw->fCount*sizeof(AliHLTTPCRawCluster);
+       bdRawClusters.fSpecification = iter->fSpecification;
+       bdRawClusters.fDataType = AliHLTTPCDefinitions::fgkRawClustersDataType;
+       outputBlocks.push_back( bdRawClusters );
+       fBenchmark.AddOutput(bdRawClusters.fSize);
+       tSize+=bdRawClusters.fSize;
       }
     }
 
@@ -682,6 +689,11 @@ int AliHLTTPCClusterFinderComponent::ScanConfigurationArgument(int argc, const c
     HLTDebug("Setting fReleaseMemory to true.");
     return 1;
   }
+  if (argument.CompareTo("-publish-raw")==0) {
+    fPublishRawClusters=kTRUE;
+    fClusterFinder->SetFillRawClusters(fPublishRawClusters);
+    return 1;
+  }
 
   if (argument.CompareTo("-active-pads")==0 || argument.CompareTo("activepads")==0){
     if(argument.CompareTo("activepads" )==0){
@@ -923,10 +935,22 @@ void AliHLTTPCClusterFinderComponent::GetOCDBObjectDescription( TMap* const targ
   if (!targetMap) return;
   
   // OCDB entries for component arguments
-  targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinder32Bit"),    new TObjString("component arguments, empty at the moment"));
-  targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinderPacked"),   new TObjString("component arguments, empty at the moment"));
-  targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinderUnpacked"), new TObjString("component arguments, empty at the moment"));
-  targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinderDecoder"),  new TObjString("component arguments, empty at the moment"));
+  switch(fModeSwitch){
+  case kClusterFinderPacked:
+    // deprecated but kept for a short while to support porting to release
+    targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinderPacked"),   new TObjString("component arguments, empty at the moment"));
+    break;
+  case kClusterFinderUnpacked:
+    targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinderUnpacked"), new TObjString("component arguments, empty at the moment"));
+    break;
+  case kClusterFinderDecoder:
+    // deprecated but kept for a short while to support porting to release
+    targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinderDecoder"),  new TObjString("component arguments, empty at the moment"));
+    break;
+  case kClusterFinder32Bit: 
+    targetMap->Add(new TObjString("HLT/ConfigTPC/TPCClusterFinder32Bit"),    new TObjString("component arguments, empty at the moment"));
+    break;
+  }
   
   // OCDB entries to be fetched by the TAXI (access via the AliTPCcalibDB class)
   targetMap->Add(new TObjString("TPC/Calib/Parameters"),    new TObjString("unknown content"));