]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
update by Gaute:
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Jun 2009 11:10:42 +0000 (11:10 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Jun 2009 11:10:42 +0000 (11:10 +0000)
- SSD now also gives out the ITS cluster struct
- memory leak fixed: Deleting temporary output buffer.
- Some changes in DoInit
- added libITSsim to dependencies
- Get module number from AliITSgeomTGeo
- Get number of ddls from AliDAQ

HLT/ITS/AliHLTITSClusterFinderSPDComponent.cxx
HLT/ITS/AliHLTITSClusterFinderSSDComponent.cxx
HLT/configure.ac

index 798a22de3812f9354e5bc0af0083a3c876e622b3..59a9767e84f693a720c5e94a4c3e9f6bafad3f59 100644 (file)
@@ -34,6 +34,7 @@ using namespace std;
 #include "AliITSRecPoint.h"
 #include "AliHLTITSSpacePointData.h"
 #include "AliHLTITSClusterDataFormat.h"
+#include <AliHLTDAQ.h>
 
 #include <cstdlib>
 #include <cerrno>
@@ -46,7 +47,7 @@ ClassImp(AliHLTITSClusterFinderSPDComponent);
 
 AliHLTITSClusterFinderSPDComponent::AliHLTITSClusterFinderSPDComponent()
   :
-  fNModules(240/*AliITSDetTypeRec::fgkDefaultNModulesSPD*/),
+  fNModules(AliITSgeomTGeo::GetNDetectors(1)*AliITSgeomTGeo::GetNLadders(1) + AliITSgeomTGeo::GetNDetectors(2)*AliITSgeomTGeo::GetNLadders(2)/*240*/),
   fClusterFinder(NULL),
   fRawReader(NULL),
   fDettype(NULL),
@@ -97,7 +98,7 @@ void AliHLTITSClusterFinderSPDComponent::GetOutputDataSize( unsigned long& const
   // see header file for class documentation
 
   constBase = 0;
-  inputMultiplier = 1;
+  inputMultiplier = 100;
 }
 
 AliHLTComponent* AliHLTITSClusterFinderSPDComponent::Spawn() {
@@ -109,7 +110,7 @@ Int_t AliHLTITSClusterFinderSPDComponent::DoInit( int /*argc*/, const char** /*a
   // see header file for class documentation
 
   if ( fClusterFinder )
-    return EINPROGRESS;
+    return -EINPROGRESS;
 
   fClusters = new TClonesArray*[fNModules]; 
   for (Int_t iModule = 0; iModule < fNModules; iModule++) {
@@ -118,6 +119,7 @@ Int_t AliHLTITSClusterFinderSPDComponent::DoInit( int /*argc*/, const char** /*a
 
   //fgeomInit = new AliITSInitGeometry(kvSPD02,2);
   fgeomInit = new AliITSInitGeometry(kvPPRasymmFMD,2);
+  //fgeomInit->InitAliITSgeom(fgeom);
   fgeom = fgeomInit->CreateAliITSgeom();
   
   //set dettype
@@ -125,15 +127,16 @@ Int_t AliHLTITSClusterFinderSPDComponent::DoInit( int /*argc*/, const char** /*a
   fDettype->SetITSgeom(fgeom);
   fDettype->SetReconstructionModel(0,fClusterFinder);
   fDettype->SetDefaultClusterFindersV2(kTRUE);
-  fDettype->GetCalibration();
-  fSeg = new AliITSsegmentationSSD();
-  fDettype->SetSegmentationModel(0,fSeg);
+  fDettype->SetDefaults();
+  //fDettype->GetCalibration();
+  //fSeg = new AliITSsegmentationSPD();
+  //fDettype->SetSegmentationModel(0,fSeg);
   
   fClusterFinder = new AliITSClusterFinderV2SPD(fDettype); 
   fClusterFinder->InitGeometry();
 
   if ( fRawReader )
-    return EINPROGRESS;
+    return -EINPROGRESS;
 
   fRawReader = new AliRawReaderMemory();
 
@@ -204,9 +207,9 @@ Int_t AliHLTITSClusterFinderSPDComponent::DoEvent( const AliHLTComponentEventDat
     if(spec>0x00040000){
       HLTDebug("The Spec is to high for ITS SPD");
     }
-
+    
     Int_t id = 0;
-    for ( Int_t ii = 0; ii < 20 ; ii++ ) {   //number of ddl's
+    for ( Int_t ii = 0; ii < AliHLTDAQ::NumberOfDdls("ITSSPD") ; ii++ ) {   //number of ddl's
       if ( spec & 0x00000001 ) {
        id += ii;
        break;
@@ -265,6 +268,8 @@ Int_t AliHLTITSClusterFinderSPDComponent::DoEvent( const AliHLTComponentEventDat
       fClusters[iModule] = NULL;
     }
     
+    delete buffer; 
+
     fRawReader->ClearBuffers();
     
   } //  for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ) {    
index cae1bc9df66dc1389424c2f14c616504313a7bfc..4615048589f96581aafa8fd4fd35f3e7504c1811 100644 (file)
@@ -32,6 +32,9 @@ using namespace std;
 #include "AliHLTDataTypes.h"
 #include "AliITSgeomTGeo.h"
 #include "AliITSRecPoint.h"
+#include "AliHLTITSSpacePointData.h"
+#include "AliHLTITSClusterDataFormat.h"
+#include <AliHLTDAQ.h>
 
 #include <cstdlib>
 #include <cerrno>
@@ -44,7 +47,7 @@ ClassImp(AliHLTITSClusterFinderSSDComponent);
 
 AliHLTITSClusterFinderSSDComponent::AliHLTITSClusterFinderSSDComponent()
   :
-  fNModules(1698/*AliITSDetTypeRec::fgkDefaultNModulesSSD*/),
+  fNModules(AliITSgeomTGeo::GetNDetectors(5)*AliITSgeomTGeo::GetNLadders(5) + AliITSgeomTGeo::GetNDetectors(6)*AliITSgeomTGeo::GetNLadders(6)/*1698*/),
   fClusterFinder(NULL),
   fRawReader(NULL),
   fDettype(NULL),
@@ -89,14 +92,14 @@ void AliHLTITSClusterFinderSSDComponent::GetInputDataTypes( vector<AliHLTCompone
 
 AliHLTComponentDataType AliHLTITSClusterFinderSSDComponent::GetOutputDataType() {
   // see header file for class documentation
-  return kAliHLTDataTypeTObjArray;
+  return  kAliHLTDataTypeClusters|kAliHLTDataOriginITSSSD;
 }
 
 void AliHLTITSClusterFinderSSDComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {
   // see header file for class documentation
 
   constBase = 0;
-  inputMultiplier = 0.3;
+  inputMultiplier = 100;
 }
 
 AliHLTComponent* AliHLTITSClusterFinderSSDComponent::Spawn() {
@@ -108,7 +111,7 @@ Int_t AliHLTITSClusterFinderSSDComponent::DoInit( int /*argc*/, const char** /*a
   // see header file for class documentation
 
   if ( fClusterFinder )
-    return EINPROGRESS;
+    return -EINPROGRESS;
 
   fClusters = new TClonesArray*[fNModules]; 
   for (Int_t iModule = 0; iModule < fNModules; iModule++) {
@@ -117,6 +120,7 @@ Int_t AliHLTITSClusterFinderSSDComponent::DoInit( int /*argc*/, const char** /*a
 
   //fgeomInit = new AliITSInitGeometry(kvSSD02,2);
   fgeomInit = new AliITSInitGeometry(kvPPRasymmFMD,2);
+  //fgeomInit->InitAliITSgeom(fgeom);
   fgeom = fgeomInit->CreateAliITSgeom();
   
   //set dettype
@@ -124,16 +128,17 @@ Int_t AliHLTITSClusterFinderSSDComponent::DoInit( int /*argc*/, const char** /*a
   fDettype->SetITSgeom(fgeom);
   fDettype->SetReconstructionModel(2,fClusterFinder);
   fDettype->SetDefaultClusterFindersV2(kTRUE);
-  fSeg = new AliITSsegmentationSSD();
-  fSeg->Init();
-  fDettype->SetSegmentationModel(2,fSeg);
-  fDettype->GetCalibration();
+  fDettype->SetDefaults();
+  //fSeg = new AliITSsegmentationSSD();
+  //fSeg->Init();
+  //fDettype->SetSegmentationModel(2,fSeg);
+  //fDettype->GetCalibration();
     
   fClusterFinder = new AliITSClusterFinderV2SSD(fDettype); 
   fClusterFinder->InitGeometry();
   
   if ( fRawReader )
-    return EINPROGRESS;
+    return -EINPROGRESS;
 
   fRawReader = new AliRawReaderMemory();
 
@@ -206,7 +211,7 @@ Int_t AliHLTITSClusterFinderSSDComponent::DoEvent( const AliHLTComponentEventDat
     }
 
     Int_t id = 512;                  
-    for ( Int_t ii = 0; ii < 16 ; ii++ ) {
+    for ( Int_t ii = 0; ii < AliHLTDAQ::NumberOfDdls("ITSSSD") ; ii++ ) {
       if ( spec & 0x00000001 ) {
        id += ii;
        break;
@@ -221,43 +226,55 @@ Int_t AliHLTITSClusterFinderSSDComponent::DoEvent( const AliHLTComponentEventDat
     }
     
     fClusterFinder->RawdataToClusters(fRawReader,fClusters);
-    
-    Float_t xyz[3];
-    filebuf fb;
-    fb.open ("test.txt",ios::out | ios::app);
-    ostream os(&fb);
+
+    UInt_t nClusters=0;
     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);
-         recpoint->GetGlobalXYZ(xyz);
-         os<<xyz[0]<<" "<<xyz[1]<<" "<<xyz[2]<<endl;
-       }
+        nClusters += fClusters[i]->GetEntries(); 
       }
     }
-   
-    PushBack(*fClusters,kAliHLTDataTypeTObjArray|kAliHLTDataOriginITSSSD,iter->fSpecification);
     
-    /*  
+    UInt_t bufferSize = nClusters * sizeof(AliHLTITSSpacePointData) + sizeof(AliHLTITSClusterData);
+    AliHLTUInt8_t *buffer = new AliHLTUInt8_t[bufferSize];
+    AliHLTITSClusterData *outputClusters = reinterpret_cast<AliHLTITSClusterData*>(buffer);
+    outputClusters->fSpacePointCnt=nClusters;
+    
+    int clustIdx=0;
     for(int i=0;i<fNModules;i++){
       if(fClusters[i] != NULL){
-       PushBack(fClusters[i],kAliHLTDataTypeTObjArray|kAliHLTDataOriginITSSSD,iter->fSpecification);
-       }
+        for(int j=0;j<fClusters[i]->GetEntries();j++){
+          AliITSRecPoint *recpoint = (AliITSRecPoint*) fClusters[i]->At(j);
+          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++;
+        }
+      }
     }
-    */
     
+    PushBack(buffer,bufferSize,kAliHLTDataTypeClusters|kAliHLTDataOriginITSSSD,iter->fSpecification);  
+        
     for (Int_t iModule = 0; iModule < fNModules; iModule++) {       
       if(fClusters[iModule]){delete fClusters[iModule];}
       fClusters[iModule] = NULL;
     }
     
+    delete buffer; 
+
     fRawReader->ClearBuffers();
     
   } //  for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ) {    
   
-    //fClusterFinder->RawdataToClusters(fRawReader,&fClusters);
-  
-  //PushBack( (TObject**) fClusters,kAliHLTDataTypeTObjArray,0x00000000);
-
   return 0;
 }
index 8a41dc331e7ea41b1d8614465bc342f91290c185..f614d53572ed41816bcaa850b4e18e7295f333b9 100644 (file)
@@ -1063,7 +1063,7 @@ ALIITS_LIBS=
 CHECK_HLTMODULE([its],
                [AliITSCompressRawDataSDD.h], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/ITS],
                [Gui RAWDatasim], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS],
-               [ITSbase ITSrec], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
+               [ITSbase ITSrec ITSsim], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], 
                [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS])
 
 if test "x$enable_module" = "xmissheader"; then