adding first version of the digit publisher component for ITS (Sergey/Kenneth/Gaute)
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Dec 2009 15:41:12 +0000 (15:41 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Dec 2009 15:41:12 +0000 (15:41 +0000)
HLT/ITS/AliHLTITSAgent.cxx
HLT/ITS/AliHLTITSClusterFinderComponent.cxx
HLT/ITS/AliHLTITSClusterFinderComponent.h
HLT/ITS/AliHLTITSClusterHistoComponent.cxx
HLT/ITS/AliHLTITSDigitPublisherComponent.cxx [new file with mode: 0644]
HLT/ITS/AliHLTITSDigitPublisherComponent.h [new file with mode: 0644]
HLT/libAliHLTITS.pkg

index c746aeb8371552dda7e00716e4a6763a46f85bad..432090ad18672f9093da88ff022c8bb1220a571c 100644 (file)
@@ -38,6 +38,7 @@
 #include "AliHLTITSClusterHistoComponent.h"
 #include "AliHLTITSTrackerComponent.h"
 #include "AliHLTITSVertexerSPDComponent.h"
+#include "AliHLTITSDigitPublisherComponent.h"
 
 /** global instance for agent registration */
 AliHLTITSAgent gAliHLTITSAgent;
@@ -154,9 +155,11 @@ int AliHLTITSAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
   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;
 }
index 9bcc91084343bf2b6aea8f581dcc8187a52fc6d6..06820a3a5cfab0be04ae33e879ffd7423c081994 100644 (file)
@@ -65,7 +65,10 @@ AliHLTITSClusterFinderComponent::AliHLTITSClusterFinderComponent(int mode)
   fgeom(NULL),
   fgeomInit(NULL),
   fSPD(NULL),
-  fSSD(NULL)
+  fSSD(NULL),
+  tD(NULL),
+  tR(NULL),
+  fclusters()
 { 
   // see header file for class documentation
   // or
@@ -86,6 +89,10 @@ AliHLTITSClusterFinderComponent::AliHLTITSClusterFinderComponent(int mode)
     fInputDataType  = kAliHLTDataTypeDDLRaw | kAliHLTDataOriginITSSSD;
     fOutputDataType = kAliHLTDataTypeClusters|kAliHLTDataOriginITSSSD;
     break;
+  case kClusterFinderDigits:
+    fInputDataType  = kAliHLTDataTypeTTree|kAliHLTDataOriginITS;
+    fOutputDataType = kAliHLTDataTypeClusters|kAliHLTDataOriginITS;
+    break;
   default:
     HLTFatal("unknown cluster finder");
   }
@@ -117,6 +124,9 @@ const char* AliHLTITSClusterFinderComponent::GetComponentID()
   case kClusterFinderSSD:
     return "ITSClusterFinderSSD";
     break;
+  case kClusterFinderDigits:
+    return "ITSClusterFinderDigits";
+    break;
   }
   return "";
 }
@@ -172,6 +182,9 @@ Int_t AliHLTITSClusterFinderComponent::DoInit( int argc, const char** argv ) {
     fId=AliHLTDAQ::DdlIDOffset("ITSSSD");
     fNddl=AliHLTDAQ::NumberOfDdls("ITSSSD");
   }
+  if(fModeSwitch==kClusterFinderDigits) {
+    //tR = new TTree();
+  }
   else{
      HLTFatal("No mode set for clusterfindercomponent");
   }
@@ -222,6 +235,9 @@ Int_t AliHLTITSClusterFinderComponent::DoInit( int argc, const char** argv ) {
     arguments += argv[i];
   }
 
+  tD = NULL;
+  tR = NULL;
+
   return Configure( arguments.Data() );
 }
 
@@ -284,111 +300,145 @@ int AliHLTITSClusterFinderComponent::DoEvent
     }
   
   // TStopwatch timer;
-
   Int_t ret = 0;
+  //std::vector<AliITSRecPoint> vclusters;
+  if(fModeSwitch==kClusterFinderDigits) {
+    for ( const TObject *iter = GetFirstInputObject(fInputDataType); iter != NULL; iter = GetNextInputObject() ) {  
+      tD = dynamic_cast<TTree*>(const_cast<TObject*>( iter ) );
+      if(!tD){
+       HLTFatal("No Digit Tree found");
+       return -1;
+      }
+      tR = new TTree();
+      fDettype->SetTreeAddressD(tD);
+      fDettype->MakeBranch(tR,"R");
+      fDettype->SetTreeAddressR(tR);
+      Option_t *opt="All";
+      fDettype->DigitsToRecPoints(tD,tR,0,opt,kTRUE);
+      
+      TClonesArray * fRecPoints;
+      tR->SetBranchAddress("ITSRecPoints",&fRecPoints);
+      for(Int_t treeEntry=0;treeEntry<tR->GetEntries();treeEntry++){
+       tR->GetEntry(treeEntry);
+       for(Int_t tCloneEntry=0;tCloneEntry<fRecPoints->GetEntries();tCloneEntry++){
+         AliITSRecPoint *recpoint=(AliITSRecPoint*)fRecPoints->At(tCloneEntry);
+         fclusters.push_back(*recpoint);
+       }
+      }
+      
+      if(tR){
+       tR->Delete();
+      }
+      UInt_t nClusters=fclusters.size();
+      
+      UInt_t bufferSize = nClusters * sizeof(AliHLTITSSpacePointData) + sizeof(AliHLTITSClusterData);
+      if( size + bufferSize > maxBufferSize ){
+       HLTWarning( "Output buffer size exceed (buffer size %d, current size %d)", maxBufferSize, size+bufferSize);
+       ret = -ENOSPC;      
+       break;          
+      }
+      if( nClusters>0 ){
 
-  // -- Loop over blocks
-  for( const AliHLTComponentBlockData* iter = GetFirstInputBlock(fInputDataType); iter != NULL; iter = GetNextInputBlock() ) {
-  
-    // -- Debug output of datatype --
-    HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
+       RecPointToSpacePoint(outputPtr,size);
+       
+       AliHLTComponentBlockData bd;
+       FillBlockData( bd );
+       bd.fOffset = size;
+       bd.fSize = bufferSize;
+       bd.fSpecification = 0x00000000;
+       bd.fDataType = GetOutputDataType();
+       outputBlocks.push_back( bd );
+       size += bufferSize;
+       
+       fclusters.clear();      
+      }
+    }
+  }
+  else{
+      
+    // -- Loop over blocks
+    for( const AliHLTComponentBlockData* iter = GetFirstInputBlock(fInputDataType); iter != NULL; iter = GetNextInputBlock() ) {
+      
+      // -- Debug output of datatype --
+      HLTDebug("Event 0x%08LX (%Lu) received datatype: %s - required datatype: %s",
               evtData.fEventID, evtData.fEventID, 
               DataType2Text(iter->fDataType).c_str(), 
               DataType2Text(fInputDataType).c_str());
-    
-    // -- Check for the correct data type
-    if ( iter->fDataType != (fInputDataType) )  
-      continue;
-    
-    // -- Get equipment ID out of specification
-    AliHLTUInt32_t spec = iter->fSpecification;
-  
-    Int_t id = fId;
-    for ( Int_t ii = 0; ii < fNddl ; ii++ ) {   //number of ddl's
-      if ( spec & 0x00000001 ) {
-       id += ii;
-       break;
+      
+      // -- Check for the correct data type
+      if ( iter->fDataType != (fInputDataType) )  
+       continue;
+      
+      // -- Get equipment ID out of specification
+      AliHLTUInt32_t spec = iter->fSpecification;
+      
+      Int_t id = fId;
+      for ( Int_t ii = 0; ii < fNddl ; ii++ ) {   //number of ddl's
+       if ( spec & 0x00000001 ) {
+         id += ii;
+         break;
+       }
+       spec = spec >> 1 ;
       }
-      spec = spec >> 1 ;
-    }
-    
-    // -- Set equipment ID to the raw reader
-
-    if(!fRawReader->AddBuffer((UChar_t*) iter->fPtr, iter->fSize, id)){
-      HLTWarning("Could not add buffer");
-    }
-    // TStopwatch timer1;
-    
-    std::vector<AliITSRecPoint> vclusters;
-    
-    if(fModeSwitch==kClusterFinderSPD && !fUseOfflineFinder){ fSPD->RawdataToClusters( fRawReader, vclusters ); }
-    else if(fModeSwitch==kClusterFinderSSD && !fUseOfflineFinder){ fSSD->RawdataToClusters( vclusters ); }
-    else{
-      if(fModeSwitch==kClusterFinderSPD && fUseOfflineFinder) {fDettype->DigitsToRecPoints(fRawReader,fClusters,"SPD");}
-      if(fModeSwitch==kClusterFinderSSD && fUseOfflineFinder) {fDettype->DigitsToRecPoints(fRawReader,fClusters,"SSD");}
-      if(fModeSwitch==kClusterFinderSDD) {fDettype->DigitsToRecPoints(fRawReader,fClusters,"SDD");}
-      for(int i=0;i<fNModules;i++){
-       if(fClusters[i] != NULL){
-         for(int j=0;j<fClusters[i]->GetEntriesFast();j++){
-           AliITSRecPoint *recpoint = (AliITSRecPoint*) (fClusters[i]->At(j));
-           vclusters.push_back(*recpoint);
+      
+      // -- Set equipment ID to the raw reader
+      
+      if(!fRawReader->AddBuffer((UChar_t*) iter->fPtr, iter->fSize, id)){
+       HLTWarning("Could not add buffer");
+      }
+      // TStopwatch timer1;
+      
+      if(fModeSwitch==kClusterFinderSPD && !fUseOfflineFinder){ fSPD->RawdataToClusters( fRawReader, fclusters ); }
+      else if(fModeSwitch==kClusterFinderSSD && !fUseOfflineFinder){ fSSD->RawdataToClusters( fclusters ); }
+      else{
+       if(fModeSwitch==kClusterFinderSPD && fUseOfflineFinder) {fDettype->DigitsToRecPoints(fRawReader,fClusters,"SPD");}
+       if(fModeSwitch==kClusterFinderSSD && fUseOfflineFinder) {fDettype->DigitsToRecPoints(fRawReader,fClusters,"SSD");}
+       if(fModeSwitch==kClusterFinderSDD) {fDettype->DigitsToRecPoints(fRawReader,fClusters,"SDD");}
+       for(int i=0;i<fNModules;i++){
+         if(fClusters[i] != NULL){
+           for(int j=0;j<fClusters[i]->GetEntriesFast();j++){
+             AliITSRecPoint *recpoint = (AliITSRecPoint*) (fClusters[i]->At(j));
+             fclusters.push_back(*recpoint);
+           }
+           fClusters[i]->Delete();
+           delete fClusters[i];
          }
-         fClusters[i]->Delete();
-         delete fClusters[i];
-       }
-       fClusters[i] = NULL;
-      }     
-    }
-    
-    // timer1.Stop();
-    // fStatTime+=timer1.RealTime();
-    // fStatTimeC+=timer1.CpuTime();
-    
-    fRawReader->ClearBuffers();    
-
-    UInt_t nClusters=vclusters.size();
-    
-    UInt_t bufferSize = nClusters * sizeof(AliHLTITSSpacePointData) + sizeof(AliHLTITSClusterData);
-    if( size + bufferSize > maxBufferSize ){
-      HLTWarning( "Output buffer size exceed (buffer size %d, current size %d)", maxBufferSize, size+bufferSize);
-      ret = -ENOSPC;      
-      break;           
-    }
-    //cout<<"event "<<fStatNEv<<", nclu="<<nClusters<<":"<<endl;
-    if( nClusters>0 ){
-      AliHLTITSClusterData *outputClusters = reinterpret_cast<AliHLTITSClusterData*>(outputPtr + size);
-      outputClusters->fSpacePointCnt=nClusters;    
-      int clustIdx=0;
-      for(int i=0;i<vclusters.size();i++){
-       AliITSRecPoint *recpoint = (AliITSRecPoint*) &(vclusters[i]);
-       //cout<<recpoint->GetDetectorIndex()<<" "<<recpoint->GetY()<<" "<<recpoint->GetZ()<<endl;
-       outputClusters->fSpacePoints[clustIdx].fY=recpoint->GetY();
-       outputClusters->fSpacePoints[clustIdx].fZ=recpoint->GetZ();
-       outputClusters->fSpacePoints[clustIdx].fSigmaY2=recpoint->GetSigmaY2();
-       outputClusters->fSpacePoints[clustIdx].fSigmaZ2=recpoint->GetSigmaZ2();
-       outputClusters->fSpacePoints[clustIdx].fSigmaYZ=recpoint->GetSigmaYZ();
-       outputClusters->fSpacePoints[clustIdx].fQ=recpoint->GetQ();
-       outputClusters->fSpacePoints[clustIdx].fNy=recpoint->GetNy();
-       outputClusters->fSpacePoints[clustIdx].fNz=recpoint->GetNz();
-       outputClusters->fSpacePoints[clustIdx].fLayer=recpoint->GetLayer();
-       outputClusters->fSpacePoints[clustIdx].fIndex=recpoint->GetDetectorIndex() | recpoint->GetPindex() | recpoint->GetNindex();
-       outputClusters->fSpacePoints[clustIdx].fTracks[0]=recpoint->GetLabel(0);
-       outputClusters->fSpacePoints[clustIdx].fTracks[1]=recpoint->GetLabel(1);
-       outputClusters->fSpacePoints[clustIdx].fTracks[2]=recpoint->GetLabel(2);      
-       clustIdx++;
+         fClusters[i] = NULL;
+       }     
       }
-      AliHLTComponentBlockData bd;
-      FillBlockData( bd );
-      bd.fOffset = size;
-      bd.fSize = bufferSize;
-      bd.fSpecification = iter->fSpecification;
-      bd.fDataType = GetOutputDataType();
-      outputBlocks.push_back( bd );
-      size += bufferSize;
-    }
-
-  } // input blocks
-
+      
+      // timer1.Stop();
+      // fStatTime+=timer1.RealTime();
+      // fStatTimeC+=timer1.CpuTime();
+      
+      fRawReader->ClearBuffers();    
+         
+      UInt_t nClusters=fclusters.size();
+      
+      UInt_t bufferSize = nClusters * sizeof(AliHLTITSSpacePointData) + sizeof(AliHLTITSClusterData);
+      if( size + bufferSize > maxBufferSize ){
+       HLTWarning( "Output buffer size exceed (buffer size %d, current size %d)", maxBufferSize, size+bufferSize);
+       ret = -ENOSPC;      
+       break;          
+      }
+      if( nClusters>0 ){
+
+       RecPointToSpacePoint(outputPtr,size);
+
+       AliHLTComponentBlockData bd;
+       FillBlockData( bd );
+       bd.fOffset = size;
+       bd.fSize = bufferSize;
+       bd.fSpecification = iter->fSpecification;
+       bd.fDataType = GetOutputDataType();
+       outputBlocks.push_back( bd );
+       size += bufferSize;
+       
+       fclusters.clear();      
+      }
+      
+    } // input blocks
+  }
   /*
   timer.Stop();
   
@@ -471,4 +521,25 @@ int AliHLTITSClusterFinderComponent::Reconfigure(const char* cdbEntry, const cha
   
   return iResult;
 }
-
+void AliHLTITSClusterFinderComponent::RecPointToSpacePoint(AliHLTUInt8_t* outputPtr,AliHLTUInt32_t& size){
+  AliHLTITSClusterData *outputClusters = reinterpret_cast<AliHLTITSClusterData*>(outputPtr + size);
+  outputClusters->fSpacePointCnt=fclusters.size();    
+  int clustIdx=0;
+  for(int i=0;i<fclusters.size();i++){
+    AliITSRecPoint *recpoint = (AliITSRecPoint*) &(fclusters[i]);
+    outputClusters->fSpacePoints[clustIdx].fY=recpoint->GetY();
+    outputClusters->fSpacePoints[clustIdx].fZ=recpoint->GetZ();
+    outputClusters->fSpacePoints[clustIdx].fSigmaY2=recpoint->GetSigmaY2();
+    outputClusters->fSpacePoints[clustIdx].fSigmaZ2=recpoint->GetSigmaZ2();
+    outputClusters->fSpacePoints[clustIdx].fSigmaYZ=recpoint->GetSigmaYZ();
+    outputClusters->fSpacePoints[clustIdx].fQ=recpoint->GetQ();
+    outputClusters->fSpacePoints[clustIdx].fNy=recpoint->GetNy();
+    outputClusters->fSpacePoints[clustIdx].fNz=recpoint->GetNz();
+    outputClusters->fSpacePoints[clustIdx].fLayer=recpoint->GetLayer();
+    outputClusters->fSpacePoints[clustIdx].fIndex=recpoint->GetDetectorIndex() | recpoint->GetPindex() | recpoint->GetNindex();
+    outputClusters->fSpacePoints[clustIdx].fTracks[0]=recpoint->GetLabel(0);
+    outputClusters->fSpacePoints[clustIdx].fTracks[1]=recpoint->GetLabel(1);
+    outputClusters->fSpacePoints[clustIdx].fTracks[2]=recpoint->GetLabel(2);      
+    clustIdx++;
+  }
+}
index 257f3bb010717c298d1e9db3a27466d482919f09..de879b9a947783dfc1b172f16ddc30f4b9c4d6ff 100644 (file)
@@ -20,6 +20,7 @@
 #include "AliITSInitGeometry.h"
 #include "TClonesArray.h"
 #include "AliHLTDataTypes.h"
+#include "TTree.h"
 
 class AliHLTITSClusterFinderSPD;
 class AliHLTITSClusterFinderSSD;
@@ -75,7 +76,8 @@ class AliHLTITSClusterFinderComponent : public AliHLTProcessor
   enum {
     kClusterFinderSPD,
     kClusterFinderSDD,
-    kClusterFinderSSD
+    kClusterFinderSSD,
+    kClusterFinderDigits    
   };
   /*
    * ---------------------------------------------------------------------------------
@@ -160,6 +162,8 @@ class AliHLTITSClusterFinderComponent : public AliHLTProcessor
    * properties.
    */
   int Configure(const char* arguments);
+
+  void RecPointToSpacePoint(AliHLTUInt8_t* outputPtr,AliHLTUInt32_t& size);
   /*
    * ---------------------------------------------------------------------------------
    *                             Members - private
@@ -171,6 +175,7 @@ class AliHLTITSClusterFinderComponent : public AliHLTProcessor
    * use fModeSwitch = 0 for SPD
    * use fModeSwitch = 1 for SDD
    * use fModeSwitch = 2 for SSD
+   * use fModeSwitch = 3 for ClusterFinding on Digits (Full ITS)
    */
   Int_t fModeSwitch;      // !
   AliHLTComponentDataType fInputDataType; // !
@@ -189,10 +194,14 @@ class AliHLTITSClusterFinderComponent : public AliHLTProcessor
   AliITSDetTypeRec* fDettype;                                 //!transient
   AliITSgeom* fgeom;                                          //!transient
   AliITSInitGeometry* fgeomInit;                              //!transient
+  AliHLTITSClusterFinderSPD *fSPD;                            //!transient
+  AliHLTITSClusterFinderSSD *fSSD;                            //!transient
 
-  AliHLTITSClusterFinderSPD *fSPD;
-  AliHLTITSClusterFinderSSD *fSSD;
+  TTree *tD;                                                  //!transient
+  TTree *tR;                                                  //!transient
 
+  std::vector<AliITSRecPoint> fclusters;                      //!transient
   /*
   int fStatNEv;
   double fStatTime;
index dd916e56dcbcf8ac186c6d24683be38f154b2990..ed78a806dc0b6d1bc2a52bcc03ee84e939a1bc49 100644 (file)
@@ -46,7 +46,7 @@ AliHLTITSClusterHistoComponent::AliHLTITSClusterHistoComponent()
   fCharge(NULL),   
   fPlotCharge(kFALSE),   
   fPlotXYPhiEta(kTRUE),
-  fOutputSize(5000)
+  fOutputSize(20000)
 {
   // see header file for class documentation
   // or
@@ -73,6 +73,7 @@ void AliHLTITSClusterHistoComponent::GetInputDataTypes(AliHLTComponentDataTypeLi
   list.push_back( kAliHLTDataTypeClusters|kAliHLTDataOriginITSSPD );
   list.push_back( kAliHLTDataTypeClusters|kAliHLTDataOriginITSSDD );
   list.push_back( kAliHLTDataTypeClusters|kAliHLTDataOriginITSSSD );
+  list.push_back( kAliHLTDataTypeClusters|kAliHLTDataOriginITS );
 }
 
 AliHLTComponentDataType AliHLTITSClusterHistoComponent::GetOutputDataType(){
@@ -84,7 +85,7 @@ void AliHLTITSClusterHistoComponent::GetOutputDataSize( unsigned long& constBase
   // see header file for class documentation
   // XXX TODO: Find more realistic values.
   constBase = fOutputSize;
-  inputMultiplier = 2;
+  inputMultiplier = 20;
 }
 
 AliHLTComponent* AliHLTITSClusterHistoComponent::Spawn(){
@@ -163,7 +164,8 @@ int AliHLTITSClusterHistoComponent::DoEvent(const AliHLTComponentEventData& /*ev
   
       if(iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSPD) && 
          iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSDD) && 
-         iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSSD))
+         iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSSD) &&
+        iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITS))    
          continue;
 
       const AliHLTITSClusterData* clusterData = (const AliHLTITSClusterData*) iter->fPtr;
diff --git a/HLT/ITS/AliHLTITSDigitPublisherComponent.cxx b/HLT/ITS/AliHLTITSDigitPublisherComponent.cxx
new file mode 100644 (file)
index 0000000..257fbde
--- /dev/null
@@ -0,0 +1,140 @@
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//*                                                                        *
+//* Primary Authors: Kenneth Aamodt, Sergey Gorbunov                       *
+//*                  for The ALICE HLT Project.                            *
+//*                                                                        *
+//* Permission to use, copy, modify and distribute this software and its   *
+//* documentation strictly for non-commercial purposes is hereby granted   *
+//* without fee, provided that the above copyright notice appears in all   *
+//* copies and that both the copyright notice and this permission notice   *
+//* appear in the supporting documentation. The authors make no claims     *
+//* about the suitability of this software for any purpose. It is          *
+//* provided "as is" without express or implied warranty.                  *
+//**************************************************************************
+
+/** @file   AliHLTITSDigitPublisherComponent.cxx
+    @author Kenneth Aamodt, Sergey Gorbunov
+    @date   
+    @brief  Component to run offline clusterfinders
+*/
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+#include <TSystem.h>
+#include <TROOT.h>
+#include "AliHLTITSDigitPublisherComponent.h" 
+#include "AliRun.h"
+#include "AliRunLoader.h"
+#include "AliGeomManager.h"
+#include "AliITSInitGeometry.h"
+#include "AliITSLoader.h"
+#include "AliCDBManager.h"
+#include "AliLog.h"
+#include "TTree.h"
+#include "TObjArray.h"
+#include "TClonesArray.h"
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTITSDigitPublisherComponent);
+
+AliHLTITSDigitPublisherComponent::AliHLTITSDigitPublisherComponent()
+  :
+  fRunLoader(NULL),
+  fITSLoader(NULL),
+  fNumberOfEvents(0),
+  fEventNumber(0),
+  tD(NULL)
+{ 
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTITSDigitPublisherComponent::~AliHLTITSDigitPublisherComponent() {
+  // see header file for class documentation
+}
+
+// Public functions to implement AliHLTComponent's interface.
+// These functions are required for the registration process
+
+const char* AliHLTITSDigitPublisherComponent::GetComponentID()
+{
+  // see header file for class documentation
+  return "ITSDigitPublisher";
+}
+
+void AliHLTITSDigitPublisherComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
+  // see header file for class documentation
+  list.clear(); 
+  //list.push_back( ???? | ???? );
+}
+
+AliHLTComponentDataType AliHLTITSDigitPublisherComponent::GetOutputDataType() {
+  // see header file for class documentation
+
+  return kAliHLTDataTypeTTree|kAliHLTDataOriginITS;
+}
+
+void AliHLTITSDigitPublisherComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {
+  // see header file for class documentation
+  constBase = 20000;
+  inputMultiplier = 1000;
+}
+
+AliHLTComponent* AliHLTITSDigitPublisherComponent::Spawn() {
+  // see header file for class documentation
+  return new AliHLTITSDigitPublisherComponent();
+}
+       
+Int_t AliHLTITSDigitPublisherComponent::DoInit( int /*argc*/, const char** /*argv*/ ) {
+  // see header file for class documentation
+  
+  if(AliGeomManager::GetGeometry()==NULL){
+    AliGeomManager::LoadGeometry();
+  }
+
+  fRunLoader = GetRunLoader();//AliRunLoader::Open("galice.root");
+  if(!fRunLoader){
+    HLTFatal("No RunLoader found");
+    return -1;
+  }
+  fITSLoader = (AliITSLoader *)(fRunLoader->GetLoader("ITSLoader"));
+  if(!fITSLoader){
+    HLTFatal("No ITS RunLoader found");
+    return -1;
+  }
+  fNumberOfEvents = fRunLoader->GetNumberOfEvents();
+  return 0;
+}
+
+Int_t AliHLTITSDigitPublisherComponent::DoDeinit() {
+  // see header file for class documentation
+
+  return 0;
+}
+
+Int_t AliHLTITSDigitPublisherComponent::GetEvent(const AliHLTComponentEventData& /*evtData*/,AliHLTComponentTriggerData& /*trigData*/)
+{
+  // see header file for class documentation
+  if (!IsDataEvent()) return 0;
+
+  fRunLoader->GetEvent(fEventNumber);
+  fITSLoader->LoadDigits("read");
+  tD = fITSLoader->TreeD();
+  if(!tD){
+    HLTFatal("No Digit Tree found");
+    return -1;
+  } 
+  //tD->GetEntry(fEventNumber);
+  
+  PushBack((TObject*)tD,kAliHLTDataTypeTTree|kAliHLTDataOriginITS,0x00000000);
+  fEventNumber++;
+  return 0;
+}
+
diff --git a/HLT/ITS/AliHLTITSDigitPublisherComponent.h b/HLT/ITS/AliHLTITSDigitPublisherComponent.h
new file mode 100644 (file)
index 0000000..d9e5315
--- /dev/null
@@ -0,0 +1,95 @@
+//-*- Mode: C++ -*-
+#ifndef ALIHLTITSDIGITPUBLISHERCOMPONENT_H
+#define ALIHLTITSDIGITPUBLISHERCOMPONENT_H
+
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//* See cxx source for full Copyright notice                               *
+
+/** @file   AliHLTITSDigitPublisherComponent.cxx
+    @author Kenneth Aamodt, Sergey Gorbunov
+    @date   
+    @brief  Component to run the offline clusterfinder.
+*/
+
+#include "AliHLTOfflineDataSource.h"
+class AliRunLoader;
+class AliITSLoader;
+class TClonesArray;
+class TTree;
+/**
+ * @class AliHLTITSDigitPublisherComponent
+ *
+ */
+class AliHLTITSDigitPublisherComponent : public AliHLTOfflineDataSource
+{
+ public:
+  
+  
+  /** 
+   * constructor
+   */
+  AliHLTITSDigitPublisherComponent();
+
+  /** destructor */
+  virtual ~AliHLTITSDigitPublisherComponent();
+
+  /*
+   * ---------------------------------------------------------------------------------
+   * Public functions to implement AliHLTComponent's interface.
+   * These functions are required for the registration process
+   * ---------------------------------------------------------------------------------
+   */
+
+  /** interface function, see @ref AliHLTComponent for description */
+  const char* GetComponentID();
+
+  /** interface function, see @ref AliHLTComponent for description */
+   void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
+
+  /** interface function, see @ref AliHLTComponent for description */
+  AliHLTComponentDataType GetOutputDataType();
+
+  /** interface function, see @ref AliHLTComponent for description */
+  virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
+
+  /** interface function, see @ref AliHLTComponent for description */
+  AliHLTComponent* Spawn();
+
+ protected:
+       
+  /*
+   * ---------------------------------------------------------------------------------
+   * Protected functions to implement AliHLTComponent's interface.
+   * These functions provide initialization as well as the actual processing
+   * capabilities of the component. 
+   * ---------------------------------------------------------------------------------
+   */
+       
+  /** Initialization */
+  Int_t DoInit( int argc, const char** argv );
+
+  /** DeInitialization */
+  Int_t DoDeinit();
+  
+  /** EventLoop */
+  Int_t GetEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
+
+  ///////////////////////////////////////////////////////////////////////////////////
+    
+ private:
+  /** copy constructor prohibited */
+  AliHLTITSDigitPublisherComponent(const AliHLTITSDigitPublisherComponent&);
+  /** assignment operator prohibited */
+  AliHLTITSDigitPublisherComponent& operator=(const AliHLTITSDigitPublisherComponent&);
+
+  AliRunLoader * fRunLoader;
+  AliITSLoader * fITSLoader;
+  Int_t fNumberOfEvents;
+  Int_t fEventNumber;
+  TTree *tD;
+
+  ClassDef(AliHLTITSDigitPublisherComponent, 0)
+    
+};
+#endif
index 5c43d388eef7c1feb2f96873f5a85a73f21ca737..937225337e4b08a4c74a818aee008feb252c7c3c 100644 (file)
@@ -11,6 +11,7 @@ CLASS_HDRS:=          AliHLTITStrack.h \
                AliHLTITSCompressRawDataSDDComponent.h \
                AliHLTITSSSDQARecPointsComponent.h \
                AliHLTITSQAComponent.h \
+               AliHLTITSDigitPublisherComponent.h \
                tracking/AliITStrackerHLT.h \
                tracking/AliHLTITSTrackerComponent.h \
                tracking/AliHLTITSDetector.h \