]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/ITS/AliHLTITSAgent.cxx
automatically added data sink components are now added directly to the internal insta...
[u/mrichter/AliRoot.git] / HLT / ITS / AliHLTITSAgent.cxx
index c1515c9069603fc4dcccd75f31169bfcdf9762ab..edf67d31513d4f97053c48d648d9fc9eb203a9fa 100644 (file)
 //* provided "as is" without express or implied warranty.                  *
 //**************************************************************************
 
-/** @file   AliHLTITSAgent.cxx
-    @author Matthias Richter
-    @date   25.08.2008
-    @brief  Agent of the libAliHLTITS library
-*/
+/ @file   AliHLTITSAgent.cxx
+//  @author Matthias Richter
+//  @date   25.08.2008
+//  @brief  Agent of the libAliHLTITS library
+//  @note
 
 #include <cassert>
 #include "AliHLTITSAgent.h"
-#include "AliHLTConfiguration.h"
 #include "AliHLTOUT.h"
 #include "AliHLTDAQ.h"
 
 // header files of library components
-
-// header file of the module preprocessor
 #include "AliHLTITSCompressRawDataSDDComponent.h"
+#include "AliHLTITSSSDQARecPointsComponent.h"
+#include "AliHLTITSQAComponent.h"
 #include "AliHLTITSClusterFinderComponent.h"
 #include "AliHLTITSClusterHistoComponent.h"
 #include "AliHLTITSTrackerComponent.h"
+#include "AliHLTITSVertexerSPDComponent.h"
+#include "AliHLTITSDigitPublisherComponent.h"
+
+// header file of the module preprocessor
+// none at the moment
 
 /** global instance for agent registration */
 AliHLTITSAgent gAliHLTITSAgent;
@@ -73,6 +77,8 @@ int AliHLTITSAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
   // ITS tracking is currently only working on raw data
   // to run on digits, a digit publisher needs to be implemented
 
+  TString trackerInput="";
+  TString vertexerSPDInput="";
   if (rawReader || !runloader) {
     // AliSimulation: use the AliRawReaderPublisher if the raw reader is available
     // Alireconstruction: indicated by runloader==NULL, run always on raw data
@@ -82,21 +88,85 @@ int AliHLTITSAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
     // define the ITS cluster finder configurations
     //
 
-    TString trackerInput;
-    for (int detectorId=0; detectorId<3; detectorId++) {
-      iResult=CreateCFConfigurations(handler, detectorId, trackerInput);
-    }
+    TString spdCF;
+    TString ssdCF;
+    TString sddCF;
+    
+    iResult=CreateCFConfigurations(handler, AliHLTDAQ::DetectorID("ITSSPD"), spdCF);
+    handler->CreateConfiguration("ITS-SPD-CF","BlockFilter",spdCF.Data(),"");
+
+    iResult=CreateCFConfigurations(handler, AliHLTDAQ::DetectorID("ITSSDD"), sddCF);
+    handler->CreateConfiguration("ITS-SDD-CF","BlockFilter",sddCF.Data(),"");
+
+    iResult=CreateCFConfigurations(handler, AliHLTDAQ::DetectorID("ITSSSD"), ssdCF);
+    handler->CreateConfiguration("ITS-SSD-CF","BlockFilter",ssdCF.Data(),"");
+
+
+    ///////////////////////////////////////////////////////////////////////////////////////////////////
+    //
+    // define the SPD vertexer Z input
+    //
+    vertexerSPDInput="ITS-SPD-CF";
+
+    ///////////////////////////////////////////////////////////////////////////////////////////////////
+    //
+    // define the ITS tracker input
+    //
+    trackerInput="ITS-SPD-CF ITS-SDD-CF ITS-SSD-CF";
+  }
+  else if (runloader && !rawReader) {
+    // indicates AliSimulation with no RawReader available -> run on digits
 
     ///////////////////////////////////////////////////////////////////////////////////////////////////
     //
-    // define the ITS tracker configuration
+    // define the Digit Publisher and ITS cluster finder configuration
     //
+    handler->CreateConfiguration("DigitPublisher","AliLoaderPublisher",NULL,"-loader ITSLoader -datatype 'ALITREED' 'ITS '");
+    handler->CreateConfiguration("DigitClusterFinder","ITSClusterFinderDigits","DigitPublisher","");
+    
+    ///////////////////////////////////////////////////////////////////////////////////////////////////
+    //
+    // define the SPD vertexer Z input.
+    //
+    // Can not run on Digit ClusterFinder. Wrong inputtype. And wrong input data.
+    // If this is fixed in the VertexerSPD it needs to implement the data type
+    // handling for the ITS digits and ignore the input from the SDD and SSD
+    //vertexerSPDInput="DigitClusterFinder";
+    
+    ///////////////////////////////////////////////////////////////////////////////////////////////////
+    //
+    // define the ITS tracker input
+    //
+    // Currently there is a seg fault in the TTree access from the DigitClusterFinder
+    // needs first to be investigated
+    trackerInput="DigitClusterFinder";
+  }
+
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // define the SPD vertexer Z configuration
+  //
+  if (!vertexerSPDInput.IsNull()) {
+    handler->CreateConfiguration("ITS-SPD-vertexer","ITSVertexerSPD", vertexerSPDInput, "");
+  }
+
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // define the ITS tracker configuration
+  //
+  if (!trackerInput.IsNull()) {
     if (handler->FindConfiguration("TPC-globalmerger")) {
+      // add the TPC tracking if available
       trackerInput+=" TPC-globalmerger";
     }
+    if (handler->FindConfiguration("TPC-mcTrackMarker")) {
+      // add the TPC tracking if available
+      trackerInput+=" TPC-mcTrackMarker";
+    }
     handler->CreateConfiguration("ITS-tracker","ITSTracker",trackerInput.Data(),"");
   }
-  return 0;
+
+  return iResult;
 }
 
 const char* AliHLTITSAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
@@ -128,11 +198,16 @@ int AliHLTITSAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
   assert(pHandler);
   if (!pHandler) return -EINVAL;
   pHandler->AddComponent(new AliHLTITSCompressRawDataSDDComponent);
+  pHandler->AddComponent(new AliHLTITSSSDQARecPointsComponent);
+  pHandler->AddComponent(new AliHLTITSQAComponent);
   pHandler->AddComponent(new AliHLTITSClusterFinderComponent(AliHLTITSClusterFinderComponent::kClusterFinderSPD));
   pHandler->AddComponent(new AliHLTITSClusterFinderComponent(AliHLTITSClusterFinderComponent::kClusterFinderSDD));
   pHandler->AddComponent(new AliHLTITSClusterFinderComponent(AliHLTITSClusterFinderComponent::kClusterFinderSSD));
+  pHandler->AddComponent(new AliHLTITSClusterFinderComponent(AliHLTITSClusterFinderComponent::kClusterFinderDigits));
   pHandler->AddComponent(new AliHLTITSClusterHistoComponent);
   pHandler->AddComponent(new AliHLTITSTrackerComponent);
+  pHandler->AddComponent(new AliHLTITSVertexerSPDComponent);
+  pHandler->AddComponent(new AliHLTITSDigitPublisherComponent);
 
   return 0;
 }
@@ -258,29 +333,47 @@ int AliHLTITSAgent::CreateCFConfigurations(AliHLTConfigurationHandler* pHandler,
   }
 
   int minddl=AliHLTDAQ::DdlIDOffset(detectorId);
-  int maxddl=minddl+=AliHLTDAQ::NumberOfDdls(detectorId);
+  int maxddl=minddl+AliHLTDAQ::NumberOfDdls(detectorId)-1;
   int spec=0x1;
   int ddlno=0;
 
+  // this is a simple switch for experimenting with different configurations
+  // it's supposed to be false for normal compilation
+  bool bOneCFperDDL=false;
   TString origin=idString; origin.ReplaceAll("ITS", "I");
   TString cfBase=idString; cfBase+="_CF";
   TString componentId=idString; componentId.ReplaceAll("ITS", "ITSClusterFinder");
+  TString cfinput, cf;
   for(ddlno=minddl;ddlno<=maxddl;ddlno++){  
-    TString arg, publisher, cf;
+    TString arg, publisher;
  
     // the HLT origin defines are 4 chars: ISPD, ISSD, ISDD respectively
-    arg.Form("-minid %d -datatype 'DDL_RAW ' '%s' -dataspec 0x%08x -verbose",ddlno, origin.Data(), spec);
+    arg.Form("-minid %d -datatype 'DDL_RAW ' '%s' -dataspec 0x%08x",ddlno, origin.Data(), spec);
+    if (CheckFilter(kHLTLogDebug)) arg+=" -verbose";
     publisher.Form("ITS-DP_%d", ddlno);
     pHandler->CreateConfiguration(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
 
+    if (cfinput.Length()>0) cfinput+=" ";
+    cfinput+=publisher;
+
+    if (bOneCFperDDL) {
     cf.Form("%s_%d",cfBase.Data(), ddlno);
     pHandler->CreateConfiguration(cf.Data(), componentId.Data(), publisher.Data(), "");
 
     if (output.Length()>0) output+=" ";
     output+=cf;
+    }
 
     spec=spec<<1;
   }
+
+  if (!bOneCFperDDL) {
+    cf.Form("%s",cfBase.Data());
+    pHandler->CreateConfiguration(cf.Data(), componentId.Data(), cfinput.Data(), "");
+
+    if (output.Length()>0) output+=" ";
+    output+=cf;
+  }
   
   return 0;
 }