]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCAgent.cxx
Convertor from CATracker output to AliHLTTracksData added. It is needed by QA components.
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCAgent.cxx
index 3acd70a723d585e20e11b886d39e6b71a57796fe..cbc190ac97550ba1d3592cc845b9650db23fd8c8 100644 (file)
@@ -1,4 +1,4 @@
-// @(#) $Id$
+// $Id$
 
 //**************************************************************************
 //* This file is property of and copyright by the ALICE HLT Project        * 
 //* provided "as is" without express or implied warranty.                  *
 //**************************************************************************
 
-/** @file   AliHLTTPCAgent.cxx
-    @author Matthias Richter
-    @date   
-    @brief  Agent of the libAliHLTTPC library
-*/
+/ @file   AliHLTTPCAgent.cxx
+//  @author Matthias Richter
+//  @date   
+//  @brief  Agent of the libAliHLTTPC library
+//  @note   
 
 #include "AliHLTTPCAgent.h"
 #include "AliHLTConfiguration.h"
@@ -48,6 +48,7 @@ AliHLTTPCAgent gAliHLTTPCAgent;
 //#include "AliHLTTPCCalibPedestalComponent.h"
 #include "AliHLTTPCCAInputDataCompressorComponent.h"
 #include "AliHLTTPCCATrackerComponent.h"
+#include "AliHLTTPCCATrackerOutputConverter.h"
 #include "AliHLTTPCTrackMCMarkerComponent.h"
 #include "AliHLTTPCCAGlobalMergerComponent.h"
 #include "AliHLTTPCdEdxComponent.h"
@@ -82,10 +83,10 @@ AliHLTTPCAgent gAliHLTTPCAgent;
 ClassImp(AliHLTTPCAgent)
 
 AliHLTTPCAgent::AliHLTTPCAgent()
-  :
-  AliHLTModuleAgent("TPC"),
-  fRawDataHandler(NULL),
-  fTracksegsDataHandler(NULL)
+  : AliHLTModuleAgent("TPC")
+  , fRawDataHandler(NULL)
+  , fTracksegsDataHandler(NULL)
+  , fClustersDataHandler(NULL)
 {
   // see header file for class documentation
   // or
@@ -209,7 +210,19 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
 
     // the esd converter configuration
     handler->CreateConfiguration("TPC-hltout-tracks-esd-converter", "TPCEsdConverter", "TPC-hltout-tracks-publisher", "");
+
+    /////////////////////////////////////////////////////////////////////////////////////
+    //
+    // a kChain HLTOUT configuration for processing of {'CLUSTERS':'TPC '} data blocks
+    // stores the blocks in file HLT.TPC.Clusters.root in HOMER format
+
+    // publisher component
+    handler->CreateConfiguration("TPC-hltout-cluster-publisher", "AliHLTOUTPublisher"   , NULL, "");
+
+    // the HLTOUT component collects the blocks and stores the file
+    handler->CreateConfiguration("TPC-hltout-cluster-dump", "HLTOUT", "TPC-hltout-cluster-publisher", "-digitfile HLT.TPC.Clusters.root -rawout=off -links 2");
   }
+
   return 0;
 }
 
@@ -255,6 +268,7 @@ int AliHLTTPCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
   pHandler->AddComponent(new AliHLTTPCCompDumpComponent);
   pHandler->AddComponent(new AliHLTTPCCAInputDataCompressorComponent);
   pHandler->AddComponent(new AliHLTTPCCATrackerComponent);
+  pHandler->AddComponent(new AliHLTTPCCATrackerOutputConverter);
   pHandler->AddComponent(new AliHLTTPCCAGlobalMergerComponent);
   pHandler->AddComponent(new AliHLTTPCTrackMCMarkerComponent);
   pHandler->AddComponent(new AliHLTTPCGlobalMergerComponent);
@@ -315,9 +329,9 @@ int AliHLTTPCAgent::GetHandlerDescription(AliHLTComponentDataType dt,
     }
   }
 
-  // dump for {'CLUSTERS':'TPC '} currently not used any more
+  // dump for {'CLUSTERS':'TPC '} blocks stored in a 'digit' file
   if (dt==AliHLTTPCDefinitions::fgkClustersDataType) {
-      desc=AliHLTOUTHandlerDesc(kProprietary, dt, GetModuleId());
+      desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
       return 1;
   }
 
@@ -349,6 +363,13 @@ AliHLTOUTHandler* AliHLTTPCAgent::GetOutputHandler(AliHLTComponentDataType dt,
     return fRawDataHandler;
   }
 
+  // dump for {'CLUSTERS':'TPC '}, stored in a file HLT.TPC.Clusters.root in HOMER format
+  if (dt==AliHLTTPCDefinitions::fgkClustersDataType) {
+    if (fClustersDataHandler==NULL)
+      fClustersDataHandler=new AliHLTOUTHandlerChain("chains=TPC-hltout-cluster-dump libHLTsim.so libAliHLTUtil.so");
+    return fClustersDataHandler;
+  }
+
   // afterburner for {'TRAKSEGS':'TPC '} blocks to be converted to ESD format
   // in a kChain HLTOUT handler
   if (dt==AliHLTTPCDefinitions::fgkTrackSegmentsDataType) {
@@ -380,6 +401,12 @@ int AliHLTTPCAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
     delete fTracksegsDataHandler;
     fTracksegsDataHandler=NULL;
   }
+
+  if (pInstance==fClustersDataHandler) {
+    delete fClustersDataHandler;
+    fClustersDataHandler=NULL;
+  }
+
   return 0;
 }