]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
run TPC offline clusterer with multiple input blocks for better performance
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Jun 2008 14:00:33 +0000 (14:00 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 Jun 2008 14:00:33 +0000 (14:00 +0000)
HLT/TPCLib/macros/rec-hlt-tpc-offline.C
HLT/TPCLib/offline/AliHLTTPCOfflineClustererComponent.cxx
HLT/TPCLib/offline/AliHLTTPCOfflineClustererComponent.h
HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx
HLT/configure.ac

index 3b31d1455517a99dd0da88d50b980f2914756c95..ec2eea0b598db0ce9f627f068fcbbc2c2e10ff39 100644 (file)
@@ -40,8 +40,18 @@ void rec_hlt_tpc_offline()
   //
   // define the analysis chain to be run
   //
+
+  bool sectorClusterer=true; // run clusterer on sector or DDL level
+  // check if the AliRawReaderMemory supports multiple buffers
+  TClass* info=TClass::GetClass("AliRawReaderMemory");
+  TList* methods=info->GetListOfAllPublicMethods();
+  if (sectorClusterer && !methods->FindObject("AddBuffer")) {
+    cerr << "warning: AliRawReaderMemory does not support multiple buffers, falling back to run clusterer on DDL level" << endl;
+    sectorClusterer=false;
+  }
   int iMinSlice=0;
-  int iMaxSlice=0;
+  int iMaxSlice=17;
   int iMinPart=0;
   int iMaxPart=5;
 
@@ -50,8 +60,9 @@ void rec_hlt_tpc_offline()
   TString writerInput;
   TString trackerInput;
   for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
+    TString arg, clustererInput;
     for (int part=iMinPart; part<=iMaxPart; part++) {
-      TString arg, publisher, cf;
+      TString publisher, cf;
 
       // raw data publisher components
       int ddlno=DDLNoFromSlicePatch(slice, part);
@@ -59,6 +70,7 @@ void rec_hlt_tpc_offline()
       publisher.Form("DP_%02d_%d", slice, part);
       AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
 
+      if (!sectorClusterer) {
       // cluster finder components
       cf.Form("CF_%02d_%d", slice, part);
       AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", publisher.Data(), "");
@@ -67,6 +79,18 @@ void rec_hlt_tpc_offline()
       trackerInput+=cf;
       //if (writerInput.Length()>0) writerInput+=" ";
       //writerInput+=cf;
+      } else {
+       if (clustererInput.Length()>0) clustererInput+=" ";
+       clustererInput+=publisher;
+      }
+    }
+    if (sectorClusterer) {
+      // cluster finder components
+      cf.Form("CF_%02d", slice);
+      AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", clustererInput.Data(), "");
+
+      if (trackerInput.Length()>0) trackerInput+=" ";
+      trackerInput+=cf;
     }
   }
 
index 0d15c2d57817fd85af3d47c80325d5cf29854667..1dc3a65e8c2220468aab9eb54adf483cf840c24a 100644 (file)
@@ -100,6 +100,11 @@ int AliHLTTPCOfflineClustererComponent::DoInit( int argc, const char** argv )
   // Perfom initialisation. Checks arguments (argc,argv)  
   // and make initialisation. Returns 0 if success.  
   //
+#ifdef HAVE_NOT_TPCOFFLINE_REC
+  HLTError("AliRoot version > v4-13-Release required");
+  return -ENOSYS;
+#endif //HAVE_NOT_TPCOFFLINE_REC
+
   int iResult=0;
   HLTInfo("parsing %d arguments", argc);
 
@@ -200,6 +205,11 @@ int AliHLTTPCOfflineClustererComponent::DoEvent( const AliHLTComponentEventData&
   HLTInfo("processing data");
 
   int iResult=0;
+  int commonMinSlice=-1;
+  int commonMaxSlice=-1;
+  int commonMinPatch=-1;
+  int commonMaxPatch=-1;
+
   for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTPC);
        pBlock!=NULL && iResult>=0;
        pBlock=GetNextInputBlock()) {
@@ -216,9 +226,20 @@ int AliHLTTPCOfflineClustererComponent::DoEvent( const AliHLTComponentEventData&
       break;
     }
 
+    if (commonMinPatch<0) {
+      commonMinSlice=slice;
+      commonMaxSlice=slice;
+      commonMinPatch=patch;
+      commonMaxPatch=patch;
+    } else {
+      if (commonMinSlice<slice) commonMinSlice=slice;
+      if (commonMaxSlice>slice) commonMinSlice=slice;
+      if (commonMinPatch<patch) commonMinPatch=patch;
+      if (commonMaxPatch>patch) commonMinPatch=patch;
+    }
+
     if (fRawReader && fClusterer) {
       // setup raw reader and cluster finder
-      fRawReader->SetMemory( reinterpret_cast<UChar_t*>( pBlock->fPtr ), pBlock->fSize );
       int ddlId=AliDAQ::DdlIDOffset("TPC");
       if (patch<2) {
        ddlId+=2*slice+patch;
@@ -226,14 +247,46 @@ int AliHLTTPCOfflineClustererComponent::DoEvent( const AliHLTComponentEventData&
        ddlId+=72;
        ddlId+=4*slice+patch-2;   
       }
+
+#ifdef HAVE_NOT_ALIRAWREADERMEMORY_ADDBUFFER
+      // AliRawReaderMemory does not support mulriple blocks, 
+      // process on block by block basis
+      fRawReader->SetMemory( reinterpret_cast<UChar_t*>( pBlock->fPtr ), pBlock->fSize );
       fRawReader->SetEquipmentID(ddlId);
+      iResult=RunClusterer(pBlock->fSpecification);
+#else //!HAVE_NOT_ALIRAWREADERMEMORY_ADDBUFFER
+      // add all raw data blocks to one clusterer
+      fRawReader->AddBuffer( reinterpret_cast<UChar_t*>( pBlock->fPtr ), pBlock->fSize, ddlId );
+#endif //HAVE_NOT_ALIRAWREADERMEMORY_ADDBUFFER
+    }
+  }
 
+#ifndef HAVE_NOT_ALIRAWREADERMEMORY_ADDBUFFER
+  iResult=RunClusterer(AliHLTTPCDefinitions::EncodeDataSpecification(commonMinSlice, 
+                                                                    commonMaxSlice,
+                                                                    commonMinPatch,
+                                                                    commonMaxPatch));
+  fRawReader->ClearBuffers();
+#endif //HAVE_NOT_ALIRAWREADERMEMORY_ADDBUFFER
+
+  return iResult;
+}
+
+int AliHLTTPCOfflineClustererComponent::RunClusterer(AliHLTUInt32_t outspec)
+{
+  // see header file for class documentation
+  int iResult=0;
+  {
+    if (fRawReader && fClusterer) {
       // run the cluster finder
       fClusterer->Digits2Clusters(fRawReader);
 
       AliTPCClustersRow *clrow = 0x0;
       Int_t nbClusters = 0;
-      TObjArray* outClrow=fClusterer->GetOutputArray();
+      TObjArray* outClrow=NULL;
+#ifndef HAVE_NOT_TPCOFFLINE_REC
+      outClrow=fClusterer->GetOutputArray();
+#endif //HAVE_NOT_TPCOFFLINE_REC
       if (outClrow) {
       Int_t lower   = outClrow->LowerBound();
       Int_t entries = outClrow->GetEntriesFast();
@@ -247,19 +300,18 @@ int AliHLTTPCOfflineClustererComponent::DoEvent( const AliHLTComponentEventData&
       }
 
       // insert TObjArray of clusters into output stream
-      PushBack(outClrow, kAliHLTDataTypeTObjArray|kAliHLTDataOriginTPC/*AliHLTTPCDefinitions::fgkOfflineClustersDataType*/, pBlock->fSpecification);
+      PushBack(outClrow, kAliHLTDataTypeTObjArray|kAliHLTDataOriginTPC/*AliHLTTPCDefinitions::fgkOfflineClustersDataType*/, outspec);
 
       // clear array
       outClrow->Clear();
       }
-      HLTInfo("processing done: DDL %d Number of clusters %d",ddlId, nbClusters);
+      HLTInfo("processing done: Number of clusters %d (specification 0x%08x)", nbClusters, outspec);
 
     } else {
       HLTError("component not initialized");
       iResult=-EFAULT;
     }
   }
-
   return iResult;
 }
 
index 27fe0981b4b9e09d5a50f8b60b5cb843b2c82753..89af4be1b84515d290ea7ecb510c950bb8bf02f7 100644 (file)
@@ -87,6 +87,12 @@ private:
   /** assignment operator prohibited */
   AliHLTTPCOfflineClustererComponent& operator=(const AliHLTTPCOfflineClustererComponent&);
 
+  /**
+   * Run the clusterer and PushBack the clusters with the given specification.
+   * @param outspec    data specification of the output block
+   */
+  int RunClusterer(AliHLTUInt32_t outspec);
+
   /**
    * Configure the component.
    * Parse a string for the configuration arguments and set the component
index c0f1cbfa8527f4ca4f14b39ec932039d2f3e4413..3b796ac68fb49ad6b1fd91d975a41260d28c4678 100644 (file)
@@ -91,9 +91,9 @@ int AliHLTTPCOfflineTrackerComponent::DoInit( int argc, const char** argv )
   // init configuration 
   //
   int iResult=0;
-#ifdef HAVE_NOT_TPC_LOAD_CLUSTERS
-  HLTError("AliRoot version > v4-13-Release required");
-  return -EFAULT;
+#ifdef HAVE_NOT_TPCOFFLINE_REC
+  HLTFatal("AliRoot version > v4-13-Release required");
+  return -ENOSYS;
 #endif
 
   TString argument="";
@@ -188,9 +188,9 @@ int AliHLTTPCOfflineTrackerComponent::DoEvent( const AliHLTComponentEventData& /
 //       if (dynamic_cast<AliTPCClustersRow*>(clusterArray->At(lower))==NULL) continue;
 
       HLTInfo("load %d cluster rows from block %s 0x%08x", clusterArray->GetEntries(), DataType2Text(GetDataType(pObj)).c_str(), GetSpecification(pObj));
-#ifndef HAVE_NOT_TPC_LOAD_CLUSTERS
+#ifndef HAVE_NOT_TPCOFFLINE_REC
       fTracker->LoadClusters(clusterArray);
-#endif //HAVE_NOT_TPC_LOAD_CLUSTERS
+#endif //HAVE_NOT_TPCOFFLINE_REC
     }// end loop over input objects
 
     // set magnetic field for the ESD, assumes correct initialization of
index 55659b3c7d9b07d310754a3d7e611959916df3bf..45c57f927ca747f10c56e83ffbaf586f5cb7aa66 100644 (file)
@@ -267,7 +267,7 @@ if test ! "x$have_aliroot" = "xno" ; then
 
   dnl
   dnl AliRawReaderMemory support for multiple buffers added
-  dnl Jun 2008
+  dnl revision 26829 Jun 2008
   dnl
   CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/RAW"
   have_rawreadermemory_multbuffers=no
@@ -276,7 +276,7 @@ if test ! "x$have_aliroot" = "xno" ; then
                                   rr.AddBuffer(NULL, 0, 0);])],
                  [have_rawreadermemory_multbuffers=yes], 
                 [AC_DEFINE(HAVE_NOT_ALIRAWREADERMEMORY_ADDBUFFER)])
-  AC_MSG_CHECKING(for AliRawReaderMemory for support of multiple buffers)
+  AC_MSG_CHECKING(AliRawReaderMemory support for multiple buffers)
   AC_MSG_RESULT([$have_rawreadermemory_multbuffers])
 
   dnl
@@ -313,18 +313,25 @@ if test ! "x$have_aliroot" = "xno" ; then
     fi
     AC_MSG_RESULT([$have_alitpc])
 
-    have_tpc_load_clusters=no
-    AC_MSG_CHECKING(for on-line features of TPC offline tracker)
+    dnl
+    dnl Check for functionality in the TPC reconstruction required for online
+    dnl processing
+    dnl 
+    have_tpc_hltoffline_rec=no
+    AC_MSG_CHECKING(for on-line features of TPC offline reconstruction)
       ALITPC_LIBS="-lGui -lTPCbase -lTPCrec"
       LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS"
       AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <AliTPCtrackerMI.h>
+                                      #include <AliTPCclustererMI.h>   
                                       #include <TObjArray.h>], 
                                       [AliTPCtrackerMI tracker;
                                       TObjArray* array=NULL;
-                                      tracker.LoadClusters(array);])],
-                                      [have_tpc_load_clusters=yes], 
-                                     [AC_DEFINE(HAVE_NOT_TPC_LOAD_CLUSTERS)])
-    AC_MSG_RESULT([$have_tpc_load_clusters])
+                                      tracker.LoadClusters(array);
+                                      AliTPCclustererMI cl(NULL, NULL);
+                                      cl.GetOutputArray();])],
+                                      [have_tpc_hltoffline_rec=yes], 
+                                     [AC_DEFINE(HAVE_NOT_TPCOFFLINE_REC)])
+    AC_MSG_RESULT([$have_tpc_hltoffline_rec])
 
   fi
   AC_CHECK_HEADER([AliTPCCalibPulser.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPULSER)])