]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TRD/AliHLTTRDClusterizer.h
bug fix in ordering the strip
[u/mrichter/AliRoot.git] / HLT / TRD / AliHLTTRDClusterizer.h
index a4171b4c2c0198df2f9012e169911622be731076..452529447900bd6abfc28465e2f31d233e0bc942 100644 (file)
@@ -1,7 +1,11 @@
+//-*- Mode: C++ -*-
+// $Id$
+
 #ifndef ALIHLTTRDCLUSTERIZER_H
 #define ALIHLTTRDCLUSTERIZER_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
+//* 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                               *
 
 ////////////////////////////////////////////////////////////////////////////
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
 #include "AliTRDclusterizer.h"
+#include "AliTRDReconstructor.h"
 #include "AliHLTTRDCluster.h"
 #include "AliHLTDataTypes.h"
-
-class AliTRDReconstructor;
-class TClonesArray;
+#include "AliHLTTRDTrackletWordArray.h"
 
 class AliHLTTRDClusterizer : public AliTRDclusterizer
 {
@@ -22,23 +25,38 @@ class AliHLTTRDClusterizer : public AliTRDclusterizer
   AliHLTTRDClusterizer(const AliTRDReconstructor *const rec = 0x0);
   AliHLTTRDClusterizer(const Text_t *const name, const Text_t *const title, const AliTRDReconstructor *const rec = 0x0);
   AliHLTTRDClusterizer(const AliHLTTRDClusterizer& c);
+  virtual ~AliHLTTRDClusterizer() {};
   AliHLTTRDClusterizer& operator=(const AliHLTTRDClusterizer& c);
 
   void            Copy(TObject& c) const;
-  void            SetMemBlock(AliHLTUInt8_t* ptr){fMemBlock=ptr;fNoOfClusters=0;}
-  AliHLTUInt8_t*  GetMemBlock(){return fMemBlock;}
-  UInt_t          GetAddedSize(){return fNoOfClusters*sizeof(AliHLTTRDCluster);}
+  void            SetMemBlock(AliHLTUInt8_t* ptr){
+    if(fReconstructor->IsProcessingTracklets()){
+      fTrMemBlock=ptr; fTrMemCurrPtr=ptr;
+      fClMemBlock=ptr+GetTrMemBlockSize();  //if IsProcessingTracklets() is enabled we always reserve a data block of size GetTrMemBlockSize() for the tracklets
+    }else{
+      fClMemBlock=ptr;
+    }
+    fNoOfClusters=0;
+  }
+  AliHLTUInt8_t*  GetClMemBlock(){return fClMemBlock;}
+  AliHLTUInt8_t*  GetTrMemBlock(){return fTrMemBlock;}
+  UInt_t          GetAddedClSize(){return fNoOfClusters*sizeof(AliHLTTRDCluster);}
+  UInt_t          GetAddedTrSize(){return (AliHLTUInt8_t*)fTrMemCurrPtr-(AliHLTUInt8_t*)fTrMemBlock;}
+  UInt_t          GetTrMemBlockSize(){return 30*(sizeof(AliHLTTRDTrackletWordArray)+512*sizeof(UInt_t));}
 
  protected:
   void            AddClusterToArray(AliTRDcluster *cluster);
+  void            AddTrackletsToArray();
 
-  TClonesArray*   RecPoints(){return 0x0;}  //these are functions in the parents class. must not be used in hlt!
-  void  SetClustersOwner(Bool_t /*own*/){}  //if used accidentally it may give an compilation error because are protected,
-                                            //but the error can also appear in run time
+  TClonesArray*   RecPoints(){return 0x0;}       //these are functions in the parents class and must not be used in hlt!
+  TClonesArray*   TrackletsArray(){return 0x0;}  //if used accidentally it may give a compilation error because they are protected,
+  void  SetClustersOwner(Bool_t /*own*/){}       //but it could be that the error appears only in  run time
   
-  AliHLTUInt8_t*  fMemBlock;
+  AliHLTUInt8_t*  fClMemBlock;
+  AliHLTUInt8_t*  fTrMemBlock;
+  AliHLTUInt8_t*  fTrMemCurrPtr;
 
-  ClassDef(AliHLTTRDClusterizer, 0)
+  ClassDef(AliHLTTRDClusterizer, 1)
 };
 
 #endif