]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Add ITS clusterfinder for SPD and SSD (Gaute)
authorjthaeder <jthaeder@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Mar 2009 19:35:28 +0000 (19:35 +0000)
committerjthaeder <jthaeder@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Mar 2009 19:35:28 +0000 (19:35 +0000)
- Update ITS Agent (Gaute)
- Update pkg and cmake file (Gaute)
- Add test macros (Gaute)

HLT/CMake_libAliHLTITS.txt
HLT/ITS/AliHLTITSAgent.cxx
HLT/ITS/AliHLTITSClusterFinderSPDComponent.cxx [new file with mode: 0644]
HLT/ITS/AliHLTITSClusterFinderSPDComponent.h [new file with mode: 0644]
HLT/ITS/AliHLTITSClusterFinderSSDComponent.cxx [new file with mode: 0644]
HLT/ITS/AliHLTITSClusterFinderSSDComponent.h [new file with mode: 0644]
HLT/ITS/macros/rec-spd-cluster.C [new file with mode: 0644]
HLT/ITS/macros/rec-ssd-cluster.C [new file with mode: 0644]
HLT/libAliHLTITS.pkg

index 6b71a84d4a2525a4106e3d3b5bdc6aae75933d22..00642c93c87506e2f6838541814c50391e877b21 100644 (file)
@@ -5,6 +5,10 @@ ITS/AliHLTITStrack.cxx
 ITS/AliHLTITStracker.cxx
 ITS/AliHLTITSVertexerZ.cxx
 ITS/AliHLTITSclusterer.cxx
+ITS/AliHLTITSAgent.cxx
+ITS/AliHLTITSClusterFinderSPDComponent.cxx
+ITS/AliHLTITSClusterFinderSSDComponent.cxx
+ITS/AliHLTITSCompressRawDataSDDComponent.cxx
 )
 
 # fill list of header files from list of source files
index 358f99b53b2d797193785140ce4ec448be8f48b0..856389bd12bd0368d84127c39da9471535dc1a16 100644 (file)
@@ -32,6 +32,8 @@
 
 // header file of the module preprocessor
 #include "AliHLTITSCompressRawDataSDDComponent.h"
+#include "AliHLTITSClusterFinderSPDComponent.h"
+#include "AliHLTITSClusterFinderSSDComponent.h"
 
 /** global instance for agent registration */
 AliHLTITSAgent gAliHLTITSAgent;
@@ -84,6 +86,8 @@ int AliHLTITSAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
   assert(pHandler);
   if (!pHandler) return -EINVAL;
   pHandler->AddComponent(new AliHLTITSCompressRawDataSDDComponent);
+  pHandler->AddComponent(new AliHLTITSClusterFinderSPDComponent);
+  pHandler->AddComponent(new AliHLTITSClusterFinderSSDComponent);
 
   return 0;
 }
diff --git a/HLT/ITS/AliHLTITSClusterFinderSPDComponent.cxx b/HLT/ITS/AliHLTITSClusterFinderSPDComponent.cxx
new file mode 100644 (file)
index 0000000..b1f03d4
--- /dev/null
@@ -0,0 +1,248 @@
+
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//*                                                                        *
+//* Primary Authors: Gaute Øvrebekk <st05886@alf.uib.no>                   *
+//*                  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   AliHLTITSClusterFinderSPDComponent.cxx
+    @author Gaute Øvrebekk <st05886@alf.uib.no>
+    @date   
+    @brief  Component to run offline clusterfinder for SPD
+*/
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+#include "AliHLTITSClusterFinderSPDComponent.h" 
+
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+#include "AliHLTDataTypes.h"
+#include "AliITSgeomTGeo.h"
+#include "AliITSRecPoint.h"
+
+#include <cstdlib>
+#include <cerrno>
+#include "TString.h"
+#include "TObjString.h"
+#include <sys/time.h>
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTITSClusterFinderSPDComponent);
+
+AliHLTITSClusterFinderSPDComponent::AliHLTITSClusterFinderSPDComponent()
+  :
+  fNModules(240),
+  fClusterFinder(NULL),
+  fRawReader(NULL),
+  fDettype(NULL),
+  fClusters(NULL),
+  fcal(NULL),
+  fgeom(NULL),
+  fgeomInit(NULL){
+  //fRawReaderOff(NULL),
+  //fRawStream(NULL),
+  //fNModules(AliITSgeomTGeo::GetNModules()),
+  //fNModules(AliITSDetTupeRec::fgkDefaultNModulesSPD),
+  
+  
+
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTITSClusterFinderSPDComponent::~AliHLTITSClusterFinderSPDComponent() {
+  // see header file for class documentation
+}
+
+// Public functions to implement AliHLTComponent's interface.
+// These functions are required for the registration process
+
+const char* AliHLTITSClusterFinderSPDComponent::GetComponentID()
+{
+  // see header file for class documentation
+
+  return "ITSClusterFinderSPD";
+}
+
+void AliHLTITSClusterFinderSPDComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
+  // see header file for class documentation
+  list.clear(); 
+  list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginITSSPD );
+
+}
+
+AliHLTComponentDataType AliHLTITSClusterFinderSPDComponent::GetOutputDataType() {
+  // see header file for class documentation
+  return kAliHLTDataTypeTObjArray;
+}
+
+void AliHLTITSClusterFinderSPDComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {
+  // see header file for class documentation
+
+  constBase = 0;
+  inputMultiplier = 0.3;
+}
+
+AliHLTComponent* AliHLTITSClusterFinderSPDComponent::Spawn() {
+  // see header file for class documentation
+  return new AliHLTITSClusterFinderSPDComponent();
+}
+       
+Int_t AliHLTITSClusterFinderSPDComponent::DoInit( int /*argc*/, const char** /*argv*/ ) {
+  // see header file for class documentation
+
+  if ( fClusterFinder )
+    return EINPROGRESS;
+
+  fClusters = new TClonesArray*[fNModules]; 
+  for (Int_t iModule = 0; iModule < fNModules; iModule++) {
+    fClusters[iModule] = NULL;
+  }
+
+  fcal = new AliITSCalibrationSPD();
+  //fgeomInit = new AliITSInitGeometry(kvSPD02,2);
+  fgeomInit = new AliITSInitGeometry(kvPPRasymmFMD,2);
+  fgeom = fgeomInit->CreateAliITSgeom();
+  
+  //set dettype
+  fDettype = new AliITSDetTypeRec();
+  fDettype->SetITSgeom(fgeom);
+  for (Int_t iModule = 0; iModule < fNModules; iModule++) {
+    fDettype->SetCalibrationModel(iModule,fcal);
+  }
+  
+  fClusterFinder = new AliITSClusterFinderV2SPD(fDettype); 
+
+  if ( fRawReader )
+    return EINPROGRESS;
+
+  fRawReader = new AliRawReaderMemory();
+
+  return 0;
+}
+
+Int_t AliHLTITSClusterFinderSPDComponent::DoDeinit() {
+  // see header file for class documentation
+
+  if ( fRawReader )
+    delete fRawReader;
+  fRawReader = NULL;
+
+  if ( fClusterFinder )
+    delete fClusterFinder;
+  fClusterFinder = NULL;
+
+  return 0;
+}
+
+Int_t AliHLTITSClusterFinderSPDComponent::DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& /*trigData*/)
+{  // see header file for class documentation
+
+  // -- Iterator over Data Blocks --
+  const AliHLTComponentBlockData* iter = NULL;
+  
+  if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )){
+    return 0;
+  }
+
+  if (!IsDataEvent()) return 0;
+
+  if ( evtData.fBlockCnt<=0 )
+      {
+       Logging( kHLTLogWarning, "HLT::ITSClusterFinderSPD::DoEvent", "DoEvent", "no blocks in event" );
+       return 0;
+      }
+
+  // -- Loop over blocks
+  for ( iter = GetFirstInputBlock(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginITSSPD); 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(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginITSSPD).c_str());
+    
+    // -- Check for the correct data type
+    if ( iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginITSSPD) )   //Add SPD to data origin????????
+      continue;
+    
+    // -- Set RawReader
+    //fRawReader->SetMemory( (UChar_t*) iter->fPtr, iter->fSize );
+    
+    // -- Get equipment ID out of specification
+    AliHLTUInt32_t spec = iter->fSpecification;
+  
+    if(spec>0x00040000){
+      HLTDebug("The Spec is to high for ITS SPD");
+    }
+
+    Int_t id = 0;
+    for ( Int_t ii = 1; ii < 20 ; ii++ ) {   //number of ddl's
+      if ( spec & 0x00000001 ) {
+       id += ii;
+       break;
+      }
+      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");
+    }
+    
+    fClusterFinder->RawdataToClusters(fRawReader,fClusters);
+    
+    /*
+    for(int i=0;i<fNModules;i++){
+      if(fClusters[i] != NULL){
+      for(int j=0;j<fClusters[i]->GetEntries();j++){
+         AliITSRecPoint *recpoint = (AliITSRecPoint*) fClusters[i]->At(j);
+         cout<<"Cluster: X: "<<recpoint->GetX()<<" Y: "<<recpoint->GetY()<<" Z: "<<recpoint->GetZ()<<endl;
+       }
+      }
+    }
+    */
+
+    PushBack(*fClusters,kAliHLTDataTypeTObjArray|kAliHLTDataOriginITSSPD,iter->fSpecification);
+    
+    /*  
+    for(int i=0;i<fNModules;i++){
+      if(fClusters[i] != NULL){
+       PushBack(fClusters[i],kAliHLTDataTypeTObjArray|kAliHLTDataOriginITSSPD,iter->fSpecification);
+       }
+    }
+    */
+
+    /*
+    for (Int_t iModule = 0; iModule < fNModules; iModule++) {           
+      fClusters[iModule] = NULL;
+    }
+    */
+    fRawReader->ClearBuffers();
+    
+  } //  for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ) {    
+  
+    //fClusterFinder->RawdataToClusters(fRawReader,&fClusters);
+  
+  //PushBack( (TObject**) fClusters,kAliHLTDataTypeTObjArray,0x00000000);
+
+  return 0;
+}
diff --git a/HLT/ITS/AliHLTITSClusterFinderSPDComponent.h b/HLT/ITS/AliHLTITSClusterFinderSPDComponent.h
new file mode 100644 (file)
index 0000000..b75f9b4
--- /dev/null
@@ -0,0 +1,130 @@
+
+#ifndef ALIHLTITSCLUSTERFINDERSPDCOMPONENT_H
+#define ALIHLTITSCLUSTERFINDERSPDCOMPONENT_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   AliHLTITSClusterFinderSPDComponent.cxx
+    @author Gaute Øvrebekk <st05886@alf.uib.no>
+    @date   
+    @brief  Component to run the offline clusterfinder.
+*/
+
+#include "AliHLTProcessor.h"
+#include "AliRawReaderMemory.h"
+#include "AliITSClusterFinderV2SPD.h"
+#include "TClonesArray.h"
+#include "AliITSDetTypeRec.h"
+#include "AliITSCalibrationSPD.h"
+#include "AliITSgeom.h"
+#include "AliITSInitGeometry.h"
+
+/**
+ * @class AliHLTITSClusterFinderSPDComponent
+ * Component to run the offline clusterfinder.
+ *
+ * @ingroup alihlt_its_components
+ */
+
+class AliHLTITSClusterFinderSPDComponent : public AliHLTProcessor
+{
+ public:
+
+  /*
+   * ---------------------------------------------------------------------------------
+   *                            Constructor / Destructor
+   * ---------------------------------------------------------------------------------
+   */
+  
+  /** constructor */
+  AliHLTITSClusterFinderSPDComponent();
+
+  /** destructor */
+  virtual ~AliHLTITSClusterFinderSPDComponent();
+
+  /*
+   * ---------------------------------------------------------------------------------
+   * 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();
+  
+  Int_t fNModules;             // total number of modules
+
+  /** EventLoop */
+  //Int_t DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
+  //    AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr
+  //    ,AliHLTUInt32_t& size, AliHLTComponentBlockList& outputBlocks);
+
+  Int_t DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/);
+               
+  using AliHLTProcessor::DoEvent;
+  ///////////////////////////////////////////////////////////////////////////////////
+    
+    private:
+  
+  /** copy constructor prohibited */
+  AliHLTITSClusterFinderSPDComponent(const AliHLTITSClusterFinderSPDComponent&);
+  /** assignment operator prohibited */
+  AliHLTITSClusterFinderSPDComponent& operator=(const AliHLTITSClusterFinderSPDComponent&);
+
+  /*
+   * ---------------------------------------------------------------------------------
+   *                             Members - private
+   * ---------------------------------------------------------------------------------
+   */
+
+  /** the cluster finder object */
+  AliITSClusterFinderV2SPD* fClusterFinder;                   //!transient
+
+  /** the reader object for data decoding */
+  AliRawReaderMemory* fRawReader;                             //!transient
+
+  AliITSDetTypeRec* fDettype;                                 //!transient
+
+  TClonesArray** fClusters;                                   //!transient
+
+  AliITSCalibrationSPD* fcal;                                 //!transient
+
+  AliITSgeom* fgeom;                                          //!transient
+
+  AliITSInitGeometry* fgeomInit;                              //!transient
+  
+  ClassDef(AliHLTITSClusterFinderSPDComponent, 0)
+    
+    };
+#endif
diff --git a/HLT/ITS/AliHLTITSClusterFinderSSDComponent.cxx b/HLT/ITS/AliHLTITSClusterFinderSSDComponent.cxx
new file mode 100644 (file)
index 0000000..b26baae
--- /dev/null
@@ -0,0 +1,248 @@
+
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//*                                                                        *
+//* Primary Authors: Gaute Øvrebekk <st05886@alf.uib.no>                   *
+//*                  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   AliHLTITSClusterFinderSSDComponent.cxx
+    @author Gaute Øvrebekk <st05886@alf.uib.no>
+    @date   
+    @brief  Component to run offline clusterfinder for SSD
+*/
+
+#if __GNUC__>= 3
+using namespace std;
+#endif
+
+#include "AliHLTITSClusterFinderSSDComponent.h" 
+
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+#include "AliHLTDataTypes.h"
+#include "AliITSgeomTGeo.h"
+#include "AliITSRecPoint.h"
+
+#include <cstdlib>
+#include <cerrno>
+#include "TString.h"
+#include "TObjString.h"
+#include <sys/time.h>
+
+/** ROOT macro for the implementation of ROOT specific class methods */
+ClassImp(AliHLTITSClusterFinderSSDComponent);
+
+AliHLTITSClusterFinderSSDComponent::AliHLTITSClusterFinderSSDComponent()
+  :
+  fNModules(1698),
+  fClusterFinder(NULL),
+  fRawReader(NULL),
+  fDettype(NULL),
+  fClusters(NULL),
+  fcal(NULL),
+  fgeom(NULL),
+  fgeomInit(NULL){
+  //fRawReaderOff(NULL),
+  //fRawStream(NULL),
+  //fNModules(AliITSgeomTGeo::GetNModules()),
+  //fNModules(AliITSDetTupeRec::fgkDefaultNModulesSSD),
+  
+  
+
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+}
+
+AliHLTITSClusterFinderSSDComponent::~AliHLTITSClusterFinderSSDComponent() {
+  // see header file for class documentation
+}
+
+// Public functions to implement AliHLTComponent's interface.
+// These functions are required for the registration process
+
+const char* AliHLTITSClusterFinderSSDComponent::GetComponentID()
+{
+  // see header file for class documentation
+
+  return "ITSClusterFinderSSD";
+}
+
+void AliHLTITSClusterFinderSSDComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list) {
+  // see header file for class documentation
+  list.clear(); 
+  list.push_back( kAliHLTDataTypeDDLRaw | kAliHLTDataOriginITSSSD );
+
+}
+
+AliHLTComponentDataType AliHLTITSClusterFinderSSDComponent::GetOutputDataType() {
+  // see header file for class documentation
+  return kAliHLTDataTypeTObjArray;
+}
+
+void AliHLTITSClusterFinderSSDComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {
+  // see header file for class documentation
+
+  constBase = 0;
+  inputMultiplier = 0.3;
+}
+
+AliHLTComponent* AliHLTITSClusterFinderSSDComponent::Spawn() {
+  // see header file for class documentation
+  return new AliHLTITSClusterFinderSSDComponent();
+}
+       
+Int_t AliHLTITSClusterFinderSSDComponent::DoInit( int /*argc*/, const char** /*argv*/ ) {
+  // see header file for class documentation
+
+  if ( fClusterFinder )
+    return EINPROGRESS;
+
+  fClusters = new TClonesArray*[fNModules]; 
+  for (Int_t iModule = 0; iModule < fNModules; iModule++) {
+    fClusters[iModule] = NULL;
+  }
+
+  fcal = new AliITSCalibrationSSD();
+  //fgeomInit = new AliITSInitGeometry(kvSSD02,2);
+  fgeomInit = new AliITSInitGeometry(kvPPRasymmFMD,2);
+  fgeom = fgeomInit->CreateAliITSgeom();
+  
+  //set dettype
+  fDettype = new AliITSDetTypeRec();
+  fDettype->SetITSgeom(fgeom);
+  for (Int_t iModule = 0; iModule < fNModules; iModule++) {
+    fDettype->SetCalibrationModel(iModule,fcal);
+  }
+  
+  fClusterFinder = new AliITSClusterFinderV2SSD(fDettype); 
+
+  if ( fRawReader )
+    return EINPROGRESS;
+
+  fRawReader = new AliRawReaderMemory();
+
+  return 0;
+}
+
+Int_t AliHLTITSClusterFinderSSDComponent::DoDeinit() {
+  // see header file for class documentation
+
+  if ( fRawReader )
+    delete fRawReader;
+  fRawReader = NULL;
+
+  if ( fClusterFinder )
+    delete fClusterFinder;
+  fClusterFinder = NULL;
+
+  return 0;
+}
+
+Int_t AliHLTITSClusterFinderSSDComponent::DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& /*trigData*/)
+{  // see header file for class documentation
+
+  // -- Iterator over Data Blocks --
+  const AliHLTComponentBlockData* iter = NULL;
+  
+  if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )){
+    return 0;
+  }
+
+  if (!IsDataEvent()) return 0;
+
+  if ( evtData.fBlockCnt<=0 )
+      {
+       Logging( kHLTLogWarning, "HLT::ITSClusterFinderSSD::DoEvent", "DoEvent", "no blocks in event" );
+       return 0;
+      }
+
+  // -- Loop over blocks
+  for ( iter = GetFirstInputBlock(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginITSSSD); 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(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginITSSSD).c_str());
+    
+    // -- Check for the correct data type
+    if ( iter->fDataType != (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginITSSSD) )   //Add SSD to data origin????????
+      continue;
+    
+    // -- Set RawReader
+    //fRawReader->SetMemory( (UChar_t*) iter->fPtr, iter->fSize );
+    
+    // -- Get equipment ID out of specification
+    AliHLTUInt32_t spec = iter->fSpecification;
+  
+    if(spec>0x00040000){
+      HLTDebug("The Spec is to high for ITS SSD");
+    }
+
+    Int_t id = 0;                  //what should be here, 512???
+    for ( Int_t ii = 1; ii < 16 ; ii++ ) {   //number of ddl's
+      if ( spec & 0x00000001 ) {
+       id += ii;
+       break;
+      }
+      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");
+    }
+    
+    fClusterFinder->RawdataToClusters(fRawReader,fClusters);
+    
+    /*
+    for(int i=0;i<fNModules;i++){
+      if(fClusters[i] != NULL){
+      for(int j=0;j<fClusters[i]->GetEntries();j++){
+         AliITSRecPoint *recpoint = (AliITSRecPoint*) fClusters[i]->At(j);
+         cout<<"Cluster: X: "<<recpoint->GetX()<<" Y: "<<recpoint->GetY()<<" Z: "<<recpoint->GetZ()<<endl;
+       }
+      }
+    }
+    */
+
+    PushBack(*fClusters,kAliHLTDataTypeTObjArray|kAliHLTDataOriginITSSSD,iter->fSpecification);
+    
+    /*  
+    for(int i=0;i<fNModules;i++){
+      if(fClusters[i] != NULL){
+       PushBack(fClusters[i],kAliHLTDataTypeTObjArray|kAliHLTDataOriginITSSSD,iter->fSpecification);
+       }
+    }
+    */
+
+    /*
+    for (Int_t iModule = 0; iModule < fNModules; iModule++) {           
+      fClusters[iModule] = NULL;
+    }
+    */
+    fRawReader->ClearBuffers();
+    
+  } //  for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ) {    
+  
+    //fClusterFinder->RawdataToClusters(fRawReader,&fClusters);
+  
+  //PushBack( (TObject**) fClusters,kAliHLTDataTypeTObjArray,0x00000000);
+
+  return 0;
+}
diff --git a/HLT/ITS/AliHLTITSClusterFinderSSDComponent.h b/HLT/ITS/AliHLTITSClusterFinderSSDComponent.h
new file mode 100644 (file)
index 0000000..1f5e782
--- /dev/null
@@ -0,0 +1,130 @@
+
+#ifndef ALIHLTITSCLUSTERFINDERSSDCOMPONENT_H
+#define ALIHLTITSCLUSTERFINDERSSDCOMPONENT_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   AliHLTITSClusterFinderSSDComponent.cxx
+    @author Gaute Øvrebekk <st05886@alf.uib.no>
+    @date   
+    @brief  Component to run the offline clusterfinder.
+*/
+
+#include "AliHLTProcessor.h"
+#include "AliRawReaderMemory.h"
+#include "AliITSClusterFinderV2SSD.h"
+#include "TClonesArray.h"
+#include "AliITSDetTypeRec.h"
+#include "AliITSCalibrationSSD.h"
+#include "AliITSgeom.h"
+#include "AliITSInitGeometry.h"
+
+/**
+ * @class AliHLTITSClusterFinderSSDComponent
+ * Component to run the offline clusterfinder.
+ *
+ * @ingroup alihlt_its_components
+ */
+
+class AliHLTITSClusterFinderSSDComponent : public AliHLTProcessor
+{
+ public:
+
+  /*
+   * ---------------------------------------------------------------------------------
+   *                            Constructor / Destructor
+   * ---------------------------------------------------------------------------------
+   */
+  
+  /** constructor */
+  AliHLTITSClusterFinderSSDComponent();
+
+  /** destructor */
+  virtual ~AliHLTITSClusterFinderSSDComponent();
+
+  /*
+   * ---------------------------------------------------------------------------------
+   * 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();
+  
+  Int_t fNModules;             // total number of modules
+
+  /** EventLoop */
+  //Int_t DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
+  //    AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr
+  //    ,AliHLTUInt32_t& size, AliHLTComponentBlockList& outputBlocks);
+
+  Int_t DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/);
+               
+  using AliHLTProcessor::DoEvent;
+  ///////////////////////////////////////////////////////////////////////////////////
+    
+    private:
+  
+  /** copy constructor prohibited */
+  AliHLTITSClusterFinderSSDComponent(const AliHLTITSClusterFinderSSDComponent&);
+  /** assignment operator prohibited */
+  AliHLTITSClusterFinderSSDComponent& operator=(const AliHLTITSClusterFinderSSDComponent&);
+
+  /*
+   * ---------------------------------------------------------------------------------
+   *                             Members - private
+   * ---------------------------------------------------------------------------------
+   */
+
+  /** the cluster finder object */
+  AliITSClusterFinderV2SSD* fClusterFinder;                   //!transient
+
+  /** the reader object for data decoding */
+  AliRawReaderMemory* fRawReader;                             //!transient
+
+  AliITSDetTypeRec* fDettype;                                 //!transient
+
+  TClonesArray** fClusters;                                   //!transient
+
+  AliITSCalibrationSSD* fcal;                                 //!transient
+
+  AliITSgeom* fgeom;                                          //!transient
+
+  AliITSInitGeometry* fgeomInit;                              //!transient
+  
+  ClassDef(AliHLTITSClusterFinderSSDComponent, 0)
+    
+    };
+#endif
diff --git a/HLT/ITS/macros/rec-spd-cluster.C b/HLT/ITS/macros/rec-spd-cluster.C
new file mode 100644 (file)
index 0000000..aa2f0d9
--- /dev/null
@@ -0,0 +1,92 @@
+
+//aliroot -b -q rec-spd-cluster.C | tee rec-spd-cluster.log
+
+void rec_spd_cluster(const char* input="./", char* opt="")
+{
+
+  if(!gSystem->AccessPathName("galice.root")){
+    cerr << "please delete the galice.root or run at different place." << endl;
+    return;
+  }
+  
+  if (!input) {
+    cerr << "please specify input or run without arguments" << endl;
+    return;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // init the HLT system in order to define the analysis chain below
+  //
+  gSystem->Load("libHLTrec.so");
+  AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance();
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Setting up which output to give
+  //
+  TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTITS.so libAliHLTSample.so loglevel=0x7c chains=";
+
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // define the analysis chain to be run
+  //
+  
+  int minddl=0x00000000;
+  int maxddl=0x00040000;
+
+  int ddl=0;
+  int ddlno=0;
+
+  TString dummyInput="";
+  for(int ddl=minddl;ddl<=maxddl;){
+    TString arg, publisher, cf;
+    //arg.Form("-minid %d -datatype 'DDL_RAW ' 'ITS '  -dataspec 0x%02x%02x%02x%02x -verbose", ddl, 00, 00, 00, 00);   
+    //arg.Form("-detector ITSSPD -skipempty -datatype 'DDL_RAW ' 'ITS ' -verbose");
+    //arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC '  -dataspec 0x%02x%02x%02x%02x -verbose", ddlno, slice, slice, part, part);
+    //arg.Form("-minid %d -datatype 'DDL_RAW ' 'ISPD ' -dataspec 0x%08x -verbose",ddlno, ddl);
+    //arg.Form("-detector ITSSPD -datatype 'DDL_RAW ' 'ISPD ' -skipempty -dataspec 0x%08x -verbose",ddl);
+    arg.Form("-minid %d -datatype 'DDL_RAW ' 'ISPD ' -dataspec 0x%08x -verbose",ddlno, ddl);
+    publisher.Form("DP_%d", ddl);
+    AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
+    
+    cf.Form("CF_%d",ddl);
+    AliHLTConfiguration cfconf(cf.Data(), "ITSClusterFinderSPD", publisher.Data(), "");
+
+    if (dummyInput.Length()>0) dummyInput+=" ";
+    dummyInput+=cf;
+
+    ddlno++;
+    if(ddl==0x0000000){ddl++;}else{ddl = ddl << 1;}
+  }
+
+  //add dummy
+  AliHLTConfiguration dummyconf("dummy", "Dummy", dummyInput.Data(), "-output_percentage 0");
+
+  option+="dummy";
+
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Init and run the reconstruction
+  // All but HLT reconstructio is switched off
+  //
+  AliReconstruction rec;
+  rec.SetInput(input);
+  rec.SetRunVertexFinder(kFALSE);
+  rec.SetRunLocalReconstruction("HLT");
+  rec.SetRunTracking("");
+  rec.SetLoadAlignFromCDB(0);
+  rec.SetRunQA(":");
+
+  // NOTE: FillESD is a step in the AliReconstruction sequence and has
+  // nothing to do with the fact that this macro writes ESD output
+  // HLT processes the HLTOUT during FillESD and extracts data which
+  // has already been prepared. This step is currently not necessary for
+  // this macro
+  rec.SetFillESD("");
+  rec.SetOption("HLT", option);
+  rec.Run();
+}
+
+
+
diff --git a/HLT/ITS/macros/rec-ssd-cluster.C b/HLT/ITS/macros/rec-ssd-cluster.C
new file mode 100644 (file)
index 0000000..883618f
--- /dev/null
@@ -0,0 +1,92 @@
+
+//aliroot -b -q rec-spd-cluster.C | tee rec-spd-cluster.log
+
+void rec_ssd_cluster(const char* input="./", char* opt="")
+{
+
+  if(!gSystem->AccessPathName("galice.root")){
+    cerr << "please delete the galice.root or run at different place." << endl;
+    return;
+  }
+  
+  if (!input) {
+    cerr << "please specify input or run without arguments" << endl;
+    return;
+  }
+
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // init the HLT system in order to define the analysis chain below
+  //
+  gSystem->Load("libHLTrec.so");
+  AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance();
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Setting up which output to give
+  //
+  TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTITS.so libAliHLTSample.so loglevel=0x7c chains=";
+
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // define the analysis chain to be run
+  //
+  
+  int minddl=0x00000000;
+  int maxddl=0x00004000;
+
+  int ddl=0;
+  int ddlno=0;
+
+  TString dummyInput="";
+  for(int ddl=minddl;ddl<=maxddl;){
+    TString arg, publisher, cf;
+    //arg.Form("-minid %d -datatype 'DDL_RAW ' 'ITS '  -dataspec 0x%02x%02x%02x%02x -verbose", ddl, 00, 00, 00, 00);   
+    //arg.Form("-detector ITSSPD -skipempty -datatype 'DDL_RAW ' 'ITS ' -verbose");
+    //arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC '  -dataspec 0x%02x%02x%02x%02x -verbose", ddlno, slice, slice, part, part);
+    //arg.Form("-minid %d -datatype 'DDL_RAW ' 'ISPD ' -dataspec 0x%08x -verbose",ddlno, ddl);
+    //arg.Form("-detector ITSSPD -datatype 'DDL_RAW ' 'ISPD ' -skipempty -dataspec 0x%08x -verbose",ddl);
+    arg.Form("-minid %d -datatype 'DDL_RAW ' 'ISSD ' -dataspec 0x%08x -verbose",ddlno, ddl);
+    publisher.Form("DP_%d", ddl);
+    AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
+    
+    cf.Form("CF_%d",ddl);
+    AliHLTConfiguration cfconf(cf.Data(), "ITSClusterFinderSSD", publisher.Data(), "");
+
+    if (dummyInput.Length()>0) dummyInput+=" ";
+    dummyInput+=cf;
+
+    ddlno++;
+    if(ddl==0x0000000){ddl++;}else{ddl = ddl << 1;}
+  }
+
+  //add dummy
+  AliHLTConfiguration dummyconf("dummy", "Dummy", dummyInput.Data(), "-output_percentage 0");
+
+  option+="dummy";
+
+  ///////////////////////////////////////////////////////////////////////////////////////////////////
+  //
+  // Init and run the reconstruction
+  // All but HLT reconstructio is switched off
+  //
+  AliReconstruction rec;
+  rec.SetInput(input);
+  rec.SetRunVertexFinder(kFALSE);
+  rec.SetRunLocalReconstruction("HLT");
+  rec.SetRunTracking("");
+  rec.SetLoadAlignFromCDB(0);
+  rec.SetRunQA(":");
+
+  // NOTE: FillESD is a step in the AliReconstruction sequence and has
+  // nothing to do with the fact that this macro writes ESD output
+  // HLT processes the HLTOUT during FillESD and extracts data which
+  // has already been prepared. This step is currently not necessary for
+  // this macro
+  rec.SetFillESD("");
+  rec.SetOption("HLT", option);
+  rec.Run();
+}
+
+
+
index 649b001f4ea8e05877b192633e155b365343fd8a..526f705b2673fd5db49662241adb0082669d77d0 100644 (file)
@@ -6,6 +6,8 @@ CLASS_HDRS:=    AliHLTITStrack.h \
                AliHLTITSVertexerZ.h \
                AliHLTITSclusterer.h \
                AliHLTITSAgent.h\
+               AliHLTITSClusterFinderSPDComponent.h\
+               AliHLTITSClusterFinderSSDComponent.h\
                AliHLTITSCompressRawDataSDDComponent.h  
 
 MODULE_SRCS=   $(CLASS_HDRS:.h=.cxx)