]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/PHOS/AliHLTPHOSClusterizer.h
Hack to get it running with current setup
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSClusterizer.h
index 7474193de3cdc216911cb188a2be50d0af9d27c3..bf5046eb81bd2155ef8bb3568f353484477ea31e 100644 (file)
@@ -1,3 +1,6 @@
+//-*- Mode: C++ -*-
+// $Id$
+
 /**************************************************************************
  * This file is property of and copyright by the ALICE HLT Project        * 
  * All rights reserved.                                                   *
 // or
 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 
-#include "AliHLTPHOSBase.h"
-#include "AliPHOSGetter.h"
 
 #include "AliHLTPHOSRecPointContainerStruct.h"
 #include "AliHLTPHOSRecPointDataStruct.h"
 #include "AliHLTPHOSDigitContainerDataStruct.h"
 #include "AliHLTPHOSDigitDataStruct.h"
+#include "AliHLTLogging.h"
 
 #include "AliPHOSGeometry.h"
 
-class TClonesArray;
-class AliPHOSDigit;
-class AliPHOSRecoParamEmc;
+class AliHLTPHOSDigitReader;
 
 /** 
  * @class AliHLTPHOSClusterizer
  * Clusterizer for PHOS HLT. The clusterizer takes digits as input, either
  * in the form of a container of AliHLTPHOSDigitDataStruct or a
- * TClonesArray of AliPHOSDigit through an instance of a AliPHOSGetter
+ * TClonesArray of AliPHOSDigit through an instance of a AliPHOSLoader
  *
  * @ingroup alihlt_phos
  */
-class AliHLTPHOSClusterizer : public AliHLTPHOSBase
+//class AliHLTPHOSClusterizer : public AliHLTPHOSBase
+class AliHLTPHOSClusterizer : public AliHLTLogging
 {
   
 public:
@@ -65,18 +66,40 @@ public:
   
   /** Destructor */
   virtual ~AliHLTPHOSClusterizer();
-  
-  /*
-  AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &);
-  AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer &) {return *this;}
-  */
 
-  /** Set rec point container */
-  void SetRecPointContainer(AliHLTPHOSRecPointContainerStruct *RecPointContainerPtr)
-  { fRecPointContainerPtr = RecPointContainerPtr; }
+  /** Copy constructor */  
+  AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &) : 
+    AliHLTLogging(),
+    fRecPointDataPtr(0),
+    fDigitDataPtr(0),
+    fCurrentDigit(0),
+    fStartDigit(0),
+    fPreviousDigit(0),
+    fEmcClusteringThreshold(0),
+    fEmcMinEnergyThreshold(0),
+    fEmcTimeGate(0),
+    fDigitsInCluster(0),
+    fDigitContainerPtr(0),
+    fMaxDigitIndexDiff(2*NZROWSMOD),
+    fAvailableSize(0),
+    fDigitReader(0)
+  {
+    //Copy constructor not implemented
+  }
+  
+  /** Assignment */
+  AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer)
+  {
+    //Assignment
+    return *this; 
+  }
+  
+  /** Set digit container */
+  void SetDigitContainer(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
+  { fDigitContainerPtr = digitContainerPtr; }
 
-  /** Set reco parameters */
-  void SetRecoParameters(AliPHOSRecoParamEmc* recoPars);
+  /** Set rec point data buffer */
+  void SetRecPointDataPtr(AliHLTPHOSRecPointDataStruct* recPointDataPtr);
 
   /** Set emc clustering threshold */
   void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; }
@@ -86,36 +109,17 @@ public:
 
   /** Set emc time gate */
   void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }
-
-  /** Set log weight */
-  void SetLogWeight(Float_t weight) { fLogWeight = weight; }  
-    
-  /** 
-   * Set offline mode
-   * @param getter pointer to an instance of AliPHOSGetter
-   */
-  void SetOfflineMode(AliPHOSGetter* getter); 
   
   /** Starts clusterization of the event */ 
-  virtual Int_t ClusterizeEvent();
-
-  /** 
-   * Gets an event, for offline mode
-   * @param evtNr event number to get
-   */
-  virtual Int_t GetEvent(Int_t evtNr);
-  
-  /** Get number of events */
-  Int_t GetNEvents();
+  virtual Int_t ClusterizeEvent(AliHLTPHOSDigitHeaderStruct *digitHeader, UInt_t availableSize, UInt_t& totSize);
 
   /**
    * For a given digit this digit scans for neighbouring digits which 
    * passes the threshold for inclusion in a rec point. If one is found 
    * it is added to the current rec point
-   * @param digIndex index of the digit in the digit container
    * @param recPoint pointer to the current rec point
    */
-  virtual void ScanForNeighbourDigits(Int_t digIndex, AliHLTPHOSRecPointDataStruct* recPoint);
+  virtual Int_t ScanForNeighbourDigits(AliHLTPHOSRecPointDataStruct* recPoint, AliHLTPHOSDigitDataStruct *digit);
 
   /**
    * Checks if two digits are neighbours
@@ -124,10 +128,23 @@ public:
    */
   virtual Int_t AreNeighbours(AliHLTPHOSDigitDataStruct* d1, AliHLTPHOSDigitDataStruct* d2);
 
-  /** Calculates the center of gravity of a rec point */
-  virtual void CalculateCenterOfGravity();
 
-private:
+protected:
+
+  /** Pointer to the rec point output */
+  AliHLTPHOSRecPointDataStruct* fRecPointDataPtr;              //! transient
+
+  /** Pointer to the digit output */
+  AliHLTPHOSDigitDataStruct* fDigitDataPtr;                    //! transient
+
+  /** Pointer to the digit output */
+  AliHLTPHOSDigitDataStruct* fCurrentDigit;                    //! transient
+
+  /** Pointer to the digit output */
+  AliHLTPHOSDigitDataStruct* fStartDigit;                    //! transient
+
+  /** Pointer to the digit output */
+  AliHLTPHOSDigitDataStruct* fPreviousDigit;                    //! transient
   /** Energy threshold for starting a cluster for the calorimeter */
   Float_t fEmcClusteringThreshold;                             //COMMENT
 
@@ -137,37 +154,22 @@ private:
   /** Maximum time difference for inclusion in a rec point */
   Float_t fEmcTimeGate;                                        //COMMENT
 
-  /** Variable used in calculation of the center of gravity for a rec point */
-  Float_t fLogWeight;                                          //COMMENT
-
   /** Counts the digits in a rec point */
   Int_t fDigitsInCluster;                                      //COMMENT
 
-  /** Online mode flag */
-  Bool_t fOnlineMode;                                          //COMMENT
-  
-  /** Array of digits from one event, used in offline mode */
-  TClonesArray *fDigitArrayPtr;                                //! transient
-
-  /** Array of reconstruction points from one event, used in offline mode */ 
-  TObjArray *fEmcRecPointsPtr;                                 //! transient
-
-  /** Pointer to digit */
-  AliPHOSDigit *fDigitPtr;                                     //! transient
-
   /** Contains the digits from one event */
   AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr;      //! transient
 
-  /** Contains the reconstruction points from one event */
-  AliHLTPHOSRecPointContainerStruct *fRecPointContainerPtr;    //! transient
+  /** Maximum difference in index to be a neighbour */
+  Int_t fMaxDigitIndexDiff;                                    //COMMENT
 
-  /** Instance of the PHOS geometry class */
-  AliPHOSGeometry *fPHOSGeometry;                              //! transient
-  
-  /** Instance of the PHOS getter, used in offline mode */    
-  AliPHOSGetter *fGetterPtr;                                   //! transient
-  
-  ClassDef(AliHLTPHOSClusterizer, 1);
+  /** Current available buffer size */
+  UInt_t fAvailableSize;                                       //COMMENT
+
+  /** object reading the digit */
+  AliHLTPHOSDigitReader *fDigitReader;                         //COMMENT
+
+  ClassDef(AliHLTPHOSClusterizer, 0);
 };
 
 #endif