]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCAgent.cxx
Corrected assignment operator
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCAgent.cxx
index 6ed17525086b8b427ca22df6b9a1cd1a1138af53..5d67bd2bd26fd227c6c9cdb937bc7f566a49e1bc 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"
 #include "AliHLTTPCDefinitions.h"
 #include "AliHLTOUT.h"
 #include "AliHLTOUTHandlerChain.h"
@@ -48,6 +47,7 @@ AliHLTTPCAgent gAliHLTTPCAgent;
 //#include "AliHLTTPCCalibPedestalComponent.h"
 #include "AliHLTTPCCAInputDataCompressorComponent.h"
 #include "AliHLTTPCCATrackerComponent.h"
+#include "AliHLTTPCCATrackerOutputConverter.h"
 #include "AliHLTTPCTrackMCMarkerComponent.h"
 #include "AliHLTTPCCAGlobalMergerComponent.h"
 #include "AliHLTTPCdEdxComponent.h"
@@ -73,19 +73,21 @@ AliHLTTPCAgent gAliHLTTPCAgent;
 #include "AliHLTTPCTrackDumpComponent.h"
 #include "AliHLTTPCHWCFDataReverterComponent.h"
 #include "AliHLTTPCHWClusterTransformComponent.h"
+#include "AliHLTTPCCFComparisonComponent.h"
 // #include "AliHLTTPCCalibSeedMakerComponent.h"
 // #include "AliHLTTPCCalibTimeComponent.h"
 // #include "AliHLTTPCCalibTimeGainComponent.h"
 // #include "AliHLTTPCCalibrationComponent.h"
+#include "AliHLTTPCDataCheckerComponent.h"
 
 /** ROOT macro for the implementation of ROOT specific class methods */
 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
@@ -105,18 +107,6 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
 {
   // see header file for class documentation
   if (handler) {
-    const char* cdbEntry="TPC/Calib/Parameters";
-    AliCDBManager* pMan=AliCDBManager::Instance();
-    AliTPCParam* pTPCParam=NULL;
-    if (pMan) {
-      AliCDBEntry *pEntry = pMan->Get(cdbEntry);
-      if (pEntry && 
-         pEntry->GetObject() &&
-         (pTPCParam=dynamic_cast<AliTPCParam*>(pEntry->GetObject()))) {
-      } else {
-       HLTWarning("can not load AliTPCParam from CDB entry %s", cdbEntry);
-      }
-    }
 
     // This the tracking configuration for the full TPC
     // - 216 clusterfinders (1 per partition)
@@ -130,6 +120,7 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
     int iMaxPart=5;
     TString mergerInput;
     TString sinkClusterInput;
+    TString dEdXInput;
     for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
       TString trackerInput;
       for (int part=iMinPart; part<=iMaxPart; part++) {
@@ -152,16 +143,13 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
 
        // cluster finder components
        cf.Form("TPC-CF_%02d_%d", slice, part);
-       arg="";
-       if (pTPCParam) {
-         arg+=" -timebins "; arg+=pTPCParam->GetMaxTBin()+1;
-       }
+       arg="-release-memory";
        if (!rawReader && runloader) {
          arg+=" -do-mc";
          handler->CreateConfiguration(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), arg.Data());
        } else {
 #ifndef HAVE_NOT_ALTRORAWSTREAMV3
-         handler->CreateConfiguration(cf.Data(), "TPCClusterFinder32Bit", publisher.Data(),"");
+         handler->CreateConfiguration(cf.Data(), "TPCClusterFinder32Bit", publisher.Data(),arg.Data());
 #else
          // using the AltroDecoder if the official V3 decoder is not
          // available in the offline code
@@ -170,6 +158,8 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
        }
        if (trackerInput.Length()>0) trackerInput+=" ";
        trackerInput+=cf;
+       if (dEdXInput.Length()>0) dEdXInput+=" ";
+       dEdXInput+=cf;
        if (sinkClusterInput.Length()>0) sinkClusterInput+=" ";
        sinkClusterInput+=cf;
       }
@@ -186,6 +176,11 @@ int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
     // GlobalMerger component
     handler->CreateConfiguration("TPC-globalmerger","TPCCAGlobalMerger",mergerInput.Data(),"");
 
+    if (dEdXInput.Length()>0) dEdXInput+=" ";
+    dEdXInput+="TPC-globalmerger";
+
+    handler->CreateConfiguration("TPC-dEdx","TPCdEdx",dEdXInput.Data(),"");
+
     // the esd converter configuration
     TString converterInput="TPC-globalmerger";
     if (!rawReader && runloader) {
@@ -224,7 +219,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;
 }
 
@@ -238,7 +245,10 @@ const char* AliHLTTPCAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
     // AliRoot simulation
     //if (runloader->GetLoader("TPCLoader") != NULL)
       //return "TPC-esd-converter TPC-clusters";
-      return "TPC-clusters";
+
+    // 2010-10-26 TPC clusters not written to HLTOUT in order to make the simulation
+    // closer to the real data 
+    //return "TPC-clusters";
   }
   return NULL;
 }
@@ -270,6 +280,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);
@@ -299,10 +310,12 @@ int AliHLTTPCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
   pHandler->AddComponent(new AliHLTTPCTrackDumpComponent);
   pHandler->AddComponent(new AliHLTTPCHWCFDataReverterComponent);
   pHandler->AddComponent(new AliHLTTPCHWClusterTransformComponent);
+  pHandler->AddComponent(new AliHLTTPCCFComparisonComponent);
 //   pHandler->AddComponent(new AliHLTTPCCalibSeedMakerComponent);
 //   pHandler->AddComponent(new AliHLTTPCCalibTimeComponent);
 //   pHandler->AddComponent(new AliHLTTPCCalibTimeGainComponent);
 //   pHandler->AddComponent(new AliHLTTPCCalibrationComponent);
+  pHandler->AddComponent(new AliHLTTPCDataCheckerComponent);
 
   return 0;
 }
@@ -330,9 +343,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;
   }
 
@@ -364,6 +377,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) {
@@ -395,6 +415,12 @@ int AliHLTTPCAgent::DeleteOutputHandler(AliHLTOUTHandler* pInstance)
     delete fTracksegsDataHandler;
     fTracksegsDataHandler=NULL;
   }
+
+  if (pInstance==fClustersDataHandler) {
+    delete fClustersDataHandler;
+    fClustersDataHandler=NULL;
+  }
+
   return 0;
 }